Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Controller for the healthBamMain component.
function MainController( $log ) { var main = this; /** * A function for Jessica to make a change to. */ function jessica() { $log.debug("TODO"); } /** * A function for KP to make a change to. */ function kp() { $log.debug("TODO"); } /** * A function for John to make a change to. */ function john() { $log.debug("TODO"); } /** * This function only exists to prevent everyone from modifying the same area in code. * * TODO - remove this once everyone has submitted a code change */ function training() { jessica(); kp(); john(); } $log.debug("Main Controller loaded", main); training(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function healthController() {\n\n }", "function MainController() {\n\n }", "get health(){ return this._health}", "function Start() \n{\n\t\n\tguiHealth = GameObject.Find(\"GameManager\");\n healthBarScript = guiHealth.GetComponent(GuiDisplayJava) as GuiDisplayJava;\n \n // Set initial value of the health...\n \n // Uncomment the line below and call reduceHealth() in the Update() method to watch health decrease\n healthBarScript.healthWidth = 199;\n \n // Uncomment the line below and call increaseHealth() in the Update() method to watch health increase\n // healthBarScript.healthWidth = -8;\n \n}", "function HomeCtrl () {\n const app = this;\n app.stats = {};\n app.nodeDiscovery = false;\n app.message = '';\n\n }", "get Health() {\n return this.health;\n }", "function healthDashboardContainerModel(params) {\n\t\tvar self = this;\n\t\tvar loggerUtil = require('pcs/util/loggerUtil');\n\n\t\t//Set the resourcebundle\n\t\tself.bundle = require('ojL10n!pcs/resources/nls/dashboardResource');\n\n\t\tself.parent = params.parent;\t// hold the instance of dashboardContainer\n\n\t\tself.baseRestUrl = self.parent.baseRestUrl;\n\t\tself.restEndPoint = self.parent.baseRestUrl + self.parent.chartEndpoint;\n\t\tvar authInfo =self.parent.authInfo; // Login credentials\n\n\t\t//count related bindings\n\t\tself.openCount = ko.observable(0); // No of open task\n\t\tself.progressCount = ko.observable(0); // No of active task\n\t\tself.recoverableCount = ko.observable(0); //No.of recoverable task\n\t\tself.suspendedCount = ko.observable(0); // No.of suspended task\n\n\t\tself.processTrackingPage = self.parent.processTrackingPage;\n\t\tself.totalCountURL= self.processTrackingPage;\n\t\tself.progressCountURL = self.processTrackingPage+\"?status=OPEN&userRole=USER_ROLE_ADMIN\"; // No of active task\n\t\tself.recoverableCountURL = self.processTrackingPage +\"?status=FAULTED_RECOVERABLE&userRole=USER_ROLE_ADMIN\"; //No.of recoverable task\n\t\tself.suspendedCountURL = self.processTrackingPage+ \"?status=SUSPENDED&userRole=USER_ROLE_ADMIN\" ; // No.of suspended task\n\n\t\t//chart convertors for percentage\n\t\t//var converterFactory = oj.Validation.converterFactory('number');\n\t\t//var converterOptions = {style: 'percent'};\n\n\t\t//chart related bindings\n\t\tself.barSeriesValue = ko.observableArray(); // List of count on x axis\n\t\tself.barGroupsValue = ko.observableArray(); // List of processes on Y axis\n\t\t//self.yConverter = converterFactory.createConverter(converterOptions);\n\n\t\t// Method to refresh the content\n\t\tself.refresh = function(){\n\t\t\tself.loadData();\n\t\t\t//Refresh Process list too\n\t\t\tself.parent.loadProcessList();\n\t\t};\n\n\t\t// method to create the parameter list for the query\n\t\tself.paramList= function(){\n\t\t\tvar param = util.paramList(self);\n\t\t\treturn param;\n\t\t};\n\n\t\t// Primary function for load/reload process data to display\n\t\tself.loadData = function() {\n\t\t\tvar param =self.paramList();\n\n\t\t\t// Add overlays for loading\n\t\t\t$('#bpm-dsb-health-chart-overlay').addClass('bpm-dsb-load-overlay');\n\n\t\t\t//Load count data\n\t\t\tself.load(util.queries.PROCESS_HEALTH_BILLBOARD+param,self.populateHealthBillboardData);\n\t\t\t//Load chart data\n\t\t\tself.load(util.queries.PROCESS_HEALTH_TABLE+param,self.populateHealthTable);\n\t\t};\n\n\t\t// function for loading data using AJAX\n\t\tself.load = function(query ,populate){\n\t\t\tvar url = self.restEndPoint + query;\n\t\t\t$.ajax\n\t\t\t({\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl: url,\n\t\t\t\tbeforeSend: function (xhr) {\n\t\t\t\t\tif (authInfo) {\n\t\t\t\t\t\txhr.setRequestHeader('Authorization', authInfo);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\txhrFields: {\n\t\t\t\t\twithCredentials: true\n\t\t\t\t},\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tsuccess: function (json) {\n\t\t\t\t\tpopulate(json);\n\t\t\t\t},\n\t\t\t\terror: function ( jqXHR) {\n\t\t\t\t\tpopulate();\n\t\t\t\t\tutil.errorHandler(jqXHR);\n\t\t\t\t},\n\t\t\t\tfailure: function () {\n\t\t\t\t\tloggerUtil.log('failed in loading health data -' + query);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// method to populate Billboard data\n\t\tself.populateHealthBillboardData = function(data){\n\t\t\tif(data && data.rows){\n\t\t\t\tvar c = util.columnAlias(data);\n\t\t\t\tvar row = data.rows[0]; // all the data is in the first row\n\n\t\t\t\tself.openCount(row.values[c.TOTAL_OPEN]+0);\n\t\t\t\tself.progressCount(row.values[c.TOTAL_ACTIVE]+0);\n\t\t\t\tself.suspendedCount(row.values[c.TOTAL_SUSPENDED]+0);\n\t\t\t\tself.recoverableCount(row.values[c.TOTAL_FAULTED_RECOVERABLE]+0);\n\t\t\t}\n\t\t};\n\n\t\t// method to populate charts\n\t\t// Data columns - \"PROCESS_LABEL\" , \"PROCESS_INSTANCE_STATUS\",\"TOTALCOUNT\",\"PERCENTAGE\"\n\t\tself.populateHealthTable = function(data){\n\t\t\tvar barGroups = []; //[\"Process 1\", \"Process 2\" ,\"Process 3\", \"Process 4\" ,\"Process 5\"];\n\t\t\tvar barSeriesNames = []; // Active, Recoverable ,Suspended\n\n\t\t\tvar barSeriesItems = [];\n\t\t\tvar barSeries = [];\n\n\t\t\tvar barsColorArray = {\n\t\t\t\t'ACTIVE' :'#bde2a0',\n\t\t\t\t'RECOVERABLE' : '#f0a7a8',\n\t\t\t\t'SUSPENDED' :'#bee5f6',\n\t\t\t\t'ABORT':'#003366'\n\t\t\t};\n\n\n\n\n\t\t\tvar stateMap ={}; //'ACTIVE' :0, 'RECOVERABLE' :1, 'SUSPENDED' :2, 'ABORT' :3 ....\n\t\t\tvar processes = {}; // Create a object list in which process object has its states listed\n\n\t\t\tif(data && data.rows) {\n\t\t\t\tvar c = util.columnAlias(data);\n\t\t\t\tfor(var i=0 ;i< data.rows.length; i++){\n\t\t\t\t\t// Get the values for each column in the response\n\t\t\t\t\tvar procName = data.rows[i].values[c.PROCESS_LABEL];\n\t\t\t\t\tvar state = data.rows[i].values[c.PROCESS_INSTANCE_STATUS];\n\t\t\t\t\tvar count = data.rows[i].values[c.TOTALCOUNT];\n\t\t\t\t\tvar percent = data.rows[i].values[c.PERCENTAGE];\n\t\t\t\t\tvar procId =data.rows[i].values[c.PROCESS_NAME];\n\t\t\t\t\t// create the list of distinct states being returned\n\t\t\t\t\tif(barSeriesNames.indexOf(state) === -1 ){\n\t\t\t\t\t\tstateMap[state] = barSeriesNames.length ; //Add the state in stateMap and the index will be the current length of states added i.e first will be 0 , second 1 and so on\n\t\t\t\t\t\tbarSeriesNames.push(state);\n\t\t\t\t\t\tbarSeriesItems.push([]);\n\t\t\t\t\t}\n\t\t\t\t\t//create the list of distinct process being returned\n\t\t\t\t\tif(barGroups.map(function(e) { return e.id; }).indexOf(procId) === -1){\n\t\t\t\t\t\tbarGroups.push({\n\t\t\t\t\t\t\tname : procName,\n\t\t\t\t\t\t\tid : procId,\n\t\t\t\t\t\t\tshortDesc : self.bundle.health.chart.process_id+ \" : \" + procId\n\t\t\t\t\t\t});\n\t\t\t\t\t\tprocesses[procId] = {'title' : procName};\n\t\t\t\t\t}\n\t\t\t\t\t// add the current state and the count info the the process object\n\t\t\t\t\tprocesses[procId][state] = {'COUNT' : count, 'PERCENT' :percent};\n\t\t\t\t}\n\n\t\t\t\t// Now we have the complete process list with all state info\n\t\t\t\t// Iterate over all the process object\n\t\t\t\tfor (var proc in processes) {\n\t\t\t\t\tvar process = processes[proc];\n\t\t\t\t\t// Iterate over all the sattes for this particular process\n\t\t\t\t\tfor (var j=0; j<barSeriesNames.length ; j ++ ){\n\t\t\t\t\t\tvar state = barSeriesNames[j];\n\t\t\t\t\t\tvar stateName = oj.Translations.getTranslatedString(state);\n\t\t\t\t\t\tstateName = stateName ? stateName :state;\n\t\t\t\t\t\t// Check if this process has any instance in this particular state , add the values if it has else add 0\n\t\t\t\t\t\tif( process[state] != undefined){\n\t\t\t\t\t\t\tbarSeriesItems[stateMap[state]].push({\n\t\t\t\t\t\t\t\ty :process[state]['PERCENT'],\n\t\t\t\t\t\t\t\tlabel:process[state]['COUNT'],\n\t\t\t\t\t\t\t\tlabelPosition:'auto',\n\t\t\t\t\t\t\t\tshortDesc: self.bundle.health.chart.state + \" : \" + stateName +\n\t\t\t\t\t\t\t\t\"&lt;br/&gt;\"+ self.bundle.health.chart.process_name + \" : \" + process.title +\n\t\t\t\t\t\t\t\t\"&lt;br/&gt;\"+ self.bundle.health.chart.process_id + \" : \" + proc +\n\t\t\t\t\t\t\t\t\"&lt;br/&gt;\" +\tself.bundle.health.chart.no_instances + \" : \" + process[state]['COUNT'] +\n\t\t\t\t\t\t\t\t\"&lt;br/&gt;\" +\tself.bundle.health.chart.percentage + \" : \" + process[state]['PERCENT'] + \"%\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tbarSeriesItems[stateMap[state]].push({y :0, label:0, labelPosition:'auto'});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Create the chart series using the above data\n\t\t\t\tfor(var i=0 ;i<barSeriesNames.length ; i++){\n\t\t\t\t\tvar state = barSeriesNames[i];\n\t\t\t\t\tstateName = stateName ? stateName :state;\n\t\t\t\t\tvar stateName = oj.Translations.getTranslatedString(state);\n\t\t\t\t\tbarSeries.push({name: stateName, items: barSeriesItems[stateMap[state]] ,color : barsColorArray[state] , id :state});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// remove overlays for loading\n\t\t\t$('#bpm-dsb-health-chart-overlay').removeClass('bpm-dsb-load-overlay');\n\n\t\t\t// Populate the chart\n\t\t\tself.barSeriesValue(barSeries);\n\t\t\tself.barGroupsValue(barGroups);\n\t\t};\n\n\t\t// ------ Loading Mechanism -------------------\n\t\tself.parent.selectedTab.subscribe(function(tab) {\n\t\t\tif (tab === 0){\n\t\t\t\tself.loadData();\n\t\t\t}\n\t\t});\n\n\t\t// ------- Code for Filtering and offCanvas --------------------------\n\t\tself.parent.filterApplied.subscribe(function() {\n\t\t\tif (self.parent.selectedTab() === 0) {\n\t\t\t\tself.loadData();\n\t\t\t}\n\t\t});\n\n\n\t\t//--------------- Drill down ----------------------\n\n\t\tself.totalDrilldown = function (){\n\t\t\tutil.drilldown(self.totalCountURL);\n\t\t};\n\n\t\tself.activeDrilldown = function (){\n\t\t\tutil.drilldown(self.progressCountURL);\n\t\t};\n\n\t\tself.recoverableDrilldown = function (){\n\t\t\tutil.drilldown(self.recoverableCountURL);\n\t\t};\n\n\t\tself.suspendedDrilldown = function (){\n\t\t\tutil.drilldown(self.suspendedCountURL);\n\t\t}\n\n\t\tthis.handleAttached = function(info)\n\t\t{\n\t\t\t// if the param is passed then load the content immediately\n\t\t\tif (params.loadImmediate){\n\t\t\t\tself.loadData();\n\t\t\t}\n\n\n\t\t\t//The DOM is already inserted\n\t\t\t$(\"#bpm-dsb-health-chart\").ojChart({\n\t\t\t\t\"drill\": function(event, ui) {\n\t\t\t\t\tvar processName = '';\n\t\t\t\t\tvar status ='';\n\t\t\t\t\tif(ui['series'])\n\t\t\t\t\t\tstatus = ui['series'];\n\t\t\t\t\tif(ui['group'])\n\t\t\t\t\t\tprocessName = ui['group'];\n\n\t\t\t\t\tloggerUtil.log(processName + \";\" + status);\n\n\t\t\t\t\tif(processName === ''){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (status === ''){\n\t\t\t\t\t\tutil.drilldown(self.processTrackingPage+ '?processName=' +processName);\n\t\t\t\t\t}\n\t\t\t\t\telse if (status === 'ACTIVE'){\n\t\t\t\t\t\tutil.drilldown(self.processTrackingPage+ '?processName=' +processName+ '&status=OPEN&userRole=USER_ROLE_ADMIN');\n\t\t\t\t\t}\n\t\t\t\t\telse if(status === 'RECOVERABLE'){\n\t\t\t\t\t\tutil.drilldown(self.processTrackingPage+ '?processName=' +processName + '&status=FAULTED_RECOVERABLE&userRole=USER_ROLE_ADMIN');\n\t\t\t\t\t}\n\t\t\t\t\telse if(status === 'SUSPENDED'){\n\t\t\t\t\t\tutil.drilldown(self.processTrackingPage+ '?processName=' +processName + '&status=SUSPENDED&userRole=USER_ROLE_ADMIN');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function statsController(dashBoardService) {\n var vm = this;\n\n load();\n\n\n ////////////\n\n /**\n * load the overview data\n */\n function load() {\n dashBoardService.getStats().success(function(data) {\n vm.stats = data;\n }).error( function(data, status, headers) {\n alert('Error: ' + data + '\\nHTTP-Status: ' + status);\n });\n }\n }", "function AppComponent() {\n this.title = 'Route-Optimizer-Interface';\n // console.log(this.batteryLevel);\n }", "function Controller(){} //Extends Class (at bottom of page).", "function Controller() {\n\n }", "function WizardBarController() {\n }", "function Controller() { }", "function Controller() {\n \n }", "function Controller() {\n \n }", "stageCastle(stage){\n stage.addChild(this.healthBar);\n }", "setHealth(health) {\n this.health = health;\n }", "function IndexController() {\n initHbbtv();\n setRedButtonTimeout();\n window.onkeydown = redButtonCreateAppEventHandler;\n}", "function UpdateHealthBar() {\n\tthis.healthBar.transform.localScale =\n\t\t\tnew Vector3(this.currentHealth / this.maxHealth, 1 ,1);\n\t//set the bg bar to be in the same location as the health bar\n\tthis.healthBarBg.transform.position = this.healthBar.transform.position;\n}", "constructor(_name, _initialHealth) {\n this.name = _name;\n this.health = _initialHealth;\n }", "_drawHealthBar() {\n const { x, y, width, height } = this.config;\n this._bar = this.scene.add.rectangle( x, y, width, height,\n this.config.barColor );\n this._bar.setOrigin( 0, 0 );\n }", "create() {\r\n this.hp_hud = this.add.image(25, 25, 'hp_hud_2x');\r\n\r\n this.sp_hud = this.add.image(25, 45, 'sp_hud_2x');\r\n\r\n this.health_bar = new LuminusHUDProgressBar(this, this.hp_hud.x, this.hp_hud.y, this.hp_hud.width, this.player);\r\n\r\n this.maximize = this.add\r\n .image(\r\n this.cameras.main.width - this.maximizeSpriteOffsetX,\r\n this.maximizeSpriteOffsetY,\r\n this.maximizeSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.settingsIcon = this.add\r\n .image(\r\n this.cameras.main.width - this.settingsSpriteOffsetX,\r\n this.settingsSpriteOffsetY,\r\n this.settingsSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.inventoryIcon = this.add\r\n .image(\r\n this.cameras.main.width - this.inventorySpriteOffsetX,\r\n this.inventorySpriteOffsetY,\r\n this.inventorySpriteName\r\n )\r\n .setInteractive()\r\n .setScale(this.inventorySpriteScale);\r\n\r\n this.attributesBook = this.add\r\n .image(\r\n this.cameras.main.width - this.baseSpriteOffsetX * 4.1,\r\n this.baseSpriteOffsetY,\r\n this.attributesBookSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.maximize.on('pointerup', (pointer) => {\r\n this.scale.toggleFullscreen();\r\n });\r\n\r\n // Launches Attribute Scene Scene.\r\n this.attributesBook.on('pointerup', (pointer) => {\r\n if (!this.scene.isVisible(this.attributeSceneName)) {\r\n this.scene.launch(this.attributeSceneName, {\r\n player: this.player,\r\n });\r\n } else {\r\n this.scene.get(this.attributeSceneName).scene.stop();\r\n // this.scene.stop(this.inventorySceneName);\r\n }\r\n });\r\n\r\n // Launches Inventory Scene.s\r\n this.inventoryIcon.on('pointerup', (pointer) => {\r\n SceneToggleWatcher.toggleScene(this, this.inventorySceneName, this.player);\r\n });\r\n\r\n if (!LuminusUtils.isMobile() || (LuminusUtils.isMobile() && this.input.gamepad.pad1)) {\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n }\r\n\r\n if (this.input.gamepad.pad1) {\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n this.setGamepadTextures();\r\n }\r\n\r\n this.input.gamepad.on('connected', (pad) => {\r\n console.log(pad.id);\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n this.setGamepadTextures();\r\n });\r\n this.input.gamepad.on('disconnected', (pad) => {\r\n this.inventoryShortcutIcon.setTexture(this.inventoryShortcutSprite);\r\n this.attributesShortcutIcon.setTexture(this.attributesShortcutIconDesktop);\r\n });\r\n\r\n // Launch the settings Scene.\r\n this.settingsIcon.on('pointerdown', (pointer) => {\r\n if (!this.scene.isVisible(this.settingSceneName)) {\r\n this.scene.launch(this.settingSceneName);\r\n } else {\r\n this.scene.stop(this.settingSceneName);\r\n }\r\n });\r\n\r\n this.scale.on('resize', (resize) => {\r\n this.resizeAll(resize);\r\n });\r\n // All Scenes have to be stopped before they are called to launch.\r\n this.scene.stop(this.inventorySceneName);\r\n this.scene.stop(this.settingSceneName);\r\n this.scene.stop(this.attributeSceneName);\r\n\r\n this.level_text = this.add.text(15, 75, 'LvL ' + this.player.attributes.level);\r\n }", "render () {\n this.healthBarBG = new HealthBarBGSprite({ game: this.game });\n this.game.layerManager.layers.get('uiLayer').add(this.healthBarBG);\n this.game.layerManager.layers.get('uiLayer').add(this);\n\n this.fixedToCamera = true;\n this.healthBarBG.fixedToCamera = true;\n }", "function AppController() {\n}", "function AdminController() {\n\tthis.view = new AdminViewHelper(this);\n\tthis.allLostItems = {};\n\tthis.init();\n}", "function Controller(){\n\n // function to activate checkbox containers\n this._checkboxActivate = function (checkButton, checkContainer) {\n if (checkButton == null) {return}\n checkButton.addEventListener('change', function () {\n if (this.active) {\n checkContainer.classList.add(\"active\");\n } \n else {\n checkContainer.classList.remove(\"active\");\n };\n });\n };\n\n // function to manage progress bar states\n this._ProgressState = function (button, aContainer, aProgress) {\n if (aContainer == null) {return}\n // following function extended from following stackoverflow post: http://stackoverflow.com/questions/14188654/detect-click-outside-element-vanilla-javascript\n document.addEventListener('click', function(event){\n\n var isClickInside = aContainer.contains(event.target);\n var buttonClick = button.contains(event.target);\n if (!isClickInside) {\n aProgress.classList.remove('active');\n } \n else if(buttonClick) {\n aProgress.classList.remove('active');\n }\n else {\n aProgress.classList.add('active');\n }\n });\n };\n\n // function to manage progress bar updates - originally from High Conversion Forms course\n this._ProgressTracker = function (inputs, progressBar) {\n var self = this;\n this.progressBar = progressBar;\n this.inputs = inputs;\n this.inputs.forEach(function (input) {\n \n input.element = document.querySelector(input.selector);\n input.added = false;\n input.isValid = null;\n if (input.element == null) {return}\n input.element.oninput = function () {\n input.isValid = self._determineStatus(input);\n self._adjustProgressIfNecessary(input);\n };\n });\n this._determineStatus = function (input) {\n var isValid = false;\n \n if (input.element.value.length > 0) {\n isValid = true;\n } else {\n isValid = false;\n }\n\n try {\n isValid = isValid && input.element.validate();\n } catch (e) {\n console.log(e);\n }\n return isValid;\n };\n\n this._adjustProgressIfNecessary = function (input) {\n var newAmount = this.progressBar.value;\n\n if (input.added && !input.isValid) {\n newAmount = newAmount - input.amount;\n input.added = false;\n } else if (!input.added && input.isValid) {\n newAmount = newAmount + input.amount;\n input.added = true;\n }\n this.progressBar.value = newAmount;\n };\n };\n\n }", "function firstInitHealthBar() {\r\n hbWidth = userIntThis.sys.game.config.width*0.20;\r\n hbHeight = userIntThis.sys.game.config.height*0.05;\r\n hbIncrement = hbWidth/maxHealth;\r\n hbReady = true;\r\n oldHealth = maxHealth;\r\n healthBar = userIntThis.add.graphics();\r\n healthBar.setDepth(500);\r\n}", "function updateHealthbar() {\n let redPos = redBar.components.position;\n redPos.width = (health - currHealth) / health * redPos.height * 4;\n\n let greenPos = greenBar.components.position;\n greenPos.width = greenPos.height * 4 - redPos.width;\n }", "run() {\n debug('Adding Components and trigger controller')\n this.addComponents(this.controller, this.port);\n this.controller.startTicking();\n }", "function JobApiController() {\n\t}", "start() {\n Bangle.on('HRM', handleHeartBeat)\n Bangle.setHRMPower(true)\n }", "constructor(x, y) {\n // Position\n // The player cannot go past the top and bottom of the screen\n this.x = x;\n this.y = y;\n // Velocity and speed\n this.vx = 0;\n this.vy = 0;\n this.speed = 0;\n this.walk = 7\n this.sprint = 12;\n // Health properties\n this.maxHealth = 200;\n this.health = this.maxHealth; // Must be AFTER defining this.maxHealth\n this.dmg = 1;\n this.radius = 75;\n this.ghostCaught = 0;\n // Input properties\n this.upKey = 87;\n this.downKey = 83;\n this.leftKey = 65;\n this.rightKey = 68;\n\n this.img = loadImage('assets/images/ghostbuster.png');\n this.beam = loadSound('assets/sounds/beam.mp3');\n\n\n this.healthBar =0;\n this.healthFill =0;\n }", "initControllers() {\n\t\tnew BlockController(this.app);\n\t}", "function ctrl() {\r\n\t// Subscribe to routeChanging which is published by user\r\n\t// when accessing a new route (after app init)\r\n\tpubSub.subscribe('routeChanging', () => {\r\n\t\t// Show loader and start animation\r\n\t\tloader.start();\r\n\t});\r\n\r\n\t// Subscribe to routeChanged which is published whenever\r\n\t// template of target route has been rendered\r\n\tpubSub.subscribe('routeChanged', () => {\r\n\t\t// Stop animation and hide loader\r\n\t\tloader.stop();\r\n\t});\r\n}", "function adminDashboardCtrl(UserService, $scope, Idle, MESSAGES, $uibModal, $timeout, $state, Common) {\n\n var vm = this;\n\n console.log('im getting in the dashboards');\n }", "humanHealth() {\n if ( this.humanHealth < 0 ) {\n this.humanHealth = 0;\n alert( 'You Lost!' );\n this.gameStarted = false;\n } else if ( this.humanHealth > 100 ) {\n this.humanHealth = 100;\n }\n }", "function ViewController(){}//Extends Controller (at bottom of page).", "function WAController( ) { \n\t\t// Allows instantiation without using the \"new\" keyword\n\t\tif ( !( this instanceof WAController ) ) return new WAController( );\n\t\t\n\t\t// Sets the current instance as a variable\n\t\tconst wa = this;\n\n\t\t// Helper function to escape regex strings\n\t\tfunction regesc( s ) { \n\t\t\treturn s.replace( /[-[\\]{}()*+!<=:?.\\/\\\\^$|#\\s,]/g, \"\\\\$&\" );\n\t\t}\n\n\t\t// Helper function to check if a user is a member of a group\n\t\tfunction isMember( groups ) { \n\t\t\tconst g = Array.isArray( groups ) ? groups : [ groups ];\n\t\t\treturn g.some( function( group ) { \n\t\t\t\treturn mwc.wgUserGroups.includes( group );\n\t\t\t} );\n\t\t}\n\n\t\t// Dispatches the loader\n\t\tfunction dispatchLoader( options ) { \n\t\t\tfunction load( modules ) { \n\t\t\t\tconst loader = { };\n\t\t\t\t\n\t\t\t\tloader.scripts = typeof options.scripts === \"string\" ?\n\t\t\t\t\t[ options.scripts ] : \n\t\t\t\t\t( Array.isArray( options.scripts ) ? \n\t\t\t\t\t\toptions.scripts : [ ] );\n\t\t\t\t\n\t\t\t\tloader.stylesheets = typeof options.stylesheets === \"string\" ?\n\t\t\t\t\t[ options.stylesheets ] : \n\t\t\t\t\t( Array.isArray( options.stylesheets ) ? \n\t\t\t\t\t\toptions.stylesheets : [ ] );\n\t\t\t\t\n\t\t\t\tloader.modules = modules;\n\t\t\t\t\n\t\t\t\tloader.loadedScripts = [ ];\n\t\t\t\t\n\t\t\t\tloader.loadedStylesheets = [ ];\n\n\t\t\t\tloader.objects = new Proxy( { }, { \n\t\t\t\t\tget: function( target, property ) { \n\t\t\t\t\t\treturn typeof target[ property ] !== \"undefined\" ? \n\t\t\t\t\t\t\ttarget[ property ] : \n\t\t\t\t\t\t\tnull; \n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\tArray.from( loader.stylesheets ).forEach( function( stylesheet ) { \n\t\t\t\t\timportArticle( { \n\t\t\t\t\t\ttype: \"style\",\n\t\t\t\t\t\tarticle: stylesheet\n\t\t\t\t\t} ).then( function( ) { \n\t\t\t\t\t\tloader.loadedStylesheets.push( stylesheet );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\treturn Promise.all( loader.scripts.map( function( script ) { \n\t\t\t\t\tif ( typeof script === \"string\" ) script = { page: script };\n\t\t\t\t\t\n\t\t\t\t\tconst baseObject = script.baseObject || { };\n\t\t\t\t\tconst prop = script.id || null, hook = script.hook || null, page = script.page;\n\t\t\t\t\t\n\t\t\t\t\tif ( \n\t\t\t\t\t\tbaseObject && \n\t\t\t\t\t\tbaseObject.hasOwnProperty( prop ) \n\t\t\t\t\t) { \n\t\t\t\t\t\tloader.objects[ prop ] = baseObject[ prop ];\n\t\t\t\t\t\tloader.loadedScripts.push( page );\n\t\t\t\t\t\treturn Promise.resolve( );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn importArticle( { \n\t\t\t\t\t\ttype: \"script\",\n\t\t\t\t\t\tarticle: page\n\t\t\t\t\t} ).then( function( ) { \n\t\t\t\t\t\treturn new Promise( function( resolve ) {\n\t\t\t\t\t\t\tif ( hook ) {\n\t\t\t\t\t\t\t\tmw.hook( hook ).add( function( ) { \n\t\t\t\t\t\t\t\t\tconst args = Array.from( arguments );\n\t\t\t\t\t\t\t\t\tif ( prop ) loader.objects[ prop ] = args.length === 1 ? args[ 0 ] : args;\n\t\t\t\t\t\t\t\t\tresolve.apply( null, args );\n\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\tif ( prop ) loader.objects[ prop ] = baseObject[ prop ];\n\t\t\t\t\t\t\t\tresolve( );\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.then( function( ) {\n\t\t\t\t\treturn new Proxy( loader, { \n\t\t\t\t\t\tget: function( obj, prop ) { \n\t\t\t\t\t\t\treturn obj[ prop ] || null;\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 new Promise( function( resolve, reject ) { \n\t\t\t\tif ( \n\t\t\t\t\t( \"modules\" in options && Array.isArray( options.modules ) ) ||\n\t\t\t\t\t( \"module\" in options && typeof options.module === \"string\" )\n\t\t\t\t) {\n\t\t\t\t\tconst modules = \"module\" in options ? [ options.module ] : options.modules;\n\t\t\t\t\tmw.loader.using( modules ).then( function( ) { \n\t\t\t\t\t\tload( modules ).then( resolve );\n\t\t\t\t\t} );\n\t\t\t\t} else { \n\t\t\t\t\tload( [ ] ).then( resolve );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Timeago function\n\t\tfunction timeago( epoch ) { \n\t\t\tconst delta = Math.round( ( Date.now( ) - new Date( epoch * 1000 ) ) / 1000 );\n\t\t\tconst absDelta = Math.abs( delta );\n\n\t\t\tif ( isNaN( delta ) ) return \"\";\n\n\t\t\tconst minutes = Math.round( delta / 60 ), hours = Math.round( minutes / 60 );\n\t\t\tconst days = Math.round( hours / 24 ), months = Math.round( days / 30 ), years = Math.round( months / 12 );\n\n\t\t\tconst props = Object.freeze( { \n\t\t\t\tago: function( ) { \n\t\t\t\t\treturn delta > 5;\n\t\t\t\t},\n\t\t\t\tjustnow: function( ) { \n\t\t\t\t\treturn absDelta < 5;\n\t\t\t\t},\n\t\t\t\ttime: function( ) { \n\t\t\t\t\treturn delta < -5;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tconst type = Object.getOwnPropertyNames( props )\n\t\t\t\t.find( function( prop ) { \n\t\t\t\t\tconst condition = props[ prop ];\n\t\t\t\t\treturn condition( );\n\t\t\t\t} );\n\t\t\t\n\t\t\tif ( !type ) return \"\";\n\n\t\t\tif ( type === \"justnow\" ) return wa.msg( \"timeago-justnow\" ).parse( );\n\t\t\t\n\t\t\tconst units = new Map( [ \n\t\t\t\t[ \"seconds\", function( ) { \n\t\t\t\t\treturn absDelta < 60;\n\t\t\t\t} ],\n\t\t\t\t[ \"minute\", function( ) { \n\t\t\t\t\treturn absDelta >= 60 && Math.abs( minutes ) < 2;\n\t\t\t\t} ],\n\t\t\t\t[ \"minutes\", function( ) { \n\t\t\t\t\treturn Math.abs( minutes ) >= 2 && Math.abs( minutes ) < 60;\n\t\t\t\t} ],\n\t\t\t\t[ \"hour\", function( ) { \n\t\t\t\t\treturn Math.abs( minutes ) >= 60 && Math.abs( hours ) < 2;\n\t\t\t\t} ],\n\t\t\t\t[ \"hours\", function( ) { \n\t\t\t\t\treturn Math.abs( hours ) >= 2 && Math.abs( hours ) < 24;\n\t\t\t\t} ],\n\t\t\t\t[ \"day\", function( ) { \n\t\t\t\t\treturn Math.abs( hours ) >= 24 && Math.abs( days ) < 2;\n\t\t\t\t} ],\n\t\t\t\t[ \"days\", function( ) { \n\t\t\t\t\treturn Math.abs( days ) >= 2 && Math.abs( days ) < 30;\n\t\t\t\t} ],\n\t\t\t\t[ \"month\", function( ) { \n\t\t\t\t\treturn Math.abs( days ) >= 30 && Math.abs( months ) < 2;\n\t\t\t\t} ],\n\t\t\t\t[ \"months\", function( ) { \n\t\t\t\t\treturn Math.abs( months ) >= 2 && Math.abs( months ) < 12;\n\t\t\t\t} ],\n\t\t\t\t[ \"year\", function( ) { \n\t\t\t\t\treturn Math.abs( months ) >= 12 && Math.abs( years ) < 2;\n\t\t\t\t} ],\n\t\t\t\t[ \"years\", function( ) { \n\t\t\t\t\treturn Math.abs( years ) >= 2;\n\t\t\t\t} ]\n\t\t\t] );\n\n\t\t\tconst unit = Array.from( units.keys( ) )\n\t\t\t\t.find( function( key ) { \n\t\t\t\t\tconst condition = units.get( key );\n\t\t\t\t\treturn condition( );\n\t\t\t\t} );\n\n\t\t\tif ( !unit ) return \"\";\n\n\t\t\tconst values = new Map( [ \n\t\t\t\t[ \"seconds\", delta ],\n\t\t\t\t[ \"minutes\", minutes ],\n\t\t\t\t[ \"hour\", false ],\n\t\t\t\t[ \"hours\", hours ],\n\t\t\t\t[ \"day\", false ],\n\t\t\t\t[ \"days\", days ],\n\t\t\t\t[ \"month\", false ],\n\t\t\t\t[ \"months\", months ],\n\t\t\t\t[ \"year\", false ],\n\t\t\t\t[ \"years\", years ]\n\t\t\t] );\n\n\t\t\tif ( !values.has( unit ) ) return \"\";\n\n\t\t\tconst value = values.get( unit );\n\t\t\t\n\t\t\tconst instance = typeof value === \"number\" ?\n\t\t\t\twa.msg( \"timeago-\" + unit + \"-\" + type, value ) : \n\t\t\t\twa.msg( \"timeago-\" + unit + \"-\" + type );\n\t\t\t\n\t\t\tif ( !instance.exists ) return \"\";\n\n\t\t\treturn instance.parse( );\n\t\t}\n\n\t\t// Member check\n\t\tconst CAN_BLOCK = Object.freeze( [ \"sysop\", \"staff\", \"wiki-manager\", \"helper\", \"soap\", \"global-discussions-moderator\" ] );\n\t\twa.canBlock = isMember( CAN_BLOCK );\n\n\t\tconst CAN_DELETE = Object.freeze( CAN_BLOCK.concat( [ \"discussion-moderator\", \"threadmoderator\" ] ) );\n\t\twa.isMod = wa.canDelete = isMember( CAN_DELETE );\n\n\t\tconst CAN_ROLLBACK = Object.freeze( CAN_DELETE.concat( \"rollback\" ) );\n\t\twa.canRollback = isMember( CAN_ROLLBACK );\n\t\t\n\t\tconst CAN_PATROL = Object.freeze( CAN_DELETE.concat( \"patroller\" ) );\n\t\twa.canPatrol = isMember( CAN_PATROL );\n\n\t\t// Setting the configuration object\n\t\twa.options = $.extend( { }, options );\n\n\t\t// Default configurations\n\t\twa.defaults = Object.freeze( { \n\t\t\t// The limit of pages to show on the activity feed at one time\n\t\t\tlimit: 50,\n\t\t\t// Sets the WikiActivity theme\n\t\t\ttheme: \"main\",\n\t\t\t// A list of namespaces to exclude\n\t\t\texcludedNamespaces: [ ],\n\t\t\t// Determines whether to show bot edits\n\t\t\tshowBotEdits: false,\n\t\t\t// Determines whether the activity feed should be loaded on a module\n\t\t\tloadModule: false,\n\t\t\t// Allows for custom rendering\n\t\t\tcustomRendering: { },\n\t\t\t// Determines whether the RC button on the\n\t\t\t// header can be changed back to Wiki Activity.\n\t\t\theaderLink: false,\n\t\t\t// Timeout for loading the activity feed\n\t\t\ttimeout: 15000,\n\t\t\t// Determines whether the activity feed is infinitely scrolling\n\t\t\tautoScroll: true\n\t\t} );\n\n\t\t// A list of supported namespaces\n\t\twa.supportedNamespaces = Object.freeze( [ \n\t\t\t0, // Article\n\t\t\t1, // Article talk\n\t\t\t2, // User\n\t\t\t3, // User talk\n\t\t\t4, // Project ({{SITENAME}})\n\t\t\t5, // Project talk ({{SITENAME}} talk)\n\t\t\t6, // File\n\t\t\t7, // File talk\n\t\t\t110, // Forum\n\t\t\t111, // Forum talk\n\t\t\t500, // User blog\n\t\t\t501, // User blog comment\n\t\t\t828, // Module\n\t\t\t829, // Module talk\n\t\t] );\n\n\t\t// Setting the configurations\n\t\tObject\n\t\t\t.getOwnPropertyNames( wa.defaults )\n\t\t\t.forEach( function( property ) { \n\t\t\t\tconst def = wa.defaults[ property ];\n\t\t\t\twa.options[ property ] = typeof wa.options[ property ] !== \"undefined\" ? \n\t\t\t\t\twa.options[ property ] : def;\n\t\t\t} );\n\n\t\t// Selected namespaces\n\t\twa.namespaces = wa.supportedNamespaces.filter( function( namespace ) { \n\t\t\tconst excludeNamespaces = Array.isArray( wa.options.excludeNamespaces ) ? wa.options.excludeNamespaces : [ ];\n\t\t\treturn !excludeNamespaces.includes( namespace );\n\t\t} );\n\n\t\t// A list of namespaces that qualify as a talk namespace\n\t\twa.isTalk = Object.freeze( [ 3, 5, 111, 829 ] );\n\n\t\t// Function to check the current URL\n\t\twa.matchesUrl = function( ) { \n\t\t\tif ( mwc.wgNamespaceNumber !== -1 ) return false;\n\t\t\t\n\t\t\t// The current page title\n\t\t\tconst pageTitle = \n\t\t\t\twa.i18n\n\t\t\t\t\t.inContentLang( )\n\t\t\t\t\t.msg( \"page-title\" )\n\t\t\t\t\t.plain( );\n\t\t\t\n\t\t\t// Separate the page title by parts\n\t\t\tconst parts = mwc.wgTitle.split( \"/\" );\n\n\t\t\t// The main title \n\t\t\tconst mainTitle = parts[ 0 ];\n\n\t\t\treturn ( pageTitle === mainTitle || \"WikiActivity\" === mainTitle );\n\t\t};\n\n\t\t// Fetches the WikiActivity URL\n\t\twa.getURL = function( ) { \n\t\t\t// The Special namespace\n\t\t\tconst ns = mwc.wgCanonicalNamespaces[ -1 ];\n\n\t\t\t// The WikiActivity title\n\t\t\tconst title = wa.i18n\n\t\t\t\t.inContentLang( )\n\t\t\t\t.msg( \"page-title\" )\n\t\t\t\t.plain( );\n\t\t\t\n\t\t\t// Returns the WikiActivity URL\n\t\t\treturn mw.util.getUrl( ns + \":\" + title );\n\t\t};\n\n\t\t// Initializes all subpages\n\t\twa.initPages = function( ) { \n\t\t\t// Creating the title parts\n\t\t\tconst parts = mwc.wgTitle.split( \"/\" );\n\n\t\t\t// Fetches the main title\n\t\t\twa.mainTitle = parts.shift( );\n\n\t\t\t// Fetches the subpage\n\t\t\twa.subpage = parts.length && parts[ 0 ] ? parts[ 0 ] : \"\";\n\n\t\t\t// Sets all canonical activity types\n\t\t\twa.types = Object.freeze( { \n\t\t\t\tsocial: [ \"feeds\", \"discussions\", \"d\", \"f\" ],\n\t\t\t\tfiles: [ \"file\", \"image\", \"images\", \"videos\" ],\n\t\t\t\tfollowing: [ \"watchlist\", \"w\" ],\n\t\t\t\tmain: \"*\"\n\t\t\t} );\n\n\t\t\t// Creates all subpages\n\t\t\twa.subpages = Object.getOwnPropertyNames( wa.types )\n\t\t\t\t.reduce( function( object, property ) { \n\t\t\t\t\tconst value = wa.types[ property ];\n\n\t\t\t\t\tfunction makePattern( subpage ) { \n\t\t\t\t\t\tconst msg = wa.i18n\n\t\t\t\t\t\t\t.msg( \"page-\" + subpage + \"-subpage\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( !msg.exists ) return subpage;\n\n\t\t\t\t\t\tconst name = msg.plain( );\n\t\t\t\t\t\treturn new RegExp( \"^\" + regesc( name ) + \"$\", \"i\" );\n\t\t\t\t\t} \n\n\t\t\t\t\tif ( Array.isArray( value ) ) { \n\t\t\t\t\t\tif ( !value.includes( \"*\" ) ) object[ property ] = [ property ].concat( value ).map( makePattern );\n\t\t\t\t\t\telse object[ property ] = true;\n\t\t\t\t\t} else { \n\t\t\t\t\t\tif ( value === \"*\" ) object[ property ] = true;\n\t\t\t\t\t\telse if ( typeof value === \"boolean\" ) object[ property ] = value;\n\t\t\t\t\t\telse object[ property ] = [ property, value ].map( makePattern );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn object;\n\t\t\t\t}, { } );\n\n\t\t\twa.getType = function( subpage ) { \n\t\t\t\tconst booleanFound = [ ];\n\t\t\t\tconst subpages = Object.getOwnPropertyNames( wa.subpages )\n\t\t\t\t\t.sort( function( aProp, bProp ) { \n\t\t\t\t\t\tconst a = wa.subpages[ aProp ], b = wa.subpages[ bProp ];\n\t\t\t\t\t\tif ( typeof a === \"boolean\" && typeof b === \"boolean\" ) return 0;\n\t\t\t\t\t\tif ( typeof a === \"boolean\" && typeof b !== \"boolean\" ) return 1;\n\t\t\t\t\t\tif ( typeof a !== \"boolean\" && typeof b === \"boolean\" ) return -1;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} )\n\t\t\t\t\t.filter( function( prop ) { \n\t\t\t\t\t\tconst value = wa.subpages[ prop ];\n\t\t\t\t\t\tif ( booleanFound.length === 1 && typeof value === \"boolean\" && value ) return false;\n\t\t\t\t\t\tif ( typeof value === \"boolean\" && value ) booleanFound.push( value );\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} );\n\n\t\t\t\tcheckSubpages: for ( var i = 0; i < subpages.length; i++ ) { \n\t\t\t\t\tconst target = subpages[ i ];\n\t\t\t\t\tconst value = wa.subpages[ target ];\n\n\t\t\t\t\tif ( Array.isArray( value ) ) { \n\t\t\t\t\t\tfor ( var j = 0; j < value.length; j++ ) { \n\t\t\t\t\t\t\tconst checker = value[ j ];\n\t\t\t\t\t\t\tif ( checker instanceof RegExp && checker.test( subpage ) ) return target;\n\t\t\t\t\t\t\tif ( typeof checker === \"string\" && checker === subpage ) return target;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn \"main\";\n\t\t\t};\n\t\t};\n\n\t\twa.icons = Object.freeze( { \n\t\t\tedit: \"pencil\",\n\t\t\t\"new\": \"add\",\n\t\t\tcomment: \"comment\",\n\t\t\ttalk: \"bubble\",\n\t\t\tcategorize: \"tag\",\n\t\t\tdiff: \"clock\",\n\t\t\toptions: \"gear\",\n\t\t\tmore: \"more\"\n\t\t} );\n\n\t\twa.entries = [ ];\n\n\t\twa.avatarCache = { };\n\n\t\twa.loadedd = false;\n\n\t\twa.loading = false;\n\n\t\tdispatchLoader( { \n\t\t\tmodules: [ \"mediawiki.Title\", \"mediawiki.Uri\", \"mediawiki.util\" ],\n\t\t\tstylesheets: [ \"u:dev:MediaWiki:WikiActivity.css\" ],\n\t\t\tscripts: [ { \n\t\t\t\t\n\t\t\t} ]\n\t\t} );\n\t}", "constructor(){\n console.log(\"Creating a new alien\")\n this.health = 100;\n this.damage = 50;\n\n }", "function homeController()\r\n {\r\n var self = this;\r\n }", "function AppComponent(dialog, titleService) {\n this.dialog = dialog;\n this.titleService = titleService;\n this.title = 'app';\n this.progressBarList = [\n { id: 4, skill: '60', skillName: 'Angular' },\n { id: 3, skill: '70', skillName: 'PYTHON' },\n { id: 1, skill: '90', skillName: 'C/C++' },\n ];\n this.bioiInfo = [\n { bioTitle: 'Name', bioValue: 'Yash Ghatge' },\n { bioTitle: 'Date Of Birth', bioValue: '09/09/1997' },\n { bioTitle: 'Email', bioValue: '[email protected]' },\n { bioTitle: 'Address', bioValue: 'DA-54B,Hari Nagar,New Delhi, India-110064' },\n { bioTitle: 'Phone', bioValue: '+91-9810016447' }\n ];\n this.smoIcon = [\n { smoLink: 'https://www.facebook.com/yash.ghatge', smoLogo: '<i class=\"fa fa-facebook\" aria-hidden=\"true\"></i>' },\n { smoLink: 'https://www.linkedin.com/in/yash-ghatge-76075b169/', smoLogo: '<i class=\"fa fa-linkedin\" aria-hidden=\"true\"></i>' },\n ];\n this.titleService.setTitle(\"Resume\");\n }", "function ProcessController() {}", "function Controller() {\n // Route URL events to the controller's event handlers.\n this.route(\"/breedings/:id\", this.getBreeding);\n\n // Set default properties.\n this.detailsViewUrl = null;\n }", "function HomeController( userService, $mdSidenav, $mdBottomSheet, $timeout, $log ) {\n\n }", "function AssetController() {\n\n }", "function StateController(AnalysisService) {\n var vm = this;\n vm.percentage = 0;\n\n /**\n * Initializes the sate of the analysis.\n */\n function initialize() {\n return AnalysisService.getAnalysisState(function (data) {\n vm.state = data.state;\n vm.stateLang = data.stateLang;\n vm.percentage = Math.round(parseFloat(data.percentComplete));\n vm.stateClass = _createClass(vm.state);\n });\n }\n\n /**\n * Dynamically creates the border color for the top of the sidebar depending on the state of the analysis.\n * @param state\n * @returns {string}\n * @private\n */\n function _createClass(state) {\n return 'analysis__alert--' + state.toLowerCase();\n }\n\n initialize();\n }", "display() {\n push();\n imageMode(CENTER);\n image(this.img, this.x, this.y, this.radius, this.radius);\n pop();\n\n this.healthBar = map(this.health, 0, this.maxHealth, 0, width /2);\n this.healthFill = map(this.health, 0, 100, 255, 0);\n\n push();\n fill(this.healthFill, 100, 30);\n rectMode(CENTER, CENTER);\n rect(width / 2, height - 40, this.healthBar, 20);\n pop();\n }", "function BabylonInspectorDashboard() {\n // name , html for dash css for dash\n _super.call(this, \"babylonInspector\", \"control.html\", \"control.css\");\n this._ready = false;\n this.id = 'BABYLONINSPECTOR';\n this._dataTreeGenerator = new DataTreeGenerator(this);\n this.treeRoot = null;\n }", "function SchedulerController() {\n let vm = this;\n\n function init() {\n console.log(\"Scheduler Controller loaded\");\n }\n init();\n }", "function agentmapController() {\n //Set the tick display box to display the number of the current tick.\n // ticks_display.textContent = agentmap.state.ticks;\n\n //Check if any of the options have been changed in the interface and update the Agentmap accordingly.\n if (agentmap.animation_interval !== Number(animation_interval_map[5])) {\n agentmap.setAnimationInterval(animation_interval_map[5]);\n }\n}", "function onStatusChange(healthState) {\n appHealthDebug(`🏥: APP HEALTHY?: ${healthState.healthy}`);\n}", "function mainController(beesFactory) {\n\t\tthis.numWorkers = 5;\n\t\tthis.numDrones = 8;\n\n\t\tthis.queen = null;\n\t\tthis.workers = [];\n\t\tthis.drones = [];\n\t\tthis.gameOver = false;\n\n\t\tthis.newGame = newGame;\n\t\tthis.playARound = playARound;\n\n\t\tvar vm = this;\n\t\tvar allLivingBees = [];\n\n\t\tactivate();\n\n\t\tfunction activate() {\n\t\t\tnewGame();\n\t\t}\n\n\t\tfunction newGame() {\n\t\t\tvm.gameOver = false;\n\n\t\t\tvm.queen = beesFactory.createQueen();\n\n\t\t\tvm.workers = [];\n\t\t\tfor (var i = 0; i < vm.numWorkers; i++) {\n\t\t\t\tvm.workers.push(beesFactory.createWorker());\n\t\t\t};\n\n\t\t\tvm.drones = [];\n\t\t\tfor (var i = 0; i < vm.numDrones; i++) {\n\t\t\t\tvm.drones.push(beesFactory.createDrone());\n\t\t\t};\n\n\t\t\tallLivingBees = [vm.queen].concat(vm.workers).concat(vm.drones);\n\t\t}\n\n\t\tfunction playARound() {\n\t\t\tvar rand = Math.floor(Math.random() * allLivingBees.length);\t// TODO: move this randomness to a service that we can easily mock\n\t\t\tvar beeToHit = allLivingBees[rand];\n\t\t\tbeeToHit.takeHit();\n\t\t\t\n\t\t\tif (beeToHit.state !== 'dead') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tallLivingBees.splice(rand, 1);\n\t\t\t// check if game over\n\t\t\t// TODO: this logic should be in the model. something like 'if beeToHit.killsAllOthers ...'\n\t\t\tif (beeToHit.type === 'queen') {\n\t\t\t\tangular.forEach(allLivingBees, function(bee) {\n\t\t\t\t\tbee.die();\n\t\t\t\t});\n\t\t\t\tvm.gameOver = true;\n\t\t\t}\n\n\t\t}\n\n\t}", "function MainController() {\n\n var self = this;\n\n //\n _.extend(self, {\n });\n\n\n }", "function updateHealth(health) {\n health += 10;\n }", "function initializeController() {\n }", "function initializeController() {\n }", "function YieldController() {\n\tthis.jobsToYield = {};\n}", "function Controller(extensionMeta) {\n let dateMenu = Main.panel.statusArea.dateMenu;\n\n return {\n extensionMeta: extensionMeta,\n panelWidget: null,\n settings: null,\n placement: 0,\n apiProxy: new ApiProxy(Gio.DBus.session, 'org.gnome.Hamster', '/org/gnome/Hamster'),\n windowsProxy: new WindowsProxy(Gio.DBus.session, \"org.gnome.Hamster.WindowServer\",\n \"/org/gnome/Hamster/WindowServer\"),\n\n enable: function() {\n this.settings = Convenience.getSettings();\n this.panelWidget = new PanelWidget(this);\n this.placement = this.settings.get_int(\"panel-placement\");\n\n this._placeWidget(this.placement, this.panelWidget)\n this.apiProxy.connectSignal('ActivitiesChanged', Lang.bind(this, this.refreshActivities));\n this.activities = this.refreshActivities();\n\n Main.panel.menuManager.addMenu(this.panelWidget.menu);\n Main.wm.addKeybinding(\"show-hamster-dropdown\",\n this.panelWidget._settings,\n Meta.KeyBindingFlags.NONE,\n // Since Gnome 3.16, Shell.KeyBindingMode is replaced by Shell.ActionMode\n Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : Shell.ActionMode.ALL,\n Lang.bind(this.panelWidget, this.panelWidget.toggle)\n );\n },\n\n disable: function() {\n Main.wm.removeKeybinding(\"show-hamster-dropdown\");\n\n this._removeWidget(this.placement)\n Main.panel.menuManager.removeMenu(this.panelWidget.menu);\n GLib.source_remove(this.panelWidget.timeout);\n this.panelWidget.actor.destroy();\n this.panelWidget.destroy();\n this.panelWidget = null;\n },\n\n /**\n * Build a new cache of all activities present in the backend.\n */\n refreshActivities: function() {\n /**\n * Return an Array of [Activity.name, AcAivity.category.name] Arrays.\n *\n */\n function getActivities(controller) {\n // [FIXME]\n // It seems preferable to have a sync methods call in order to\n // avoid race conditions (previously extensions used async\n // version).\n // There is however a reasonable risk this may actually be a bad\n // idea as it may block the entire shell if the request takes too\n // long. This may be particulary likly if the dbus service uses\n // a remote database as persistent storage.\n // We need to come back to this once we have the low hanging fruits\n // covered.\n let activities = controller.apiProxy.GetActivitiesSync('');\n // [FIXME]\n // For some bizare reason I am unable to create a proper array out\n // of the return value of the dbus method call any other way.\n // So unless can provide some insight here, this hack does the job.\n let foo = function([activities]){return activities;};\n return foo(activities);\n };\n\n let result = getActivities(this);\n this.activities = result;\n return result;\n },\n\n /**\n * Place the actual extension wi\n * get in the right place according to settings.\n */\n _placeWidget: function(placement, panelWidget) {\n if (placement == 1) {\n // 'Replace calendar'\n Main.panel.addToStatusArea(\"hamster\", this.panelWidget, 0, \"center\");\n\n Main.panel._centerBox.remove_actor(dateMenu.container);\n Main.panel._addToPanelBox('dateMenu', dateMenu, -1, Main.panel._rightBox);\n } else if (placement == 2) {\n // 'Replace activities'\n let activitiesMenu = Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0]\n // If our widget replaces the 'Activities' menu in the panel,\n // this property stores the original text so we can restore it\n // on ``this.disable``.\n this._activitiesText = activitiesMenu.get_text();\n activitiesMenu.set_text('');\n Main.panel.addToStatusArea(\"hamster\", this.panelWidget, 1, \"left\");\n } else {\n // 'Default'\n Main.panel.addToStatusArea(\"hamster\", this.panelWidget, 0, \"right\");\n };\n },\n\n _removeWidget: function(placement) {\n if (placement == 1) {\n // We replaced the calendar\n Main.panel._rightBox.remove_actor(dateMenu.container);\n Main.panel._addToPanelBox(\n 'dateMenu',\n dateMenu,\n Main.sessionMode.panel.center.indexOf('dateMenu'),\n Main.panel._centerBox\n );\n } else if (placement == 2) {\n // We replaced the 'Activities' menu\n let activitiesMenu = Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0]\n activitiesMenu.set_text(this._activitiesText);\n };\n },\n };\n}", "function Controller() {\n // route data members\n this.middlewares = [];\n this.userTypes = [];\n this.permissions = [];\n this.isPublic = false;\n this.accepts = {};\n this.config = {};\n}", "constructor(health, strength) {\n\t\tthis.health = health;\n\t\tthis.strength = strength;\n\t}", "function BasicIAController(name, root) {\n\tthis.name = name;\n\tthis.root = (root === null)? this : root;\n\tthis.ready = false;\n\tthis.bus = (root === null)? new EventEmitter() : this.root.bus;\n\t\n\tthis.build(name);\n}", "function BasicIAController(name, root) {\n\tthis.name = name;\n\tthis.root = (root === null)? this : root;\n\tthis.ready = false;\n\tthis.bus = (root === null)? new EventEmitter() : this.root.bus;\n\t\n\tthis.build(name);\n}", "function main() {\n\n\t\tfbor = new FBOCompositor( renderer, 512, SHADER_CONTAINER.passVert );\n\t\tfbor.addPass( 'velocity', SHADER_CONTAINER.velocity );\n\t\tfbor.addPass( 'position', SHADER_CONTAINER.position, { velocityBuffer: 'velocity' } );\n\n\n\t\tpsys = new ParticleSystem();\n\t\tvar initialPositionDataTexture = psys.generatePositionTexture();\n\t\tfbor.renderInitialBuffer( initialPositionDataTexture, 'position' );\n\n\n\t\thud = new HUD( renderer );\n\n\tinitGui();\n\n}", "function Main(){\n PubSub.call(this); // super();\n\n // ui system\n this.screens = new Screens(this);\n\n this.onceOn('init', this.init, this);\n }", "function SetHealth(health : int) {\n\tvar scalePercentage : float;\n\tif (health < maxHealth) { // Less health\n\t\tscalePercentage = 1.0 - ((maxHealth - health) / maxHealth);\n\t\tgreenGUITexture.pixelInset.width = redGUITexture.pixelInset.width * scalePercentage;\n\t} else if (health > maxHealth) { // More health\n\t\tscalePercentage = 1.0 + Mathf.Abs((maxHealth - health) / maxHealth);\n\t\tgreenGUITexture.pixelInset.width = redGUITexture.pixelInset.width * scalePercentage;\n\t} \n\tcurrentHealth = health;\n}", "function Controller(){\n this.config = config\n}", "function HealthBar(width, height, owner, offsetX, offsetY) {\n if (offsetX === void 0) { offsetX = 0; }\n if (offsetY === void 0) { offsetY = -50; }\n this._size = undefined;\n this._offset = undefined;\n this._centerOffset = new vector2D_2.default(0, 0);\n this._progressOffset = new vector2D_2.default(0, 0);\n /**\n * Whether or not the HitpointBar is visible.\n */\n this.visible = true;\n /**\n * Whether or not the HitPointBar should be horizontally centered relative to the owner's position.\n */\n this.center = true;\n this._size = new size_3.default(width, height);\n this._offset = new vector2D_2.default(offsetX, offsetY);\n this._owner = owner;\n this.base = new healthBarElement_1.HealthBarBase(color_11.default.white, color_11.default.white, 1, this);\n this.progress = new healthBarElement_1.HealthBarProgress(color_11.default.black, color_11.default.black, 0, this);\n this.base.transparency = 0.2;\n this.progress.transparency = 0.5;\n }", "function AppComponent(http) {\n // declare some properties\n this.title = \"Tour of Heroes\";\n this.heroes = [];\n this.http = http;\n }", "function main() {\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n <%= class_name %>.server.preload(<%= class_name %>.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: <%= class_name %>.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n // The default code just activates all the views you have on the page. If\n // your app gets any level of complexity, you should just get the views you\n // need to show the app in the first place, to speed things up.\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n // TODO: Set the content property on your primary controller\n // ex: <%= class_name %>.contactsController.set('content',<%= class_name %>.contacts);\n\n}", "function maxHealthBoost(tempHealth) {\n maxHealth += tempHealth; \n currentHealth = maxHealth;\n maxHealthUpdate();\n parseHealthBarAnimate();\n}", "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\n\t\t\t// Setup Form.\n\t\t\ttempForm();\n\t\t}", "function initController() {\n }", "function ItemController($scope, $location, applicationState, Choko) {\n}", "function settingController($scope, $state, $window, commonApi, constants, localize) {\n // Init data when initialize welcome screen\n function initialize() {\n }\n\n //initialize welcome screen\n initialize();\n }", "constructor(name, health){//name and health will be varied\n\t\t\tthis.name = name;//the name is whatever the user chooses\n\t\t\tthis.maxHealth = health;//this will allow the character health to be restored if needed to it's max\n\t\t\tthis.currentHealth = health;//this health depeds\n\t\t\tthis.isIncapacitated = false;\n\t\t\tthis.barriers = {//basic statistics for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 10,\n\t\t\t\tsneak: 10,\n\t\t\t\tpersuade: 10\n\t\t\t};\n\t\t\tthis.skills ={//basic skill stats for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 0,\n\t\t\t\tsneak: 0,\n\t\t\t\tpersuade: 0\n\t\t\t};\n\t\t}", "function MembershipAdminController(breadcrumbService) {\n var vm = this;\n vm.$onInit = onInit;\n\n //--\n\n function onInit() {\n vm.breadcrumbs = [\n breadcrumbService.forState('home'),\n breadcrumbService.forState('home.admin'),\n breadcrumbService.forState('home.admin.access'),\n breadcrumbService.forState('home.admin.access.memberships'),\n ];\n }\n\n}", "function HomeController($scope, //IScope,\n $state, $stateParams, authSvc, WebAPI) {\n // currently, simplest way to clear out the registration mode it to set it to false when you go to the dashboard.\n authSvc.registering = false;\n // recent trans.\n WebAPI.getRecentTransactions()\n .then(function (result) { $scope.recentTrans = result.data; });\n // accounts\n WebAPI.getAccounts()\n .then(function (result) { $scope.accounts = result.data; });\n }", "activateHealthCheckUp() {\n setInterval(() => {\n if (this.master.masterActivated) {\n let totalWorkers = this.master.totWorker();\n let workersOnline = this.master.onlineWorkers();\n\n if (totalWorkers == workersOnline)\n console.log(`Cluster Health: ${chalk.green.bold.italic(this.health[1])}`);\n else if (workersOnline > 0) {\n console.log(`Cluster Health: ${chalk.yellow.bold.italic(this.health[0])}`);\n winston.warn('Cluster health: YELLOW')\n }\n else if (workersOnline == 0) {\n console.log(`Cluster Health: ${chalk.red.bold.italic(this.health[-1])}`);\n winston.error('Cluster health: RED');\n }\n let workerStats = this.master.workerStats()\n winston.info(`Engaged: ${workerStats.engaged} Idle: ${workerStats.idle}`);\n // Log the worker stats\n }\n }, 20000);\n }", "run() {\n /* Attach the event liteners to the UI controller event emitter */\n $UIController.on(\"userNameChanged\", (userName) => {\n this._formData.userName = userName;\n });\n\n $UIController.on(\"messageChanged\", (message) => {\n this._formData.userMessage = message;\n });\n\n $UIController.on(\"formSubmitted\", () => {\n const {userName, userMessage} = this._formData;\n\n if (!userName || !userMessage)\n return;\n\n $ConnectionController.sendMessage(userName, userMessage);\n $UIController.displayMessage(userMessage, false);\n this._formData.userMessage = \"\";\n $UIController.resetForm(this._formData);\n });\n\n /* Setup the user interface */\n $UIController.init(this._UIMetaData);\n $UIController.renderMessageForm(this._formData);\n\n /* Prepare the connection by assigning the event listeners to the connection controller */\n $ConnectionController.on(\"connected\", () => {\n $UIController.setFormDisableMode(false);\n });\n\n $ConnectionController.on(\"disconnected\", () => {\n $UIController.setFormDisableMode(true);\n });\n\n $ConnectionController.on(\"messageReceived\", ({user: userName, message}) => {\n $UIController.displayMessage(message, true, userName);\n });\n\n /* Run the main service by connection to the remote server */\n $ConnectionController.connect();\n\n console.log(\"App running...\");\n\n }", "function Boss() {\n var _this = _super.call(this, \"bossB\") || this;\n _this.Start();\n _this.life = 1000;\n return _this;\n }", "function Start () {\n\thealth = 60;\n\tcurrHealth = 60;\n\thealthRate = 7;\n}", "function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }", "constructor() {\n this.controller = new Controller();\n this._initialized = false;\n }", "function StudiesAdminController(breadcrumbService) {\n var vm = this;\n vm.$onInit = onInit;\n\n //--\n\n function onInit() {\n vm.breadcrumbs = [\n breadcrumbService.forState('home'),\n breadcrumbService.forState('home.admin'),\n breadcrumbService.forState('home.admin.studies')\n ];\n }\n\n}", "function applicationLoaded() {\n initiateController();\n }", "async main(params) {\n var [res, req] = this.extract_request(params);\n if (!(await this.gui_is_enabled()))\n return this.render_error(res, 'GUI is not enabled.');\n return this.render_page(res, \"pages/main\", { pageTitle: 'Configuration' });\n //} else {\n // return this.render_page(res, \"pages/main\", { pageTitle: 'Configuration', uuid: uuid });\n //} \n }", "constructor(health=18, power=5) {\n this.health = health;\n this.power = power;\n }", "function BpmnStatsController ($scope, BpmnStatsProcessDefinitionResource,BpmnStatsTaskProcessDefinitionResource) {\n // input: processInstance\n\n $scope.processStats = null;\n $scope.taskStats = null;\n \n BpmnStatsProcessDefinitionResource.query({id: $scope.processDefinition.id}).$promise.then(function(response) {\n $scope.processStats = response.data;\n }); \n \n \n var processData = $scope.processData.newChild($scope); \n processData.observe(['filter','activityInstanceHistoricStats', function(filter,activityInstanceHistoricStats) {\n\n \t$scope.taskStats = null;\n \t\n \tif(filter.activityIds && filter.activityIds.length==1){\n \t\t\n \t\tif(activityInstanceHistoricStats && activityInstanceHistoricStats.length>0){\n \t\t\t angular.forEach(activityInstanceHistoricStats, function(statsElement) {\n \t\t\t\tif(filter.activityIds[0]==statsElement.id){\n \t\t\t\t\t$scope.taskStats = statsElement;\n \t\t\t\t}\n \t\t }); \t\t\t\n \t\t}\n \t}\n \t\n \t\n $scope.filter = filter;\n \t\n }]);\n \n }", "function activeController() {\n FoodService.get({ id: $stateParams.foodId }).$promise\n .then(food => {\n vm.food = food;\n })\n .catch(err => {\n vm.message = `Something error: ${err.data}`;\n });\n }", "onRender () {\n\t\tthis.registerComponent(App.Compontents, \"app-controls\", TopBarControls, this.$el.find(\"#topbar-container\"), { title: \"Home\" });\n }", "load(){\n\n\t\tfor(var moduleName in this.ControllerManifest){\n\n\t\t\tLog.info(\"Loading app module {}\", moduleName);\n\n\t\t\tvar thisModuleManifest = this.ControllerManifest[moduleName];\n\t\t\t\n\t\t\tvar moduleFileName = thisModuleManifest.file || $.concat(\".\", moduleName + \"Module\", \"js\");\n\t\t\tvar ModuleObject = false;\n\n\t\t\ttry{\n\t\t\t\tModuleObject = require(__CONFIG.paths.modules + \"/\" + moduleFileName);\n\t\t\t}catch(e){\n\t\t\t\tLog.error(\"Can't include file of module {}\", moduleName, e);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._validatePayloadSchema(moduleName, this.ControllerManifest[moduleName].methods);\n\t\t\tthis.Prototypes[moduleName.toLowerCase()] = {\n\t\t\t\tobject : ModuleObject,\n\t\t\t\tmanifest : this.ControllerManifest[moduleName]\n\t\t\t}\t\t\t\n\t\t}\n\t\tLog.info(\"__________________________ INITIALISED. APP RUNNING. __________________________ \");\n\t}", "async function main() {\n // create a new actionhero process\n const app = new index_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals((exitCode) => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "function main($scope, mainFactory, loadMainController) {\n\t console.log(loadMainController);\n\t $scope.main = \"This is main page\";\n\t mainFactory.say();\n\t}", "function showBanner(message,status){\n banerData.message = message;\n banerData.banerClass = ($filter('lowercase')(status) === 'success') ? 'alert-success' : 'alert-danger';\n banerData.showBaner=true;\n $scope.alertBaner = angular.copy(banerData);\n }", "constructor() {\n this.instance = createProgressBar();\n }", "function showHealth() {\r\n document.getElementById(`errors`).style.display = `none`;\r\n document.getElementById(`items`).style.display = `none`;\r\n document.getElementById(`health`).style.display = `block`;\r\n}", "function main() {\n verb(\"BetaBoards!\")\n\n var s = style()\n\n if (isTopic()) {\n iid = getPage()\n cid = iid\n\n initEvents()\n remNextButton()\n postNums()\n floatQR()\n hideUserlists()\n\n quotePyramid(s)\n\n ignore()\n\n beepAudio()\n\n addIgnoredIds(document.querySelectorAll(\".ignored\"))\n\n var f = function(){\n pageUpdate()\n\n loop = setTimeout(f, time)\n }\n\n var bp = readify('beta-init-load', 2)\n , lp = isLastPage([0, 2, 5, 10, NaN][bp])\n\n verb(\"bp \" + bp + \", lp: \" + lp)\n\n if (lp || bp === 4) loop = setTimeout(f, time)\n\n } else if (isPage(\"post\")) {\n addPostEvent()\n\n } else if (isPage(\"msg\")) {\n try {\n addPostEvent()\n } catch(e) {\n addQuickMsgEvent()\n }\n\n } else if (isForum()) {\n hideUserlists()\n\n var f = function(){\n forumUpdate()\n\n loop = setTimeout(f, time)\n }\n\n loop = setTimeout(f, time)\n\n } else if (isHome()) {\n optionsUI()\n ignoreUI()\n\n // Hint events\n addHintEvents()\n\n }\n}", "function openAHOFbar(){\n servePage('AHOF', 'pages/LargeBlocksTemplate', 'A History of Forests');\n}", "function Controller () {\n this.ui = new UI()\n this.answers = {}\n}", "function maxHealthUpdate() {\r\n hbIncrement = hbWidth/maxHealth; \r\n}" ]
[ "0.76854885", "0.6148833", "0.5985905", "0.5881076", "0.587341", "0.57857496", "0.56405616", "0.5608412", "0.5585611", "0.5532997", "0.55292207", "0.54681545", "0.5451594", "0.54449266", "0.54449266", "0.54331416", "0.5368403", "0.5357342", "0.5357302", "0.53568894", "0.5335435", "0.5275012", "0.5263049", "0.5220827", "0.52040315", "0.5193077", "0.5179329", "0.51789606", "0.51738983", "0.5158026", "0.5157731", "0.51506406", "0.51444596", "0.510741", "0.5103164", "0.51018214", "0.50962925", "0.50884897", "0.5087731", "0.5086584", "0.50779295", "0.5077402", "0.5076073", "0.50746334", "0.50727147", "0.5070662", "0.50588566", "0.5054932", "0.504835", "0.5045938", "0.50297886", "0.50172085", "0.5015304", "0.50140333", "0.49922428", "0.49922428", "0.498984", "0.49693733", "0.49572918", "0.495693", "0.49436137", "0.49436137", "0.4941579", "0.49300167", "0.49205115", "0.491685", "0.49131304", "0.49114972", "0.49071383", "0.48994973", "0.48986638", "0.48849118", "0.48825848", "0.4859328", "0.48570985", "0.48513418", "0.4850394", "0.4842557", "0.48388475", "0.48323157", "0.48260334", "0.48237455", "0.48215255", "0.4820102", "0.4812831", "0.4811464", "0.4809256", "0.48060828", "0.4804125", "0.48032302", "0.47966123", "0.47949672", "0.47922078", "0.47901362", "0.47899154", "0.47886437", "0.4787569", "0.47808516", "0.47783452", "0.47763425" ]
0.4840684
78
A function for Jessica to make a change to.
function jessica() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAChange(){\n contentPanel.SC.run(function(){\n contentPanel.MySystem.store.createRecord(contentPanel.MySystem.Node, { 'title': 'Test node ' + newNodeIndex, 'image': '/lightbulb_tn.png' });\n });\n newNodeIndex += 1;\n }", "change() { }", "function change(o) {\n\to.id = 2;\n}", "function changeTodo() {\n\ttodos[0] = 'item updated';\n}", "change() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return Changeable$M.change.apply(this, args);\n }", "function changeTodo(position, newValue) {\r\n todos[position] = newValue;\r\n displayTodos();\r\n}", "function changeTodo(pos, newValue) {\n\ttodos[pos] = newValue;\n\tdisplayTodos();\n}", "function changeTodo(position, newValue) {\n\ttodos[position] = newValue;\n\tdisplayTodos();\n}", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "function changeTodo(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "function changeTodo(position, newValue) {\n todos[position] = newValue\n displayTodos()\n}", "function changeStudent(student) {\n student.name = \"Thang\";\n}", "function manure_left_on_pasture_and_applied_to_soils(){\n a_FAO_i='manure_left_on_pasture_and_applied_to_soils';\n initializing_change();\n change();\n}", "function make_change(change_types, value) {\n // change_Types should be a list of available coins, like [1, 5, 10, 25, 50]\n // ehh, this is almost identical to the step-jumping problem...\n}", "function changeName(obj) {\n obj.age = 20;\n}", "function change(b) {\n b = 2;\n}", "function Change (path, change) {\n this.path = path;\n this.name = change.name;\n this.type = change.type;\n this.object = change.object;\n this.value = change.object[change.name];\n this.oldValue = change.oldValue;\n}", "_changeType(to) {\n removeType(this, this.type);\n addType(this, to);\n }", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t\t if (doc.cm.state.suppressEdits) return;\n\t\t }\n\t\t\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) return;\n\t\t }\n\t\t\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function changeName(obj){\n obj.name = 'coder'\n}", "function changeValueInArray(id, nameOfVariable, valuetoChange, nameofArray) {\r\n\r\n// code that makes changes in the programmingButtonArray or the programmingLinksArray.\r\n// this function is needed for bens open frameworks code to change the values within your code\r\n// you can use the atomicUpdateArray() function that I wrote to make these changes. \r\n}", "function changing(obj){\n obj.greeting = 'hola'; //mutate\n}", "function changeName(obj) {\n obj.name = 'coder'\n}", "function changeName(obj) {\n\tobj.name = 'diffEllie';\n}", "function changeName(obj) {\r\n obj.name = 'coder';\r\n}", "function successfulChange(response){\n response.tell('Merry Christmas!');\n}", "function saveEditsOnto(){\n var node=obj1Onto;\n if(editingOnto&&node!=null){\n editingOnto=false;\n node.select('text').text(currentStringOnto);\n node.select('circle').style('fill','#69f');\n node.each(function(d){\n d.name=currentStringOnto;\n node_dataOnto[d.index].name = currentStringOnto;\n });\n currentStringOnto=\"\";\n editingOnto=false;\n updateGraphOnto(node_dataOnto,link_dataOnto);\n }\n}", "function changeName(obj){\r\n obj.name = 'coder';\r\n}", "function modify(original, changes){\n var result = clone(original);\n deepCopyInto(changes, result, true);\n return result;\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "onModifyAtk() {}", "function changeTodos(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "function editMade() {\n version += 1;\n emitter({});\n }", "function changeGreeting(obj) {\n\tobj.greeting = 'Hola'; //mutate\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\t\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\t\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function changeGreeting(obj) {\n obj.greeting = 'Hola'; // mutate \n}", "function changeName(newName){\n\tthis.currentName = newName;\n}", "function changeExisting(index, name, quant) {\n\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n\t\t if (doc.cm.state.suppressEdits) { return }\n\t\t }\n\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) { return }\n\t\t }\n\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function changeTodo(i, update) {\r\n\ttodos[i] = update;\r\n\tdisplayTodos();\r\n}", "goChange() {\n const scopeChangedPrice = parseFloat(((this.price / 100) * 5).toFixed(2));\n const nextPrice = randomNumber(\n (this.price - scopeChangedPrice),\n (this.price + scopeChangedPrice),\n 'float'\n );\n const nextVolume = randomNumber((this.volume + 10), (this.volume + 30), 'int');\n\n /*\n khi chua resetPrice: \n nextPrice = currentPrice\n this.price = prevPrice\n */\n this.setChange(nextPrice, this.price);\n /*\n setChange() da duoc chay: \n this.change = currentChange\n this.price = prevPrice\n */\n this.setPercentChange(this.change, this.price);\n this.resetPrice(nextPrice);\n this.resetVolume(nextVolume);\n this.resetValue(this.price, this.volume);\n }", "function C012_AfterClass_Jennifer_ForceChangeActor(NewCloth) {\n\tif (ActorGetValue(ActorCloth) != NewCloth) {\n\t\tActorSetCloth(NewCloth);\n\t\tC012_AfterClass_Jennifer_CalcParams();\n\t\tCurrentTime = CurrentTime + 50000;\n\t} else OverridenIntroText = GetText(\"NoNeedToChange\");\n\tC012_AfterClass_Jennifer_GaggedAnswer();\n}", "function changeAuthor(position, newValue) {\nauthors[position] = newValue;\ndisplayAuthor(); // Automatically display changes\n}", "function changeGreeting(obj) {\n obj.greeting = \"hola\" //mutate\n}", "function livestock_heads(){\n a_FAO_i='livestock_heads';\n initializing_change();\n change();\n}", "changeOwner(newOwner){\n this.owner = newOwner;\n }", "changes(state,payload){\n state.commit(\"addSomeName\",payload.name);\n state.commit(\"changeCity\",payload.city);\n }", "function changeTodo(event) {\n revisedTodo = prompt(\"Enter the updated Todo\");\n\n if (revisedTodo != null && revisedTodo != \"\") {\n var position = event.currentTarget.id.split(\"-\")[1];\n todos[position].todoText = revisedTodo;\n }\n displayTodos();\n}", "function changeGreeting(obj){\n\tobj.greeting = \"Hola\"\n}", "function changeGreeting (obj) {\n obj.greeting = 'Hola' // mutate\n}", "function makeChange(doc, change, ignoreReadOnly) {\r\n if (doc.cm) {\r\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\r\n if (doc.cm.state.suppressEdits) return;\r\n }\r\n\r\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\r\n change = filterChange(doc, change, true);\r\n if (!change) return;\r\n }\r\n\r\n // Possibly split or suppress the update based on the presence\r\n // of read-only spans in its range.\r\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\r\n if (split) {\r\n for (var i = split.length - 1; i >= 0; --i)\r\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\r\n } else {\r\n makeChangeInner(doc, change);\r\n }\r\n }", "function changeRecipe(position, newValue) {\n recipes[position] = newValue;\n displayRecipes();\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function myEdit(e){\n Logger.log(\"change triggered\");\n\n refetch();\n //Logger.log(e);\n}", "function changeTurn(newTurn){\n turn = newTurn;\n console.log('it is turn: ' + turn);\n}", "function OnInclinationOfTheRoof_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"INCLINATION_OF_THE_ROOF\"] = e.id ;\r\n}", "function onChange() {\n console.log(\"something changed...\");\n \n }", "change() {\n this._updateValueProperty();\n\n this.sendAction('action', this.get('value'), this);\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "changeName(newName) {\n this.cgram.changeAnchorName(this.name, newName);\n }", "function C012_AfterClass_Amanda_ForceChangeActor(NewCloth) {\n\tif (ActorGetValue(ActorCloth) != NewCloth) {\n\t\tActorSetCloth(NewCloth);\n\t\tC012_AfterClass_Amanda_CalcParams();\n\t\tCurrentTime = CurrentTime + 50000;\n\t} else OverridenIntroText = GetText(\"NoNeedToChange\");\n\tC012_AfterClass_Amanda_GaggedAnswer();\n}", "function livestock_production(){\n a_FAO_i='livestock_production';\n initializing_change();\n change();\n}", "function makeChange(doc, change, ignoreReadOnly) {\r\n if (doc.cm) {\r\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\r\n if (doc.cm.state.suppressEdits) { return }\r\n }\r\n\r\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\r\n change = filterChange(doc, change, true);\r\n if (!change) { return }\r\n }\r\n\r\n // Possibly split or suppress the update based on the presence\r\n // of read-only spans in its range.\r\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\r\n if (split) {\r\n for (var i = split.length - 1; i >= 0; --i)\r\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\r\n } else {\r\n makeChangeInner(doc, change);\r\n }\r\n}", "function EditRetargetCommand(){\r\n }", "function C012_AfterClass_Jennifer_ForceChangePlayer(NewCloth) {\n\tPlayerClothes(NewCloth);\n\tif (C012_AfterClass_Jennifer_CurrentStage < 3900) ActorSetPose(\"Happy\");\n\tCurrentTime = CurrentTime + 50000;\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) {\n return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n }\n\n if (doc.cm.state.suppressEdits) {\n return;\n }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n\n if (!change) {\n return;\n }\n } // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n\n\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\n if (split) {\n for (var i = split.length - 1; i >= 0; --i) {\n makeChangeInner(doc, {\n from: split[i].from,\n to: split[i].to,\n text: i ? [\"\"] : change.text,\n origin: change.origin\n });\n }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}" ]
[ "0.64560956", "0.64371085", "0.632784", "0.6306832", "0.61692667", "0.60667247", "0.6062099", "0.60517526", "0.59841794", "0.598404", "0.59502995", "0.59480625", "0.5870167", "0.5866589", "0.58184123", "0.58091223", "0.57987654", "0.57867175", "0.57792807", "0.57792807", "0.57666236", "0.5755354", "0.5746376", "0.57324153", "0.5727849", "0.5726873", "0.5719542", "0.57177293", "0.5697189", "0.56925696", "0.5687495", "0.5682301", "0.568117", "0.568117", "0.568117", "0.5680347", "0.5677551", "0.5673016", "0.56691635", "0.56630033", "0.5660593", "0.565835", "0.56409895", "0.5635823", "0.5630672", "0.5630672", "0.56179404", "0.56144446", "0.558001", "0.5562861", "0.5558821", "0.5558345", "0.5545371", "0.55313945", "0.55203605", "0.55035055", "0.54824", "0.54808724", "0.54734194", "0.5469091", "0.5469091", "0.5469091", "0.5469091", "0.5469091", "0.5469091", "0.5469091", "0.5459845", "0.5458792", "0.5457381", "0.5444809", "0.5437912", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.54352844", "0.5434374", "0.5434317", "0.54246956", "0.54178464", "0.54122806", "0.5410909", "0.5398806", "0.5388391", "0.53883445", "0.53883445", "0.53883445", "0.53883445", "0.53883445" ]
0.0
-1
A function for KP to make a change to.
function kp() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change() { }", "change() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return Changeable$M.change.apply(this, args);\n }", "function change(o) {\n\to.id = 2;\n}", "function makeAChange(){\n contentPanel.SC.run(function(){\n contentPanel.MySystem.store.createRecord(contentPanel.MySystem.Node, { 'title': 'Test node ' + newNodeIndex, 'image': '/lightbulb_tn.png' });\n });\n newNodeIndex += 1;\n }", "goChange() {\n const scopeChangedPrice = parseFloat(((this.price / 100) * 5).toFixed(2));\n const nextPrice = randomNumber(\n (this.price - scopeChangedPrice),\n (this.price + scopeChangedPrice),\n 'float'\n );\n const nextVolume = randomNumber((this.volume + 10), (this.volume + 30), 'int');\n\n /*\n khi chua resetPrice: \n nextPrice = currentPrice\n this.price = prevPrice\n */\n this.setChange(nextPrice, this.price);\n /*\n setChange() da duoc chay: \n this.change = currentChange\n this.price = prevPrice\n */\n this.setPercentChange(this.change, this.price);\n this.resetPrice(nextPrice);\n this.resetVolume(nextVolume);\n this.resetValue(this.price, this.volume);\n }", "function changeTodo(pos, newValue) {\n\ttodos[pos] = newValue;\n\tdisplayTodos();\n}", "function changeTodo() {\n\ttodos[0] = 'item updated';\n}", "function changeTodo(position, newValue) {\r\n todos[position] = newValue;\r\n displayTodos();\r\n}", "onModifyAtk() {}", "function changeTodo(position, newValue) {\n\ttodos[position] = newValue;\n\tdisplayTodos();\n}", "function make_change(change_types, value) {\n // change_Types should be a list of available coins, like [1, 5, 10, 25, 50]\n // ehh, this is almost identical to the step-jumping problem...\n}", "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "function manure_left_on_pasture_and_applied_to_soils(){\n a_FAO_i='manure_left_on_pasture_and_applied_to_soils';\n initializing_change();\n change();\n}", "function changeTodo(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "function changeTodo(position, newValue) {\n todos[position] = newValue\n displayTodos()\n}", "changeOwner(newOwner){\n this.owner = newOwner;\n }", "function Change (path, change) {\n this.path = path;\n this.name = change.name;\n this.type = change.type;\n this.object = change.object;\n this.value = change.object[change.name];\n this.oldValue = change.oldValue;\n}", "function change(b) {\n b = 2;\n}", "function livestock_heads(){\n a_FAO_i='livestock_heads';\n initializing_change();\n change();\n}", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "_changeType(to) {\n removeType(this, this.type);\n addType(this, to);\n }", "function KeyValueChangeRecord() { }", "function KeyValueChangeRecord() { }", "function EditRetargetCommand(){\r\n }", "function saveEditsOnto(){\n var node=obj1Onto;\n if(editingOnto&&node!=null){\n editingOnto=false;\n node.select('text').text(currentStringOnto);\n node.select('circle').style('fill','#69f');\n node.each(function(d){\n d.name=currentStringOnto;\n node_dataOnto[d.index].name = currentStringOnto;\n });\n currentStringOnto=\"\";\n editingOnto=false;\n updateGraphOnto(node_dataOnto,link_dataOnto);\n }\n}", "processChangeOwner() {\n let ownerTextField = document.getElementById(TodoGUIId.LIST_OWNER_TEXTFIELD);\n let newOwner = ownerTextField.value;\n let listBeingEdited = window.todo.model.listToEdit;\n window.todo.model.updateListOwner(listBeingEdited, newOwner);\n }", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t\t if (doc.cm.state.suppressEdits) return;\n\t\t }\n\t\t\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) return;\n\t\t }\n\t\t\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function OnInclinationOfTheRoof_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"INCLINATION_OF_THE_ROOF\"] = e.id ;\r\n}", "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "function food_supply(){\n a_FAO_i='food_supply';\n initializing_change();\n change();\n}", "function changeName(obj) {\n obj.age = 20;\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\t\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\t\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "change() {\n this._updateValueProperty();\n\n this.sendAction('action', this.get('value'), this);\n }", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n\t\t if (doc.cm.state.suppressEdits) { return }\n\t\t }\n\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) { return }\n\t\t }\n\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function KeyValueChangeRecord() {}", "function KeyValueChangeRecord() {}", "function KeyValueChangeRecord() {}", "function changeNodeData() {\n var nodeId = graphData.network.getSelection().nodes[0];\n var newIp = $(\"#change-node-ip-input\")[0].value;\n var newMac = $(\"#change-node-mac-input\")[0].value;\n var changedNode = { id: nodeId };\n if(newIp) {\n changedNode['ip'] = newIp;\n }\n if(newMac) {\n changedNode['mac'] = newMac;\n }\n graphData.nodes.update(changedNode);\n hideChangeForm();\n }", "function editannounement() {\n\n}", "function KeyValueChangeRecord(){}", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function changeTodos(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "function changeTodo(event) {\n revisedTodo = prompt(\"Enter the updated Todo\");\n\n if (revisedTodo != null && revisedTodo != \"\") {\n var position = event.currentTarget.id.split(\"-\")[1];\n todos[position].todoText = revisedTodo;\n }\n displayTodos();\n}", "function myEdit(e){\n Logger.log(\"change triggered\");\n\n refetch();\n //Logger.log(e);\n}", "function livestock_manure(){\n a_FAO_i='livestock_manure';\n initializing_change();\n change();\n}", "function changeValueInArray(id, nameOfVariable, valuetoChange, nameofArray) {\r\n\r\n// code that makes changes in the programmingButtonArray or the programmingLinksArray.\r\n// this function is needed for bens open frameworks code to change the values within your code\r\n// you can use the atomicUpdateArray() function that I wrote to make these changes. \r\n}", "function livestock_production(){\n a_FAO_i='livestock_production';\n initializing_change();\n change();\n}", "function changeAuthor(position, newValue) {\nauthors[position] = newValue;\ndisplayAuthor(); // Automatically display changes\n}", "edit() {\n }", "function EditLogItemShift () {}", "function changeTodo(i, update) {\r\n\ttodos[i] = update;\r\n\tdisplayTodos();\r\n}", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj){\n obj.name = 'coder'\n}", "constructor(name, newValue, action) {\n this.name = name\n this.newValue = newValue\n this.action = action\n }", "function changeName(newName){\n\tthis.currentName = newName;\n}", "function changeName(obj){\r\n obj.name = 'coder';\r\n}", "function crops_livestock(){\n a_FAO_i='crops_livestock';\n initializing_change();\n change();\n}", "function modify(original, changes){\n var result = clone(original);\n deepCopyInto(changes, result, true);\n return result;\n}", "function changeStudent(student) {\n student.name = \"Thang\";\n}", "changeOil() {\n console.log('changing oil of ' + this.toString());\n }", "function changeName(obj) {\r\n obj.name = 'coder';\r\n}", "E_Func (key) \n\t{\n\t\tvar NewTodo = this.state.TodoItems;\n\t\tvar keys = Object.keys(NewTodo);\n\t\tvar newkey = key.id;\n\t\tvar idloc = keys.lastIndexOf(newkey);\n\t\t\n\t\tthis.setState({ActiveKey: idloc});\n\t\tthis.setState({value: this.state.TodoItems[this.state.ActiveKey].Item});\n\t\talert(\"Now Editing.\");\n\t\tthis.setState({Mode: false});\n\t}", "function onChangeWorkingLine(action) {\n changeWorkingLine(action);\n initEditor();\n}", "function changing(obj){\n obj.greeting = 'hola'; //mutate\n}", "function changeExisting(index, name, quant) {\n\n}", "function changeName(obj) {\n\tobj.name = 'diffEllie';\n}", "changeActiveObject(nodeId) {\n if(this.isCircuit(nodeId)){\n this.selectedObjectChanged(nodeId);\n }\n }", "function changed(change) {\n if (change.changeType === \"property\" && change.property === property) {\n fn(change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\r\n if (doc.cm) {\r\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\r\n if (doc.cm.state.suppressEdits) return;\r\n }\r\n\r\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\r\n change = filterChange(doc, change, true);\r\n if (!change) return;\r\n }\r\n\r\n // Possibly split or suppress the update based on the presence\r\n // of read-only spans in its range.\r\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\r\n if (split) {\r\n for (var i = split.length - 1; i >= 0; --i)\r\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\r\n } else {\r\n makeChangeInner(doc, change);\r\n }\r\n }", "function keyChange(newKey) {\n key = newKey;\n changeKey();\n}", "function changeName(obj) {\n obj.name = 'coder'\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function changeHistoryItem(contact, changes) {\n return {\n timestamp: Date.now(),\n author: $sessionStorage.user.username,\n lastRev: contact._rev,\n changes: changes\n };\n }", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function editMade() {\n version += 1;\n emitter({});\n }", "function generateChange(cents, changeDict) {\n\n}", "function pesticides(){\n a_FAO_i='pesticides';\n initializing_change();\n change();\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }" ]
[ "0.6550308", "0.62440735", "0.6223802", "0.6205822", "0.6136095", "0.60201323", "0.598303", "0.59753084", "0.5916637", "0.5912132", "0.5904388", "0.5875789", "0.5857539", "0.585589", "0.58298886", "0.5816654", "0.5807647", "0.57835245", "0.5775016", "0.5759714", "0.5749441", "0.57448345", "0.57448345", "0.57340384", "0.57271916", "0.5651687", "0.56394005", "0.5619811", "0.55997807", "0.55742073", "0.557347", "0.5541046", "0.5531291", "0.55160564", "0.5507564", "0.5507564", "0.5507564", "0.5506629", "0.55056673", "0.5500005", "0.5497174", "0.5497174", "0.54878527", "0.5483637", "0.5465023", "0.5446476", "0.54437554", "0.54426897", "0.5436148", "0.54347974", "0.5433697", "0.5428614", "0.5427411", "0.5427411", "0.54251", "0.541816", "0.54165614", "0.5415703", "0.54148346", "0.54107964", "0.54052943", "0.54017437", "0.53970766", "0.53958005", "0.5395111", "0.53903705", "0.5385416", "0.53781366", "0.5372812", "0.53695077", "0.5363127", "0.5360387", "0.5357424", "0.5347911", "0.5347911", "0.5347911", "0.5347911", "0.5347911", "0.5347911", "0.5347911", "0.53477514", "0.5340608", "0.5340608", "0.5340608", "0.53386736", "0.5331309", "0.53273237", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496", "0.53214496" ]
0.0
-1
A function for John to make a change to.
function john() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change() { }", "function changeTodo() {\n\ttodos[0] = 'item updated';\n}", "function change(o) {\n\to.id = 2;\n}", "function changeName(obj) {\n obj.age = 20;\n}", "function changeName(obj) {\n\tobj.name = 'diffEllie';\n}", "function changeStudent(student) {\n student.name = \"Thang\";\n}", "change() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return Changeable$M.change.apply(this, args);\n }", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj){\n obj.name = 'coder'\n}", "function changeTodo(position, newValue) {\r\n todos[position] = newValue;\r\n displayTodos();\r\n}", "function changeTodo(pos, newValue) {\n\ttodos[pos] = newValue;\n\tdisplayTodos();\n}", "function changeName(obj) {\r\n obj.name = 'coder';\r\n}", "function changeName(obj){\r\n obj.name = 'coder';\r\n}", "function changeTodo(position, newValue) {\n\ttodos[position] = newValue;\n\tdisplayTodos();\n}", "function changeName(obj) {\n obj.name = 'coder'\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "changeOwner(newOwner){\n this.owner = newOwner;\n }", "function editPerson() {\n\n}", "function updateName(person) {\n person.name = 'Camilo';\n}", "function changeName(newName){\n\tthis.currentName = newName;\n}", "function makeAChange(){\n contentPanel.SC.run(function(){\n contentPanel.MySystem.store.createRecord(contentPanel.MySystem.Node, { 'title': 'Test node ' + newNodeIndex, 'image': '/lightbulb_tn.png' });\n });\n newNodeIndex += 1;\n }", "function changeTodo(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "function changeTodo(position, newValue) {\n todos[position] = newValue\n displayTodos()\n}", "function changeTodo(event) {\n revisedTodo = prompt(\"Enter the updated Todo\");\n\n if (revisedTodo != null && revisedTodo != \"\") {\n var position = event.currentTarget.id.split(\"-\")[1];\n todos[position].todoText = revisedTodo;\n }\n displayTodos();\n}", "function changeAuthor(position, newValue) {\nauthors[position] = newValue;\ndisplayAuthor(); // Automatically display changes\n}", "function manure_left_on_pasture_and_applied_to_soils(){\n a_FAO_i='manure_left_on_pasture_and_applied_to_soils';\n initializing_change();\n change();\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t\t if (doc.cm.state.suppressEdits) return;\n\t\t }\n\t\t\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) return;\n\t\t }\n\t\t\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function make_change(change_types, value) {\n // change_Types should be a list of available coins, like [1, 5, 10, 25, 50]\n // ehh, this is almost identical to the step-jumping problem...\n}", "function change(b) {\n b = 2;\n}", "function changing(obj){\n obj.greeting = 'hola'; //mutate\n}", "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "function changeGreeting(obj) {\n obj.greeting = 'Hola'; // mutate \n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\t\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\t\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "_changeType(to) {\n removeType(this, this.type);\n addType(this, to);\n }", "function changeGreeting(obj) {\n\tobj.greeting = 'Hola'; //mutate\n}", "function changeGreeting(obj){\n\tobj.greeting = \"Hola\"\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function makeChange(doc, change, ignoreReadOnly) {\n\t if (doc.cm) {\n\t if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n\t if (doc.cm.state.suppressEdits) return;\n\t }\n\n\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t change = filterChange(doc, change, true);\n\t if (!change) return;\n\t }\n\n\t // Possibly split or suppress the update based on the presence\n\t // of read-only spans in its range.\n\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t if (split) {\n\t for (var i = split.length - 1; i >= 0; --i)\n\t makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n\t } else {\n\t makeChangeInner(doc, change);\n\t }\n\t }", "function changeTodo(i, update) {\r\n\ttodos[i] = update;\r\n\tdisplayTodos();\r\n}", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n\t\t if (doc.cm.state.suppressEdits) { return }\n\t\t }\n\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) { return }\n\t\t }\n\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function successfulChange(response){\n response.tell('Merry Christmas!');\n}", "processChangeOwner() {\n let ownerTextField = document.getElementById(TodoGUIId.LIST_OWNER_TEXTFIELD);\n let newOwner = ownerTextField.value;\n let listBeingEdited = window.todo.model.listToEdit;\n window.todo.model.updateListOwner(listBeingEdited, newOwner);\n }", "function Change (path, change) {\n this.path = path;\n this.name = change.name;\n this.type = change.type;\n this.object = change.object;\n this.value = change.object[change.name];\n this.oldValue = change.oldValue;\n}", "function editannounement() {\n\n}", "function modify(original, changes){\n var result = clone(original);\n deepCopyInto(changes, result, true);\n return result;\n}", "function changedGreeting (obj){ //l\n obj.greetings = \"hola\";\n}", "function changeGreeting(obj) {\n obj.greeting = \"hola\" //mutate\n}", "processChangeName() {\n let nameTextField = document.getElementById(TodoGUIId.LIST_NAME_TEXTFIELD);\n let newName = nameTextField.value;\n\n // added\n let checkName = newName.trim();\n if (checkName == \"\") {\n newName = \"Unnknown\";\n }\n\n let listBeingEdited = window.todo.model.listToEdit;\n window.todo.model.updateListName(listBeingEdited, newName);\n }", "function changeGreeting(greeting) {\n return { greeting };\n}", "function livestock_heads(){\n a_FAO_i='livestock_heads';\n initializing_change();\n change();\n}", "function changeValueInArray(id, nameOfVariable, valuetoChange, nameofArray) {\r\n\r\n// code that makes changes in the programmingButtonArray or the programmingLinksArray.\r\n// this function is needed for bens open frameworks code to change the values within your code\r\n// you can use the atomicUpdateArray() function that I wrote to make these changes. \r\n}", "function changeName(obj){\n obj.name='color';\n}", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "function changeTodos(position, newValue) {\n todos[position] = newValue;\n displayTodos();\n}", "edit() {\n }", "function changeAdminUserName(id, fname, lname) {\n\n\tif ('undefined' !== typeof id && ('-h' === id || '--help' === id || 'help' === id)) {\n\t\n\t\tactionHelp(\"adminUser changeName\", 'Change first and last name for an admin user.', '[id] [firstname] [lastname]');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof id || '' === id) {\n\t\n\t\tconsole.log('Cannot change user names; user id invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof fname || '' === fname) {\n\t\n\t\tconsole.log('Cannot change user names; first name invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof lname || '' === lname) {\n\t\n\t\tconsole.log('Cannot change user names; last name invalid.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.changeName(id, fname, lname, function(error, changed) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!changed) {\n\t\t\n\t\t\tconsole.log('User with id ' + id + ' does not exist. Use \"adminUser list\" to see all existing users.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\t\n\t\tconsole.log('First and Last names for user have been updated to \"' + fname + ' ' + lname + '\" (id ' + id + ').');\n\t\treturn process.exit();\n\t\n\t});\n\n}", "function makeChange(doc, change, ignoreReadOnly) {\r\n if (doc.cm) {\r\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\r\n if (doc.cm.state.suppressEdits) return;\r\n }\r\n\r\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\r\n change = filterChange(doc, change, true);\r\n if (!change) return;\r\n }\r\n\r\n // Possibly split or suppress the update based on the presence\r\n // of read-only spans in its range.\r\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\r\n if (split) {\r\n for (var i = split.length - 1; i >= 0; --i)\r\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\r\n } else {\r\n makeChangeInner(doc, change);\r\n }\r\n }", "function given(name, age, nickname){\n this.name = name;\n this.age = age;\n this.nickname = nickname;\n this.changeName = function name(name){\n this.name = name;\n }\n}", "function editMade() {\n version += 1;\n emitter({});\n }", "function changeGreeting (obj) {\n obj.greeting = 'Hola' // mutate\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }", "function changeLife(change, playername) {\n return {\n type: 'CHANGE_LIFE',\n payload: {\n change: change,\n playername: playername\n }\n };\n}", "goChange() {\n const scopeChangedPrice = parseFloat(((this.price / 100) * 5).toFixed(2));\n const nextPrice = randomNumber(\n (this.price - scopeChangedPrice),\n (this.price + scopeChangedPrice),\n 'float'\n );\n const nextVolume = randomNumber((this.volume + 10), (this.volume + 30), 'int');\n\n /*\n khi chua resetPrice: \n nextPrice = currentPrice\n this.price = prevPrice\n */\n this.setChange(nextPrice, this.price);\n /*\n setChange() da duoc chay: \n this.change = currentChange\n this.price = prevPrice\n */\n this.setPercentChange(this.change, this.price);\n this.resetPrice(nextPrice);\n this.resetVolume(nextVolume);\n this.resetValue(this.price, this.volume);\n }", "constructor(name, newValue, action) {\n this.name = name\n this.newValue = newValue\n this.action = action\n }", "onModifyAtk() {}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\r\n if (doc.cm) {\r\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\r\n if (doc.cm.state.suppressEdits) { return }\r\n }\r\n\r\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\r\n change = filterChange(doc, change, true);\r\n if (!change) { return }\r\n }\r\n\r\n // Possibly split or suppress the update based on the presence\r\n // of read-only spans in its range.\r\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\r\n if (split) {\r\n for (var i = split.length - 1; i >= 0; --i)\r\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\r\n } else {\r\n makeChangeInner(doc, change);\r\n }\r\n}", "function historyChangeFromChange(doc, change) {\n\t\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t\t return histChange;\n\t\t }", "function changeHistoryItem(contact, changes) {\n return {\n timestamp: Date.now(),\n author: $sessionStorage.user.username,\n lastRev: contact._rev,\n changes: changes\n };\n }", "function historyChangeFromChange(doc, change) {\n\t\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t\t return histChange\n\t\t }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) {\n return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n }\n\n if (doc.cm.state.suppressEdits) {\n return;\n }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n\n if (!change) {\n return;\n }\n } // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n\n\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\n if (split) {\n for (var i = split.length - 1; i >= 0; --i) {\n makeChangeInner(doc, {\n from: split[i].from,\n to: split[i].to,\n text: i ? [\"\"] : change.text,\n origin: change.origin\n });\n }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n}" ]
[ "0.63452595", "0.6336644", "0.6329708", "0.62742156", "0.6213752", "0.6199251", "0.6133659", "0.6082958", "0.6082958", "0.60604215", "0.6048877", "0.60407734", "0.6031565", "0.60243547", "0.60187066", "0.6013837", "0.6000386", "0.6000386", "0.6000386", "0.59711665", "0.59655774", "0.5946372", "0.5930419", "0.5923151", "0.59185725", "0.58978695", "0.5880147", "0.5869617", "0.5859804", "0.58588207", "0.585338", "0.5831049", "0.58258754", "0.5812884", "0.5807562", "0.5774806", "0.57624584", "0.57528216", "0.57388824", "0.5737502", "0.5737502", "0.5719149", "0.57176167", "0.56887686", "0.5688114", "0.56828904", "0.56648296", "0.5659783", "0.5649791", "0.56417763", "0.5639954", "0.5639151", "0.56378096", "0.5635289", "0.56351453", "0.5616571", "0.55881065", "0.5584247", "0.5582763", "0.5582249", "0.5576407", "0.55743515", "0.55703586", "0.55584705", "0.55584705", "0.55584705", "0.55584705", "0.55584705", "0.55584705", "0.55584705", "0.5522064", "0.5521986", "0.55204463", "0.5518345", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.55168146", "0.5509658", "0.5498374", "0.5496386", "0.5493221", "0.5490582", "0.54878855", "0.5484693", "0.5484693", "0.5484693", "0.5484693" ]
0.0
-1
This function only exists to prevent everyone from modifying the same area in code. TODO remove this once everyone has submitted a code change
function training() { jessica(); kp(); john(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disallowEdit() {\n setAllowEdit(false);\n }", "function Protect() {\r\n}", "function lock() {\n clearAlertBox();\n // Lock the editors\n aceEditor.setReadOnly(true);\n\n // Disable the button and set checkCorrectness to true.\n $(\"#resetCode\").attr(\"disabled\", \"disabled\");\n correctnessChecking = true;\n}", "function AllowPlace()\n{\n\tIsPen = true;\n}", "function unlock() {\n // Unlock the editors\n aceEditor.setReadOnly(false);\n\n // No longer checkCorrectness, so enable the button again.\n correctnessChecking = false;\n $(\"#resetCode\").removeAttr(\"disabled\", \"disabled\");\n\n // Focus on the editor.\n aceEditor.focus();\n}", "function privateFunction(){\n\t// That will be used only on this file\n}", "function BLOCKIND() {return true;}", "function warnBeforeEditing ()\n{\n return confirm( \"!!!!! WARNING !!!!!\\n\\nThis page is a Lurch document, and should not be edited on the wiki.\\n\\nUnless you know the internal format of such documents very well, YOU MAY CORRUPT YOUR DATA. Do you wish to proceed despite the risk?\\n\\nChoose OK to edit anyway.\\nChoose Cancel to cancel the edit action.\" );\n}", "function C012_AfterClass_Jennifer_JenniferDeniedOrgasm() {\n\tCurrentTime = CurrentTime + 50000;\n\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"OrgasmDeniedFromMasturbation\")) {\n\t\tGameLogAdd(\"OrgasmDeniedFromMasturbation\");\n\t\tActorChangeAttitude(-2, 1);\n\t}\n\tC012_AfterClass_Jennifer_EndEnslaveJennifer();\n}", "function fixbadjs(){\n\ttry{\n\t\tvar uw = typeof unsafeWindow !== \"undefined\"?unsafeWindow:window;\n\t\t// breakbadtoys is injected by jumpbar.js from TheHiveWorks\n\t\t// killbill and bucheck are injected by ks_headbar.js from Keenspot\n\t\tvar badFunctions = [\"breakbadtoys2\", \"killbill\", \"bucheck\"];\n\t\tfor (var i = 0; i < badFunctions.length; i++) {\n\t\t\tvar name = badFunctions[i];\n\t\t\tif (typeof uw[name] !== \"undefined\") {\n\t\t\t\tconsole.log(\"Disabling anti-wcr code\");\n\t\t\t\tuw.removeEventListener(\"load\", uw[name], true);\n\t\t\t\tuw[name] = function() {};\n\t\t\t} else {\n\t\t\t\tObject.defineProperty(uw,name,{get:function(){return function(){}}, configurable: false});\n\t\t\t}\n\t\t}\n\t} catch(e) {\n\t\tconsole.error(\"Failed to disable bad js:\", e);\n\t\t//console.error(e);\n\t}\n}", "function allowAny() { }", "function myFunction() {\n var editor = document.getElementById(\"main-body\");\n var button = document.getElementById(\"editBtnEdit\");\n var coloring = document.getElementById(\"color\");\n //allowing editing of all texts/links\n if (editor.isContentEditable) {\n getPageHtml();\n document.getElementsByClassName(\"sidebar\")[0].style.width = \"0\";\n editor.contentEditable = 'false';\n button.style.backgroundColor = \"#F96\";\n button.innerHTML = 'Enable Editing';\n //document.designMode = \"off\";\n savePageToDB();\n } else {\n document.getElementsByClassName(\"sidebar\")[0].style.width = \"0px\";\n editor.contentEditable = 'true';\n document.getElementById(\"sideEdit\").contentEditable = \"false\";\n button.style.backgroundColor = \"#6F9\";\n button.innerHTML = 'Save Changes';\n loadEditView();\n //document.designMode = \"on\";\n }\n}", "function detalleReadonly(){\n}", "function sensitiveMode(){\n //We reset the map\n //resetMap();\n\n // remove the user set list and add the sensitive list to websiteMap\n removeUserSet();\n addPreloadListFromBlacklist();\n\n //We save the new mode and we refresh the policy\n saveMode(\"sensitive\");\n}", "function preventEdition() {\n // Discards the edition by executing the undo command.\n commands.executeCommand('undo');\n}", "function OnSafeZone(prohibitDir:Vector3):void{\r\n\tif (isActive) return;\r\n\tprohibitDirs.Add(prohibitDir);\r\n\tresting = true;\r\n}", "function prevent_userjs_lockout()\n {\n\tif (extension_button || !disable_main_button || !something_to_display())\n\t return;\n\tdisable_main_button = false;\t\n\tset_global_bool_setting('disable_main_button', false);\n\tset_global_setting('ui_position', 'bottom_right');\n\tset_global_setting('menu_display_logic', 'auto');\n\tinit_ui();\n }", "function addMod() {\n let sheetName = \"Any% Best World Segments\"\n let email = \"\"\n let remove = false // swaps to removing instead of adding\n\n let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName)\n for (let p of sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE)) {\n if (p.canEdit()) {\n remove ? p.removeEditor(email) : p.addEditor(email)\n console.log(remove ? \"removed:\" : \"added:\", p.getDescription())\n } else {\n console.log(\"error: couldn't edit protected range\", p.getDescription())\n }\n }\n}", "function disableOldForumEdit() {\n\tif ( typeof( wgUserGroups ) != 'undefined' && wgUserGroups.join(' ').indexOf( 'sysop' ) ) {\n\t\treturn;\n\t}\n\n\tif( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {\n\t\treturn;\n\t}\n\n\tif(\n\t\t!document.getElementById( 'archive-page' ) ||\n\t\t!document.getElementById( 'ca-edit' )\n\t) {\n\t\treturn;\n\t}\n \n\tif( skin == 'monaco' ) {\n\t\teditLink = document.getElementById( 'ca-edit' );\n\t} else if( skin == 'monobook' ) {\n\t\teditLink = document.getElementById( 'ca-edit' ).firstChild;\n\t}\n \n\teditLink.removeAttribute( 'href', 0 );\n\teditLink.removeAttribute( 'title', 0 );\n\teditLink.style.color = 'gray';\n\teditLink.innerHTML = 'Arkisto';\n\n\tappendCSS( '#control_addsection, #ca-addsection { display: none !important; }' );\n}", "function C012_AfterClass_Amanda_IsChangingBlocked() {\n\tif (GameLogQuery(CurrentChapter, CurrentActor, \"EventBlockChanging\"))\n\t\tOverridenIntroText = GetText(\"ChangingIsBlocked\");\n}", "function blockUnrequired(){\r\n\tset(\"V[z_vaxx_*]\",\"\");\r\n\tset(\"V[z_va01_*]\",\"\");\r\n}", "function reserved(){}", "static avoidGlobalClone() {\n return function windowAcl(normalizedThisArg,\n normalizedArgs /* ['property', args], ['property', value], etc. */,\n aclArgs /* [name, isStatic, isObject, property, opType, context] */,\n hookArgs /* [f, thisArg, args, context, newTarget] */,\n applyAcl /* for recursive application of ACL */) {\n let opType = aclArgs[4];\n if (opType === 'w' || opType === 'W') {\n ///console.log('windowAcl:', aclArgs, normalizedArgs);\n if (Array.isArray(aclArgs[3])) {\n switch (normalizedArgs[0]) {\n case 'assign':\n for (let newName in normalizedArgs[1][1]) {\n let value = normalizedArgs[1][1][newName];\n let currentName = _globalObjects.get(value);\n if (currentName instanceof Set) {\n for (let _currentName of currentName) {\n if (_currentName !== newName) {\n if (Reflect.has(acl, _currentName)) {\n //console.error('windowAcl: cloning access-controlled window.' + _currentName + ' to window.' + newName);\n return false;\n }\n }\n }\n }\n }\n break;\n case 'defineProperties':\n for (let newName in normalizedArgs[1][1]) {\n let value;\n if (Reflect.has(normalizedArgs[1][1][newName], 'value')) {\n value = normalizedArgs[1][1][newName].value;\n }\n else if (Reflect.has(normalizedArgs[1][1][newName], 'get')) {\n value = normalizedArgs[1][1][newName].get.call(normalizedThisArg);\n }\n let currentName = _globalObjects.get(value);\n if (currentName instanceof Set) {\n for (let _currentName of currentName) {\n if (_currentName !== newName) {\n if (Reflect.has(acl, _currentName)) {\n //console.error('windowAcl: cloning access-controlled window.' + _currentName + ' to window.' + newName);\n return false;\n }\n }\n }\n }\n }\n break;\n default:\n break;\n }\n }\n else {\n let value;\n let newName;\n switch (normalizedArgs[0]) {\n case 'defineProperty':\n newName = normalizedArgs[1][1];\n if (normalizedArgs[1][2] && typeof normalizedArgs[1][2] === 'object') {\n if (Reflect.has(normalizedArgs[1][2], 'value')) {\n value = normalizedArgs[1][2].value;\n }\n else if (Reflect.has(normalizedArgs[1][2], 'get')) {\n value = normalizedArgs[1][2].get.call(normalizedThisArg);\n }\n }\n else {\n return false;\n }\n break;\n case '__defineGetter__':\n newName = normalizedArgs[1][0];\n if (typeof normalizedArgs[1][1] === 'function') {\n value = normalizedArgs[1][1].call(normalizedThisArg);\n }\n else {\n return false;\n }\n break;\n default:\n newName = normalizedArgs[0];\n value = normalizedArgs[1];\n break;\n }\n let currentName = _globalObjects.get(value);\n if (currentName instanceof Set) {\n for (let _currentName of currentName) {\n if (_currentName !== newName) {\n if (Reflect.has(acl, _currentName)) {\n //console.error('windowAcl: cloning access-controlled window.' + _currentName + ' to window.' + newName);\n return false;\n }\n }\n }\n }\n }\n }\n return 'rwxRW'[opTypeMap[opType]] === opType; // equivalent to 'rwxRW' acl\n };\n }", "function bbedit_acpperms_undo_bits() {}", "function C012_AfterClass_Amanda_AmandaDeniedOrgasm() {\n\tCurrentTime = CurrentTime + 50000;\n\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"OrgasmDeniedFromMasturbation\")) {\n\t\tGameLogAdd(\"OrgasmDeniedFromMasturbation\");\n\t\tActorChangeAttitude(-2, 1);\n\t}\n\tC012_AfterClass_Amanda_EndEnslaveAmanda();\n}", "function allowedToEdit() {\n\t\treturn role === 'farm_admin' || role === 'farmer';\n\t}", "function isForbiddenNode(node) {\n return node.isContentEditable || // DraftJS and many others\n (node.parentNode && node.parentNode.isContentEditable) || // Special case for Gmail\n (node.tagName && (node.tagName.toLowerCase() == \"textarea\" || // Some catch-alls\n node.tagName.toLowerCase() == \"input\"));\n}", "_deny() {\n // deny everything\n this.deny({\n insert() { return true; },\n update() { return true; },\n remove() { return true; }\n });\n }", "function onEditAsAdmin(e) {\n Logger.log(\"On edit as admin\");\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var masterSheet = ss.getActiveSheet();\n if (masterSheet.getName() != masterSheetName) return;\n \n //Check if its just open and we should restrict it\n if(!checkIfHasAccess(e)) {\n return;\n }\n \n Logger.log(\"Have access\");\n var columnsToGiveAccess = [];\n if(e.range.getColumn() === fillerEmailField) {\n columnsToGiveAccess = [labelsCol, fillerCol, fillerEmailCol, descriptionCol, fillerPhoneCol, taskStatusCol, extraCol, extraCol2];\n }else if(e.range.getColumn() === creatorEmailField) {\n columnsToGiveAccess = [labelsCol, fillerCol, fillerEmailCol, descriptionCol, fillerPhoneCol, taskStatusCol, extraCol, extraCol2, creatorCol, creatorCommentsCol];\n }\n\n // Only grant permissions if set this array\n if(columnsToGiveAccess.length > 0) {\n if(grantPermission(columnsToGiveAccess, e)) {\n unprotectRange(columnsToGiveAccess,e); //Set as unprotected in main sheet\n // Popping the last two columns (Use as extra - should not be displayed)\n columnsToGiveAccess.pop();\n columnsToGiveAccess.pop();\n showAlert(accessGranted, editableColumns + columnsToGiveAccess.toString());\n }\n }\n Logger.log(\"Finished\");\n}", "function isForbiddenNode(node) {\r\n return node.isContentEditable || // DraftJS and many others\r\n (node.parentNode && node.parentNode.isContentEditable) || // Special case for Gmail\r\n (node.tagName && (node.tagName.toLowerCase() == \"textarea\" || // Some catch-alls\r\n node.tagName.toLowerCase() == \"input\"));\r\n}", "async function saveButton(e) {\n // localStorage.setItem(\"code\", editor.userCode);\n e.preventDefault();\n\n console.log(\"edit code id is: \", editCodeId);\n const { _id } = await userAPI.getUserId(sub);\n console.log(\"User is:\", _id)\n\n try {\n if (editCodeId.codeId === \"\") {\n \n const codeBlock = {\n author: _id,\n code: editor.userCode,\n title: titleInput.codeTitle,\n isPrivate: isPrivate,\n };\n\n const newCodeBlock = await codeBlockAPI.saveCodeBlock(\n codeBlock\n );\n setCodeSnips([...codeSnips, newCodeBlock]);\n } else if(editCodeId.authorId !== _id ){\n // console.log(\"I made it to the specified area\")\n\n const codeBlock = {\n author:editCodeId.author,\n title: titleInput.codeTitle,\n isPrivate: isPrivate,\n dateModified: new Date(),\n isCloned:true,\n originalId:editCodeId.codeId,\n dateCloned: new Date(),\n code: editor.userCode\n }\n // console.log(\"codeBlock from specificied area is: \", codeBlock)\n\n const clonedBlock = await codeBlockAPI.saveCodeBlock(codeBlock)\n\n // console.log(\"newCodeBlock is: \", clonedBlock)\n }else{\n const codeBlockId = editCodeId.codeId;\n const authorId = await userAPI.getUserId(sub);\n\n const codeBlock = {\n author: authorId,\n code: editor.userCode,\n title: titleInput.codeTitle,\n isPrivate: isPrivate,\n dateModified: new Date(),\n };\n\n // console.log(\"codeblock is: \", codeBlock);\n\n const updatedCodeBlock = await codeBlockAPI.updateCodeBlock(\n codeBlockId,\n codeBlock\n );\n // console.log(\"updated code block is: \", updatedCodeBlock);\n }\n } catch (err) {\n console.log(err);\n }\n\n seteditCodeId({ codeId: \"\" });\n }", "function C012_AfterClass_Amanda_AllowLeave() {\n\tC012_AfterClass_Amanda_CheckNotes();\n}", "function C012_AfterClass_Jennifer_IsChangingBlocked() {\n\tif (GameLogQuery(CurrentChapter, CurrentActor, \"EventBlockChanging\"))\n\t\tOverridenIntroText = GetText(\"ChangingIsBlocked\");\n}", "function isEditor() {\n var user = Session.getActiveUser().getEmail();\n return EDITORS.indexOf(user) >= 0;\n}", "function set_entityusecode_if_edit_address() {\n if (nlapiGetContext().getExecutionContext() === 'userinterface') {\n if (window.entityusecode_needs_to_be_set) {\n set_entityusecode();\n }\n return true;\n }\n}", "get restricted() {\n\t\treturn this.__Internal__Dont__Modify__.restricted;\n\t}", "function disableOldForumEdit() {\n\tif( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {\n\t\treturn;\n\t}\n\tif( !document.getElementById('old-forum-warning') ) {\n\t\treturn;\n\t}\n\n\tif( skin == 'oasis' ) {\n\t\tif( wgNamespaceNumber == 2 || wgNamespaceNumber == 3 ) {\n\t\t\t$(\"#WikiaUserPagesHeader .wikia-menu-button li a:first\").html('Archived').removeAttr('href').attr('style', 'color: darkgray;');\n\t\t\t$('span.editsection').remove();\n\t\t\treturn;\n\t\t} else {\n\t\t\t$(\"#WikiaPageHeader .wikia-menu-button a:first\").html('Archived').removeAttr('href').attr('style', 'color: darkgray;');\n\t\t\t$('span.editsection').remove();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif( !document.getElementById('ca-edit') ) {\n\t\treturn;\n\t}\n\n\tif( skin == 'monaco' ) {\n\t\teditLink = document.getElementById('ca-edit');\n\t} else if( skin == 'monobook' ) {\n\t\teditLink = document.getElementById('ca-edit').firstChild;\n\t} else {\n\t\treturn;\n\t}\n\n\teditLink.removeAttribute('href', 0);\n\teditLink.removeAttribute('title', 0);\n\teditLink.style.color = 'gray';\n\teditLink.innerHTML = 'Archived';\n\n\t$('span.editsection-upper').remove();\n\t$('span.editsection').remove();\n\n\tappendCSS( '#control_addsection, #ca-addsection { display: none !important; }' );\n}", "lockEditor() {\n this.lock = true;\n }", "function preventInternalEditWatch(component) {\n component.hotInstance.addHook('beforeChange', () => {\n component.__internalEdit = true;\n });\n component.hotInstance.addHook('beforeCreateRow', () => {\n component.__internalEdit = true;\n });\n component.hotInstance.addHook('beforeCreateCol', () => {\n component.__internalEdit = true;\n });\n component.hotInstance.addHook('beforeRemoveRow', () => {\n component.__internalEdit = true;\n });\n component.hotInstance.addHook('beforeRemoveCol', () => {\n component.__internalEdit = true;\n });\n}", "function checkReadOnly(){\n\tif (assistants.scope.current === 'eid'){\n return true; //read from eID\n\t}else{\n\t\tif (myForm.user){\n\t\t\tif (myForm.user.modeid == '3'){\n\t\t\t\treturn true; //Firmenkunde\n\t\t\t}else{\n\t\t\t\tif (myForm.user.levelid == '3') {\n\t\t\t\t\treturn true; //höhere Sicherheitstufe Bürger\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function canEditOwner() {\n // If this is an archived playbook, don't allow anyone to edit it.\n if (vm.current.details.isArchived === true) {\n return;\n }\n\n if (vm.current.details.isOwnedByMe === true) {\n vm.current.details.canEditOwner = true;\n getUserList();\n }\n else {\n authService.hasPermission(\"PLAYBOOK_OWNER\", \"Edit\")\n .then(function (data) {\n vm.current.details.canEditOwner = data || false;\n\n if (vm.current.details.canEditOwner === true) {\n getUserList();\n }\n });\n }\n }", "function disable_entityusecode_for_roles() {\n if (nlapiGetContext().getExecutionContext() === 'userinterface') {\n var ALLOWEDROLES = [\n '3', //Administrator\n '1010', //Accountant\n '1048', //Senior Accountant\n '1012' //CFO/Controller\n ];\n nlapiDisableLineItemField('addressbook', \"custpage_ava_entityusecode\", true); //disable entityusecodes field\n if (ALLOWEDROLES.indexOf(nlapiGetRole()) === -1) { //only allow certain roles access to tax exempt states\n nlapiDisableField('custentity_tax_exempt_states', true);\n }\n\n if (NLShowAddressChildRecordPopup !== undefined) {\n var temp_function = NLShowAddressChildRecordPopup;//we need to hijack netsuites function to set a global \n var entityusecode_on_address_popup = function(containingRecordManagerName, targetRecordManagerName, bReadOnly, url, triggerObject, linenum, options, machineName, subrecordName) {\n window.entityusecode_needs_to_be_set = true;\n temp_function(containingRecordManagerName, targetRecordManagerName, bReadOnly, url, triggerObject, linenum, options, machineName, subrecordName);\n };\n NLShowAddressChildRecordPopup = entityusecode_on_address_popup;\n } else {\n //some way we can notify the dev team that this errored\n }\n }\n}", "function checkMode(){\n\t $('.antiscroll-wrap').antiscroll();\n\t $(this).scrubContent();\n\t try { $(\"#sidebar\").width($(\"#sidebar\").width() + 10); } catch (e) {}\n\t if(mode == \"edit\"){\n\t\t /*******************************************************\n\t\t\t* Edit Sidebar\n\t\t\t********************************************************/\n\t\t\t//Add and style contentEdit button\n\t\t\tif(branchType == \"sidebar\"){\n\t\t\t\t$(\"#sidebar\").attr('contenteditable', true);\n CKEDITOR.disableAutoInline = true;\n\t\t\t\tCKEDITOR.inline( 'sidebar', {\n\t\t\t\t\ton: {\n\t\t\t\t\t\tblur: function (event){\n\t\t\t\t\t\t\tif(cachedTextPreEdit != event.editor.getData()){\n\t\t\t\t\t\t\t\tsaveSidebarEdit(event.editor.getData());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tenableNext();\n\t\t\t\t\t\t\tenableBack();\n\t\t\t\t\t\t\t$('.btn_branch').attr('aria-disabled', 'false');\n\t\t\t\t\t\t\t$('.btn_branch').button('option', 'disabled', false);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfocus: function (event){\n\t\t\t\t\t\t\tcachedTextPreEdit = event.editor.getData();\n\t\t\t\t\t\t\tdisableNext();\n\t\t\t\t\t\t\tdisableBack();\n\t\t\t\t\t\t\t$('.btn_branch').attr('aria-disabled', 'true');\n\t\t\t\t\t\t\t$('.btn_branch').button('option', 'disabled', true);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttoolbar: contentToolbar,\n\t\t\t\t\ttoolbarGroups :contentToolgroup,\n\t\t\t\t\textraPlugins: 'sourcedialog',\n\t\t\t\t\tallowedContent: true\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/*******************************************************\n\t\t\t* Edit Content\n\t\t\t********************************************************/\n\t\t\t//Add and style contentEdit button\n\t\t\tif(branchType != \"graphicOnly\"){\n \t$(\"#content\").attr('contenteditable', true);\n CKEDITOR.disableAutoInline = true;\n\t\t\t\tCKEDITOR.inline( 'content', {\n\t\t\t\t\ton: {\n\t\t\t\t\t\tblur: function (event){\n\t\t\t\t\t\t\tif(cachedTextPreEdit != event.editor.getData()){\n\t\t\t\t\t\t\t\tsaveContentEdit(event.editor.getData());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tenableNext();\n\t\t\t\t\t\t\tenableBack();\n\t\t\t\t\t\t\t$('.btn_branch').attr('aria-disabled', 'false');\n\t\t\t\t\t\t\t$('.btn_branch').button('option', 'disabled', false);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfocus: function (event){\n\t\t\t\t\t\t\tcachedTextPreEdit = event.editor.getData();\n\t\t\t\t\t\t\tdisableNext();\n\t\t\t\t\t\t\tdisableBack();\n\t\t\t\t\t\t\t$('.btn_branch').attr('aria-disabled', 'true');\n\t\t\t\t\t\t\t$('.btn_branch').button('option', 'disabled', true);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttoolbar: contentToolbar,\n\t\t\t\t\ttoolbarGroups :contentToolgroup,\n\t\t\t\t\textraPlugins: 'sourcedialog',\n\t\t\t\t\tallowedContent: true\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/*******************************************************\n\t\t\t* Edit Question\n\t\t\t********************************************************/\n //Add and style titleEdit button\n\t\t\tif(branchType != \"graphicOnly\"){\n\t\t\t\t$('#scrollableContent').prepend(\"<div id='branchEdit' class='btn_edit_text' title='Edit this exercise'></div>\");\n\t\t\t}else{\n\t\t\t\t$('#mediaHolder').prepend(\"<div id='branchEdit' class='btn_edit_text' title='Edit this exercise'></div>\");\n\t\t\t}\n\n\t\t\t$(\"#branchEdit\").click(function(){\n\t\t\t\tupdateBranchDialog();\n\t\t\t}).tooltip();\n\t\t}\n }", "function checkPermissions() {\n for (i = 0; i < $scope.modules.length; i++) {\n for (j = 0; j < $scope.modules[i].use_cases.length; j++) {\n if ($scope.modules[i].use_cases[j].codename in $scope.useCases) {\n $scope.modules[i].use_cases[j].allowed = true;\n } else {\n delete $scope.modules[i].use_cases[j].allowed;\n }\n }\n }\n }", "function userDenyLocation(e) { \n alert(e.message);\n populateMap(false);\n }", "function handleAvoidAreaChanged(avoidAreaString) {\n\t\t\thandlePrefsChanged({\n\t\t\t\tkey : preferences.avoidAreasIdx,\n\t\t\t\tvalue : avoidAreaString\n\t\t\t});\n\t\t}", "function StupidBug() {}", "function inForbiddenZone() {\n var rowIndex = 0;\n var columnIndex = 0;\n for(rowIndex = 0; rowIndex <= GameData.forbiddenRow; rowIndex++) {\n for(columnIndex = 0; columnIndex < GameData.mainPlayField.getFieldWidth(); columnIndex++) {\n if(GameData.mainPlayField.getBlockType(rowIndex, columnIndex) !== 0) {\n return true;\n }\n }\n }\n return false;\n}", "function inside() {\n return false;\n }", "function inside() {\n return false;\n }", "function inside() {\n return false;\n }", "function inside() {\n return false;\n }", "function inside() {\n return false;\n }", "function inside() {\n return false;\n }", "unlocked(){return true}", "function gpsNotAccessible(){\n setConfig4Location(false);\n}", "changeReadOnly() {\n\t\tif (this.state.readOnly && this.props.cityPolygon == null) {\n\t\t\talert('You cannot create a study area before you select a city');\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\treadOnly: !this.state.readOnly\n\t\t\t});\n\t\t}\n\t}", "function strictMode(){\n //We reset the map\n //resetMap();\n\n //We remove the preloaded lists\n removeUserSet();\n removePreloadListFromBlacklist();\n\n //We save the new mode and we refresh the policy\n saveMode(\"strict\");\n}", "function forbid_key(){ \n /*\n\t//禁止F5\n\tif(event.keyCode==116){\n event.keyCode=0;\n event.returnValue=false;\n }\n */\n \n if(event.shiftKey){\n event.returnValue=false;\n }\n //禁止shift\n \n if(event.altKey){\n event.returnValue=false;\n }\n //禁止alt\n \n if(event.ctrlKey){\n event.returnValue=false;\n }\n //禁止ctrl\n return true;\n}", "function blockSomeKeys() {\n function keypress(e) {\n if (e.which >= 33 && e.which <= 40) {\n e.preventDefault();\n return false;\n }\n return true;\n }\n window.onkeydown = keypress;\n }", "function doingBazaarMaintainance() {\n let loc = window.location.href;\n if (loc.indexOf('add') > 0 || loc.indexOf('manage') > 0 || loc.indexOf('personalize') > 0) {\n console.log('Nothing to see here, just doing maintainace on my own Bazaar...');\n return true;\n }\n return false;\n }", "function disablePrivateFeatures() {\n // TODO Update the login status\n}//disablePrivateFeatures()", "function secret() {\n\t\tvar unused1;\n\t}", "function func() {\n var priv = \"secret code\";\n}", "function DisableDataEntryPage()\n{ \n var preventDisableAttr = 'preventModifyDisable';\n\n $(\"input\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"select\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"textarea\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"a\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n if ($(this).css('visibility') == 'hidden' || $(this).css('display') == 'none')\n $(this).attr('keephidden', 'true');\n else {\n var tempAnchor = $(this).clone();\n tempAnchor.attr('id', $(this).attr('id') + 'tmp').attr('href', 'javascript:void(null);');\n tempAnchor.attr('onclick', '').unbind('click').attr('onmouseover', '').unbind('mouseover');\n tempAnchor.attr('removeOnModify', 'true');\n $(this).attr('showOnModify', 'true').css('display', 'none').before(tempAnchor);\n }\n });\n \t\n HideApplets();\t\t\t\n}", "function allowQuestion() { }", "function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }", "static isAllowedToControl(object, isControlled){\n\t\t\tlet offset = object.getFlag(moduleName, 'offset') || {};\n\t\t\tif(Object.keys(offset).length === 0) return;\n\t\t\tlet objParent = object.getFlag(moduleName, 'parent') || {};\n\t\t\tif(document.getElementById(\"tokenAttacher\") && TokenAttacher.isCurrentAttachUITarget(objParent)) return;\n\t\t\tlet unlocked = object.getFlag(moduleName, 'unlocked');\n\t\t\tif(unlocked) return;\n\t\t\t\n\t\t\tif(game.user.isGM){\n\t\t\t\tlet quickEdit = getProperty(window, 'tokenAttacher.quickEdit');\n\t\t\t\tif(quickEdit && canvas.scene._id === quickEdit.scene) return;\n\t\t\t}\n\t\t\treturn object.release();\n\t\t}", "function avoidAreasError(errorous) {\n\t\t\tui.showAvoidAreasError(errorous);\n\t\t}", "function shouldIgnore(event) {\n return isEditable(eventTarget(event)) || hasModifiers(event);\n}", "set Restricted(value) {}", "function reassignProtections() {\n let sheetName = \"RTA Strat ILs\"\n\n let [users, mods] = getDirectory(sheetName)\n // assign email addresses to ranges\n let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName)\n for (let p of sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE)) {\n if (p.canEdit()) {\n let previousEditors = p.getEditors()\n if (previousEditors.length < 100) { continue } // skip ranges that have already been restricted\n p.removeEditors(previousEditors)\n if (p.getDescription() == 'header') {\n p.addEditors(mods)\n console.log(\"protected header\")\n } else {\n let name = p.getRange().getCell(1,1).getValue().toLowerCase()\n let email = users[name]\n if (email) {\n p.addEditors(mods.concat(email))\n console.log(\"registered\", name)\n } else {\n p.addEditors(mods)\n console.log(\" generic\", name)\n }\n }\n } else {\n console.log(\"error: couldn't edit protected range\", protection.getDescription())\n }\n }\n}", "static _lockChangeAlert() {\n const canvas = EngineToolbox.getCanvas();\n if (document.pointerLockElement === canvas) {\n document.addEventListener(\"mousemove\", Input._updatePosition, false);\n } else {\n document.removeEventListener(\"mousemove\", Input._updatePosition, false);\n }\n }", "function onReadOnlyChange()/*:void*/ {\n var readOnly/*:Boolean*/ = this.readOnlyValueExpression$AoGC.getValue();\n this.canvasMgr$AoGC && this.canvasMgr$AoGC.clearSelection();\n this.toggleShim(readOnly);\n }", "unlockEditor() {\n this.lock = false;\n }", "function SafeScript() { }", "function SafeScript() { }", "function SafeScript() { }", "checkEditingMode(){\n let textArea = document.querySelector(\"textarea.rm-block-input\");\n if (!textArea || textArea.getAttribute(\"zotero-tribute\") != null) return;\n\n document.querySelectorAll('.zotero-roam-tribute').forEach(d=>d.remove());\n\n textArea.setAttribute(\"zotero-tribute\", \"active\");\n\n var tribute = new Tribute(zoteroRoam.config.tribute);\n tribute.attach(textArea);\n\n textArea.addEventListener('tribute-replaced', (e) => {\n let item = e.detail.item;\n if(item.original.source == \"zotero\"){\n let textArea = document.querySelector('textarea.rm-block-input');\n let trigger = e.detail.context.mentionTriggerChar + e.detail.context.mentionText;\n let triggerPos = e.detail.context.mentionPosition;\n\n let replacement = e.detail.item.original.value;\n let blockContents = e.target.defaultValue;\n\n let escapedTrigger = zoteroRoam.utils.escapeRegExp(trigger);\n let triggerRegex = new RegExp(escapedTrigger, 'g');\n let newText = blockContents.replaceAll(triggerRegex, (match, pos) => (pos == triggerPos) ? replacement : match );\n\n // Store info about the replacement, to help debug\n zoteroRoam.interface.tributeTrigger = trigger;\n zoteroRoam.interface.tributeBlockTrigger = textArea;\n zoteroRoam.interface.tributeNewText = newText;\n\n var setValue = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;\n setValue.call(textArea, newText);\n\n var ev = new Event('input', { bubbles: true });\n textArea.dispatchEvent(ev); \n }\n });\n\n }", "function ignore() { }", "allow() {\n this._isAllowed = true;\n }", "function disable(){\r\n\treturn;\r\n}", "function checkAuthorization()\n{\n var sheet = SpreadsheetApp.getActive();\n // ScriptApp.newTrigger(\"myEdit\").forSpreadsheet(sheet).onEdit().create();\n ScriptApp.newTrigger(\"myEdit\").forSpreadsheet(sheet).onChange().create();\n ScriptApp.newTrigger(\"onOpen\").forSpreadsheet(sheet).onOpen().create();\n\n return;\n}", "hacky(){\n return\n }", "function SRC_verifyEditArea()\r\n{\r\n if (SRC_findResourceSearchBase().inTextMode()) {\r\n alert(\"Unable to add this link (the editor is in text mode)\");\r\n return false;\r\n }\r\n\r\n if (!SRC_findResourceSearchBase().inEditArea()) {\r\n alert(\"Unable to add this link (cursor focus is not in an edit area)\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function mainCleanup() {\n lastrunworld = currentworld;\n currentworld = game.global.world;\n aWholeNewWorld = lastrunworld != currentworld;\n //run once per portal:\n if (currentworld == 1 && aWholeNewWorld) {\n lastHeliumZone = 0;\n zonePostpone = 0;\n //for the dummies like me who always forget to turn automaps back on after portaling\n if(getPageSetting('RunUniqueMaps') && !game.upgrades.Battle.done && autoTrimpSettings.AutoMaps.enabled == false)\n settingChanged(\"AutoMaps\");\n return true; // Do other things\n }\n}", "function oob_system(){\n\t\ntest_find_conflict();\n}//end function oob_system", "function priv () {\n\t\t\t\n\t\t}", "function apply_source_code(){\r\n\t//var content=$('#html_source_code').val();\r\n\tvar content=editor1.getValue();\r\n\t//strip the script tags\r\n\tcontent=content.replace(/<script.*?>.*?<\\/.*?script>/gi, \"\");\r\n\tcontent=$.trim(content);\r\n\t//do not allow inline scripts to get executed\r\n\t//content=content.replace('(?<=<.*)javascript.*:[^\"]*', \"\");\r\n\tvar old_content=$('.deck-current').find('.slide-body').html().trim();\r\n if(old_content!=content ){\r\n \t$('.deck-current').find('.slide-body').html(content);\r\n \titem_change.push($('.deck-current').find('.slide-body').attr('id'));\r\n \tenable_save_button();\r\n }\t\r\n}", "function isProtectedSheet() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getActiveSheet();\n var sheetName = sheet.getName();\n \n if (sheetName == \"Master Inventory\" || sheetName == \"Qty Wanted + Prices\") {\n SpreadsheetApp.getUi().alert(\"You cannot overwrite this inventory sheet, please create a new sheet and try again\");\n return true;\n }\n else\n return false;\n}", "function main(){\n return false;\n}", "onEditMode() {\n const {selectedPage, selectedView, selectedPageDirty} = this.props;\n return ((selectedPage && selectedPage.tabId === 0) || selectedPageDirty\n || selectedView === panels.SAVE_AS_TEMPLATE_PANEL\n || selectedView === panels.ADD_MULTIPLE_PAGES_PANEL \n || selectedView === panels.CUSTOM_PAGE_DETAIL_PANEL);\n }", "function handle_context_requirement_change(new_requirements)\n {\n do_limit_to_private_context = new_requirements.do_limit_to_private_context;\n if (bookmarks.is_unlocked()) { update_in_active_tabs(); }\n }", "function hack_legacy_app_specific_hacks() {\n\n if(_pTabId == \"pMouseSpinalCord\") {\n\n if(window.console)\n console.log(\"importing legacy spinal hacks\");\n\n import_spinal_hacks();\n\n } else if(_pTabId == \"pGlioblastoma\") {\n\n import_glio_hacks();\n }\n}", "static _canModify(user, doc, data) {\n if (user.isGM) return true; // GM users can do anything\n return doc.data.author === user.id; // Users may only update their own created drawings\n }", "function forbiden(){\n\tdocument.getElementById(\"sub\").disabled = true;\n\tdocument.getElementById(\"A_choice\").disabled = true;\n\tdocument.getElementById(\"B_choice\").disabled = true;\n\tdocument.getElementById(\"C_choice\").disabled = true;\n\tdocument.getElementById(\"D_choice\").disabled = true;\n}", "function toggleProtection() {\n var sel = $(svgRoot).find('.selected').first().closest('g');\n if ( sel.length === 0 )\n return true;\n // @todo Prevent toggling protection if parent (not whole document) is read only.\n if ( isReadOnly() )\n return true;\n sel.toggleClass('protected');\n if ( sel.hasClass('protected') )\n $('#'+self.cfg.textareaId)\n .blur()\n .prop( 'disabled', true );\n else\n $('#'+self.cfg.textareaId)\n .prop( 'disabled', false )\n .focus();\n for ( var n=0; n<self.cfg.onProtectionChange.length; n++ )\n self.cfg.onProtectionChange[n](sel);\n registerChange('toggled protection of '+getElementPath(sel));\n return false;\n }", "function openEdit() { \n document.getElementById(\"editableArea\").style.width = \"100%\";\n document.getElementById(\"viewArea\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n\n var approvedArea = document.getElementById(\"approvedArea\");\n if (approvedArea) {\n approvedArea.style.width = \"0\";\n }\n}", "doEditMode() {\n\n }", "function setPermissions() {\n \n Logger.log(\"setting permissions...\");\n \n // find the doc you want to do this for, and paste in its ID\n // get ID from: https://docs.google.com/document/d/LONGIDSTRINGHERE/edit\n\n var pumpkinDoc = DriveApp.getFileById('1pDkYbLDteEQtk1V2ufR3Y9gghyiPxgwJRloRomQVCbk');\n var currentTime = new Date();\n \n var chatWindowBegins = new Date();\n chatWindowBegins.setHours(20,45,0); // 8.45 pm\n var chatWindowCloses = new Date();\n chatWindowCloses.setHours(21,0,0); // 9.00 pm\n \n Logger.log(\"Current Time:\" + currentTime);\n Logger.log(\"Chat Window Begins:\" + chatWindowBegins);\n Logger.log(\"Chat Window Closes:\" + chatWindowCloses);\n\n if((currentTime >= chatWindowBegins) && (currentTime < chatWindowCloses)){\n Logger.log(\"time to chat!\");\n //change overall editing permissions to anyone can edit \n pumpkinDoc.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);\n }\n else{\n Logger.log(\"time to pumpkin!\");\n \n //remove explicit editors\n editors = pumpkinDoc.getEditors();\n for (i in editors) {\n email = editors[i].getEmail();\n Logger.log(email);\n if (email != \"\") {\n pumpkinDoc.removeEditor(email);\n }\n }\n \n //change overall editing permissions to anyone can view\n pumpkinDoc.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.VIEW)\n \n }\n \n}", "function privateFunction() {\n\n}" ]
[ "0.61383396", "0.5948349", "0.5813972", "0.5626072", "0.5609636", "0.5604327", "0.55946994", "0.5594173", "0.552369", "0.55230194", "0.5521189", "0.5492849", "0.5438334", "0.543218", "0.5430754", "0.5371369", "0.5371239", "0.53694355", "0.5348208", "0.5327032", "0.52979136", "0.5290126", "0.5286649", "0.5284596", "0.52820414", "0.52692693", "0.5262551", "0.526128", "0.5242661", "0.5235903", "0.5222078", "0.52211905", "0.5198938", "0.5197825", "0.51830584", "0.51806086", "0.51706344", "0.5167977", "0.51656324", "0.51648927", "0.5164321", "0.51620436", "0.5160028", "0.51522565", "0.51522493", "0.5146879", "0.51429355", "0.5127062", "0.512641", "0.512641", "0.512641", "0.512641", "0.512641", "0.512641", "0.5123753", "0.5122066", "0.51100236", "0.51081896", "0.51055527", "0.51009744", "0.5095874", "0.5095712", "0.50925285", "0.5086527", "0.50762695", "0.5076003", "0.5071933", "0.50675684", "0.5065668", "0.50652784", "0.50633246", "0.5060555", "0.5050201", "0.50490206", "0.50477695", "0.5046323", "0.5046323", "0.5046323", "0.5036754", "0.5020669", "0.50145054", "0.5009876", "0.5008733", "0.5008605", "0.50043803", "0.50036645", "0.499886", "0.49987644", "0.49984685", "0.49901333", "0.49822658", "0.4979669", "0.4977853", "0.4976414", "0.49756268", "0.49751633", "0.49731266", "0.4970232", "0.49669734", "0.49549058", "0.4954693" ]
0.0
-1
TODO: Handle also "drag" event. First need to be able to specify the events that we want to listent to, via `this.data`. // If not specified listen to all `SOURCE_EVENTS` TODO: Consider to move some functions to the outer scope
function handleDrag(ev, broadcast) { // Ignore other events if (!isDragEvent(ev)) return; const data = this.data; const delegator = hg.Delegator(); const _target = ev.currentTarget; let listenersAdded = false; // TODO: Check if can remove this if (ev.type === 'dragstart') { const triggerDragstart = !listenersAdded; addListeners(); if (triggerDragstart) dragstart(ev); } // TODO: Check if can remove `target` from broadcasted data, // from all/some handlers function dragstart(e) { if (!isRootElementOfEvent(e)) return; const dataTransfer = e._rawEvent.dataTransfer; dataTransfer.effectAllowed = 'move'; broadcast(addData({ type: 'dragstart', target: e.target, dataTransfer, })); } function dragend(e) { if (!isRootElementOfEvent(e)) return; removeListeners(); broadcast(addData({ type: 'dragend', target: e.target, })); } function addData(additional) { return Object.assign({}, data, additional); } function isRootElementOfEvent(e) { return e.target === _target; } function addListeners() { if (listenersAdded) return; delegator.addGlobalEventListener('dragstart', dragstart); delegator.addGlobalEventListener('dragend', dragend); listenersAdded = true; } function removeListeners() { if (!listenersAdded) return; delegator.removeGlobalEventListener('dragstart', dragstart); delegator.removeGlobalEventListener('dragend', dragend); listenersAdded = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setEvents() {\n\n if (this.fileInputLinkEle) {\n //Show file reference dialog when clicking the \"Select File\" link\n this.fileInputLinkEle.addEventListener('click', evt => {\n this.fileInputEle.click();\n evt.preventDefault();\n });\n }\n\n if (this.fileInputEle) {\n //Add a file when a file is selected on the file reference dialog\n this.fileInputEle.addEventListener('change', evt => {\n\n const selectedFiles = evt.target.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n });\n }\n\n\n this.fileDropAreaEle.addEventListener('dragenter', evt => {\n\n evt.preventDefault();\n\n // If there is a child element in the file drop area\n // Count enter/leave to ignore \"dragenter\"/\"dragleave\" event in child element\n this.enterLeaveNum++;\n\n const draggingObjectTypes = evt.dataTransfer.types;\n\n\n // If dragging objects contains \"file\" type object,\n // then set a flag to indicate that it can be dropped\n let draggingObjectContainsFile = false;\n\n for (const draggingObjectType of draggingObjectTypes) {\n if (draggingObjectType === 'Files') {\n draggingObjectContainsFile = true;\n break;\n }\n }\n\n if (!draggingObjectContainsFile) {\n this.nonFileObjectDragging = true;\n } else {\n this.nonFileObjectDragging = false;\n }\n\n\n if (this.nonFileObjectDragging) {\n this.fileDropAreaEle.style.cursor = 'not-allowed';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;\n } else {\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_CLS_NAME);\n return;\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('dragover', evt => {\n\n if (this.nonFileObjectDragging) {\n //Return here to show 'forbidden' icon.\n return;\n }\n evt.preventDefault();\n });\n\n this.fileDropAreaEle.addEventListener('dragleave', evt => {\n\n this.enterLeaveNum--;\n\n if (this.enterLeaveNum === 0) {\n //When it comes out of the parent element (dragleave)\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('drop', evt => {\n\n evt.stopPropagation();\n evt.preventDefault();\n\n this.enterLeaveNum = 0;\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;//Skip adding dropped file.\n\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n const selectedFiles = evt.dataTransfer.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n\n });\n\n }", "function attachSourceEvents(dots){\n\tdots.forEach(dot => {\n\t\tdot.addEventListener('dragstart', dragStart, false);\n\t});\n}", "function processDragAndDrop() {\n\t\t\t\t\tif (definition.DragSource && voAggregation.getMetadata().hasAggregation(\"dragSource\")) {\n\t\t\t\t\t\t[].concat(definition.DragSource.DragItem).forEach(function(item) {\n\t\t\t\t\t\t\tvoAggregation.addDragSource(new sap.ui.vbm.DragSource({\n\t\t\t\t\t\t\t\ttype: item.type\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (definition.DropTarget && voAggregation.getMetadata().hasAggregation(\"dropTarget\")) {\n\t\t\t\t\t\t[].concat(definition.DropTarget.DropItem).forEach(function(item) {\n\t\t\t\t\t\t\tvoAggregation.addDropTarget(new sap.ui.vbm.DropTarget({\n\t\t\t\t\t\t\t\ttype: item.type\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}", "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n });\n\n //prevent default on other drag events\n Quas.on(\"drag dragover\", \".drop\", function(e){\n e.preventDefault();\n });\n\n //dropping the file\n Quas.on(\"drop\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n upload(e.dataTransfer.files, function(data){\n //todo progress bar\n closeToolModals();\n Quas.getEl(\"#post-tool-cloud\").visible(true);\n loadModal(\"cloud\");\n });\n });\n }", "function initSourceListeners() {\n document.querySelector('.source_con .load').addEventListener('click', onSourceLoad);\n }", "onStart ( e ) {\n\n e.target.classList.remove ( 'use-hover' );\n this.isDragging = true;\n\n e.vdg = this.getEventData ( e );\n this.$emit ( 'drag-start', e );\n\n }", "function addListenersToSources() {\r\n var srcs, tId, i;\r\n for (tId in aTargetIds) {\r\n if (aTargetIds.hasOwnProperty(tId)) {\r\n srcs = aTargetIds[tId].sources;\r\n for (i = 0; i < srcs.length; i += 1) {\r\n srcs[i].addEventListener('click', accordionAction);\r\n }\r\n }\r\n }\r\n }", "function addListeners() {\n // text.addEventListener(\"dragstart\", function (e) {\n // e.dataTransfer.setData(\"text/plain\", text.id);\n // });\n //\n // targetContainer.addEventListener(\"dragover\", function (e) {\n // e.preventDefault();\n // });\n // targetContainer.addEventListener(\"drop\", function (e) {\n // e.preventDefault();\n // e.stopPropagation();\n // // console.log(e.dataTransfer.getData(\"text/plain\"));\n //\n // var element = document.getElementById(e.dataTransfer.getData(\"text/plain\"));\n // if (element.parentNode) {\n // element.parentNode.removeChild(element);\n // }\n // this.appendChild(element);\n // });\n\n $(\"#text\").on(\"dragstart\", function (e) {\n e.originalEvent.dataTransfer.setData(\"text/plain\", this.id);\n });\n $(\".container\").on(\"dragover\", function (e) {\n e.preventDefault();\n }).on(\"drop\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n var element = document.getElementById(e.originalEvent.dataTransfer.getData(\"text/plain\"));\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n this.appendChild(element);\n });\n }", "prepareDropTarget() {\n this.dropTargetView.addEventListener('dragover', (e) => {\n e.stopPropagation();\n e.preventDefault();\n });\n this.dropTargetView.addEventListener('dragenter', (e) => {\n e.stopPropagation();\n e.preventDefault();\n });\n this.dropTargetView.addEventListener('drop', (e) => {\n e.stopPropagation();\n e.preventDefault();\n\n const fileInfo = e.dataTransfer.files[0];\n\n const reader = new FileReader();\n reader.onload = (re) => this.loadFile(fileInfo.name, re.target.result);\n reader.readAsText(fileInfo);\n });\n }", "function onDragStart(event) {\n //Store data to record movement\n this.data = event.data;\n this.alpha = 0.5;\n this.dragging = true;\n \n}", "drag(ev) {\n // console.log('drag')\n }", "function drag_drag(d) {\n\t\t\t\t\n\t\t\t\td.x = d3.event.x, d.y = d3.event.y;\n\t\t\t d3.select(this).attr(\"cx\", d.x).attr(\"cy\", d.y);\n\t\t\t link.filter(function(l) { return l.source === d; }).attr(\"x1\", d.x).attr(\"y1\", d.y);\n\t\t\t link.filter(function(l) { return l.target === d; }).attr(\"x2\", d.x).attr(\"y2\", d.y);\n\t\t\t label.filter(function(l) {return l.name === d.name; }).attr(\"x\",d.x).attr(\"y\",d.y-8);\n\t\t\t \n\t\t\t}", "function createDragAndDropListener() {\n\n //Create Listeners for Columns\n var tempColumns = document.getElementsByClassName('evo_c-divtable-column');\n if (tempColumns != null) {\n for (var i = 0; i < tempColumns.length; i++) {\n tempColumns[i].addEventListener('dragstart', handleColumnDragStart, false);\n tempColumns[i].addEventListener('dragenter', handleColumnDragEnter, false)\n tempColumns[i].addEventListener('dragover', handleColumnDragOver, false);\n tempColumns[i].addEventListener('dragleave', handleColumnDragLeave, false);\n tempColumns[i].addEventListener('drop', handleColumnDrop, false);\n tempColumns[i].addEventListener('dragend', handleColumnDragEnd, false);\n }\n }\n //Create Listeners for Rows\n var tempRows = document.getElementsByClassName('evo_c-divtable-row_evo_c-divtable-header');\n if (tempRows != null) {\n for (var i = 0; i < tempRows.length; i++) {\n tempRows[i].addEventListener('dragstart', handleRowDragStart, false);\n tempRows[i].addEventListener('dragenter', handleRowDragEnter, false)\n tempRows[i].addEventListener('dragover', handleRowDragOver, false);\n tempRows[i].addEventListener('dragleave', handleRowDragLeave, false);\n tempRows[i].addEventListener('drop', handleRowDrop, false);\n tempRows[i].addEventListener('dragend', handleRowDragEnd, false);\n }\n }\n }", "onDragStart({dataTransfer: dt, currentTarget: t}) { dt.setData('text', t.src) }", "function handler(event) {\n var elem = this, returned, data = event.data || {};\n // mousemove or mouseup\n if (data.elem) {\n // update event properties...\n elem = event.dragTarget = data.elem; // drag source element\n event.dragProxy = drag.proxy || elem; // proxy element or source\n event.cursorOffsetX = data.pageX - data.left; // mousedown offset\n event.cursorOffsetY = data.pageY - data.top; // mousedown offset\n event.offsetX = event.pageX - event.cursorOffsetX; // element offset\n event.offsetY = event.pageY - event.cursorOffsetY; // element offset\n }\n // mousedown, check some initial props to avoid the switch statement\n else if (drag.dragging || (data.which > 0 && event.which != data.which) ||\n $(event.target).is(data.not)) return;\n // handle various events\n switch (event.type) {\n // mousedown, left click, event.target is not restricted, init dragging\n case 'mousedown':\n $.extend(data, $(elem).offset(), {\n elem: elem, target: event.target,\n pageX: event.pageX, pageY: event.pageY\n }); // store some initial attributes\n $event.add(document, \"mousemove mouseup\", handler, data);\n selectable(elem, false); // disable text selection\n drag.dragging = null; // pending state\n break; // prevents text selection in safari\n // mousemove, check distance, start dragging\n case !drag.dragging && 'mousemove':\n if (squared(event.pageX - data.pageX)\n + squared(event.pageY - data.pageY) // x² + y² = distance²\n < data.distance) break; // distance tolerance not reached\n event.target = data.target; // force target from \"mousedown\" event (fix distance issue)\n returned = hijack(event, \"dragstart\", elem); // trigger \"dragstart\", return proxy element\n if (returned !== false) { // \"dragstart\" not rejected\n drag.dragging = elem; // activate element\n drag.proxy = event.dragProxy = $(returned || elem)[0]; // set proxy\n }\n // mousemove, dragging\n case 'mousemove':\n if (drag.dragging) {\n returned = hijack(event, \"drag\", elem); // trigger \"drag\"\n if (data.drop && $special.drop) { // manage drop events\n $special.drop.allowed = (returned !== false); // prevent drop\n $special.drop.handler(event); // \"dropstart\", \"dropend\"\n }\n if (returned !== false) break; // \"drag\" not rejected, stop\n event.type = \"mouseup\"; // helps \"drop\" handler behave\n }\n // mouseup, stop dragging\n case 'mouseup':\n $event.remove(document, \"mousemove mouseup\", handler); // remove page events\n if (drag.dragging) {\n if (data.drop && $special.drop) $special.drop.handler(event); // \"drop\"\n hijack(event, \"dragend\", elem); // trigger \"dragend\"\n }\n selectable(elem, true); // enable text selection\n drag.dragging = drag.proxy = data.elem = false; // deactivate element\n break;\n }\n }", "function dragstart(d) {\n d3.event.sourceEvent.preventDefault();\n d3.event.sourceEvent.stopPropagation();\n }", "attach() {\n this.draggable.on('drag:move', this[onDragMove]).on('drag:stop', this[onDragStop]);\n }", "function initDragListeners(){\n\t\t\tjQuery('.cell', $ganttTable)\n\t\t\t\t\t.on('dragstart', controller.handleDragstart.bind(controller))\n\t\t\t\t\t.on('drag', controller.handleDrag.bind(controller))\n\t\t\t\t\t.on('dragend', controller.handleDragend.bind(controller));\n\t\t}", "function programListDragHandler(event) {\n dragging = event.target;\n event.dataTransfer.setData('text/html', dragging);\n}", "function addEventListeners() {\n const dragListItems = document.querySelectorAll(\".draggable-list__entry\");\n const draggables = document.querySelectorAll(\".draggable-list__detail\");\n\n draggables.forEach(draggable => {\n draggable.addEventListener(\"dragstart\", dragStart);\n });\n\n dragListItems.forEach(item => {\n item.addEventListener(\"dragover\", dragOver);\n item.addEventListener(\"drop\", dragDrop);\n item.addEventListener(\"dragenter\", dragEnter);\n item.addEventListener(\"dragleave\", dragLeave);\n });\n}", "attach() {\n this.draggable.on('drag:start', this[onDragStart]).on('drag:move', this[onDragMove]).on('drag:stop', this[onDragStop]);\n }", "function drag (event) {\r\n console.log(\"drag FN start\");\r\n console.log(event);\r\n draggedPic = event.target; // TODO draggedPic\r\n event.dataTransfer.setData(\"text\", event.target.id);\r\n event.dataTransfer.effectAllowed = \"move\";\r\n}", "function addDragHandlers () {\n if (supportsTouch) {\n element.addEventListener('touchmove', handleTouchMove, false)\n } else {\n element.addEventListener('mouseover', handleDragEnter, false)\n element.addEventListener('mouseout', handleDragLeave, false)\n }\n\n // document.addEventListener(\"selectstart\", prevent, false);\n }", "function drag(event) {\n draggedItem = event.target;\n dragging = true;\n}", "function setupDragDropListener(obj){\n obj.addEventListener(\"dragover\", fileDragHover, false);\n obj.addEventListener(\"dragleave\", fileDragHover, false);\n obj.addEventListener(\"drop\", fileSelectHandler, false);\n obj.style.display = \"block\";\n }", "function startDrag (e) {\n //we are capturing the event object and using it to set some information about what is being dragged\n //in this case we are saying that we are storing some text and it is the id of element being moved\n //We need to set this, this iswhy it wasn't working earlier\n //Set the drag's format and data. Use the event target's id for the data\n e.dataTransfer.setData('text', e.target.dataset.audiosrc);\n console.log(\"dragging\");\n console.log(e.dataTransfer.getData('text'));\n }", "addEventListeners() {\n\n this.dropZone.ondragover = (e) => {\n\n e.preventDefault();\n e.target.classList.add(\"highlight\");\n };\n \n this.dropZone.ondragleave = (e) => {\n \n e.preventDefault();\n e.target.classList.remove(\"highlight\");\n };\n \n this.dropZone.ondrop = (e) => {\n \n e.preventDefault();\n e.target.classList.remove(\"highlight\");\n this.addFiles(e);\n };\n \n this.fileInput.onchange = (e) => {\n \n e.preventDefault();\t\n this.addFiles(e);\n };\n }", "attachEvents() {\n // Keep track pointer hold and dragging distance\n this.pointerDown = false;\n this.drag = {\n startX: 0,\n endX: 0,\n startY: 0,\n letItGo: null,\n preventClick: false,\n transformX: 0,\n transformY: 0\n };\n }", "onDrag({ context, event }) {\n const me = this,\n dd = me.dragData,\n start = dd.startDate;\n\n let client;\n\n if (me.constrainToTimeline) {\n client = me.client;\n } else {\n let target = event.target;\n\n // Can't detect target under a touch event\n if (/^touch/.test(event.type)) {\n const center = Rectangle.from(dd.context.element, null, true).center;\n\n target = DomHelper.elementFromPoint(center.x, center.y);\n }\n\n client = IdHelper.fromElement(target, 'timelinebase');\n }\n\n const depFeature = me.client.features.dependencies,\n x = context.newX,\n y = context.newY;\n\n if (!client) {\n if (depFeature) {\n depFeature.updateDependenciesForTimeSpan(dd.draggedRecords[0], dd.context.element);\n }\n return;\n }\n\n if (client !== me.currentOverClient) {\n me.onMouseOverNewTimeline(client);\n }\n\n //this.checkShiftChange();\n\n me.updateDragContext(context, event);\n\n // Snapping not supported when dragging outside a scheduler\n if (me.constrainDragToTimeline && (me.showExactDropPosition || me.client.timeAxisViewModel.snap)) {\n const newDate = client.getDateFromCoordinate(me.getCoordinate(dd.draggedRecords[0], context.element, [x, y])),\n timeDiff = newDate - dd.sourceDate,\n realStart = new Date(dd.origStart - 0 + timeDiff),\n offset = client.timeAxisViewModel.getDistanceBetweenDates(realStart, dd.startDate);\n\n if (dd.startDate >= client.timeAxis.startDate && offset != null) {\n DomHelper.addTranslateX(context.element, offset);\n }\n }\n\n // Let product specific implementations trigger drag event (eventDrag, taskDrag)\n me.triggerEventDrag(dd, start);\n\n let valid = me.checkDragValidity(dd, event);\n\n if (valid && typeof valid !== 'boolean') {\n context.message = valid.message || '';\n valid = valid.valid;\n }\n\n context.valid = valid !== false;\n\n if (me.showTooltip) {\n me.tip.realign();\n }\n\n if (depFeature) {\n depFeature.updateDependenciesForTimeSpan(\n dd.draggedRecords[0],\n dd.context.element.querySelector(client.eventInnerSelector)\n );\n }\n }", "function dragstarted(d){\n d3.event.sourceEvent.stopPropagation();\n }", "function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return;\n }\n var handle;\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n // Record the event listeners.\n var listeners = [];\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n connect: data.connect,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice(),\n });\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers,\n });\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers,\n });\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }", "function dragStart () {\n d3.event.sourceEvent.stopPropagation();\n}", "function drag(ev) {\n console.log(ev.dataTransfer);\n if(ev.target.id){\n console.log(ev.dataTransfer);\n ev.dataTransfer.setData(\"text\", ev.target.id);\n \n }\n console.log(ev.target.dataset.index);\n if(ev.target.dataset.index){\n console.log(\"tem ue\");\n ev.dataTransfer.setData(\"el-index\", ev.target.dataset.index);\n }\n}", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "setSourceObject(object) {\n\n if (this.sourceDOMObject != null) {\n this.sourceDOMObject.removeEventListener('mousedown', this._mouseDownHandle);\n this.sourceDOMObject.removeEventListener('mouseup', this._mouseUpHandle);\n this.sourceDOMObject.removeEventListener('mousemove', this._mouseMoveHandle);\n this.sourceDOMObject.removeEventListener('mouseleave', this._mouseLeave);\n this.sourceDOMObject.removeEventListener('wheel', this._wheelHandle);\n // Do not open menu after left clicking\n this.sourceDOMObject.removeEventListener('contextmenu', this._contexMenuHandle);\n }\n\n this.sourceDOMObject = object;\n\n // Setup mouse event listeners\n this.sourceDOMObject.addEventListener(\"mousedown\", this._mouseDownHandle);\n this.sourceDOMObject.addEventListener(\"mouseup\", this._mouseUpHandle);\n this.sourceDOMObject.addEventListener('mousemove', this._mouseMoveHandle);\n this.sourceDOMObject.addEventListener('mouseleave', this._mouseLeave);\n this.sourceDOMObject.addEventListener('wheel', this._wheelHandle);\n // Do not open menu after left clicking\n this.sourceDOMObject.addEventListener('contextmenu', this._contexMenuHandle);\n }", "function addDraggableEvents() {\n [].forEach.call(\n document.querySelectorAll('.card'),\n function(card) { \n card.addEventListener('dragstart',handleDragStart,false);\n card.addEventListener('dragend',handleDragEnd,false);\n card.addEventListener('dragleave',handleCardDragLeave,false);\n }\n );\n [].forEach.call(\n document.querySelectorAll('.card-holder'),\n function(holder) {\n holder.addEventListener('dragover',handleDragOver,false);\n holder.addEventListener('dragleave',handleDragLeave,false);\n holder.addEventListener('dragenter',handleDragEnter,false);\n holder.addEventListener('drop',handleDrop,false);\n holder.addEventListener('dragstart',function(e) {\n if (e.target === this) {\n e.preventDefault();\n return false;\n }\n },false);\n }\n );\n}", "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function drag(e) {\n draggedItem = e.target\n dragging = true\n}", "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone');\n\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "function addDragEeventListener(nodes, codeNames){\n nodes\n .call(d3.drag()\n .on('start', drags)\n .on('drag', dragging)\n .on('end', dragged));\n codeNames\n .call(d3.drag()\n .on('start', drags)\n .on('drag', dragging)\n .on('end', dragged));\n}", "onDragStarted(mousePosition) {\n }", "onDragStart(e, name){\n console.log('now dragging',name);\n e.dataTransfer.setData(\"name\", name);\n }", "function start ( event, data ) {\n\n\t\t// Mark the handle as 'active' so it can be styled.\n\t\tif( data.handles.length === 1 ) {\n\t\t\tdata.handles[0].children().addClass(Classes[15]);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Attach the move event.\n\t\tattach ( actions.move, doc, move, {\n\t\t\tstart: event.calcPoint,\n\t\t\thandles: data.handles,\n\t\t\tpositions: [\n\t\t\t\t$Locations[0],\n\t\t\t\t$Locations[$Handles.length - 1]\n\t\t\t]\n\t\t});\n\n\t\t// Unbind all movement when the drag ends.\n\t\tattach ( actions.end, doc, end, null );\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\t$('body').css('cursor', $(event.target).css('cursor'));\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( $Handles.length > 1 ) {\n\t\t\t\t$Target.addClass(Classes[12]);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t$('body').on('selectstart' + namespace, false);\n\t\t}\n\t}", "function Draggable(){this.on('mousedown',this._dragStart,this);this.on('mousemove',this._drag,this);this.on('mouseup',this._dragEnd,this);this.on('globalout',this._dragEnd,this); // this._dropTarget = null;\n // this._draggingTarget = null;\n // this._x = 0;\n // this._y = 0;\n }", "onCreate() {\n // TODO: this pattern sucks. Setup a utility that streamlines caching of these functions for later unsubscribing\n this.properties.onDragOverBound = this._onDragOver.bind(this);\n this.properties.onDragEndBound = this._onDragEnd.bind(this);\n this.properties.onFileDropBound = this.onFileDrop.bind(this); // public\n this.properties.ignoreDropBound = this._ignoreDrop.bind(this);\n\n // Tells the browser that we *can* drop on this target\n this.addEventListener('dragover', this.properties.onDragOverBound, false);\n this.addEventListener('dragenter', this.properties.onDragOverBound, false);\n\n this.addEventListener('dragend', this.properties.onDragEndBound, false);\n this.addEventListener('dragleave', this.properties.onDragEndBound, false);\n\n this.addEventListener('drop', this.properties.onFileDropBound, false);\n\n document.addEventListener('drop', this.properties.ignoreDropBound, false);\n document.addEventListener('dragenter', this.properties.ignoreDropBound, false);\n document.addEventListener('dragover', this.properties.ignoreDropBound, false);\n }", "drop(ev) {\n\t\tev.preventDefault();\n\t\tvar data = ev.dataTransfer.getData(\"text\");\n\t\tif(data.includes(\"func\"))\n\t\t{\n\t\t\tcopyID = \"drag\" + counter;\n\t\t\tcounter++;\n\t\t\tvar offLeft = document.getElementById(\"context\").offsetLeft;\n\t\t\tvar offTop = document.getElementById(\"context\").offsetTop;\n\t\t\tvar x = ev.clientX - offLeft; // Get the horizontal coordinate of mouse\n\t\t\tvar y = ev.clientY - offTop; // Get the vertical coordinate of mouse\n\t\t\t\n\t\t\t// console.log(\"Left =\" + offLeft + \", Top =\" + offTop );\n\t\t\t// console.log(\"X =\" + x + \", Y =\" + y );\n\t\t\tvar elem;\n\t\t\tswitch (data) {\n\t\t\t\tcase \"funcBody\":\n\t\t\t\t\telem = document.getElementById(\"funcBody\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\t// x -= elem.offsetWidth/2;\n\t\t\t\t\t// y -= elem.offsetHeight/2;\n\t\t\t\t\tthis.appendData(funcBody, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcRec\":\n\t\t\t\t\telem = document.getElementById(\"funcRec\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\tthis.appendData(funcRec, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcOp\":\n\t\t\t\t\telem = document.getElementById(\"funcOp\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\tthis.appendData(funcOp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcExp\":\n\t\t\t\t\telem = document.getElementById(\"funcExp\");\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\tthis.appendData(funcExp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcNExp\":\n\t\t\t\t\telem = document.getElementById(\"funcNExp\");\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\tthis.appendData(funcNExp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log(\"Invalid drop\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "addSource(source) {\n this._data.source = source;\n }", "onMouseDrag(e) {}", "function eventStart(event, data) {\n\n var handle;\n if (data.handleNumbers.length === 1) {\n\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n // Ignore 'disabled' handles\n if (handleOrigin.hasAttribute('disabled')) {\n return false;\n }\n\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Record the event listeners.\n var listeners = [];\n\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n handleNumbers: data.handleNumbers\n });\n\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n handleNumbers: data.handleNumbers\n });\n\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener('selectstart', preventDefault, false);\n }\n\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent('start', handleNumber);\n });\n }", "function listenDrag(e){\n // prevent browser dragging\n S.lib.preventDefault(e);\n\n var coords = S.lib.getPageXY(e);\n drag.start_x = coords[0];\n drag.start_y = coords[1];\n\n draggable = U.get(S.contentId());\n S.lib.addEvent(document, 'mousemove', positionDrag);\n S.lib.addEvent(document, 'mouseup', unlistenDrag);\n\n if(S.client.isGecko)\n U.get(drag_id).style.cursor = '-moz-grabbing';\n }", "function start(ev) {\n //guardo el id del elemento que estoy arrastrando\n ev.dataTransfer.setData(\"name\", ev.target.id);\n console.log( ev.target.id);\n}", "static get listeners() {\n return {\n 'container.down': '_mouseDownHandler',\n 'document.move': '_drag',\n 'document.up': '_switchThumbDropHandler',\n 'mouseenter': '_switchButtonOnMouseEnter',\n 'mouseleave': '_switchButtonOnMouseLeave',\n 'resize': '_resizeHandler',\n 'container.resize': '_resizeHandler',\n 'document.selectstart': '_selectStartHandler'\n };\n }", "__initializeDragAreaFuncs(){\n //handle drop for reasult file\n this.__dragAreaResultFile.addObserverFunc(function (dataJson) {\n this.__anomalyCheckbox.setOptions(Object.keys(dataJson));\n this.__anomalyGraph.setData(dataJson);\n this.__resultData = dataJson;\n }.bind(this));\n\n //handle drop for learn file\n this.__dragAreaLearnFile.addObserverFunc(function (dataJson) {\n this.__learnData = dataJson;\n }.bind(this));\n }", "function handleDragStart(e){\n dragSrcEl = this;\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/html', this.innerHTML);\n}", "function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return false;\n }\n\n var handle;\n\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Record the event listeners.\n var listeners = [];\n\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n\n data.handleNumbers.forEach(function(handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }", "function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return false;\n }\n\n var handle;\n\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Record the event listeners.\n var listeners = [];\n\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n\n data.handleNumbers.forEach(function(handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }", "function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return false;\n }\n\n var handle;\n\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Record the event listeners.\n var listeners = [];\n\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n\n data.handleNumbers.forEach(function(handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }", "function eventStart(event, data) {\n // Ignore event if any handle is disabled\n if (data.handleNumbers.some(isHandleDisabled)) {\n return false;\n }\n\n var handle;\n\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Record the event listeners.\n var listeners = [];\n\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n doNotReject: true,\n handleNumbers: data.handleNumbers\n });\n\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener(\"selectstart\", preventDefault, false);\n }\n\n data.handleNumbers.forEach(function(handleNumber) {\n fireEvent(\"start\", handleNumber);\n });\n }", "onDrag({\n context,\n event\n }) {\n const me = this,\n dd = me.dragData,\n start = dd.startDate;\n let client;\n\n if (me.constrainDragToTimeline) {\n client = me.client;\n } else {\n let target = event.target; // Can't detect target under a touch event\n\n if (/^touch/.test(event.type)) {\n const center = Rectangle.from(dd.context.element, null, true).center;\n target = DomHelper.elementFromPoint(center.x, center.y);\n }\n\n client = Widget.fromElement(target, 'timelinebase');\n }\n\n const depFeature = me.client.features.dependencies,\n x = context.newX,\n y = context.newY;\n\n if (!client) {\n if (depFeature) {\n depFeature.updateDependenciesForTimeSpan(dd.draggedRecords[0], dd.context.element);\n }\n\n return;\n }\n\n if (client !== me.currentOverClient) {\n me.onMouseOverNewTimeline(client);\n } //this.checkShiftChange();\n\n me.updateDragContext(context, event); // Snapping not supported when dragging outside a scheduler\n\n if (me.constrainDragToTimeline && (me.showExactDropPosition || me.client.timeAxisViewModel.snap)) {\n const newDate = client.getDateFromCoordinate(me.getCoordinate(dd.draggedRecords[0], context.element, [x, y])),\n timeDiff = newDate - dd.sourceDate,\n realStart = new Date(dd.origStart - 0 + timeDiff),\n offset = client.timeAxisViewModel.getDistanceBetweenDates(realStart, dd.startDate);\n\n if (dd.startDate >= client.timeAxis.startDate && offset != null) {\n DomHelper.addTranslateX(context.element, offset);\n }\n } // Let product specific implementations trigger drag event (eventDrag, taskDrag)\n\n me.triggerEventDrag(dd, start);\n let valid = me.checkDragValidity(dd, event);\n\n if (valid && typeof valid !== 'boolean') {\n context.message = valid.message || '';\n valid = valid.valid;\n }\n\n context.valid = valid !== false;\n\n if (me.showTooltip) {\n me.tip.realign();\n }\n\n if (depFeature) {\n depFeature.updateDependenciesForTimeSpan(dd.draggedRecords[0], dd.context.element.querySelector(client.eventInnerSelector), dd.newResource);\n }\n }", "onPointerMove(e) {\n\t\tif (this.mouseMoved < dragThreshold) {\n\t\t\tthis.mouseMoved += 1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!draggingEl) {\n\t\t\temit(this.el, 'dragstart');\n\n\t\t\tdraggingEl = this.el;\n\t\t\tthis.$clonedEl = createDragShadow(this.el, this.shadowClass);\n\n\t\t\t// for auto-scroll\n\t\t\tthis.scrollParent.addEventListener(events.enter, this.onPointerEnter, { passive: true });\n\t\t\tthis.scrollParent.addEventListener(events.leave, this.onPointerLeave, { passive: true });\n\t\t\tthis.onPointerEnter();\n\t\t}\n\n\t\tthis.$clonedEl.moveTo(e);\n\t\temit(this.el, 'drag');\n\n\t\t// for auto-scroll\n\t\tconst scrollRect = this.scrollParent.getBoundingClientRect();\n\t\t// is the mouse closer to the top or bottom edge of the scroll parent?\n\t\tconst topDist = Math.abs(scrollRect.top - e.clientY);\n\t\tconst bottomDist = Math.abs(scrollRect.bottom - e.clientY);\n\t\t// should we scroll up, or down?\n\t\tconst speedDirection = topDist < bottomDist ? -1 : 1;\n\t\t// should we scroll at 3px per frame, or 0px per frame (i.e. pause auto-scroll)?\n\t\tconst speedMagnitude = Math.min(topDist, bottomDist) < 40 ? 3 : 0;\n\t\tthis.scrollSpeed = speedDirection * speedMagnitude;\n\t}", "addEvents() {\n this.moduleView.getModuleContainer().addEventListener(\"mousedown\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchstart\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchmove\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchend\", this.eventDraggingHandler, false);\n if (this.moduleView.textArea != undefined) {\n this.moduleView.textArea.addEventListener(\"touchstart\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"touchend\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"touchmove\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"mousedown\", (e) => { e.stopPropagation(); });\n }\n if (this.moduleView.closeButton != undefined) {\n this.moduleView.closeButton.addEventListener(\"click\", () => { this.deleteModule(); });\n this.moduleView.closeButton.addEventListener(\"touchend\", () => { this.deleteModule(); });\n }\n if (this.moduleView.miniButton != undefined) {\n this.moduleView.miniButton.addEventListener(\"click\", () => { this.minModule(); });\n this.moduleView.miniButton.addEventListener(\"touchend\", () => { this.minModule(); });\n }\n if (this.moduleView.maxButton != undefined) {\n this.moduleView.maxButton.addEventListener(\"click\", () => { this.maxModule(); });\n this.moduleView.maxButton.addEventListener(\"touchend\", () => { this.maxModule(); });\n }\n if (this.moduleView.fEditImg != undefined) {\n this.moduleView.fEditImg.addEventListener(\"click\", this.eventOpenEditHandler);\n this.moduleView.fEditImg.addEventListener(\"touchend\", this.eventOpenEditHandler);\n }\n }", "function drag(e) {\r\n //draggedItem = e.target; No need for a global variable here\r\n e.dataTransfer.setData(\"text\", e.target.id); // set data in drag and drop event to dragged element's id\r\n dragging = true;\r\n}", "function TreeGrid_Sizer_BeginDrag(event)\n{\n\t//not during gestures\n\tif (!__GESTURES.IsBusy())\n\t{\n\t\t//get source element\n\t\tvar srcElement = Browser_GetEventSourceElement(event);\n\t\t//search for the sizer\n\t\twhile (srcElement && !srcElement.Sizer)\n\t\t{\n\t\t\t//iterate\n\t\t\tsrcElement = srcElement.parentNode;\n\t\t}\n\t\t//valid?\n\t\tif (srcElement)\n\t\t{\n\t\t\t//start dragging\n\t\t\tDragging_Start(event);\n\t\t\t//setup target \n\t\t\t__DRAG_DATA.Target = srcElement;\n\t\t\t//set up listeners\n\t\t\t__DRAG_DATA.OnMove = TreeGrid_Sizer_Drag_OnMove;\n\t\t\t__DRAG_DATA.OnEnd = TreeGrid_Sizer_Drag_OnEnd;\n\t\t\t//store the sizer\n\t\t\t__DRAG_DATA.Sizer = srcElement.Sizer;\n\t\t\t//tell the treegrid to initialise our data\n\t\t\tTreeGrid_InitialiseResize();\n\t\t\t//block the event\n\t\t\tBrowser_BlockEvent(event);\n\t\t}\n\t}\n}", "function ListView_Sizer_BeginDrag(event)\n{\n\t//not during gestures\n\tif (!__GESTURES.IsBusy())\n\t{\n\t\t//get source element\n\t\tvar srcElement = Browser_GetEventSourceElement(event);\n\t\t//search for the sizer\n\t\twhile (srcElement && !srcElement.Sizer)\n\t\t{\n\t\t\t//iterate\n\t\t\tsrcElement = srcElement.parentNode;\n\t\t}\n\t\t//valid?\n\t\tif (srcElement)\n\t\t{\n\t\t\t//start dragging\n\t\t\tDragging_Start(event);\n\t\t\t//setup target \n\t\t\t__DRAG_DATA.Target = srcElement;\n\t\t\t//set up listeners\n\t\t\t__DRAG_DATA.OnMove = ListView_Sizer_Drag_OnMove;\n\t\t\t__DRAG_DATA.OnEnd = ListView_Sizer_Drag_OnEnd;\n\t\t\t//set target's initial size\n\t\t\t__DRAG_DATA.InitialWidth = Get_NumberFromStyle(srcElement.Sizer.Header.style.width, null);\n\t\t\t//store the sizer\n\t\t\t__DRAG_DATA.Sizer = srcElement.Sizer;\n\t\t\t//invalid width?\n\t\t\tif (!__DRAG_DATA.InitialWidth)\n\t\t\t{\n\t\t\t\t//use the offset\n\t\t\t\t__DRAG_DATA.InitialWidth = Browser_GetOffsetWidth(srcElement);\n\t\t\t}\n\t\t}\n\t}\n}", "dragStart(event) {\n this.originX = event.clientX;\n this.originY = event.clientY;\n event.currentTarget.setPointerCapture(event.pointerId);\n this.dragStarted = true;\n }", "function handleDragStart(e) {\n // e.target(this) element is the source node.\n // this.style.opacity = '0.4';\n let name = e.target.querySelector('header').innerText\n nameStartIndex = names.indexOf(name)\n dragSrcEl = this;\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/html', this.innerHTML);\n}", "_checkInputSourcesChange() {\n const added = [];\n const removed = [];\n const newInputSources = this.inputSources;\n const oldInputSources = this[PRIVATE].currentInputSources;\n\n for (const newInputSource of newInputSources) {\n if (!oldInputSources.includes(newInputSource)) {\n added.push(newInputSource);\n }\n }\n\n for (const oldInputSource of oldInputSources) {\n if (!newInputSources.includes(oldInputSource)) {\n removed.push(oldInputSource);\n }\n }\n\n if (added.length > 0 || removed.length > 0) {\n this.dispatchEvent('inputsourceschange', new XRInputSourcesChangeEvent('inputsourceschange', {\n session: this,\n added: added,\n removed: removed\n }));\n }\n\n this[PRIVATE].currentInputSources.length = 0;\n for (const newInputSource of newInputSources) {\n this[PRIVATE].currentInputSources.push(newInputSource);\n }\n }", "handleMouseDown(e) {\n this.start = pos(e);\n this.w0 = this.state.w;\n d.addEventListener('mousemove', this.handleDrag)\n d.addEventListener('mouseup', this.handleMouseUp.bind(this))\n }", "onDrop(event) {\r\n event.preventDefault(); // Allows for dropping\r\n const data = event.dataTransfer.getData(\"text\");\r\n if (data == locationAncestor_type_1.dragAndDropName && this.state.inDropMode) {\r\n this.module.onDrop();\r\n }\r\n }", "function Dragging_Move(event)\n{\n\t//has drag data?\n\tif (__DRAG_DATA && __DRAG_DATA.OnMove && __DRAG_DATA.TouchDetail === Browser_GetTouchId(event))\n\t{\n\t\t//call it\n\t\t__DRAG_DATA.OnMove(event);\n\t}\n}", "eventListeners() {\n\n // Event triggered when item is added\n this.eventAggregator.subscribe('dragTarget.onAdd', evt => {\n let src = evt.from;\n let dest = evt.to;\n\t\t\tlet item = evt.item;\n\n // When actual dragged item is dropped, we remove it and handle\n // updating the array for our repeater ourselves\n evt.item.parentElement.removeChild(evt.item);\n\n // Dragging widget into new page\n if (item.dataset.type) {\n let animalType = item.dataset.type;\n\n let itemInstance = {};\n\n if (animalType === 'cat') {\n itemInstance.type = 'cat';\n itemInstance.src = 'http://thecatapi.com/api/images/get?format=src&type=jpg';\n } else {\n itemInstance.type = 'dog';\n itemInstance.src = 'http://loremflickr.com/640/480/dog';\n }\n\n this.droppedItems.splice(evt.newIndex - 1, 0, itemInstance);\n }\n });\n\n // Events for when sorting takes place, we need to update the array to let\n // Aurelia know that changes have taken place and our repeater is up-to-date\n this.eventAggregator.subscribe('dragTarget.onUpdate', evt => {\n // The item being dragged\n let el = evt.item;\n\t\t\t\n\t\t\t// Old index position of item\n let oldIndex = evt.oldIndex;\n\n // New index position of item\n let newIndex = evt.newIndex;\n\n // If item isn't being dropped into its original place\n if (newIndex != oldIndex) {\n\t\t\t\tswapArrayElements(this.droppedItems, newIndex, oldIndex);\n\n evt.item.parentElement.removeChild(evt.item);\n }\n });\n }", "addEventListeners_() {\n this.$button_.on(app.InputEvent.START, this.onDropClick);\n }", "startDrag(event) {\n event.dataTransfer.setData(\"text\", event.target.id);\n }", "function Draggable() {\n\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this);\n this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }", "function Draggable() {\n\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this);\n this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }", "function UltraGrid_Sizer_BeginDrag(event)\n{\n\t//not during gestures\n\tif (!__GESTURES.IsBusy())\n\t{\n\t\t//get source element\n\t\tvar srcElement = Browser_GetEventSourceElement(event);\n\t\t//search for the sizer\n\t\twhile (srcElement && !srcElement.Header && !srcElement.Header.UltraGridHeader)\n\t\t{\n\t\t\t//iterate\n\t\t\tsrcElement = srcElement.parentNode;\n\t\t}\n\t\t//valid?\n\t\tif (srcElement)\n\t\t{\n\t\t\t//start dragging\n\t\t\tDragging_Start(event);\n\t\t\t//setup target \n\t\t\t__DRAG_DATA.Target = srcElement;\n\t\t\t//set up listeners\n\t\t\t__DRAG_DATA.OnMove = UltraGrid_Sizer_Drag_OnMove;\n\t\t\t__DRAG_DATA.OnEnd = UltraGrid_Sizer_Drag_OnEnd;\n\t\t\t//store the sizer\n\t\t\t__DRAG_DATA.Header = srcElement.Header;\n\t\t\t//tell the treegrid to initialise our data\n\t\t\tUltraGrid_InitialiseResize(srcElement.Header);\n\t\t\t//block the event\n\t\t\tBrowser_BlockEvent(event);\n\t\t}\n\t}\n}", "function addDragListeners() {\n document.addEventListener(\"dragstart\", function (e) {\n draggedCircle = e.target;\n e.target.classList.add(\"dragging\");\n\n // Set the drag preview to be invisible\n let elem = document.createElement(\"div\");\n elem.id = \"drag-ghost\";\n elem.style.position = \"absolute\";\n document.body.appendChild(elem);\n e.dataTransfer.setDragImage(elem, 0, 0);\n });\n\n document.addEventListener(\"dragend\", function (e) {\n e.target.classList.remove(\"dragging\");\n });\n\n document.addEventListener(\"dragover\", function (e) {\n e.preventDefault();\n updateCircleLocation(e);\n drawReaderFrame();\n endGame();\n });\n }", "function eventStart ( event, data ) {\n\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handle = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handle.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\tscope_ActiveHandle = handle.children[0];\n\t\t\taddClass(scope_ActiveHandle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tscope_Listeners = moveEvent.concat(endEvent, outEvent);\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "_startEventListener(ev, data) {\n const el = ev.target;\n let isEventOnSlider = false;\n\n if (ev.which !== 1 && !('touches' in ev)) {\n return;\n }\n\n dom.forEachAncestors(el, el =>\n (isEventOnSlider = el.id === this.identifier && !dom.hasClass(el, this.options.disabledClass)),\n true);\n\n if (isEventOnSlider) {\n this._handleDown(ev, data);\n }\n }", "function drag(e){\n var state = $.data(e.data.target, 'draggable');\n var opts = state.options;\n var proxy = state.proxy;\n\n var dragData = e.data;\n var left = dragData.startLeft + e.pageX - dragData.startX;\n var top = dragData.startTop + e.pageY - dragData.startY;\n\n if (proxy){\n if (proxy.parent()[0] == document.body){\n if (opts.deltaX != null && opts.deltaX != undefined){\n left = e.pageX + opts.deltaX;\n } else {\n left = e.pageX - e.data.offsetWidth;\n }\n if (opts.deltaY != null && opts.deltaY != undefined){\n top = e.pageY + opts.deltaY;\n } else {\n top = e.pageY - e.data.offsetHeight;\n }\n } else {\n if (opts.deltaX != null && opts.deltaX != undefined){\n left += e.data.offsetWidth + opts.deltaX;\n }\n if (opts.deltaY != null && opts.deltaY != undefined){\n top += e.data.offsetHeight + opts.deltaY;\n }\n }\n }\n\n// if (opts.deltaX != null && opts.deltaX != undefined){\n// left = e.pageX + opts.deltaX;\n// }\n// if (opts.deltaY != null && opts.deltaY != undefined){\n// top = e.pageY + opts.deltaY;\n// }\n\n if (e.data.parent != document.body) {\n left += $(e.data.parent).scrollLeft();\n top += $(e.data.parent).scrollTop();\n }\n\n if (opts.axis == 'h') {\n dragData.left = left;\n } else if (opts.axis == 'v') {\n dragData.top = top;\n } else {\n dragData.left = left;\n dragData.top = top;\n }\n }", "function eventInit(){\n\n\tvar dropbox = document.getElementById(\"dropbox\");\n\tdropbox.addEventListener(\"dragenter\", function(e){\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t}\n\t , false);\n\tdropbox.addEventListener(\"dragover\", function(e){\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t}\n\t, false);\n\tdropbox.addEventListener(\"drop\", function(e){\n\t\te.stopPropagation();\n\t\te.preventDefault();\n\n\t\tvar file = e.dataTransfer.files[0];\n\t\tfilename = file.name;\n\t\tvar reader = new FileReader();\n\t\t// init the reader event handlers\n\t\treader.onloadend = handleReaderLoadEnd;\n\n\t\treader.readAsDataURL(file);\n\t }\n\t, false);\n}", "function startDrag(event) {\n dragStart = event[eventElementName];\n startOffset = self.options.vertical ? $el.scrollTop() : $el.scrollLeft();\n\n if (Modernizr.touch) {\n $(window).on('touchmove.dragScroll', function (event) {\n var touchEvent = event.originalEvent;\n moveDrag(touchEvent.touches[0]);\n event.preventDefault()\n });\n\n $(window).on('touchend.dragScroll', function (event) {\n stopDrag()\n })\n }\n else {\n $(window).on('mousemove.dragScroll', function (event) {\n moveDrag(event);\n return false\n });\n\n $(window).on('mouseup.dragScroll', function (mouseUpEvent) {\n var isClick = event.pageX == mouseUpEvent.pageX && event.pageY == mouseUpEvent.pageY;\n stopDrag(isClick);\n return false\n })\n }\n }", "function dragstart_handler(e) {\r\n e.dataTransfer.setData(\"text/plain\", e.target.dataset.jsDraggable);\r\n}", "function dragstart(d) {\n d3.event.sourceEvent.preventDefault();\n d3.event.sourceEvent.stopPropagation();\n force.stop();\n }", "function initSourceTab() {\n initSourceListeners();\n }", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tdoNotReject: true,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "onMouseDown(e) {\n // start dragging\n this.isMouseDown = true;\n\n // apply specific styles\n this.options.element.classList.add(\"dragged\");\n\n // get our touch/mouse start position\n var mousePosition = this.getMousePosition(e);\n // use our slider direction to determine if we need X or Y value\n this.startPosition = mousePosition[this.direction];\n\n // drag start hook\n this.onDragStarted(mousePosition);\n }", "onDragStart({ context, event }) {\n const me = this,\n client = me.client,\n name = client.scheduledEventName;\n\n me.currentOverClient = client;\n me.scrollClients = {};\n\n me.onMouseOverNewTimeline(client);\n\n const dragData = (me.dragData = me.getDragData(context, event));\n\n if (me.showTooltip) {\n const tipTarget = dragData.context.dragProxy ? dragData.context.dragProxy.firstChild : context.element;\n\n if (!me.tip) {\n me.tip = new Tooltip({\n id: `${client.id}-event-drag-tip`,\n align: 'b-t',\n autoShow: true,\n clippedBy: me.constrainDragToTimeline ? [client.timeAxisSubGridElement, client.bodyContainer] : null,\n forElement: tipTarget,\n getHtml: me.getTipHtml.bind(me),\n // During drag, it must be impossible for the mouse to be over the tip.\n style: 'pointer-events:none',\n cls: me.tooltipCls\n });\n\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n } else {\n me.tip.showBy(tipTarget);\n }\n }\n\n // me.copyKeyPressed = me.isCopyKeyPressed();\n //\n // if (me.copyKeyPressed) {\n // dragData.refElements.addCls('sch-event-copy');\n // dragData.originalHidden = true;\n // }\n\n // Trigger eventDragStart or taskDragStart depending on product\n client.trigger(`${name}DragStart`, {\n [`${name}Records`]: dragData.draggedRecords,\n context: dragData\n });\n }", "function dragSourceCollect (connect, monitor) {\n return {\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging()\n }\n}", "function EventSource() {\n this.listeners_ = {};\n}", "drag(event) {\n event.dataTransfer.setData(\"divId\", event.target.id);\n console.log(\"----drag----:\");\n }", "function Draggable() {\n\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\n\t // this._x = 0;\n\t // this._y = 0;\n\t}", "attach() {\n this.draggable.on('drag:start', this[onDragStart]).on('drag:move', this[onDragMove]).on('drag:stop', this[onDragStop]).on('mirror:created', this[onMirrorCreated]).on('mirror:move', this[onMirrorMove]);\n }", "function Dragging_DetectActionStart(event)\n{\n\t//interactions blocked?\n\tif (__SIMULATOR.UserInteractionBlocked())\n\t{\n\t\t//block the event (will forward to designer, if possible)\n\t\tBrowser_BlockEvent(event);\n\t}\n\telse\n\t{\n\t\t//not during gestures\n\t\tif (!__GESTURES.IsBusy())\n\t\t{\n\t\t\t//get the source element\n\t\t\tvar srcElement = Browser_GetEventSourceElement(event);\n\t\t\t//get the html\n\t\t\tvar theHTML = Get_HTMLObject(srcElement);\n\t\t\t//valid?\n\t\t\tif (theHTML)\n\t\t\t{\n\t\t\t\t//the object we will drag\n\t\t\t\tvar intObject = null;\n\t\t\t\tvar data = null;\n\t\t\t\t//switch according to class\n\t\t\t\tswitch (theHTML.InterpreterObject.DataObject.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_LINK:\n\t\t\t\t\tcase __NEMESIS_CLASS_LABEL:\n\t\t\t\t\tcase __NEMESIS_CLASS_UNKNOWN:\n\t\t\t\t\t\t//attempt to replace the object\n\t\t\t\t\t\tvar replacementObject = Label_ProcessEventForwarding(theHTML.InterpreterObject, __NEMESIS_EVENT_DRAGDROP);\n\t\t\t\t\t\t//found a link\n\t\t\t\t\t\tif (replacementObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we use this\n\t\t\t\t\t\t\tintObject = replacementObject;\n\t\t\t\t\t\t\t//drag it directly\n\t\t\t\t\t\t\ttheHTML = intObject.HTML;\n\t\t\t\t\t\t\t//get data\n\t\t\t\t\t\t\tdata = intObject.GetData();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_CLASS_TREE_VIEW:\n\t\t\t\t\t\t//memorise the interpreter object\n\t\t\t\t\t\tintObject = theHTML.InterpreterObject;\n\t\t\t\t\t\t//ask for the html data\n\t\t\t\t\t\tvar treeViewDragData = Treeview_DraggingOverTree(srcElement);\n\t\t\t\t\t\t//valid?\n\t\t\t\t\t\tif (treeViewDragData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//set it\n\t\t\t\t\t\t\ttheHTML = treeViewDragData.Branch;\n\t\t\t\t\t\t\tdata = treeViewDragData.Exception;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//ignore this\n\t\t\t\t\t\t\tintObject = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//got element to drag?\n\t\t\t\tif (intObject)\n\t\t\t\t{\n\t\t\t\t\t//begin drag operation\n\t\t\t\t\tDragging_Start(event);\n\t\t\t\t\t//store clone our drag element\n\t\t\t\t\t__DRAG_DATA.DraggingClone = theHTML.cloneNode(true);\n\t\t\t\t\t//indicate that we currently arent visible\n\t\t\t\t\t__DRAG_DATA.IsShowing = false;\n\t\t\t\t\t//get its rect\n\t\t\t\t\tvar rect = Position_GetDisplayRect(theHTML);\n\t\t\t\t\t//set special properties\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.width = rect.width + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.height = rect.height + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone_InitialPosition = { x: rect.left / __SIMULATOR.Scale + __SIMULATOR.Interpreter.DisplayPanel.scrollLeft, y: rect.top / __SIMULATOR.Scale + __SIMULATOR.Interpreter.DisplayPanel.scrollTop };\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.border = __DRAGGING_CLONE_BORDER;\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.position = \"absolute\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.zIndex = __ZINDEX_POPUP;\n\t\t\t\t\tBrowser_SetOpacity(__DRAG_DATA.DraggingClone, 50);\n\t\t\t\t\t//update its position\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.left = __DRAG_DATA.DraggingClone_InitialPosition.x + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.top = __DRAG_DATA.DraggingClone_InitialPosition.y + \"px\";\n\t\t\t\t\t//setup drag action\n\t\t\t\t\t__DRAG_DATA.DragActionSource = { InterpreterObject: intObject, Data: data };\n\t\t\t\t\t//setup start time\n\t\t\t\t\t__DRAG_DATA.StartTime = new Date().getTime();\n\t\t\t\t\t//set up listeners\n\t\t\t\t\t__DRAG_DATA.OnMove = Dragging_DetectActionMove;\n\t\t\t\t\t__DRAG_DATA.OnEnd = Dragging_DetectActionEnd;\n\t\t\t\t\t__DRAG_DATA.OnWheel = Dragging_DetectActionWheel;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function subscribe(p){\n // Add events\n p.interactive = true;\n p.buttonMode = true;\n p\n // events for drag start\n .on('mousedown', onDragStart)\n .on('touchstart', onDragStart)\n // events for drag end\n .on('mouseup', onDragEnd)\n .on('mouseupoutside', onDragEnd)\n .on('touchend', onDragEnd)\n .on('touchendoutside', onDragEnd)\n // events for drag move\n .on('mousemove', onDragMove)\n .on('touchmove', onDragMove);\n}", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}", "function eventStart ( event, data ) {\n\n\t\tvar handle;\n\t\tif ( data.handleNumbers.length === 1 ) {\n\n\t\t\tvar handleOrigin = scope_Handles[data.handleNumbers[0]];\n\n\t\t\t// Ignore 'disabled' handles\n\t\t\tif ( handleOrigin.hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandle = handleOrigin.children[0];\n\t\t\tscope_ActiveHandlesCount += 1;\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\taddClass(handle, options.cssClasses.active);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Record the event listeners.\n\t\tvar listeners = [];\n\n\t\t// Attach the move and end events.\n\t\tvar moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n\t\t\t// The event target has changed so we need to propagate the original one so that we keep\n\t\t\t// relying on it to extract target touches.\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\tstartCalcPoint: event.calcPoint,\n\t\t\tbaseSize: baseSize(),\n\t\t\tpageOffset: event.pageOffset,\n\t\t\thandleNumbers: data.handleNumbers,\n\t\t\tbuttonsProperty: event.buttons,\n\t\t\tlocations: scope_Locations.slice()\n\t\t});\n\n\t\tvar endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\tvar outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n\t\t\ttarget: event.target,\n\t\t\thandle: handle,\n\t\t\tlisteners: listeners,\n\t\t\thandleNumbers: data.handleNumbers\n\t\t});\n\n\t\t// We want to make sure we pushed the listeners in the listener list rather than creating\n\t\t// a new one as it has already been passed to the event handlers.\n\t\tlisteners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\tscope_Body.style.cursor = getComputedStyle(event.target).cursor;\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( scope_Handles.length > 1 ) {\n\t\t\t\taddClass(scope_Target, options.cssClasses.drag);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t// In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n\t\t\t// which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n\t\t\t// meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n\t\t\t// The 'cursor' flag is false.\n\t\t\t// See: http://caniuse.com/#search=selectstart\n\t\t\tscope_Body.addEventListener('selectstart', preventDefault, false);\n\t\t}\n\n\t\tdata.handleNumbers.forEach(function(handleNumber){\n\t\t\tfireEvent('start', handleNumber);\n\t\t});\n\t}" ]
[ "0.6100532", "0.6073405", "0.59625244", "0.59483385", "0.59252113", "0.591721", "0.5884206", "0.58506626", "0.58044666", "0.5775045", "0.57722443", "0.5729432", "0.56970394", "0.5687678", "0.5672379", "0.5656421", "0.56384003", "0.5634263", "0.561522", "0.56138086", "0.56124187", "0.5592007", "0.55737233", "0.5568646", "0.5562106", "0.5562013", "0.55580986", "0.5552803", "0.5546878", "0.5546213", "0.5526815", "0.55257225", "0.55180407", "0.54892033", "0.5482099", "0.5479908", "0.54786235", "0.5477699", "0.5474985", "0.5472014", "0.54679894", "0.5461003", "0.54479206", "0.5445817", "0.54415584", "0.54278916", "0.54241073", "0.5423198", "0.54135454", "0.54122365", "0.53963315", "0.5394753", "0.5394426", "0.5392", "0.53887224", "0.53864306", "0.53864306", "0.53864306", "0.53864306", "0.5378598", "0.53760797", "0.5375081", "0.5371442", "0.53640676", "0.53621954", "0.5346074", "0.53431875", "0.53425646", "0.5338278", "0.5330315", "0.5328394", "0.5319157", "0.53108585", "0.53070855", "0.5301934", "0.5301934", "0.5301425", "0.5300963", "0.53007156", "0.5296866", "0.5291699", "0.5289656", "0.52847725", "0.5280562", "0.5276837", "0.5264531", "0.52645", "0.52645", "0.52645", "0.52581996", "0.52557945", "0.52545476", "0.52447516", "0.5241444", "0.5237793", "0.5237765", "0.52375793", "0.5237491", "0.52359045", "0.52359045", "0.52359045" ]
0.0
-1
TODO: Check if can remove `target` from broadcasted data, from all/some handlers
function dragstart(e) { if (!isRootElementOfEvent(e)) return; const dataTransfer = e._rawEvent.dataTransfer; dataTransfer.effectAllowed = 'move'; broadcast(addData({ type: 'dragstart', target: e.target, dataTransfer, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAnnotationSend(target){\n socket.emit(\"post_remove_annotation\", {target: target});\n}", "setTarget(target) {\n const currentTarget = this._targetStream.value;\n if (target === currentTarget) {\n return;\n }\n // Clear the listeners from the pre-existing target.\n if (currentTarget) {\n this._clearListeners();\n this._pending = [];\n }\n this._targetStream.next(target);\n // Add the listeners that were bound before the map was initialized.\n this._pending.forEach(subscriber => subscriber.observable.subscribe(subscriber.observer));\n this._pending = [];\n }", "setTarget(target) {\n if (target === this._target) {\n return;\n }\n // Clear the listeners from the pre-existing target.\n if (this._target) {\n this._clearListeners();\n this._pending = [];\n }\n this._target = target;\n // Add the listeners that were bound before the map was initialized.\n this._pending.forEach(subscriber => subscriber.observable.subscribe(subscriber.observer));\n this._pending = [];\n }", "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "receiveMessage({data, target}) {\n data.forEach(msg => {\n if (msg) {\n let handlers = Array.from(this.getHandlers(msg.messageName,\n msg.sender || null,\n msg.recipient));\n\n msg.target = target;\n this.callback(handlers, msg);\n }\n });\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "function nu(t, e) {\n t.kh.on(e.targetId), _u(t).uh(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}", "bind(target) {\n const filters = this.props.filters || [];\n for (const event of this.props.events) {\n this.bucket.addEventNotification(event, new notifs.LambdaDestination(target), ...filters);\n }\n }", "function _removeEventListeners(target) {\n for (var i in this._eventOutput.listeners) {\n target.removeEventListener(i, this.eventForwarder);\n }\n }", "function _removeEventListeners(target) {\n for (var i in this.eventHandler.listeners) {\n target.removeEventListener(i, this.eventForwarder);\n }\n }", "function target() {}", "function destroy(target) {\n\n // Start the list of elements to be unbound with the target.\n var elements = [[target, '']];\n\n // Get the fields bound to both handles.\n $.each(target.data('base').data('handles'), function () {\n elements = elements.concat($(this).data('store').elements);\n });\n\n // Remove all events added by noUiSlider.\n $.each(elements, function () {\n if (this.length > 1) {\n this[0].off(namespace);\n }\n });\n\n // Remove all classes from the target.\n target.removeClass(clsList.join(' '));\n\n // Empty the target and remove all data.\n target.empty().removeData('base options');\n }", "function Wo(t, e) {\n var n = m(t);\n n.Hu.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Hu.set(e.targetId, e), $o(n) ? \n // The listen will be sent in onWatchStreamOpen\n Yo(n) : ls(n).uu() && Qo(n, e));\n}", "function removeEvent(target, event_name) {\r\n var removeAPI, events, len, i, handler;\r\n\r\n if (target.events === undefined) {\r\n target.events = {};\r\n }\r\n\r\n if (target.detachEvent) {\r\n // IE browser.\r\n removeAPI = 'detachEvent';\r\n } else if (target.removeEventListener) {\r\n // Other browser\r\n removeAPI = 'removeEventListener';\r\n }\r\n\r\n if (removeAPI === undefined) {\r\n // For old browser.\r\n delete target['on' + event_name];\r\n } else {\r\n events = target.events[event_name];\r\n\r\n if (events !== undefined) {\r\n len = events.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n handler = events[i];\r\n target[removeAPI](event_name, handler);\r\n delete target.events[event_name];\r\n }\r\n }\r\n }\r\n }", "setupTargetData(newTarget) {\n if (this.target) {\n this.remoteHeadingobserver.disconnect();\n }\n this.target = newTarget;\n // add a backdoor for hax to have a hook into this\n this._haxSibling = this;\n // @todo need to add some kind of \"if this gets deleted let me know\"\n // or a hook that basically blocks this being deleted because it\n // is under control of the page-break tag\n this.remoteHeadingobserver.observe(this.target, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }", "function track(target) {\n if (arguments.length === 1) {\n return reactiveMembrane.getProxy(target);\n }\n\n throw new Error();\n }", "function Bo(t, e) {\n var n = C(t);\n n.Ur.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Ur.set(e.targetId, e), Qo(n) ? \n // The listen will be sent in onWatchStreamOpen\n zo(n) : as(n).ar() && Go(n, e));\n}", "function RemoveTarget()\n{\n target = null;\n targetId = null;\n compassInUse = false;\n}", "discardTarget() {\n App.pathFinder.data.target_selected = false;\n App.pathFinder.data.target_type = App.targeting.target_types.none;\n App.pathFinder.data.target.id = null;\n App.pathFinder.data.target.translate = false;\n App.pathFinder.data.target.coordinates = [0, 0];\n App.pathFinder.data.target.time_selected = null;\n App.UI.targetSelected(false);\n }", "function clearTarget() {\n\thasTarget = false;\n}", "get target(){ return this.__target; }", "__removeBroadcastEventListeners() {\n let bindEvents = this._bindBroadcastEvents;\n /* istanbul ignore next */\n if (!bindEvents) {\n return;\n }\n\n bindEvents.forEach(item => eventCenter.off(item[0], item[1]));\n this._bindBroadcastEvents = [];\n }", "function yi(t, e) {\n t.Lh.cn(e.targetId), Pi(t).hh(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}", "get target () {\n\t\treturn this._target;\n\t}", "get target () {\n\t\treturn this._target;\n\t}", "get target () {\n\t\treturn this._target;\n\t}", "popBroadcast() { // Accepts arguments.\n\t\tif (this.observers.length > 0) {\n\t\t\tconst o = this.observers[this.observers.length - 1];\n\t\t\to.fn.apply(o.ctx, o.arguments);\n\t\t}\n\t}", "function UpdateTarget(t)\n{\n target = t;\n}", "function unbind(target){\n target.unbind('.' + name);\n }", "normalizeTarget(event) {\n return event.assignmentRecord;\n }", "getTarget()\n {\n //console.log(\"getTarget\");\n var isect = this.raycast(0,0);\n if (isect) {\n //console.log(\"setting target from intersect\");\n var target = isect.point;\n var d = this.getCamPos().distanceTo(target);\n if (d < this.maxTrackballDistance) {\n console.log(\"using target d: \"+d);\n this.target = target.clone();\n return;\n }\n console.log(sprintf(\"not using target - d: %f > maxD: %f!\", d, this.maxTrackballDistance));\n }\n console.log(\"setting target without intersect\");\n var cam = this.game.camera;\n //var wv = cam.getWorldDirection();\n var wv = this.getCamForward();\n var d = 2;\n this.target = cam.position.clone();\n this.target.addScaledVector(wv, d);\n }", "function qo(t, e) {\n t.qr.U(e.targetId), is(t).mr(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}", "get target() {\n\t\treturn this.__target;\n\t}", "get target() {\n\t\treturn this.__target;\n\t}", "onDispatch(data) {\n console.log(\"signal-client onDispatch\");\n var self = this;\n self.emit('dispatch', {selfId: data.sourceId, targetId: data.targetId});\n }", "stopMove(thisArg) {\n thisArg.models.forEach(([socket, grId]) => {\n socket.emit(\"stop_move\", {\"id\": grId});\n });\n }", "function pRemoveEvent(target,type,listner,useCapature) {\n if(target.detachEvent) \n target.detachEvent(type[0], listner); \n else \n target.removeEventListener([1], listner, useCapature);\n}", "function emitMessage (payload, type = 'general', target = 'all', socketId = null) {\n const message = { payload: payload, type: type }\n if (target === 'all') {\n io.emit('message', message)\n } else if (target === 'others') {\n // TODO: there is a way to send to all other people using socket.broadcast.emit.... but how to hook that up easily?\n // TODO: give this some thought. Could we pass the socket into here?\n PLAYERS.playersPublicInfo().forEach(player => {\n if (player.socketId !== socketId) {\n io.to(`${player.socketId}`).emit('message', message)\n }\n })\n } else { // self\n io.to(`${socketId}`).emit('message', message)\n }\n}", "unbind() {\n this.updateTarget(emptyArray);\n this.source = null;\n\n if (this.shouldUpdate) {\n this.disconnect();\n }\n }", "glitch (target = 'all', _callback) {\n if (typeof target !== 'string' && !_callback) {\n _callback = target;\n target = 'all';\n }\n\n const wrapper = (callback) => {\n return this.frames.each((frame) => {\n if (this.valid_target(target, frame)) {\n // data = callback frame\n // frame.data = if data? then data else new Buffer(0)\n const data = callback(frame.data);\n if (data || data === null) {\n return data;\n }\n else {\n return frame.data;\n }\n }\n else {\n return frame.data;\n }\n });\n };\n\n if (_callback) {\n wrapper(_callback);\n return this;\n }\n else {\n return wrapper;\n }\n }", "set target(value) {}", "stop () {\n const priv = privs.get(this)\n if (!priv.receiving) return\n priv.receiving = false\n priv.emitter.removeListener(priv.eventName, priv.receive)\n if (priv.watchError) {\n priv.emitter.removeListener('error', priv.receiveError)\n }\n priv.emitter = null\n priv.receive = null\n priv.receiveError = null\n priv.fail = null\n priv.updated = null\n priv.values = null\n }", "function wrappedHandler() {\r\n\t\t\t\t// remove ourself, and then call the real handler with the args passed to this wrapper\r\n\t\t\t\thandler.apply(obj.off(eventName, wrappedHandler), arguments);\r\n\t\t\t}", "unset() {\n if (is.string(this.target)) {\n // remove delegated events\n for (const type in this._scopeEvents.delegatedEvents) {\n const delegated = this._scopeEvents.delegatedEvents[type];\n\n for (let i = delegated.length - 1; i >= 0; i--) {\n const {\n selector,\n context,\n listeners\n } = delegated[i];\n\n if (selector === this.target && context === this._context) {\n delegated.splice(i, 1);\n }\n\n for (let l = listeners.length - 1; l >= 0; l--) {\n this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1]);\n }\n }\n }\n } else {\n this._scopeEvents.remove(this.target, 'all');\n }\n }", "unset() {\n if (is.string(this.target)) {\n // remove delegated events\n for (const type in this._scopeEvents.delegatedEvents) {\n const delegated = this._scopeEvents.delegatedEvents[type];\n\n for (let i = delegated.length - 1; i >= 0; i--) {\n const {\n selector,\n context,\n listeners\n } = delegated[i];\n\n if (selector === this.target && context === this._context) {\n delegated.splice(i, 1);\n }\n\n for (let l = listeners.length - 1; l >= 0; l--) {\n this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1]);\n }\n }\n }\n } else {\n this._scopeEvents.remove(this.target, 'all');\n }\n }", "remove() {\n this.target.removeListener(this.event, this.callback, {\n context: this.context,\n remaining: this.remaining\n });\n }", "socketBroadcast() {\n const msg = this.buildMsg('RECORDS', undefined, this.bufBroadcast);\n this.socketDoBroadcast(msg);\n this.bufBroadcast.length = 0;\n }", "function _clearSearchTargetVariables(o) {\n o.target = undefined;\n delete o.target;\n [0,1,2,3,4,5,6,7,8,9].forEach(function(i) {\n o['target' + i] = undefined;\n delete o['target' + i];\n });\n }", "function ForwardingHandler(target) {\n this.target = target;\n}", "function ForwardingHandler(target) {\n this.target = target;\n}", "function forwardTo(target, options) {\n return send$1(function (_, event) {\n return event;\n }, __assign(__assign({}, options), {\n to: target\n }));\n}", "makeTarget() {\n this.type = Node.TARGET;\n this.state = null;\n }", "function retarget() {\n\t\t$('#target').keypress(function(event) {\n\t\t\tif (event.which == 13) {\n\t\t\t\tsocket.send(JSON.stringify({\n\t\t\t\t\t'type': 'newline',\n\t\t\t\t\t'data': event.which\n\t\t\t\t}));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsocket.send(JSON.stringify({\n\t\t\t\t\t'type': 'data',\n\t\t\t\t\t'data': event.which\n\t\t\t\t}));\n\t\t\t}\n\t\t});\n\t}", "setTarget(target){\n this.target = target;\n }", "function broadcast({ type, data }) {\n const store = asyncLocalStorage.getStore()\n const { sessionId } = store\n if (!sessionId) return logger.debug('Shoudnt happen, no sessionId in asyncLocalStorage store')\n const excludedSocket = gSocketBySessionIdMap[sessionId]\n if (!excludedSocket) return logger.debug('Shouldnt happen, No socket in map', gSocketBySessionIdMap)\n excludedSocket.broadcast.emit(type, data)\n}", "static async rm(target, object) {\n object = object || ApplicationState._state;\n let original_path = target; //save this for notifications\n if (target === 'app')\n return;\n if (!target)\n return;\n\n target = ApplicationState._materializePath(target);\n\n function removeSymlink(target, keep_referrers) {\n let link_target = ApplicationState._symlinks[target];\n delete ApplicationState._symlinks[target];\n\n if (!keep_referrers) {\n let referrers = ApplicationState._reverse_symlinks[link_target];\n referrers.splice(referrers.indexOf(target), 1);\n }\n }\n\n function isSymlink(target) {\n return !!(ApplicationState._symlinks && ApplicationState._symlinks[target]);\n }\n\n function referredTo(target) {\n return !!(ApplicationState._reverse_symlinks && ApplicationState._reverse_symlinks[target]);\n }\n\n //first, check to see if this is a symlink. If so, just remove it from the symlink trackers\n if (isSymlink(target))\n return removeSymlink(target);\n\n if (referredTo(target)) {\n for (let index = 0; index < ApplicationState._reverse_symlinks[target].length; index++) {\n removeSymlink(target, true);\n }\n delete ApplicationState._reverse_symlinks[target];\n }\n\n let parts = ApplicationState.walk(target);\n let leaf = parts.slice(-1)[0];\n //strip off the leaf\n parts = parts.slice(0, -1);\n\n for (let i = 0; i < parts.length; i++) {\n object = object[parts[i].name];\n if (typeof object === 'undefined')\n throw new Error('Undefined target in ApplicationState.rm: ' + target);\n }\n\n if (leaf.parent_type === \"array\") {\n object.splice(leaf.name, 1);\n } else {\n delete object[leaf.name];\n }\n\n let options = ApplicationState._options[original_path];\n if (!options)\n options = {\n //trigger notifications?\n notify: true,\n //a specific list of paths to exclude from being notified\n exclude_notification_paths: [],\n //a list of specific listener keys that should not be notified of changes\n exclude_notification_listeners: [],\n //is this a changeable object?\n immutable: false,\n //should this value be persisted?\n persist: true,\n //do we want to maintain previous state?\n save_previous: true\n };\n await ApplicationState.notify(original_path, false, options);\n }", "function y(t){if(null!=t&&null!=t._parent)for(const e in t._handlers)t._parent.removeListener(e,t._handlers[e])}", "get target() {}", "function Mo(t, e) {\n var n = O(t);\n n.Or.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Or.set(e.targetId, e), Bo(n) ? \n // The listen will be sent in onWatchStreamOpen\n Uo(n) : rs(n).er() && Vo(n, e));\n}", "resetTargetObject () {\n this._targetObject = null;\n }", "function onDrop(source, target) {\n //emits event after piece is dropped\n var room = formEl[1].value\n socket.emit('Dropped', { source, target, room })\n}", "handleRemoteData({ receiveHandler = {} }) {\n// console.log('handleRemoteData');\n const { data: handlerData } = receiveHandler;\n if (_.isEmpty(handlerData)) {\n return;\n }\n\n Object.keys(handlerData).forEach((id) => {\n const { type, data } = handlerData[id] || {};\n if (\n _.findIndex(this.sendBuffers, { id }) === -1 &&\n this.executeCheckList.indexOf(id) === -1\n ) {\n const sendData = this.makeData(type, data);\n this.sendBuffers.push({\n id,\n data: sendData,\n index: this.executeCount,\n });\n }\n });\n }", "_stopPropagationIfTargetIsMe(event) {\n if (event.eventPhase === _index3.Event.AT_TARGET && event.target === this.node) {\n event.propagationStopped = true;\n }\n }", "constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) {\n /** @internal */\n this.source = null;\n /** @internal */\n\n this.context = null;\n /** @internal */\n\n this.bindingObserver = null;\n this.target = target;\n this.binding = binding;\n this.isBindingVolatile = isBindingVolatile;\n this.bind = bind;\n this.unbind = unbind;\n this.updateTarget = updateTarget;\n this.targetName = targetName;\n }", "function broadcast({ type, data }) {\n const store = asyncLocalStorage.getStore();\n const { sessionId } = store;\n if (!sessionId) {\n return logger.debug('no sessionId in asyncLocalStorage store');\n }\n const excludedSocket = gSocketBySessionIdMap[sessionId];\n if (!excludedSocket) {\n return logger.debug('Shouldnt happen, No socket in map', gSocketBySessionIdMap);\n }\n excludedSocket.broadcast.emit(type, data);\n}", "function q(){this.evTarget=tt,this.targetIds={},T.apply(this,arguments)}", "propagationReceived(fromId, signalId, value) {\n //Not needed\n }", "stop() {\n this.target = null;\n }", "get target() {\n\t\treturn this._t;\n\t}", "forget(target, listener, defaults) : Function {\n const emitter = this.getEmitter(listener);\n return (event, options) => {\n return target.removeEventListener(event, listener[event], { ...defaults, ...options });\n }\n }", "function broadcast({ type, data }) {\n const store = asyncLocalStorage.getStore();\n const { sessionId } = store;\n if (!sessionId)\n return logger.debug(\n \"Shoudnt happen, no sessionId in asyncLocalStorage store\"\n );\n const excludedSocket = gSocketBySessionIdMap[sessionId];\n if (!excludedSocket)\n return logger.debug(\n \"Shouldnt happen, No socket in map\",\n gSocketBySessionIdMap\n );\n excludedSocket.broadcast.emit(type, data);\n}", "unsubscribeAll() {\n this._eventTargetMap.forEach((target, eventName) => {\n const handler = this._eventHandlerMap.get([eventName, target]);\n if (handler) {\n this.unsubscribe(target, eventName, handler);\n }\n });\n }", "value(state, action, target) {\n\t\ttarget = target == null ? this.net : this.target\n\t\ttarget.forward(state)\n\t\treturn target.out.w[action]\n\t}", "function del(target, key) {\n if (_.isArray(target)) {\n target.splice(key, 1);\n return;\n }\n var ob = target.__ob__;\n if (!_.has(target, key)) {\n return;\n }\n if (!ob) {\n delete target[key];\n return target;\n }\n delete ob.value[key];\n target = defineReactive(ob.value, ob);\n notify(ob, key, ob.dep);\n return target;\n }", "_onTweenerRemove () {}", "_stopPropagationIfTargetIsMe(event) {\n if (event.eventPhase === Event.AT_TARGET && event.target === this.node) {\n event.propagationStopped = true;\n }\n }", "stop() {\n this.target = null;\n }", "function getTarget() {\n return {\n dummy: function (arg) { return arg; }\n };\n }", "function ServerBuzzSawNewChaser(data) {\n if(buzz) {\n buzz.setTarget(data);\n }\n}", "broadcastPrompt(target) {\n const content = {\n gameModule: this.round.gameModule,\n objective: this.round.objective,\n rules: this.round.rules.rules,\n scoring: this.round.rules.scoring,\n inputBar: this.round.inputBarMessage,\n promptBanner: this.round.rules.promptBanner\n }\n\n target ?\n this.messager.sendClientMessage(\n this.messager.parcelMessage(\n content, target, \"incomingPrompt\")\n )\n\n : this.messager.broadcastMessage(\n this.messager.parcelMessage(\n content, null, \"incomingPrompt\")\n );\n }", "broadcast({userid, data, ignored = null, preventBroadcast = false}) {\n const user = userMap[userid];\n const websockets = ((user && user.websockets) || []);\n\n if (typeof data === 'object') {\n data = JSON.stringify(data);\n }\n\n for (let i = 0, l = websockets.length; i < l; i++) {\n const socket = websockets[i];\n\n if (socket !== ignored && socket.readyState === 1) {\n socket.send(data);\n }\n }\n\n if (!preventBroadcast) {\n\n // Notify other instances\n process.send({\n type: 'process:msg',\n data: {\n action: 'broadcast',\n userid,\n data\n }\n });\n }\n }", "getSelectedTarget() {\n this.socket.emit('get_selected_target');\n return false;\n }", "function newTarget() {\n randomBucketReq();\n displayTarget();\n speechBubble();\n}", "function tu(t, e) {\n var n = O(t);\n n.xh.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.xh.set(e.targetId, e), ou(n) ? \n // The listen will be sent in onWatchStreamOpen\n iu(n) : _u(n).Hu() && nu(n, e));\n}", "send(data){\n Flow.from(this.listeners).where(listener => listener.notify && Util.isFunction(listener.notify)).foreach(listener => listener.notify(data));\n Flow.from(this.listeners).where(listener => !(listener.notify && Util.isFunction(listener.notify)) && Util.isFunction(listener)).foreach(listener => listener(data));\n }", "removeTweens(target) {\n if (!target) return\n\n const { _objects } = this\n\n for (let i = _objects.length - 1; i >= 0; --i) {\n const tween = _objects[i]\n if (tween && tween.target === target) {\n tween.removeEventListener(Event.REMOVE_FROM_JUGGLER, this.onRemove)\n _objects[i] = null\n this._objectIDs.delete(tween)\n }\n }\n }", "function di(t, e) {\n var n = D(t);\n n.Nh.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Nh.set(e.targetId, e), wi(n) ? \n // The listen will be sent in onWatchStreamOpen\n mi(n) : Pi(n).Ju() && yi(n, e));\n}", "function hiLite() {\n // toggle target active / inactive\n let target = event.target;\n console.log(target.id);\n}", "stopGrip(thisArg) {\n // send a request to each subscribed model\n thisArg.models.forEach(([socket, grId]) => {\n socket.emit(\"stop_grip\", {\"id\":grId});\n });\n }", "setTarget(obj) {\n this.target = obj;\n }", "handlerWillRemove (event, handler) {\n\n }", "function clickTarget(e) {\n if (e.target !== animateDropdownToggler) {\n hideMenus();\n }\n}", "function handleDrag(ev, broadcast) {\n // Ignore other events\n if (!isDragEvent(ev)) return;\n\n const data = this.data;\n const delegator = hg.Delegator();\n const _target = ev.currentTarget;\n let listenersAdded = false; // TODO: Check if can remove this\n\n if (ev.type === 'dragstart') {\n const triggerDragstart = !listenersAdded;\n addListeners();\n if (triggerDragstart) dragstart(ev);\n }\n\n // TODO: Check if can remove `target` from broadcasted data,\n // from all/some handlers\n function dragstart(e) {\n if (!isRootElementOfEvent(e)) return;\n\n const dataTransfer = e._rawEvent.dataTransfer;\n dataTransfer.effectAllowed = 'move';\n\n broadcast(addData({\n type: 'dragstart',\n target: e.target,\n dataTransfer,\n }));\n }\n\n function dragend(e) {\n if (!isRootElementOfEvent(e)) return;\n\n removeListeners();\n\n broadcast(addData({\n type: 'dragend',\n target: e.target,\n }));\n }\n\n function addData(additional) {\n return Object.assign({}, data, additional);\n }\n\n function isRootElementOfEvent(e) {\n return e.target === _target;\n }\n\n function addListeners() {\n if (listenersAdded) return;\n\n delegator.addGlobalEventListener('dragstart', dragstart);\n delegator.addGlobalEventListener('dragend', dragend);\n listenersAdded = true;\n }\n\n function removeListeners() {\n if (!listenersAdded) return;\n\n delegator.removeGlobalEventListener('dragstart', dragstart);\n delegator.removeGlobalEventListener('dragend', dragend);\n listenersAdded = false;\n }\n}", "function report_target(e){ \n console.log('New event triggered on: ' + e.target);\n}", "function broadcast(evt, data) {\n var msg = {};\n var json = toJSON(data);\n msg[evt] = _.isUndefined(json) ? true : json;\n outProc(msg, null);\n }", "function setTarget(target) {\n this.target = target;\n}", "function clearMessageData(handler) {\n var dispatcher = dispatcherMap.get(handler);\n if (dispatcher)\n dispatcher.clear();\n dispatchQueue.removeAll(handler);\n}", "function emitSystemMessage(id, action, target){\n var out = {\n type: 'system',\n action: action,\n id: id,\n target: target\n }\n io.sockets.emit('chat', out);\n}", "function broadcast(type,obj,except=null){\n\tobj.type = type;\n\tserver.clients.forEach(client => {\n\t\tif(except === null || except.uniqueHash !== client.uniqueHash){\n\t\t\tclient.send(JSON.stringify(obj));\n\t\t}\n\t});\n}", "function EventTarget(){this._listeners={};}" ]
[ "0.6394324", "0.63056266", "0.6016593", "0.58996993", "0.5875666", "0.58462334", "0.58462334", "0.58422077", "0.5823778", "0.5728211", "0.5727897", "0.5705462", "0.5689707", "0.5669575", "0.56140935", "0.56056416", "0.5573051", "0.55537456", "0.5551862", "0.5537343", "0.55238473", "0.55046695", "0.54869854", "0.5452954", "0.544722", "0.544722", "0.544722", "0.54202926", "0.54039776", "0.5388977", "0.53864753", "0.5375955", "0.5344803", "0.53295434", "0.53295434", "0.5326216", "0.5323193", "0.53099906", "0.5308213", "0.5295362", "0.5285469", "0.5275821", "0.5273913", "0.5273146", "0.5263471", "0.5263471", "0.5261836", "0.5252155", "0.52450955", "0.52418625", "0.52418625", "0.52357364", "0.52338463", "0.5228612", "0.52139443", "0.5213725", "0.5213001", "0.5193026", "0.5192796", "0.51902574", "0.5156653", "0.51540613", "0.5153758", "0.5148666", "0.51458764", "0.5143692", "0.5142218", "0.51048696", "0.5100614", "0.5098348", "0.50889605", "0.50870514", "0.5085792", "0.507917", "0.5075611", "0.50735486", "0.50707376", "0.5054726", "0.5046104", "0.50434184", "0.50398785", "0.50353473", "0.5034764", "0.50328624", "0.5030786", "0.5026422", "0.5025538", "0.5025441", "0.50250053", "0.5016561", "0.5012462", "0.50124276", "0.5008606", "0.5005657", "0.49865824", "0.49852872", "0.49847007", "0.49799046", "0.49791357", "0.49714485", "0.49678445" ]
0.0
-1
Call to the server
function activateTrygger(trygger){ var q= queryfyText(trygger); return postToServer ("activate?trygger=", q); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_server() {\n console.log(\"Calling the server\");\n if (self.vue.chosen_magic_word === null) {\n console.log(\"No magic word.\");\n setTimeout(call_server, call_interval);\n } else {\n // We can do a server call.\n // Add a bit of random delay to avoid synchronizations.\n var extra_delay = Math.floor(Math.random() * 1000);\n $.ajax({\n dataType: 'json',\n url: server_url +'read',\n data: {key: self.vue.chosen_magic_word},\n success: self.process_server_data,\n complete: setTimeout(call_server, call_interval + extra_delay) // Here we go again.\n });\n }\n }", "function server_call(type, content, who=IAm, service=server_answer) { //type: \"POST\", \"GET\"\n\t//set callbacks:\n\tCS_callback = service;\n\tCS_whoWas = who;\n\tvar caller = new XMLHttpRequest();\n\tcaller.onreadystatechange=function() {\n\t\tif (caller.readyState==4 && caller.status==200) {\n\t\t\tCS_callback(caller.responseText);\n\t\t}\n\t}\n\tif (type == \"GET\") {\n\t\tvar URL_delim = \"&\"; if (who.indexOf(\"?\") == -1 ) URL_delim = \"?\";\n\t\tcaller.open(\"GET\", who + URL_delim + \"servercall=g&\" + content, true);\n\t\tcaller.send(null);\n\t} else {\n\t\tcaller.open(\"POST\", who, true);\n\t\tcaller.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\t\tcaller.send(\"servercall=p&\" + content);\n\t}\n}", "function callTourGeneration(){\n\t\tdisableButtons();\n\t\tclearAll();\n\n\t\tvar parameters = Parameters.getAllParameters();\n\t\tvar callUri = Parameters.getUrlForTourGenerationRequest(serverUri, parameters);\n\t\t$.get(callUri, handleTourResult)\n\t\t.fail(function(xhr, status, error) {clearAll()\n\t\t\t$(\"#displayedMessage\").html('<span class=\"message_error\">Error when trying to call server.</span>');\n\t\t\tenableButtons();\n\t\t});\n\t}", "function call_server(command, dataObj) {\n print(\"Server call - Command, DataObject -> \" + command + \" \"\n + JSON.stringify(dataObj));\n print(\"\");\n var msg = {\n \"action\" : command,\n \"data\" : dataObj.content\n };\n ws.send(JSON.stringify(msg));\n}", "function ElstrServerRpcCallsAdmin (){}", "function call_server() {\n if (self.vue.chosen_magic_word === null) { \n console.log(\"No Magic Word\");\n setTimeout(call_server, call_interval);\n } else {\n //removed random delay to avoid synchronizations cause fuck that. &edit&\n //var extra_delay = Math.floor(Math.random() * 1000);\n console.log(\"Yo server what's good? | call_server()\");\n $.ajax({ //server call via ajax\n dataType: 'json',\n url: server_url +'read',\n //added BRAINBLAST to key so I don't run into your games.\n data: {key: \"BRAINBLAST\"+ self.vue.chosen_magic_word},\n success: self.process_server_data,\n complete: setTimeout(call_server, call_interval) // rm extra delay\n });\n }\n }", "function callNode(requestNodo){\n\tconsole.log(\"Get \",requestNodo);\n\trequest(requestNodo, function(error, response, body) {\n\t\tif(!error){\n\t\t\t//No pude hacer que guarde aca porque para las busquedas grandes\n\t\t\t//parece que se va por timeout aca y no espera a la respuesta\n\t\t\tconsole.log(body);\n\t\t}\n\t});\n}", "function callme() {\n\n console.log('Yes we are lsiten on the port 8888');\n}", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "async send(request, response) {}", "function call(method, url, params, callback) {\n\n var options = { uri: url, method: method }\n\n if (url.match(/subscriptions/)) {\n if (config.clientID && config.clientSecret)\n options.headers = { 'Authorization': 'Basic ' + new Buffer(config.clientID + ':' + config.clientSecret).toString('base64') }\n } else {\n if (config.token)\n options.headers = { 'Authorization': 'Bearer ' + config.token.token.access_token }\n }\n\n options.json = true; // make the JSON response being parsed\n\n if (isEmpty(params)) params = null;\n method == 'GET' ? options.qs = params : options.json = params\n\n if (process.env.DEBUG) console.log('Lelylan Node: Making the HTTP request', options)\n request(options, callback)\n }", "function invokeServer(syncMode) {\n\tvar className = \"flowMapSolutions_dev.EzPassData\";\n\tvar webORBURL = \"http://flowmap.nyctmc.org/weborb4/weborb.aspx\";\n\tproxy = webORB.bind(className, webORBURL);\n\tproxy.getMidtownEzPassLocations(new Async(successReaderLocation, errorDownloadingData));\n\t//proxy.getMidtownEzpassLinks(new Async(successMimPolylines, errorDownloadingData));\n\tproxy.getWebCameras(new Async(successGotCamera, errorDownloadingData));\n}", "function call_server(params) {\n var method = params.method,\n url = params.url,\n data = params.data,\n async = typeof params.async !== \"undefined\" ? params.async : true,\n salt = Date.now();\n if (async) {\n return new Promise( function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.onload = function () {\n if (this.status == 200) {\n resolve( JSON.parse(this.response, veda.Util.decimalDatetimeReviver) );\n } else {\n reject( new BackendError(this) );\n }\n };\n xhr.onerror = function () {\n reject( new BackendError(this) );\n };\n if (method === \"GET\") {\n var params = [];\n for (var name in data) {\n if (typeof data[name] !== \"undefined\") {\n params.push(name + \"=\" + encodeURIComponent(data[name]));\n }\n }\n params.push(salt);\n params = params.join(\"&\");\n xhr.open(method, url + \"?\" + params, async);\n xhr.timeout = 120000;\n xhr.send();\n } else {\n xhr.open(method, url + \"?\" + salt, async);\n xhr.timeout = 120000;\n xhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n var payload = JSON.stringify(data, function (key, value) {\n return key === \"data\" && this.type === \"Decimal\" ? value.toString() : value;\n });\n xhr.send(payload);\n }\n });\n } else {\n var xhr = new XMLHttpRequest();\n if (method === \"GET\") {\n var params = [];\n for (var name in data) {\n if (typeof data[name] !== \"undefined\") {\n params.push(name + \"=\" + encodeURIComponent(data[name]));\n }\n }\n params.push(salt);\n params = params.join(\"&\");\n xhr.open(method, url + \"?\" + params, async);\n xhr.send();\n } else {\n xhr.open(method, url + \"?\" + salt, async);\n xhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n var payload = JSON.stringify(data, function (key, value) {\n return key === \"data\" && this.type === \"Decimal\" ? value.toString() : value;\n });\n xhr.send(payload);\n }\n if (xhr.status === 200) {\n // Parse with date & decimal reviver\n return JSON.parse(xhr.responseText, veda.Util.decimalDatetimeReviver);\n } else {\n throw new BackendError(xhr);\n }\n }\n }", "function nlobjServerResponse() {\n}", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantUtorid')\n\t\t .query({studentNum: parseInt(applicant.studentNumber)})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(200); // response status\n\t\t\t \n\t\t\t // check that applicant has expected property\n\t\t\t expect(res.body.data).to.equal(applicant.UTORid);\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "Ping() {\n\t\tServer.SendMessage(\"/ping\");\n\t}", "function make_call(query, callback){\n\tvar postRequest = {\n\t host: \"api.trafikinfo.trafikverket.se\",\n\t path: \"/v1/data.json\",\n\t port: 80,\n\t method: \"POST\",\n\t headers: {\n\t 'Content-Type': 'text/xml',\n\t 'Content-Length': Buffer.byteLength(query)\n\t }\n\t};\n\n\tvar buffer = \"\";\n\tvar req = http.request(postRequest, function( res ) {\n\n\t\tconsole.log( res.statusCode );\n\t\tvar buffer = \"\";\n\t\tres.on( \"data\", function( data ) { buffer = buffer + data; } );\n\t\tres.on( \"end\", \n\t\t\tfunction( data ) { \n\t\t\t \tcallback(buffer); //return response values\n\t\t\t} \n\t\t);\n\t});\n\n\treq.on('error', function(e) {\n\t console.log('problem with request: ' + e.message);\n\t});\n\n\treq.write( query );\n\treq.end();\n\n}", "function connectToServer() {\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('GET','http://127.0.0.1:5000');\n\t\t\t\txhr.onload = function() {\n\t\t\t\t\tif(this.status === 200) {\n\t\t\t\t\t\tconsole.log(this.responseText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\txhr.send();\n\t\t\t}", "function serverCall(){\t\t \n\n\t\t chai.request(server)\n\t\t .post('/saveTAHistory')\n\t\t .send(requestBody)\n\t\t .end(function(error, response) {\n\t\t\t util.checkBasicStructureApplicantResp(response);\n\t\t\t done();\n\t\t });\n\t }", "function call(req, res) {\n // estatutos...\n}", "function Query(port) {\n let http = require('http');\n\n //We need a function which handles requests and send response\n function handleRequest(request, response){\n let param = request.url.split(\"/\");\n let action = param[param.length - 1];\n if(action == \"serverInfo\") {\n let server_config = JSON.parse(g_server.config);\n let server_info = GetServer();\n\n let data = {\n name: server_info.serverName,\n maxPlayers: server_info.maxPlayers,\n serverMode: server_config.mode,\n serverMap: server_config.map,\n playersOnline: g_players.length\n };\n return response.end(JSON.stringify(data));\n return response.end(msg);\n }\n else if(action == \"playersList\") {\n let players = [];\n let msg = \"\";\n for(let p of g_players) {\n players.push({id: p.client.networkId, name: p.name});\n }\n return response.end(JSON.stringify(players));\n return response.end(msg);\n }\n return response.end(\"/serverInfo - Server info\\n/playerList - List of players\");\n }\n\n let server = http.createServer(handleRequest);\n server.listen(port, function(){\n console.log(\"Server listening on: http://localhost:%s\", port);\n });\n}", "function serverConnected() {\n infoData=\"Connected to /node backend\";\n println(\"Connected to /node backend\");\n}", "ServerCallback() {\n\n }", "function send() {\n\t\tconst req = JSON.stringify({\n\t\t\taction: \"Run\",\n\t\t\tcode: codeInput.value.trim(),\n\t\t\tsession: sessionInput.value.trim(),\n\t\t})\n\t\tlet result = session.request(req);\n\t\tgetResultString(result).then(function (str) {\n\t\t\tresultLbl.value = str;\n\t\t});\n\t}", "getClientCalls() {\n\n }", "function send_request(arg1, op, arg2) {\n\t$.ajax(\"http://127.0.0.1:8000/\", {\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t\t\"arg1\": arg1,\n\t\t\t\"arg2\": arg2,\n\t\t\t\"op\": op\n\t\t},\n \tcrossDomain: true,\n \tdataType: \"jsonp\",\n\t\tsuccess: handle_response\n\t});\n}", "function callServer() {\n\n \n\n var urlAppend = \"FormRequest/GetTopStructures?request=\";\n var root = window.location\n\n var re = new RegExp('^(?:f|ht)tp(?:s)?\\://(.*?)/(.*?)/', 'im');\n var mat = root.toString().match(re)[0];\n\n var Url = mat + urlAppend + lab + \",\" + source + \",\" + typeOfCall;\n //alert(Url);\n\n document.getElementById('circuitButton').style.display = \"none\";\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = ProcessRequest;\n xmlHttp.open(\"GET\", Url, true);\n\n xmlHttp.send(null);\n\n}", "Call(req) {\n return this.api.Request(req, this.player.playerInfo)\n }", "function getStatusServer() {\r\n _doGet('/status');\r\n }", "function callAction() {\n console.log('Starting call.');\n startTime = window.performance.now();\n\n // Get local media stream tracks.\n const videoTracks = localStream.getVideoTracks();\n const audioTracks = localStream.getAudioTracks();\n if (videoTracks.length > 0) {\n console.log(`Using video device: ${videoTracks[0].label}.`);\n }\n if (audioTracks.length > 0) {\n console.log(`Using audio device: ${audioTracks[0].label}.`);\n }\n\n\n // Create peer connections and add behavior.\n localPeerConnection = new RTCPeerConnection(servers);\n console.log('Created local peer connection object localPeerConnection.');\n\n localPeerConnection.addEventListener('icecandidate', handleConnection);\n localPeerConnection.addEventListener(\n 'iceconnectionstatechange', handleConnectionChange);\n\n // Add local stream to connection and create offer to connect.\n localPeerConnection.addStream(localStream);\n console.log('Added local stream to localPeerConnection.');\n\n console.log('localPeerConnection createOffer start.');\n localPeerConnection.createOffer(offerOptions)\n .then(createdOffer).catch(setSessionDescriptionError);\n}", "send(request, callback) {\n if (!request)\n callback('Undefined request');\n this.request(request)\n .then((result) => callback(null, { jsonrpc: '2.0', id: request.id, result }))\n .catch((error) => callback(error, null));\n }", "function requestPORT(request, response) {\n response.end(\"Good request! Path hit: \" + request.url);\n}", "function testServer(){\n let _tempUrl = \"http://greenvelvet.alwaysdata.net/kwick/api/ping\";\n $.ajax({\n url: _tempUrl,\n dataType: \"jsonp\",\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n success: function (result, status, xhr) {\n let version = getResultKwick(result, 'ping', 'version');\n let completed_in = getResultKwick(result, 'ping', 'completed_in');\n let _status = getResultKwick(result, 'ping', 'status');\n console.log(version, completed_in,_status);\n },\n error: function (xhr, status, error) {\n console.log(\"Error\");\n }\n });\n }", "start() {\n if (this.server) {\n throw Error(\"InvokeServer already started\")\n }\n this.cb = null\n this.err = null\n this.msg = null\n\n this.server = http.createServer((request,response) => this._recieve(request,response))\n this.server.listen(8999)\n }", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantUtorid')\n\t\t .query({studentNum: 0})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(400); // response status\n\t\t\t \n\t\t\t // check that applicant has expected property\n\t\t\t expect(res.body.data).to.be.empty;\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "function _run() {\n let url = 'https://maker.ifttt.com/trigger/' + this.action + '/with/key/' + this.key;\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open('GET', url, true);\n // xmlhttp.onreadystatechange = (e) => { console.log(e); };\n xmlhttp.send();\n}", "function call() {\n\t// just disable the Call button on the page...\n\tcallButton.disabled = true;\n\n\t// ...and enable the Hangup button\n\thangupButton.disabled = false;\n\tlog(\"Starting call\");\n\n\t// Note: getVideoTracks() and getAudioTracks() are not supported by old version of Mozilla (<2015)\n\tif (localStream.getVideoTracks().length > 0) {\n\t\tlog('Using video device: ' + localStream.getVideoTracks()[0].label);\n\t}\n\tif (localStream.getAudioTracks().length > 0) {\n\t\tlog('Using audio device: ' + localStream.getAudioTracks()[0].label);\n\t}\n\n\tinitRTCPeerConnection();\n\n\t// This is an optional configuration string, associated with NAT traversal setup\n\tvar servers = null;\n\n\t// Create the local PeerConnection object\n\tlocalPeerConnection = new RTCPeerConnection(servers);\n\tlog(\"Created local peer connection object localPeerConnection\");\n\n\t// Add a handler associated with ICE protocol events\n\tlocalPeerConnection.onicecandidate = gotLocalIceCandidate;\n\n\t// Create the remote PeerConnection object\n\tremotePeerConnection = new RTCPeerConnection(servers);\n\tlog(\"Created remote peer connection object remotePeerConnection\");\n\n\t// Add a handler associated with ICE protocol events...\n\tremotePeerConnection.onicecandidate = gotRemoteIceCandidate;\n\n\t// ...and a second handler to be activated as soon as the remote stream becomes available.\n\tremotePeerConnection.onaddstream = gotRemoteStream;\n\n\t// Add the local stream (as returned by getUserMedia()) to the local PeerConnection.\n\tlocalPeerConnection.addStream(localStream);\n\tlog(\"Added localStream to localPeerConnection\");\n\n\t// We're all set! Create an Offer to be 'sent' to the callee as soon as the local SDP is ready.\n\tlocalPeerConnection.createOffer(gotLocalDescription, onSignalingError);\n}", "async execute() {\n await this.startServer();\n\n let userPath = this.parser.getArguments(0) || '';\n if (userPath.endsWith(path.sep)) userPath = userPath.substr(0, userPath.length - 1);\n\n const targetPath = userPath.startsWith('/') ? userPath : path.join(process.cwd(), userPath);\n const stats = await stat(targetPath);\n\n\n if (stats.isDirectory()) {\n const response = await this.httpClient\n .post('/link')\n .expect(201)\n .send({\n linkFrom: path.normalize(targetPath),\n linkTo: path.normalize(process.cwd()),\n });\n\n const data = await response.getData();\n\n } else {\n throw new Error(`Cannot link '${sourcePaths}': path is not a directory!`);\n }\n }", "function main() {\n var client = new protoDefinition.NeoTv('localhost:50051',\n grpc.credentials.createInsecure());\n\n \n app.get('/', (req, res) => res.send('Hello World!'))\n app.get('/neotv', (req, res) => {\n const data = req.query;\n return client.GetNeoTvStatus({username: data.username, password: data.password, carrier: data.carrier}, (err, status) => {\n res.send(status);\n })\n })\n\n app.listen(port, () => console.log(`Example app listening on port ${port}!`))\n app.use(bodyParser.json());\n}", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantByStudentNumber')\n\t\t .query({studentNumber: applicant.studentNumber})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(200); // response status\n\t\t\t \n\t\t\t expect(res.body.data).to.be.an('object');\n\t\t\t util.compareApplicants(res.body.data, applicant);\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "function requestServerStat() {\n\t\t\t\tvar infoContainers = $('.serverInfoContainer');\n\t\t\t\tfor(var index = 0; index< infoContainers.length; index++){\n\t\t\t\t\tvar request = new InfoRequest(infoContainers[index]);\n\t\t\t\t\trequest.request();\n\t\t\t\t\trequest.startInterval();\n\t\t\t\t}\n\t\t\t}", "async callApi(opts) {\n console.log(`invoking http call: ${util.inspect(opts)}`);\n\n try {\n var result = await request(opts);\n }\n catch(err) {\n console.error(`error invoking request: ${err.message}, opts: ${opts}`);\n return;\n }\n\n console.log(`got result: ${util.inspect(result)}`);\n return result.response;\n }", "function server_ping()\n {\n $http.get('/api/v1/me/ping').success(function (json) {\n //console.log(json);\n }); \n }", "function call (method) {\n if (!method) { return; }\n var params = [].splice.call(arguments, 0);\n post(params.shift(), params);\n}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantByStudentNumber')\n\t\t .query({studentNum: 0})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(400); // response status\n\t\t\t \n\t\t\t // check that applicant has expected property\n\t\t\t expect(res.body.data).to.be.empty;\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "function serverConnected() {\n println(\"Connected to Server\");\n}", "function get_from_server(url, callback) {\n var request = kiwiServer.request(\"GET\", url , {\"host\": SERVER_ADDR});\n var result= \"\";\n request.addListener('response', function (response) {\n response.setBodyEncoding(\"utf8\");\n response.addListener(\"data\", function (chunk) {\n result += chunk;\n });\n response.addListener(\"end\", function (chunk) {\n callback(null, result, response);\n });\n });\n request.close();\n}", "startRequest (player) {\n this.connected = true\n const data = JSON.stringify({player})\n let options = {\n hostname: this.hostname,\n port: this.port,\n agent: this.agent,\n path: '/start', \n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': data.length\n } \n }\n \n let result = this.sendRequest(options,data)\n return result\n }", "sendRequest(command, args, timeout, cb) {\n logger.verbose(`To client: ${JSON.stringify(command)}(${JSON.stringify(args)}), timeout: ${timeout}`);\n super.sendRequest(command, args, timeout, cb);\n }", "function serve() {\n connect.server(serverConfig);\n}", "function http_get(req_url){\n request.get(\n bal_query,\n function(error, response, body) {\n console.log(\"Clickatell GET:\")\n node.send(\"Clickatell GET:\");\n if (!error && response.statusCode == 200) {\n if (DEBUG){\n console.log(body, response)\n }\n console.log(req_url)\n console.log(body)\n node.send(body);\n }\n }\n );\n }", "function execRequest() {\n setInterval(handleRefresh, 3000);\n}", "function connect() {\n url = \"http://\" + url + '/api/' + username + '/lights/';\n httpDo(url, 'GET', getLights);\n}", "async function getInfo(ctx) {\n\n console.log(\"GET getInfo\");\n console.log(ctx.request.url)//mostrar la ruta completa de la peticion\n console.log(ctx.request.querystring)//el querystring pero como una cadena\n console.log(ctx.request.method)//el querystring pero como una cadena\n\n var parametros = ctx.request.query;//el query como un objeto\n\n //aqui vamos a utilizar algunos parametros\n\n ctx.body = 'SIMPLE SERVER v.0.1 ' + ctx.request.url ;//devolviendo los resultados.\n}", "function start(){\n// will start the connection\n}", "function sendHeartbeat () {\n var options = {\n host : 'team200-service-lister.mybluemix.net',\n path : '/heartbeat?service='+ id +'&desc=' + escape(desc) + '&url=' + link,\n method : \"GET\"\n };\n\n var callback = function(resp){\n\n resp.on('data', function(data){\n });\n\n resp.on('end', function(){\n console.log('Heartbeat Sent');\n });\n }\n var req = http.request(options, callback);\n req.end();\n}", "function sendHeartbeat () {\n var options = {\n host : 'team200-service-lister.mybluemix.net',\n path : '/heartbeat?service='+ id +'&desc=' + escape(desc) + '&url=' + link,\n method : \"GET\"\n };\n\n var callback = function(resp){\n\n resp.on('data', function(data){\n });\n\n resp.on('end', function(){\n console.log('Heartbeat Sent');\n });\n }\n var req = http.request(options, callback);\n req.end();\n}", "function sendHeartbeat () {\n var options = {\n host : 'team200-service-lister.mybluemix.net',\n path : '/heartbeat?service='+ id +'&desc=' + escape(desc) + '&url=' + link,\n method : \"GET\"\n };\n\n var callback = function(resp){\n\n resp.on('data', function(data){\n });\n\n resp.on('end', function(){\n console.log('Heartbeat Sent');\n });\n }\n var req = http.request(options, callback);\n req.end();\n}", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function startServer() {\n FastMQ.Client.connect('responseChannel', 'master').then((channel) => { // client connected\n console.log(\"Connected\")\n responseChannel = channel;\n responseChannel.response('refresh', (msg, res) => {\n console.log('Receive request payload:', msg.payload);\n // echo request data back;\n let resData = {\n data: msg.payload.data\n };\n res.send(resData, 'json');\n });\n \n }).catch((err) => {\n console.log('Got error:', err.stack);\n setTimeout(startServer, 5000);\n });\n}", "function main() {\n console.log(\"Contacting \" + HOST + \":\" + PORT);\n\n // Set access token and user id for example requests\n var accessToken = '';\n var userId = '';\n \n // Create template callback\n callback = function(err, resp) {\n if (err) console.log(\"Call did not succeed: \" + err);\n else console.log(\"Call succeeded: \" + JSON.stringify(resp));\n };\n\n /*\n * Example usage of getSeedTracks()\n *\n * exports.getSeedTracks(accessToken, userId, callback);\n */\n}", "function showEndpoint(response){\n}", "function gHttpBtnClick() {\n var outputRecordManager = new ndebug.OutputRecordManager();\n var objTelnet = new ndebug.Telnet('www.google.com', 80, outputRecordManager);\n objTelnet.\n setPlainTextDataToSend('GET / HTTP/1.1\\r\\nHost: www.google.com\\r\\n\\r\\n');\n objTelnet.setCompletedCallbackFnc(printFinishedTelnetOutput);\n objTelnet.createSocket();\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to schedule the alert job\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tif (gvMethod === \"Create\" || gvMethod === \"CREATE\") {\n\t\t\t\t\tDeleteJob();\n\t\t\t\t\tScheduleJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule created\"\n\t\t\t\t\t}));\n\t\t\t\t} else if (gvMethod === \"DELETE\" || gvMethod === \"Delete\") {\n\t\t\t\t\tDeleteJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule deleted\"\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, but no action taken, method was not supplied\"\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\n\t\t}\n\t}", "triggerServer(payload) {\r\n\r\n // Send request\r\n Entities.callEntityServerMethod(this.localEntity.id, \"clientRequestForServer\", [JSON.stringify({\r\n plugin: this.constructor.pluginID,\r\n data: payload\r\n })])\r\n\r\n }", "function execute(method, path, args, callback) {\n if(typeof(method) !== 'string') {\n throw new Error('Argument Error: HTTP method was not supplied for execute(), or was not a string');\n }\n\n method = method.toUpperCase();\n\n if(_.indexOf(validMethods, method) === -1) {\n throw new Error('Argument Error: HTTP Method \"'+method+'\" is not supported');\n }\n\n if(typeof(path) === 'undefined') {\n throw new Error('Argument Error: Missing path');\n }\n\n // Build the headers\n headers = {'Content-Type': 'application/json',\n 'User-Agent': 'geoloqi-node '+module.version,\n 'Accept': 'application/json'\n };\n\n if(typeof(auth.access_token) !== 'undefined') {\n headers['Authorization'] = 'OAuth '+auth.access_token;\n }\n\n var postData = '';\n if(method == 'POST') {\n postData = JSON.stringify(args);\n headers['Content-Length'] = postData.length\n }\n\n var httpOptions = {\n host: config.api_url,\n path: '/'+config.api_version+'/'+path,\n method: method,\n headers: headers\n };\n\n var req = https.request(httpOptions, function(res) {\n res.setEncoding('utf-8');\n var all = [];\n res.on('data', function(data) {\n all.push(data);\n });\n res.on('end', function() {\n callback(all.join(''));\n });\n });\n req.end(postData);\n\n req.on('error', function(e) {\n console.log('ERROR WITH EXECUTE!');\n console.log(e);\n callback(null, e);\n });\n }", "function callAtInterval() {\n apiSrvc.getData($rootScope.apiUrl + '/Default.aspx?remotemethodaddon=heartbeat').then(function (response) {\n });\n }", "function serverConnected() {\n infoData=\"Connected to Server\";\n println(\"Connected to Server\");\n}", "GET() {\n }", "function serverCall(hub, methodName, args) {\n var callback = args[args.length - 1],\n methodArgs = $.type(callback) === \"function\" ? args.slice(0, -1) : args,\n argValues = methodArgs.map(getArgValue),\n data = { hub: hub._.hubName, action: methodName, data: argValues, state: copy(hub, [\"_\"]), id: callbackId },\n d = new Deferred(),\n cb = function(result) {\n processHubState(hub._.hubName, hub, result.State); \n if (result.Error) {\n if (result.StackTrace) {\n console.log(result.StackTrace);\n }\n d.rejectWith(hub, [result.Error]);\n } else {\n if ($.type(callback) === \"function\") {\n callback.call(hub, result.Result);\n }\n d.resolveWith(hub, [result.Result]);\n }\n };\n callbacks[callbackId.toString()] = { scope: hub, callback: cb };\n callbackId += 1;\n hub._.connection().send(JSON.stringify(data));\n return d;\n}", "async ping() {\n }", "sendHello() {\n this.write({cmd: 'hello', str: 'Hello, client!'})\n this.write({cmd: 'hello2', str: 'Hello again, client!'})\n }", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to send out all relevant daily notifications\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Get the Routing Entries from the table\n\t\t\t\tvar oRoutes = getRoutes();\n\n\t\t\t\t//Perform Counts and Trigger Notifications\n\t\t\t\t_countAndSend(oRoutes);\n\n\t\t\t\t//Write to the trace\n\t\t\t\t$.trace.info(JSON.stringify({\n\t\t\t\t\tRequestedNotifications: gvRequestedProcessing,\n\t\t\t\t\tProcessedNotifications: gvProcessingCount\n\t\t\t\t}));\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\tgvError = err.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tError: gvError\n\t\t\t}));\n\t\t}\n\t}", "function kodi_request(msg,callback){\n\tconsole.log(JSON.stringify(msg));\n\n\tvar options = {\n\t\thostname: \"BedroomRPi\",\n\t\tport: 80,\n\t\tpath: \"/jsonrpc?request=\"+qs.escape(JSON.stringify(msg)),\n\t\tmethod: \"GET\",\n\t\theaders:{\n\t\t\t'Content-Type': 'application/json'\n\t\t}\n\t}\n\tvar req = http.request(options,function(res){\n\t\tres.setEncoding('utf8');\n\t\tres.on('data',function(chunk){\n\t\t\tconsole.log(chunk);\n\t\t\tcallback(JSON.parse(chunk));\n\t\t});\n\t\n\t});\n\n\treq.on('error',function(e){\n\t\tconsole.log(\"Error Talking to Kodi\", options[\"hostname\"],\n\t\t\t\te.message);\n\t});\n\n\treq.setTimeout(20000,function(e){\n\t\tconsole.log(\"Request Timeout\");\n\t});\n\n\treq.end();\n\n}", "function nlobjRequest() {\n}", "function startServer(){\n listDevices.startAttendaceServer(UserName);\n startMessageServer();\n console.log('did');\n}", "function onListening() {\n log.info('%s listening at %s', config.appName, server.address().address);\n console.log('Server started on %s', server.address().address);\n console.log(`Test using:\\n curl -kisS ${server.address().address}/hello`);\n}", "function doCall(link) {\n http.open(\"GET\", link, false );\n http.timeout = 3000;\n http.send( null );\n return http.responseText;\n }", "function makeCall(id,url,data) {\n request=initRequest();\n response=null;\n \n request.open(\"POST\",url,false); \n request.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8;');\n \n request.send(data);\n \n if (request.status == 200) {\n response=request.responseText;\n }\n \n return response;\n\n }", "function requestcommand(jeedomcmd) {\n\n var myKeyValue, myIPValue, myHttps;\n\n myKeyValue = localStorage.getItem(\"KEY\");\n myIPValue = localStorage.getItem(\"IP\");\n myHttps = \"\";\n if (JSON.parse(localStorage.getItem(\"HTTPS\"))) {\n myHttps = \"s\";\n }\n\n var client = new XMLHttpRequest();\n client.open(\"GET\", \"http\" + myHttps + \"://\" + myIPValue + \"/core/api/jeeApi.php?apikey=\" + myKeyValue + \"&type=cmd&id=\" + jeedomcmd);\n console.log(\"http\" + myHttps + \"://\" + myIPValue + \"/core/api/jeeApi.php?apikey=\" + myKeyValue + \"&type=cmd&id=\" + jeedomcmd);\n client.onreadystatechange = function () {\n if (client.readyState == 4) {\n if (client.status == 200) {\n console.log(client.responseText);\n navigator.vibrate([500, 500, 500]);\n }\n }\n };\n client.send();\n}", "function serverConnected(){\nconsole.log('connected to the server');\n}", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantTAHist')\n\t\t .query({studentNum: 0})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(400); // response status\n\t\t\t \n\t\t\t // check that applicant has expected property\n\t\t\t expect(res.body.data).to.be.empty;\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "async index({request, response}) {\r\n\r\n\t\t\r\n\t}", "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "run(callback, context) {\n //调用service的reques方法,获取相应属性后设置进service\n this.request(function (error, response) {\n let resp = this._resolveResponse(response);\n callback.call(context, resp);\n }, this)\n }", "function sendInfo(info, stationPort) {\n var options = {\n uri: 'http://localhost:' + stationPort,\n method: 'Post',\n json: info\n };\n request(options, function (error, response, body) {\n if (error) {\n console.log(error + \"17\");\n } else {\n console.log(response.statusCode, body);\n }\n });\n}", "function connect() {\n url = \"http://\" + url + '/api/' + username + '/lights/';\n httpDo(url, 'GET', getLights);\n}", "function next() {\n\t\thttpServer( opts );\n\t}", "function main() {\n\n // create the server\n var server = restify.createServer( { name : hostName } );\n server.use(restify.bodyParser());\n // set up the route\n server.post('/incoming-webhook', processIncoming);\n server.get('/health-check', processHealthCheck);\n\n server.listen(port, function() {\n });\n}", "function serverCall(){\t\t \n\n\t\t chai.request(server) \n\t\t .get('/getApplicantTAHist')\n\t\t .query({studentNum: parseInt(applicant.studentNumber)})\n\t\t .end(function(err, res){\n\t\t\t expect(res).to.have.status(200); // response status\n\t\t\t expect(res.body.data).to.be.an('array');\n\t\t\t expect(res.body.data).to.be.have.length(\n\t\t\t applicant.studentInformation.TAHistory.length);\n\t\t\t \n\t\t\t // check that TA history object has expected properties\n\t\t\t var i, course;\n\t\t\t for (i = 0; i < applicant.studentInformation.TAHistory.length; i++){\n\t\t\t // find corresponding course\n\t\t\t course = res.body.data.find(\n\t\t\t\t (course) => (course.courseCode ==\n\t\t\t\t\t\tapplicant.studentInformation.TAHistory[i].courseCode));\n\t\t\t expect(course).to.not.be.undefined;\n\t\t\t \n\t\t\t expect(course).to.have.property(\n\t\t\t\t 'timesTAd',\n\t\t\t\t parseInt(applicant.studentInformation.TAHistory[i].timesTAd));\n\t\t\t }\n\t\t\t \n\t\t\t done();\n\t\t });\n\t }", "function startServer()\n{\n\tconsole.log(\"Starting web controller...\");\n\n\tvar http = require('http');\n\thttp.createServer(function (req, res) {\n\n\t\t function respond() {\n\t\t\tres.writeHead(200, { \"Content-Type\": \"text/html\" });\n\t\t\tres.write(\"<!DOCTYPE html><html><body>\");\t\t\n\t\t\tres.write(\"<h1>Intel Galileo web controller</h1>\");\n\t\t\tres.write(\"</p><p>LED Status : \");\n\t\t\tres.write(ledstatus);\n\t\t\tres.write(\"</p><p>Actions</p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOn\\\"' value='Turn LED on'/></p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOff\\\"' value='Turn LED off'/></p>\");\n res.write(\"<p><input type='button' onclick='location.pathname = \\\"/hit\\\"' value='Hit'/></p>\");\n\t\t\tres.write(\"</body></html>\");\n\t \t\tres.end();\n\t\t}\n\n\t\tconsole.log(\"Request: \" + req.url);\n\t\tvar mraa = require('mraa');\n \n\t\tif(req.url === \"/ledOn\")\n\t\t\tturnOnLed();\n\t\telse if(req.url === \"/ledOff\")\n\t\t\tturnOffLed();\n else if(req.url === \"/hit\")\n\t\t\thit(mraa);\n\n\t\trespond();\n \t\t\n\t}).listen(1337);\n\tconsole.log('Server running at http://localhost:1337/');\n}", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function serverCall(){\t\t \n\t\t \n\t\t chai.request(server)\n\t\t .post('/saveApplicant')\n\t\t .send(applicant)\n\t\t .end(function(error, response) {\n\t\t\t util.checkBasicStructureApplicantResp(response);\n\t\t\t done();\n\t\t });\n\t }", "function mHttpBtnClick() {\n var outputRecordManager = new ndebug.OutputRecordManager();\n var objTelnet = new ndebug.Telnet('mail.google.com',\n 80,\n outputRecordManager);\n objTelnet.\n setPlainTextDataToSend('GET / HTTP/1.1\\r\\nHost: mail.google.com\\r\\n\\r\\n');\n objTelnet.setCompletedCallbackFnc(printFinishedTelnetOutput);\n objTelnet.createSocket();\n}", "async execute(){\n\t\tawait this.processRequest();\n\t\tawait this.formatRequest();\n\t\tawait this.processData();\n\t\tawait this.formatResponse();\n\t\tawait this.processResponse();\n\t}" ]
[ "0.6806835", "0.6331031", "0.63098043", "0.62808955", "0.619168", "0.61809826", "0.6159516", "0.6136136", "0.607894", "0.59980285", "0.5980644", "0.596972", "0.5954825", "0.59534323", "0.5856377", "0.58497566", "0.58357733", "0.58333987", "0.581585", "0.5814595", "0.5805203", "0.5795176", "0.5793216", "0.5771993", "0.5757864", "0.575444", "0.5750155", "0.57314533", "0.5729784", "0.5709387", "0.5692374", "0.56745887", "0.5674086", "0.5668128", "0.5659009", "0.5652291", "0.5651571", "0.56501055", "0.56451213", "0.56216806", "0.5619603", "0.5617725", "0.561761", "0.5611629", "0.56112444", "0.56112444", "0.56112444", "0.56112444", "0.56112444", "0.56112444", "0.5609576", "0.56030583", "0.5597982", "0.55801", "0.5572414", "0.55625015", "0.5528431", "0.55273044", "0.5522385", "0.55184525", "0.55181444", "0.550808", "0.550808", "0.550808", "0.5506159", "0.550562", "0.5499895", "0.54960126", "0.5495395", "0.549305", "0.5489341", "0.5478778", "0.54701895", "0.54682016", "0.54681873", "0.5466836", "0.54608345", "0.54563713", "0.5454807", "0.5451598", "0.54497164", "0.54477376", "0.5447528", "0.5446028", "0.54460216", "0.5445307", "0.54445165", "0.5444268", "0.54391766", "0.5430044", "0.5425905", "0.54221", "0.5418918", "0.5418527", "0.541545", "0.5401499", "0.53962266", "0.5393837", "0.539287", "0.53919196", "0.53913987" ]
0.0
-1
Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string. Examples capitalize('a short sentence') > 'A Short Sentence' capitalize('a lazy fox') > 'A Lazy Fox' capitalize('look, it is working!') > 'Look, It Is Working!'
function capitalize(str) { let result = '' const context = str.split(' ') for (let i = 0; i < context.length; i++) { if (context[i].trim().length > 0) { context[i] = context[i].charAt(0).toUpperCase() + context[i].substr(1, context[i].length) result += context[i] + " " } } return result.trim() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalizeWord(string) {\n \n // Should take a string of one word, and return the word with its first letter capitalized\n return string[0].toUpperCase() + string.substring(1, string.length);\n \n}", "function capitalize(string) {\n if (string.indexOf(\" \") !== -1) {\n var arr = string.split(\" \");\n var capitals = arr.map(capitalizeWord);\n return capitals.join(\" \");\n } else {\n return capitalizeWord(string);\n }\n }", "function capitalizeAllWords(string){\nvar subStrings = string.split(\" \");\nvar upperString = \"\";\nvar finishedString = \"\";\n for(var i = 0; i < subStrings.length; i++){\n if(subStrings[i]) {\n upperString = subStrings[i][0].toUpperCase() + subStrings[i].slice(1) + \" \";\n finishedString += upperString;\n }\n } return finishedString.trim()\n}", "function capitalize(str) {}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitalizeWord (string) {\n var firstLetter = string[0];\n var restOfWord = string.substring(1); \n return firstLetter.toUpperCase() + restOfWord;\n}", "function capitalize(text){\n // in: \"some_string\"\n // out: \"Some_string\"\n return text.charAt(0).toUpperCase() + text.slice(1);\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substring(1);\n}", "static capitalize(string){\n let array = string.split(\"\")\n array[0] = string[0].toUpperCase()\n return array.join(\"\")\n }", "function capitalize(string) {\n return `${string[0].toUpperCase()}${string.slice(1)}`;\n} //so we return the first character captitalized, and the rest of the string starting from the first index", "function capitalize(s){\n return s[0].toUpperCase() + s.slice(1);\n}", "function capitalize( s ) {\n // GOTCHA: Assumes it's all-one-word.\n return s[0].toUpperCase() + s.substring(1).toLowerCase();\n}", "function capitalize(string) {\n var splitStr = string.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n}", "function capitalizeWord(string) {\n str1 = string.charAt(0);\n str1 = str1.toUpperCase();\n for (var i = 1; i < string.length; i++)\n {\n str1 += string[i];\n }\n return str1;\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \"); //splits string up\n for (var i = 0; i < split.length; i++) { //loops over array of strings\n split[i] = split[i][0].toUpperCase() + split[i].slice(1); //uppercases first chas on string and slices the extra letter\n }\n var finalStr = split.join(' '); // joins split string into one string\n return finalStr; //return final string\n}", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalize(str) {\n \n function nowCapitalize(string){\n var result = '';\n for(i in string){\n if(i==0){\n result+=string[i].toUpperCase();\n } else{\n result += string[i];\n }\n }\n return result;\n }\n return str.replace(/\\s+/g,' ').split(\" \").map(x=>nowCapitalize(x)).join(' ');\n\n \n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "function capitalizeWord(string) {\n let newstr = string[0].toUpperCase() + string.substring(1);\n //console.log(newstr);\n return newstr;\n}", "function capitalizeWord(string) {\n return string.replace(string[0], string[0].toUpperCase()); //return string but replace the string[0] with a capital letter\n}", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalize(string){\r\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "function capitalize(s){\n\t\t\treturn s[0].toUpperCase() + s.slice(1);\n\t\t}", "function capitalizeAllWords(string) {\n \n // Should take a string of words and return a string with all the words capitalized\n \n let newStr = \"\";\n \n for (let word of string.split(\" \")) {\n newStr = newStr + word[0].toUpperCase() + word.substring(1,word.length) + \" \";\n }\n \n return newStr.substring(0,newStr.length - 1);\n \n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function capitalize(string) {\n // capitalize first letter\n // capitalize a letter with a SPACE to its left\n let str=string[0].toUpperCase();\n for(i=1;i<string.length;i++){\n if(string[i-1]===' '){\n str+=string[i].toUpperCase();\n }else{\n str+=string[i];\n }\n }\n return str;\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function firstLetterCapitalized (word){//function that capitalizes first letter of one word\n var letterOne = word.substring(0,1)//finds first letter\n var capitalizedLetter = letterOne.toUpperCase()//to upper case\n return capitalizedLetter + word.substring(1)//concatenates capitalized first letter and rest of word\n}", "function capitalizeAllWords(string) {\n var arr = string.split(\" \");\n for (var i = 0;i < arr.length; i++){\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n return arr.join(\" \");\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeFirstWordInAString(stringToCapitalize) {\n if (stringToCapitalize.length === 0) {\n return \"ERROR - String to manipulate is undefined\";\n }\n\n return (\n stringToCapitalize.charAt(0).toUpperCase() + stringToCapitalize.slice(1)\n );\n}", "function capitalizeAllWords(string) {\n// will use .toLower case and .split to lowercase and put in an array\nvar myArr = string.toLowerCase().split(\" \")\n// will use for loop to itterate over array\nfor(var i = 0; i < myArr.length; i++){\n // Will use charAt to return the character in string\n // will use toUpperCase to uppercase the first characters\n //will use .slice to add remaing array\n myArr[i] = myArr[i].charAt(0).toUpperCase() + myArr[i].slice(1);\n}\n // use join() to turn array to string and return\n return myArr.join(\" \");\n}", "function capitalize(){\nvar string=\"js string exercises\"\nvar newString=string.charAt(0).toUpperCase()+ string.slice(1)\nreturn newString\n}", "function capital(str) \r\n{\r\n str = str.split(\" \");\r\n\r\n for (var i = 0, x = str.length; i < x; i++) {\r\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\r\n }\r\n\r\n return str.join(\" \");\r\n}", "function capitalize(string){\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalize(str)\n{\n //return str.charAt(0).toUpperCase() + str.slice(1);\n var pieces = str.split(' ');\n for (var i = 0; i < pieces.length; i++) {\n var j = pieces[i].charAt(0).toUpperCase();\n pieces[i] = j + pieces[i].substr(1);\n }\n return pieces.join(' ');\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalize(string) {\n let result = string[0].toUpperCase();\n for(let i = 1; i < string.length; i++) {\n if(string[i - 1] == \" \") {\n result += string[i].toUpperCase();\n }\n else {\n result += string[i];\n }\n }\n return result;\n}", "function capitalizeWord(string) {\n //i string\n //r string with first capitalized\n \n let newString = string[0].toUpperCase()+string.slice(1);\n \n return newString;\n}", "function capitalize(string) {\r\n return string[0].toUpperCase() + string.slice(1);\r\n}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n }", "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "titleCase(string) {\n var sentence = string.toLowerCase().split(\" \");\n for(var i = 0; i< sentence.length; i++){\n sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1);\n }\n \n return sentence.join(\" \");\n }", "function capitalize(str) {\n let capArr = [];\n let strArr = str.split(' ');\n for (var i = 0; i < strArr.length; i++) {\n capArr.push(capital(strArr[i]));\n }\n return capArr.join(' ')\n\n\n}", "function capitalize(sentence) {\n // Get the individual words\n let words = sentence.split(' ');\n\n // Capitalize the first character in each word\n words = words.map(word => word[0].toUpperCase() + word.slice(1));\n\n return words.join(' ');\n}", "static capitalize(sentence){\n let a= sentence.toUpperCase().charAt(0);\n return a+sentence.substr(1);\n }", "static capitalize(inputString) {\n return inputString.charAt(0).toUpperCase() + inputString.slice(1)\n }", "function capitalise(s){\n let ns = [];\n for(let w of s.split(\" \")){\n ns.push(w[0].toUpperCase() + w.slice(1));\n }\n return ns.join(\" \");\n}", "function capitalize( str , echo){\n var words = str.toLowerCase().split(\" \");\n for ( var i = 0; i < words.length; i++ ) {\n var j = words[i].charAt(0).toUpperCase();\n words[i] = j + words[i].substr(1);\n }\n if(typeof echo =='undefined')\n return words.join(\" \");\n else\n return str;\n}", "function capitalizeWord(word){\n return word[0].toUpperCase() + word.substr(1);\n}", "function capitalize(word) { // capitalizes word\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function capitalWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n //function to make input value to have capital as it is inputed\n}", "function capitalizeEachWord(str) {\n return str.toUpperCase();\n}", "function capitalizeEveryWordInAString(stringToCapitalize) {\n const arrayOfStrings = stringToCapitalize.toLowerCase().split(\" \");\n let capitalizedString = \"\";\n\n for (let i = 0; i < arrayOfStrings.length; i++) {\n capitalizedString +=\n arrayOfStrings[i].charAt(0).toUpperCase() +\n arrayOfStrings[i].slice(1, arrayOfStrings[i].length) +\n \" \";\n }\n\n return capitalizedString;\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "static capitalize(word){\n let arr;\n arr = word.split(\"\")\n arr[0] = arr[0].toUpperCase()\n return arr.join(\"\")\n }", "function capitalizeEveryWordOfAStringLib (string) {\n let words = string.split(\" \");\n\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n\n }\n\n return words.join(\" \");\n}", "function capitalize(str) {\n\n const capWords = [];\n\n let strArray = str.split(' ');\n\n strArray.forEach((word, i) => {\n let upperLetter = strArray[i][0].toUpperCase() + word.slice(1)\n capWords.push(upperLetter)\n\n })\n\n return capWords.join(' ');\n}", "function capitalizeAllWords(string) {\n //split string into array of string words\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++){\n //if there is a value at element then do a thing\n if(splitStr[i]){\n //access word in word array,uppercase first char, then slice the rest back on\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n }\n string = splitStr.join(\" \");\n }\n return string;\n}", "function f(str) {\n const words = str.split(' ');\n let capitalizedWords = [];\n for (let i = 0; i < words.length; i++) {\n const capitalizedWord = words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase();\n capitalizedWords.push(capitalizedWord);\n }\n return capitalizedWords.join(' ');\n}", "function capitalizeAllWords(string) {\n let stringsArr = string.split(' ');\n for (let i = 0; i < stringsArr.length; i++) {\n stringsArr[i] = stringsArr[i][0].toUpperCase() + stringsArr[i].substring(1);\n }\n return stringsArr.join(' ');\n}", "static capitalize(string){\n return string[0].toUpperCase() + string.slice(1);\n }", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "static capitalize(string){\n return string.charAt(0).toUpperCase()+ string.slice(1)\n }", "function capitalize(string) {\r\n if (string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }\r\n return '';\r\n}", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "static capitalize(string) {\n let newString = string[0].toUpperCase() + string.slice(1)\n return newString\n }", "capitalize(word){\n let char = word.charAt(0).toUpperCase();\n let remainder = word.slice(1);\n return char + remainder;\n }", "function LetterCapitalize(str) {\n var strArr = str.split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n}", "function capitalizeStr(str) {\r\n let input = str.toLowerCase().split(\" \"); // Seperating each words and make an array\r\n input = input.map(function (value, index, array) { // value is the iterator\r\n return value.charAt(0).toUpperCase() + value.slice(1);\r\n });\r\n\r\n return input.join(\" \");\r\n}", "static capitalize(string) {\n return `${string.charAt(0).toUpperCase()}` + `${string.slice(1)}`;\n }", "function capitalize(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalize(str){\n return str[0].toUpperCase() + str.slice(1);\n}", "function capitalize(s){\n return s.split('').reduce((acc, curr, i) => {\n if (i % 2 === 0){\n acc[0] += curr.toUpperCase()\n acc[1] += curr\n } else {\n acc[1] += curr.toUpperCase()\n acc[0] += curr \n }\n return acc\n }, [\"\",\"\"])\n}", "function capitalize(str) {\n str = str.toLowerCase();\n return finalSentence = str.replace(/(^\\w{1})|(\\s+\\w{1})/g, letter => letter.toUpperCase());\n}", "function capitalize(str) {\n const array = str.split(' ');\n array.forEach((word, index) => array[index] = word[0].toUpperCase() + word.substr(1));\n return array.join(' ');\n}", "function capitalize(str) {\n var arr = str.split(\"\");\n arr[0] = arr[0].toUpperCase();\n return arr.join(\"\");\n}", "function capitalize(str) {\n var splitStr = str.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n}", "function capitalize(input) {\n var CapitalizeWords = input[0].toUpperCase();\n for (var i = 1; i <= input.length - 1; i++) {\n let currentCharacter,\n previousCharacter = input[i - 1];\n if (previousCharacter && previousCharacter == ' ') {\n currentCharacter = input[i].toUpperCase();\n } else {\n currentCharacter = input[i];\n }\n CapitalizeWords = CapitalizeWords + currentCharacter;\n }\n return CapitalizeWords;\n}", "function capitalize(str) {\n return str.toLowerCase().split(' ').map(item => {\n return item[0].toUpperCase() + item.substring(1, item.length);\n }).join(' ');\n}", "function LetterCapitalize(str) {\n // First, we use the split method to divide the input string into an array of individual words\n // Note that we pass a string consisting of a single space into the method to \"split\" the string at each space\n str = str.split(\" \");\n\n // Next, we loop through each item in our new array...\n for (i = 0; i < str.length; i++) {\n // ...and set each word in the array to be equal to the first letter of the word (str[i][0]) capitalized using the toUpperCase method.\n // along with a substring of the remainder of the word (passing only 1 arg into the substr method means that you start at that index and go until the end of the string)\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n // Finally, we join our array back together...\n str = str.join(\" \");\n\n // ...and return our answer.\n return str;\n}", "function LetterCapitalize(str) {\n \"use strict\";\n // code goes here \n var strArray = str.split(\" \"); //take my string and separate it into an array of strings (strArray) using the .split method.\n var newString = \"\";\n for (var i = 0; i < strArray.length; i++) {\n var newWord = strArray[i].substr(0, 1).toUpperCase() + strArray[i].substr(1, strArray.length);\n newString = newString + \" \" + newWord;\n //alert(newString);\n }\n\n return newString;\n\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string) {\n return string.charAt(0).toUpperCase() + string.substring(1);\n }", "function capitalizeAllWords(string){\n var splitString = string.split(' '); //splitting string at spaces into an array of strings\n //splitString is now an array containing each word of the string separately\n for(var i = 0; i < splitString.length; i++){\n var letters = splitString[i].split(''); //separating each word in array into an array of letters\n letters[0] = letters[0].toUpperCase(); //sets letter at index[0] to upper case\n splitString[i] = letters.join(''); //slaps em all back together\n }\n return splitString.join(' ');\n}", "function capitalizeAllWords(string) {\n return string.replace(/\\b\\w/g, function(string){ \n return string.toUpperCase(); \n });\n}", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1)\n }" ]
[ "0.8285596", "0.82367736", "0.8222786", "0.8193245", "0.8186978", "0.81807446", "0.81706184", "0.81702155", "0.8147706", "0.8138574", "0.81328857", "0.81130725", "0.81125367", "0.8110441", "0.80967003", "0.80943406", "0.8091477", "0.8086929", "0.8069985", "0.8067257", "0.8061706", "0.8059515", "0.80525714", "0.8044416", "0.80346376", "0.8032614", "0.80295193", "0.8021424", "0.8019603", "0.80097497", "0.8008695", "0.8000888", "0.799893", "0.7995725", "0.7995725", "0.7989031", "0.79881847", "0.7983972", "0.7983922", "0.7980589", "0.7973119", "0.79730433", "0.7956391", "0.7955214", "0.7944425", "0.79433894", "0.79419756", "0.79405093", "0.79404485", "0.79344755", "0.7931694", "0.792787", "0.79262704", "0.79258096", "0.79209787", "0.79172003", "0.79113823", "0.7908291", "0.79078937", "0.7906982", "0.7902783", "0.7902169", "0.7895496", "0.7892643", "0.7892303", "0.78921455", "0.7888614", "0.78882843", "0.7886598", "0.78779846", "0.787123", "0.787123", "0.7869533", "0.7862301", "0.7858234", "0.785054", "0.78500026", "0.78449357", "0.7843051", "0.78425527", "0.7838087", "0.7836345", "0.78336644", "0.7831769", "0.7830716", "0.78299737", "0.7829187", "0.7827454", "0.782605", "0.7825756", "0.7825436", "0.7816229", "0.78107274", "0.78107035", "0.780869", "0.780869", "0.780869", "0.7802787", "0.78022647", "0.78013575", "0.78006333" ]
0.0
-1
added on 1212.1741 by jb
function addFav(e){ var url="http://www.ipeen.com.tw"; var title="iPeen 愛評網 - 美食消費經驗分享"; var nav = navigator.userAgent; if(document.all) { e.href = 'javascript:void(0);'; window.external.AddFavorite(url, title); return false; } else if(nav.indexOf("SeaMonkey") != -1) { e.href = 'javascript:void(0);'; window.sidebar.addPanel(title, url, ''); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static final private internal function m106() {}", "static transient final private internal function m43() {}", "static private protected internal function m118() {}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "transient final private protected internal function m167() {}", "transient private protected public internal function m181() {}", "transient final private internal function m170() {}", "static transient final private protected internal function m40() {}", "static transient final protected public internal function m46() {}", "static transient private protected public internal function m54() {}", "__previnit(){}", "static final private protected internal function m103() {}", "transient private public function m183() {}", "static transient private internal function m58() {}", "static protected internal function m125() {}", "static private protected public internal function m117() {}", "static transient final protected function m44() {}", "static transient private public function m56() {}", "transient final private protected public internal function m166() {}", "static transient final private protected public internal function m39() {}", "static transient final private public function m41() {}", "static final private protected public internal function m102() {}", "static final private public function m104() {}", "static transient final private protected public function m38() {}", "static final protected internal function m110() {}", "static private public function m119() {}", "obtain(){}", "transient final private public function m168() {}", "function comportement (){\n\t }", "_firstRendered() { }", "static transient protected internal function m62() {}", "function miFuncion (){}", "function _____SHARED_functions_____(){}", "function StupidBug() {}", "added() {}", "static get END() { return 6; }", "function TMP() {\n return;\n }", "function Hx(a){return a&&a.ic?a.Mb():a}", "function ea(){}", "static get elvl_info() {return 0;}", "function oi(a){this.Of=a;this.rg=\"\"}", "constructor (){}", "constructor () {\r\n\t\t\r\n\t}", "updated() {}", "lastUsed() { }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function fm(){}", "function undici () {}", "function init() {\n\t \t\n\t }", "function sb(){this.pf=[]}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function oi(){}", "function _construct()\n\t\t{;\n\t\t}", "initialize() {}" ]
[ "0.6803819", "0.66182405", "0.6547029", "0.6184167", "0.6130519", "0.60575354", "0.6053293", "0.5939176", "0.5885846", "0.5810538", "0.57231903", "0.5704111", "0.5665902", "0.5650342", "0.56107825", "0.55738527", "0.5562895", "0.5531637", "0.5474779", "0.5412916", "0.5406572", "0.53826404", "0.53538114", "0.5344947", "0.52507377", "0.52207834", "0.5200946", "0.5165826", "0.5163229", "0.51104045", "0.5098567", "0.50956565", "0.50624716", "0.5043728", "0.50000155", "0.49773133", "0.49640092", "0.49224034", "0.48918188", "0.4885452", "0.48825988", "0.4854539", "0.48310372", "0.48289075", "0.48264602", "0.48222107", "0.4815779", "0.47977847", "0.4765419", "0.47641233", "0.4760986", "0.47364888", "0.47180396", "0.46995434", "0.46942765", "0.46942765", "0.46942765", "0.46875957", "0.46772286", "0.46601725", "0.4636297", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.4634535", "0.46227506", "0.46222275", "0.46178102" ]
0.0
-1
run start(true) to initiate a call
function start(isCaller) { console.log("start: isCaller=", isCaller); pc = new RTCPeerConnection(configuration); // send any ice candidates to the other peer pc.onicecandidate = function (evt) { console.log("onicecandidate: ", evt); if (evt.candidate) { sendMessage("candidate", evt.candidate); } }; // once remote stream arrives, show it in the remote video element pc.onaddstream = function (evt) { console.log("onaddstream: ", evt); setVideoStream(false, evt.stream); }; // get the local stream, show it in the local video element and send it console.log('Requesting getUserMedia...'); navigator.mediaDevices.getUserMedia({ "audio": true, "video": true }) .then(function (stream) { console.log("getUserMedia response: ", stream); setVideoStream(true, stream); pc.addStream(stream); if (isCaller) { pc.createOffer(offerOptions).then(gotDescription, (err) => { console.error("Error in createOffer: ", err); }); } else { pc.createAnswer().then(gotDescription, (err) => { console.error("Error in createAnswer: ", err); }); } }, (err) => { console.error("Error in getUserMedia: ", err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this.do(\"start\")\n }", "start() {\n this.isStarted = true;\n this._startRequest();\n }", "function start() {\n init();\n run();\n }", "function startNewCall() {\n\n}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start () {}", "function startcall(){\n sendData({\n type: 'start_call',\n cameraaudio: cameraaudio,\n cameravideo: cameravideo,\n capturevideo: capturevideo,\n forcevideo: forcevideo,\n forceaudio: forceaudio\n });\n}", "function start() {\n if (!argv._.length || argv._.indexOf('start') !== -1) {\n instance.start();\n }\n }", "started() {\n\t}", "started() { }", "start() {\n }", "start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n }", "start() {\n this._child.send({\n cmd: 'start',\n data: null\n });\n }", "started() {\r\n\r\n\t}", "get start() {}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "function start () {\n console.info('CALLED: start()');\n bindEvents();\n }", "function start(){\n\t\n}", "function start(){\n console.log('start()');\n}", "function start() {\n\n}", "started () {}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function start(){\n// will start the connection\n}", "start(callback){\n \n }", "function start () {\n listen()\n}", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "function start() {\n listen();\n}", "start() {\n this.running = true;\n }", "startCall()\n\t{\n\t\tconst provider = BX.Call.Provider.Voximplant;\n\n\t\tBX.Call.Engine.getInstance().createCall({\n\t\t\ttype: BX.Call.Type.Permanent,\n\t\t\tentityType: 'chat',\n\t\t\tentityId: this.getDialogId(),\n\t\t\tprovider: provider,\n\t\t\tvideoEnabled: true,\n\t\t\tenableMicAutoParameters: BX.Call.Hardware.enableMicAutoParameters,\n\t\t\tjoinExisting: true\n\t\t}).then(e => {\n\t\t\tconsole.warn('call created', e);\n\n\t\t\tthis.currentCall = e.call;\n\t\t\tthis.currentCall.useHdVideo(BX.Call.Hardware.preferHdQuality);\n\t\t\tif(BX.Call.Hardware.defaultMicrophone)\n\t\t\t{\n\t\t\t\tthis.currentCall.setMicrophoneId(BX.Call.Hardware.defaultMicrophone);\n\t\t\t}\n\t\t\tif(BX.Call.Hardware.defaultCamera)\n\t\t\t{\n\t\t\t\tthis.currentCall.setCameraId(BX.Call.Hardware.defaultCamera);\n\t\t\t}\n\n\t\t\tthis.callView.setUiState(BX.Call.View.UiState.Calling);\n\t\t\tthis.callView.setLayout(BX.Call.View.Layout.Grid);\n\t\t\tthis.callView.appendUsers(this.currentCall.getUsers());\n\t\t\tBX.Call.Util.getUsers(this.currentCall.id, this.getCallUsers(true)).then(userData => {\n\t\t\t\tthis.callView.updateUserData(userData)\n\t\t\t});\n\t\t\tthis.bindCallEvents();\n\t\t\tif(e.isNew)\n\t\t\t{\n\t\t\t\tthis.currentCall.setVideoEnabled(this.useVideo);\n\t\t\t\tthis.currentCall.inviteUsers();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.currentCall.answer({\n\t\t\t\t\tuseVideo: this.useVideo\n\t\t\t\t});\n\t\t\t}\n\n\t\t}).catch(e => {\n\t\t\tconsole.warn('creating call error', e);\n\t\t});\n\n\t\tthis.controller.getStore().commit('callApplication/startCall');\n\t}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "start() {// [3]\n }", "function start(){\r\n helloUser();\r\n }", "function start ()\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n {\n return webphone_api.addtoqueue('Start', [parameters, true]);\n }\n else\n return webphone_api.plhandler.Start(parameters, true);\n}", "function start() {\n //Currently does nothing\n }", "function start() {\n\t\t\tsetTimeout(startUp, 0);\n\t\t}", "start () {\n debug(\"Method 'start' not implemented\");\n }", "function start() {\n console.log('Starting!');\n test1();\n}", "function start() {\r\n\tstatus = -1;\r\n\taction(1, 0, 0);\r\n}", "function checkAndStart() {\n console.error(isStarted);\n console.error(localStream);\n console.error(isChannelReady);\n if (!isStarted && typeof localStream != 'undefined' && isChannelReady) { \n\tcreatePeerConnection();\n isStarted = true;\n if (isInitiator) {\n doCall();\n }\n }\n}", "function startService() {\n $log.log(TAG + 'starting.');\n running = true;\n }", "_startIfPossible() {\n if (this.started) {\n this._requestIfNeeded();\n }\n else if (this.autoStart) {\n this.start();\n }\n }", "function start(){\n\tinit();\n\ttimer=setInterval('run()', 100);\n}", "function start(){\n switch(lCmd){\n case 'my-tweets':\n Tweets();\n break;\n case 'spotify-this-song':\n SpotifyCall(inputs);\n break;\n case 'movie-this':\n Movie(inputs);\n break;\n case 'do-what-it-says':\n Do();\n break;\n default:\n console.log(\"my-tweets, spotify-this-song, movie-this and do-what-it-says are the only commands accepted. Check your input.\");\n break;\n \n }\n}", "function startService() {\n $log.log(TAG + 'starting');\n running = true;\n }", "function start() {\n status = -1;\n action(1, 0, 0);\n}", "function call() {\n\t// just disable the Call button on the page...\n\tcallButton.disabled = true;\n\n\t// ...and enable the Hangup button\n\thangupButton.disabled = false;\n\tlog(\"Starting call\");\n\n\t// Note: getVideoTracks() and getAudioTracks() are not supported by old version of Mozilla (<2015)\n\tif (localStream.getVideoTracks().length > 0) {\n\t\tlog('Using video device: ' + localStream.getVideoTracks()[0].label);\n\t}\n\tif (localStream.getAudioTracks().length > 0) {\n\t\tlog('Using audio device: ' + localStream.getAudioTracks()[0].label);\n\t}\n\n\tinitRTCPeerConnection();\n\n\t// This is an optional configuration string, associated with NAT traversal setup\n\tvar servers = null;\n\n\t// Create the local PeerConnection object\n\tlocalPeerConnection = new RTCPeerConnection(servers);\n\tlog(\"Created local peer connection object localPeerConnection\");\n\n\t// Add a handler associated with ICE protocol events\n\tlocalPeerConnection.onicecandidate = gotLocalIceCandidate;\n\n\t// Create the remote PeerConnection object\n\tremotePeerConnection = new RTCPeerConnection(servers);\n\tlog(\"Created remote peer connection object remotePeerConnection\");\n\n\t// Add a handler associated with ICE protocol events...\n\tremotePeerConnection.onicecandidate = gotRemoteIceCandidate;\n\n\t// ...and a second handler to be activated as soon as the remote stream becomes available.\n\tremotePeerConnection.onaddstream = gotRemoteStream;\n\n\t// Add the local stream (as returned by getUserMedia()) to the local PeerConnection.\n\tlocalPeerConnection.addStream(localStream);\n\tlog(\"Added localStream to localPeerConnection\");\n\n\t// We're all set! Create an Offer to be 'sent' to the callee as soon as the local SDP is ready.\n\tlocalPeerConnection.createOffer(gotLocalDescription, onSignalingError);\n}", "function start() {\n setInterval(ping, 3000);\n }", "function start() {\n switch (status) {\n case 'running':\n alert('already running');\n break;\n case 'pause':\n status = 'running';\n NOOPBOT_FETCH({\n API: 'hexbot',\n count: '800'\n }, settingColorArray);\n alert('Successful startup');\n break;\n default:\n\n }\n}", "function runStart() {\n\tvar GPIO = require(\"gpio\");\n\tvar stopPin = new GPIO(STOP_PIN);\n\tstopPin.setDirection(GPIO.INPUT);\n\tif (stopPin.getLevel()) {\n\t\tlog(\"Start program bypassed by user.\");\n\t\treturn;\n\t}\n\t\n\tvar esp32duktapeNS = NVS.open(\"esp32duktape\", \"readwrite\");\n\tvar startProgram = esp32duktapeNS.get(\"start\", \"string\");\n\tesp32duktapeNS.close();\n\tif (startProgram !== null) {\n\t\tlog(\"Running start program: %s\" + startProgram);\n\t\tvar script = ESP32.loadFile(\"/spiffs\" + startProgram);\n\t\tif (script !== null) {\n\t\t\ttry {\n\t\t\t\teval(script);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tlog(\"Caught exception: \" + e.stack);\n\t\t\t}\n\t\t} // We loaded the script\n\t} else { // We have a program \n\t\tlog(\"No start program\");\n\t}\n} // runStart", "start() {\n\t\treturn super.start();\n\t}", "function start() {\n var command = process.argv[2];\n\n if (command == \"exit\") {\n send(\"x\", \"\");\n }\n else if (command == \"force\") {\n send (\"!\", \"\");\n }\n else if (command == \"list\") {\n send(\"l\", \"\");\n }\n else if (command == \"kill\") {\n send(\"k\", getArguments());\n }\n else if (command == \"new\") {\n send(\"n\", getArguments());\n } else {\n console.log(INFO_MSG);\n }\n}", "function startConv() {\n if (isCaller) {\n console.log (\"Initiating call...\");\n } else {\n console.log (\"Answering call...\");\n }\n\n // First thing to do is acquire media stream\n navigator.getUserMedia (constraints, onMediaSuccess, onMediaError);\n } // end of 'startConv()'", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "function start() {\r\n status = -1;\r\n action(1, 0, 0);\r\n}", "function start() {\n // this gets executed on startup\n //... \n net = new convnetjs.Net();\n // ...\n \n // example of running something every 1 second\n setInterval(periodic, 1000);\n}", "function callAction() {\n console.log('Starting call.');\n startTime = window.performance.now();\n\n // Get local media stream tracks.\n const videoTracks = localStream.getVideoTracks();\n const audioTracks = localStream.getAudioTracks();\n if (videoTracks.length > 0) {\n console.log(`Using video device: ${videoTracks[0].label}.`);\n }\n if (audioTracks.length > 0) {\n console.log(`Using audio device: ${audioTracks[0].label}.`);\n }\n\n\n // Create peer connections and add behavior.\n localPeerConnection = new RTCPeerConnection(servers);\n console.log('Created local peer connection object localPeerConnection.');\n\n localPeerConnection.addEventListener('icecandidate', handleConnection);\n localPeerConnection.addEventListener(\n 'iceconnectionstatechange', handleConnectionChange);\n\n // Add local stream to connection and create offer to connect.\n localPeerConnection.addStream(localStream);\n console.log('Added local stream to localPeerConnection.');\n\n console.log('localPeerConnection createOffer start.');\n localPeerConnection.createOffer(offerOptions)\n .then(createdOffer).catch(setSessionDescriptionError);\n}", "async start(...args) {\n await super.start(...args);\n return this.dispatch({\n type: MT.START,\n args: [this.name, this.options, ...args]\n });\n }", "function start(state) { \n service.goNext(state);\n }", "function start() {\n console.log(\"server start . . .\");\n initialize();\n}", "function start(){\n\tinit();\n\trefresh_view();\n\tdocument.getElementById('result').innerHTML=\"\";\n\tclearTimeout(config.runTimeout);\n\tstop_running = false;\n\trun();\n}", "function startify(){\n\n //find a partner! Look for someone with compatible languages who is listening for a call.\n partner = users.filter(function(x){\n return x.profile.status === 'listening' && x.profile.language.toLowerCase() === client.profile.learning.toLowerCase() && x.profile.learning.toLowerCase() === client.profile.language.toLowerCase();\n })[0];\n\n //call handler: does partner exist? If so, call them! If not, start listening.\n if (partner) {\n Meteor.users.update({_id: clientID},{$set: {'profile.callStatus': ('calling ' + partner._id)}});\n var outgoingCall = peer.call(partner.profile.peerId, stream);\n middleify(outgoingCall);\n } else {\n Meteor.users.update({_id: clientID}, {$set: {'profile.status': 'listening'}});\n }\n }", "function makeCall(){\n if(callLine === 'none'){ //outcoming call\n createLocalMedia();\n send({\n event: \"call\",\n uuid: uuid,\n remoteUuid: setRemoteUuid()\n });\n callLine = 'out';\n console.log('outcoming call');\n return;\n }\n if(callLine === 'in'){ //incoming call\n call();\n callLine = 'busy';\n console.log('incoming call');\n return;\n }\n}", "function start() {\n fly();\n\n}", "function maybeStart() {\n console.log(\">>>>>>> maybeStart() \", isStarted, localStream, isChannelReady);\n if (!isStarted && typeof localStream !== \"undefined\" && isChannelReady) {\n console.log(\">>>>>> creating peer connection\");\n createPeerConnection();\n pc.addStream(localStream);\n isStarted = true;\n console.log(\"isInitiator\", isInitiator);\n if (isInitiator) {\n doCall();\n }\n }\n}" ]
[ "0.7424616", "0.7422449", "0.7304944", "0.72663134", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7093629", "0.7089949", "0.70392376", "0.69070894", "0.6891396", "0.68910825", "0.688992", "0.68878704", "0.68583655", "0.68534404", "0.6829339", "0.6829339", "0.6829339", "0.6829339", "0.6829339", "0.6829339", "0.6829339", "0.6829339", "0.68145", "0.68145", "0.68145", "0.6795843", "0.6766247", "0.6756433", "0.67506045", "0.67397356", "0.6674929", "0.6674929", "0.6674929", "0.6674929", "0.6674929", "0.6674929", "0.6674929", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.66622776", "0.6637893", "0.66174686", "0.6602969", "0.6595692", "0.6595692", "0.6595692", "0.6595692", "0.6595692", "0.65912795", "0.6587791", "0.65779084", "0.65659326", "0.65659326", "0.65659326", "0.65266407", "0.6470929", "0.647037", "0.6457024", "0.6454037", "0.64539015", "0.6450142", "0.64400965", "0.6414028", "0.64122033", "0.6392425", "0.63758886", "0.6373262", "0.63599956", "0.6350624", "0.6318628", "0.6316168", "0.63140005", "0.63115454", "0.6311413", "0.6306338", "0.6302918", "0.62871677", "0.62624836", "0.62495655", "0.6233125", "0.6207983", "0.62074536", "0.6186315", "0.618069", "0.616992", "0.6163159", "0.61591256", "0.61582434" ]
0.0
-1
hook up event handlers
function register_event_handlers() { //Cambiamos de nombre del boton atras $(".button.backButton").html("ATRAS");//$.ui.popup('Hi there'); LOGIN.crearEnlaces(); ALUMNO.crearEnlaces(); PROFESOR.crearEnlaces(); /* button #idLogin */ $(document).on("click", "#idLogin", function(evt) { LOGIN.onClickLogin(); }); /* button #idEscogerAlumno */ $(document).on("click", "#idEscogerAlumno", function(evt) { ALUMNO.onClickEscogerAlumno(); }); /* button #idEscogerProfesor */ $(document).on("click", "#idEscogerProfesor", function(evt) { /* your code goes here */ PROFESOR.onClickEscogerProfesor(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function bindEvents() {\n\t\t\teManager.on('showForm', function() {\n\t\t\t\tshowForm();\n\t\t\t});\n\t\t\teManager.on('csvParseError', function() {\n\t\t\t\tshowError();\n\t\t\t});\n\t\t}", "handleEvents() {\n }", "bindEvents() {\n }", "function initEventHandler() {\n // initSortable();\n initFormEvents(fb);\n initListEvents(fb);\n}", "function registerEvents() {\n}", "function setEventHandlers() {\n document.getElementById(\"loadprev\").addEventListener('click', load_prev, false);\n document.getElementById(\"loadnext\").addEventListener('click', load_next, false);\n }", "function handleBindEventHandlers(){\n handleAddBookmark();\n handleFilterRating();\n handleDeleteBookmark();\n handleAddForm();\n handleDescExpand();\n handleCloseButton();\n }", "setupHandlers () {\n this.rs.on('connected', () => this.eventHandler('connected'));\n this.rs.on('ready', () => this.eventHandler('ready'));\n this.rs.on('disconnected', () => this.eventHandler('disconnected'));\n this.rs.on('network-online', () => this.eventHandler('network-online'));\n this.rs.on('network-offline', () => this.eventHandler('network-offline'));\n this.rs.on('error', (error) => this.eventHandler('error', error));\n\n this.setEventListeners();\n this.setClickHandlers();\n }", "_events() {\n this._addKeyHandler();\n this._addClickHandler();\n this._setHeightMqHandler = null;\n\n if (this.options.matchHeight) {\n this._setHeightMqHandler = this._setHeight.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n\n if(this.options.deepLink) {\n $(window).on('popstate', this._checkDeepLink);\n }\n }", "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "@autobind\n initEvents() {\n $(document).on('intro', this.triggerIntro);\n $(document).on('instructions', this.triggerInstructions);\n $(document).on('question', this.triggerQuestion);\n $(document).on('submit_query', this.triggerSubmitQuery);\n $(document).on('query_complete', this.triggerQueryComplete);\n $(document).on('bummer', this.triggerBummer);\n }", "function bindEventHandlers () {\n $('#createHaiku').on('click', createHaiku);\n $('#clearOutput').on('click', clearOutput);\n }", "initializeEvents () {\n }", "_addEventsListeners ()\n {\n this._onChange();\n }", "function setupViewEventHandlers(self) {\n _view.resetButtonEventBus.onEvent(newWordLogic.bind(self));\n _view.alphabetButtonEventBus.onEvent(letterPressedLogic.bind(self));\n }", "function init () {\n bindEventHandlers();\n}", "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents().on(\"dblclick contextmenu\", function(event){\n clicked = true;\n event.preventDefault();\n });\n\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n $(\"#\"+_this.id).contents().attr(\"tabindex\",\"0\");\n\n $(\"#\"+_this.id).keydown(function(event){\n if(event.which == \"13\"){\n diagram.selectArrow(_this);\n }\n if(event.which == \"9\"){\n clicked = false;\n }\n })\n $(\"#\"+_this.id).contents().focusin(function(event){\n if(!clicked){\n setActive(true);\n }\n });\n $(\"#\"+_this.id).contents().focusout(function(event){\n setActive(false);\n });\n }", "function _bindEvents() {\n _$sort.on(CFG.EVT.CLICK, _setSort);\n _$navbar.on(CFG.EVT.CLICK, _SEL_BUTTON, _triggerAction);\n _$search.on(CFG.EVT.INPUT, _updateSearch);\n _$clear.on(CFG.EVT.CLICK, _clearSearch);\n }", "function bindEvents() {\n\t\t\tif(options.selection.mode != null){\n\t\t\t\toverlay.observe('mousedown', mouseDownHandler);\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t\toverlay.observe('mousemove', mouseMoveHandler)\n\t\t\toverlay.observe('click', clickHandler)\n\t\t}", "function setupEventHandlers() {\n\t// menus\n\t$(\"#menu_nav\").on(\"click\", onClickHandlerMainMenu);\n\t$(\"#menu_lang\").on(\"click\", onClickHandlerMainMenu);\n\t$(\"#menu_footer\").on(\"click\", onClickHandlerMainMenu);\n\t$('#campanya').hover( hoverOverSub, hoverOutSub );\n\t$('#idioma').hover( hoverOverSub, hoverOutSub );\n\n\t$('.submenu>li').hover(hoverOverSubelement,hoverOutSubelement);\n\n\t$('.photo_link').hover( hoverOverPhoto, hoverOutPhoto );\n\t$(\"#sec_aniversary\").on(\"click\", onClickHandlerAniversary);\n\t$('#sec_aniversary').bind('scroll', switchYears );\n\n\t$(\"#sec_novedades .buttons_container\").on(\"click\", onButtonClickHandler );\n\t$(\"#sec_business .buttons_container\").on(\"click\", onButtonClickHandler );\n\n\t$('#sec_descargas li').hover( hoverOverDownload, hoverOutDownload );\n\t//ACCION CERRAR GALERIA\n\t$('#pane_wrapper').click(function(){\n\t\t$(this).fadeOut(300,function(){\n\t\t\tunPanIt();\n\t\t\t$('#pane_wrapper').css('top','58px');\n\t\t\t$('#pane_wrapper').css('bottom','22px');\n\t\t\t$('#outer_container #pan_container').html('');\n\t\t\t$(this).css('zIndex','1');\n\t\t});\n\t});\n}", "function bindEvents(){\n\t\t\n\t\t$(document).on(\"click\",\".item_tag\",function(e){\n\t\t\n\t\t\tdisplayItems($(e.target));\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\taddItem($(e.target));\n\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".selected_item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tremoveItem($(e.target));\n\t\t\n\t\t});\n\t}", "registerDomEvents() {/*To be overridden in sub class as needed*/}", "function main() {\n addEventListeners();\n addAdvancedEventListeners();\n}", "_events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }", "_bindUtilHooks() {\n // initial events: when an update button is clicked\n this.cartChangeHooks.forEach((hook) => {\n utils.hooks.on(hook, (event) => {\n this._showOverlay();\n });\n });\n\n // remote events: when the proper response is sent\n this.cartChangeRemoteHooks.forEach((hook) => {\n utils.hooks.on(hook, (event) => {\n this._refreshcartPreview();\n });\n })\n }", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "function _bindEvents() {\r\n el.form.on('submit', _formHandler);\r\n el.email_input.on('focus', _resetErrors);\r\n }", "function registerEventHandlers() {\n\n\t\tEventDispatcher.addEventListener( \"LOAD_BUTTON_CLICKED\" , function(){\n\n\t\t\t// Increment number of visible the Articles model unless all are visible\n\t\t\tif( ArticleStore.visibleArticles < ArticleStore.totalArticles ) {\n\n\t\t\t\tArticleStore.visibleArticles++;\n\t\t\t\t\n\t\t\t\trender();\n\n\t\t\t}\n\n\t\t});\n\t}", "_initEvents () {\n this.el.addEventListener('click', (e) => {\n if (e.target.dataset.action in this.actions) {\n this.actions[e.target.dataset.action](e.target);\n } else this._checkForLi(e.target);\n });\n }", "function setEventHandlers() {\n // Socket.IO\n socket.sockets.on(\"connection\", onSocketConnection);\n SearchServices.emptyArray();\n}", "_events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }", "afterHandlers (event) {\n\n }", "events() {\n \t\tthis.openButton.on(\"click\", this.openOverlay.bind(this));\n\t\tthis.closeButton.on(\"click\", this.closeOverlay.bind(this));\n\t\t// search window will be open by keybaord. \n\t\t $(document).on(\"keydown\", this.keyPressDispatcher.bind(this));\n\t\t// when use input data in search window, typingLogic method is called. \n\t\t// searchField is defined by constructor of this class.\n\t\t/* we can use $('#search-term), but accessing DOM is much slower than\n\t\t JavaScript(jQuery). So, we use a property of this class object. which is\n\t\t 'searchField'. This is same as #Search-term and defined by constructor. */\n \t\tthis.searchField.on(\"keyup\", this.typingLogic.bind(this));\n \t}", "function bindInputEvents(){\n bindHeaderEvents();\n bindLoginModalEvents();\n}", "function _events () {\n _checkSubNav();\n $window.on('scroll', function () {\n _checkSubNav();\n });\n $window.on('resize', function () {\n _findMeasurements();\n })\n }", "function setEvent() {\n $('#plugin_submit').click(setConf);\n $('#plugin_cancel').click(browserBack);\n }", "function eventListeners(){\n changeOnButtonClicks();\n changeOnDotClicks();\n changeOnArrowKeys();\n changeOnAnnaLink();\n highlightDotsOnMouseover();\n highlightButtonsOnMouseover();\n highlightAnnaLinkOnMouseover();\n $(document).on(\"mousemove\", foregroundButtons);\n}", "function bindEventHandlers() {\r\n dom.mobileMenuIcon.on('click', mobileMenuIconClicked);\r\n dom.mobileMenuClose.on('click', mobileMenuCloseClicked)\r\n\t}", "function bindEulaModalEvents(){\n\n\t$('#acceptAndDownloadCheckBox').click(function(event){\n\t\thandleEulaModalCheckBoxEvent();\n\t});\n\n\thandleEulaModalCheckBoxEvent();\t\n}", "setEventListeners() {\n $('body').on('touchend click','.menu__option--mode',this.onModeToggleClick.bind(this));\n $('body').on('touchend',this.onTouchEnd.bind(this));\n this.app.on('change:mode',this.onModeChange.bind(this));\n this.app.on('show:menu',this.show.bind(this));\n this.book.on('load:book',this.setTitleBar.bind(this));\n this.book.on('pageSet',this.onPageSet.bind(this));\n this.tutorial.on('done',this.onTutorialDone.bind(this));\n }", "function initEvents () {\n\t\t\t$container.on(\"click\", \"a.ibm-twisty-trigger, span.ibm-twisty-head\", function (evt) {\n\t\t\t\tevt.preventDefault();\n\n\t\t\t\tvar $li = $(this).closest(\"li\");\n\n\t\t\t\ttoggle($li);\n\t\t\t});\n\t\t}", "function _registerEventHandler() {\n\t\t$.$TASMA.find('.button.new').on('click', TaskManager.add);\n\t\t$.$TASMA.find('.tasks-list').on('click', '.button.remove', TaskManager.remove);\n\t\t$.$TASMA.find('.button.remove-all').on('click', TaskManager.removeAll);\n\t\t$.$TASMA.find('.button.save').on('click', TaskManager.save);\n\t\t$.$TASMA.find('.button.cancel').on('click', TaskManager.cancel);\n\t}", "function iniEvents() {\n\n function _gather_table_thead() {\n data.fields.forEach(field => {\n let id = GatherComponent.idByGatherTeamField(gatherMakers, gatherMakers.team, field);\n elementById(id).addEventListener('change', refresh); // TODO optimize scope to table header rows\n });\n }\n\n function _partners_fields() {\n data.partners.forEach(partner => {\n data.fields.forEach(field => {\n let id = GatherComponent.idByPartnerField(partner, field);\n elementById(id).addEventListener('change', refresh); // TODO optmize scope to freeforms or tags\n });\n });\n }\n\n _gather_table_thead();\n _partners_fields();\n}", "onEvent() {\n \n }", "function initEventHandlersDev(){\n // Computer user requires keyboard presses\n document.onkeydown = respondToKeyPress;\n document.onkeyup = respondToKeyRelease;\n initTouchEventHandlers();\n // initButtonEventHandlers();\n initMobileEventHandlers();\n}", "initEventListners() {\n this.engine.getSession().selection.on('changeCursor', () => this.updateCursorLabels());\n\n this.engine.getSession().on('change', (e) => {\n // console.log(e);\n\n // Make sure the editor has content before allowing submissions\n this.allowCodeSubmission = this.engine.getValue() !== '';\n this.enableRunButton(this.allowCodeSubmission);\n });\n }", "function setupListeners() {\n // handle mouse down and mouse move\n el.on('mousedown touchstart', handleMouseDown);\n\n // handle mouse up\n pEl.on('mouseup touchend', handleMouseUp);\n\n // handle window resize\n $(win).resize(handleWindowResize);\n\n $('body').on(opts['namespace'] + '-neighbour-resized', function(e) {\n if (e.target !== el[0]) {\n handleNeighbourSplitter();\n }\n });\n\n // destory, cleanup listeners\n scope.$on('$destroy', function() {\n el.off('mousedown touchstart', handleMouseDown);\n pEl.off('mouseup touchend', handleMouseUp);\n $(win).off('resize', handleWindowResize);\n });\n }", "function initStepToolbarEventHandler() {\n initAddFieldSetEventHandler();\n initPreviewToggle();\n }", "function registerBootEventHandlers() {}", "function loadEventHanders() {\n // handler for hand to POST card info to server\n $( \"#player-hand .card\" ).on('click', findCardValue);\n // handler to remove hand cards\n $( \"#player-hand .card\" ).on('click', selectedCardDisappears);\n $( \".stock\" ).off().on('click', turnStatusCheck);\n }", "ConnectEvents() {\n\n }", "function addEventListeners()\n\t{\n\t\t// window event\n\t\t$(window).resize(callbacks.windowResize);\n\t\t$(window).keydown(callbacks.keyDown);\n\t\t\n\t\t// click handler\n\t\t$(document.body).mousedown(callbacks.mouseDown);\n\t\t$(document.body).mouseup(callbacks.mouseUp);\n\t\t$(document.body).click(callbacks.mouseClick);\n\n\t\t$(document.body).bind('touchstart',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchstart(e);\n\t\t});\n\t\t$(document.body).bind('touchend',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchend(e);\n\t\t});\n\t\t$(document.body).bind('touchmove',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchmove(e);\n\t\t});\n\t\t\n\t\tvar container = $container[0];\n\t\tcontainer.addEventListener('dragover', cancel, false);\n\t\tcontainer.addEventListener('dragenter', cancel, false);\n\t\tcontainer.addEventListener('dragexit', cancel, false);\n\t\tcontainer.addEventListener('drop', dropFile, false);\n\t\t\n\t\t// GUI events\n\t\t$(\".gui-set a\").click(callbacks.guiClick);\n\t\t$(\".gui-set a.default\").trigger('click');\n\t}", "addEventListeners() {\n\t\tthis.bindResize = this.onResize.bind(this);\n\t\twindow.addEventListener('resize', this.bindResize);\n\t\tthis.bindClick = this.onClick.bind(this);\n\t\tEmitter.on('CURSOR_ENTER', this.bindClick);\n\t\tthis.bindRender = this.render.bind(this);\n\t\tTweenMax.ticker.addEventListener('tick', this.bindRender);\n\t\tthis.bindEnter = this.enter.bind(this);\n\t\tEmitter.on('LOADING_COMPLETE', this.bindEnter);\n\t}", "_events() {\n this.$element.off('.zf.reveal').on({\n 'open.zf.reveal': this.open.bind(this),\n 'closed.zf.reveal': this.close.bind(this)\n });\n\n this.$insert.off('click').on({\n 'click': this.insert.bind(this)\n });\n\n this.$menu.off('click', '[data-name]').on({\n 'click': this._loadShortcode.bind(this)\n }, '[data-name]');\n\n this.$form.off('input change', ':input').on({\n 'input': this._loadPreview.bind(this),\n 'change': this._loadPreview.bind(this)\n }, ':input');\n }", "function register_event_handlers()\n {\n \n \n /* button Clear local storage */\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n clearStorage();\n return false;\n \n });\n \n /* button Set local storage */\n $(document).on(\"click\", \".uib_w_6\", function(evt)\n {\n setStorage();\n return false;\n });\n \n /* button Create Database */\n $(document).on(\"click\", \".uib_w_10\", function(evt)\n {\n createDB();\n return false;\n });\n \n /* button Fire Database Query */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n queryDB()\n return false;\n });\n \n \n \n }", "beforeHandlers (event) {\n\n }", "function initializeEvents() {\r\n 'use strict';\r\n var thumbnails = getThumbnailsArray();\r\n thumbnails.forEach(addThumbClickHandler);\r\n\r\n // 7.1.3 - Listening for the keypress event\r\n addKeyPressHandler();\r\n}", "function bindEvents(){\n document.querySelector('#pre').addEventListener('click', () => {\n handleTraversal(preorder)\n })\n document.querySelector('#in').addEventListener('click', () => {\n handleTraversal(inorder)\n })\n document.querySelector('#post').addEventListener('click', () => {\n handleTraversal(postorder)\n })\n }", "function setEventHandlers() {\n $('#edit-category-button').click(function(){\n window.location.href = '/book_shop/admin/editCategory';\n return false;\n });\n\n $('#edit-book-button').click(function(){\n window.location.href = '/book_shop/admin/editBook';\n return false;\n });\n\n $('#edit-customer-button').click(function(){\n window.location.href = '/book_shop/admin/editCustomer';\n return false;\n });\n\n $('#edit-customer-order-button').click(function(){\n window.location.href = '/book_shop/admin/editCustomerOrder';\n return false;\n });\n }", "function bindEventHandlers() {\r\n\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t//add event handlers\r\n\t\t\t\t$nav.on({\r\n\t\t\t\t\t'click': doOnBtnClick,\r\n\t\t\t\t\t'slideChanged': doOnSlideChanged\r\n\t\t\t\t}, 'li');\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow.on('click', function() {\r\n\t\t\t\t\tdoOnArrowClick(false);\r\n\t\t\t\t});\r\n\t\t\t\t$nextArrow.on('click', function() {\r\n\t\t\t\t\tdoOnArrowClick(true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t//display/hide the navigation on $root hover\r\n\t\t\t$root.on({\r\n\t\t\t\t'mouseenter': doOnSliderMouseEnter,\r\n\t\t\t\t'mouseleave': doOnSliderMouseLeave\r\n\t\t\t});\r\n\r\n\t\t\t$(window).on('resize', function(){\r\n\t\t\t\tserSliderHeight(currentIndex);\r\n\t\t\t});\r\n\t\t}", "function initializeEvents() {\n 'use strict';\n var thumbnails = getThumbnailsArray();\n thumbnails.forEach(addThumbClickHandler);\n}", "function initializeEvents() {\n 'use strict';\n var thumbnails = getThumbnailsArray();\n thumbnails.forEach(addThumbClickHandler);\n}", "_setupEvents () {\n this._events = {}\n this._setupResize()\n this._setupInput()\n\n // Loop through and add event listeners\n Object.keys(this._events).forEach(event => {\n if (this._events[event].disable) {\n // If the disable property exists, add prevent default to it\n this._events[event].disable.addEventListener(event, this._preventDefault, false)\n }\n this._events[event].context.addEventListener(event, this._events[event].event.bind(this), false)\n })\n }", "handleEvent() {}", "handleEvent() {}", "function initEventListener() {\n $scope.$on(vm.controllerId + '.data.filter', function (e, v) {\n vm.data.searchString = v;\n });\n $scope.$on(vm.controllerId + '.action.refresh', function (event, data) {\n getPage(_tableState);\n });\n $scope.$on(vm.controllerId + '.action.reload', function (e, v) {\n reload();\n });\n $scope.$on(vm.controllerId + '.action.F2', function (e, v) {\n console.log(checkQuyenUI('N'));\n if (checkQuyenUI('N')) {\n window.location.href = linkUrl + 'create';\n }\n });\n }", "function setEventHandlers() {\n $(\"#login_button\").click(function() {\n console.log(\"login clicked\");\n tools.loadPage(\"login\");\n tools.loadPage(\"login\");\n })\n $(\"#signup_button\").click(function() {\n console.log(\"signup clicked\");\n tools.loadPage(\"signup\")\n })\n $(\"#logout_button\").click(logoutUser)\n $(\"#youtube_link_button\").on('click', function() {\n url = $(\"#youtube_link_input\")[0].value\n getVideoFromURL(url);\n });\n }", "function registerHandlers()\n {\n component.click(showInput);\n component.click(function(){\n list.children('li').removeClass('mt-selected');\n });\n input.on('change',inputOnchange);\n $(document).on('click','.mt-token-erase', function() {\n $(this).parent().remove();\n });\n input.on('keydown',inputKeydown);\n document.getElementById('mailtoken').addEventListener(\"keydown\", documentKeydown); //or however you are calling your method\n\n }", "function AttachEventHandlers() {\n\n //If the event handlers have already been attached, get outta here.\n if (mbEventHandlersAttached) return;\n \n //Attach standard event handlers for input fields. \n try {\n AttachEventHandlersToFields();\n }\n catch(e) {\n //ignore error\n }\n \n //Page-specific event handlers go here.\n //AddEvt($(\"XXXXXX\"), \"mouseover\", functionXXXXX);\n \n //AddEvt($(\"New\"), \"mouseover\", functionXXXXX);\n \n \n \n //Set flag to indicate event handlers have been attached.\n mbEventHandlersAttached = true;\n}", "function register_event_handlers()\n {\n \n \n $(document).on(\"click\", \"#sidemenu_button\", function(evt)\n {\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($(\"#sidemenu\")); \n });\n $(document).on(\"click\", \".uib_w_6\", function(evt)\n {\n activate_subpage(\"#Reports_page\"); \n });\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n activate_subpage(\"#SCRUM_page\"); \n });\n $(document).on(\"click\", \".uib_w_8\", function(evt)\n {\n activate_subpage(\"#APPLICATION_page\"); \n });\n /* listitem LOGIN */\n $(document).on(\"click\", \".uib_w_5\", function(evt)\n {\n activate_subpage(\"#mainsub\"); \n });\n \n /* button LOGIN */\n $(document).on(\"click\", \"#LOGIN\", function(evt)\n {\n activate_subpage(\"#APPLICATION_page\"); \n });\n \n }", "function setupEventListeners() {\n document.querySelector(DOM.addBtn).addEventListener(\"click\", function () {\n UICtrl.toggleDisplay();\n });\n document.querySelector(DOM.formSubmit).addEventListener(\"click\", function (e) {\n ctrlAddItem(e);\n });\n }", "registerHooks() {\n this.addLocalHook('click', () => this.onClick());\n this.addLocalHook('keyup', event => this.onKeyup(event));\n }", "function FsEventsHandler() {}", "function assignEventListeners() {\n \tpageElements.output.addEventListener('click', editDelete, false);\n \t pageElements.authorSelect.addEventListener('change', dropDown, false);\n \t pageElements.tagSelect.addEventListener('change', dropDown, false);\n \t pageElements.saveBtn.addEventListener('click', saveAction ,false);\n \t pageElements.addBtn.addEventListener('click', addAction, false);\n \t pageElements.getAllBtn.addEventListener('click', getAll, false);\n \t pageElements.deleteBtn.addEventListener('click', deleteIt, false);\n }", "function register_event_handlers()\n {\n $(document).on(\"click\", \"#btnp\", function(evt)\n {\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($(\"#sideBar\")); \n });\n}", "function AllEventsHandling() {\n\n // when view book button click on the top of guest book then below event occur\n loadMovies.addEventListener('click', loadLocalStorageMoviesData);\n // when add button click below function execute\n addbtn.addEventListener(\"click\", addBtnProcess);\n}", "function initEventsSimple () {\n\t\t\t$controls.children(\"a\").click(function (evt) {\n\t\t\t\tevt.preventDefault();\n\n\t\t\t\tvar $thisLink = $(this),\n\t\t\t\t\t$links = $controls.find(\"a\"),\n\t\t\t\t\taction = $thisLink.attr(\"href\");\n\n\t\t\t\t$links.removeClass(\"ibm-active\");\n\t\t\t\t$thisLink.addClass(\"ibm-active\");\n\n\t\t\t\tif (action === '#show') {\n\t\t\t\t\t$hideables.slideDown(slideDownSpeed);\n\t\t\t\t\t\n\t\t\t\t\t// Fire stats event so they know someone used this widget and what they clicked on.\n\t\t\t\t\tfireStatsEvent(\"show descriptions\", \"descriptions widget\");\n\t\t\t\t}\n\t\t\t\telse if (action === '#hide') {\n\t\t\t\t\t$hideables.slideUp(slideupSpeed);\n\t\t\t\t\t\n\t\t\t\t\t// Fire stats event so they know someone used this widget and what they clicked on.\n\t\t\t\t\tfireStatsEvent(\"hide descriptions\", \"descriptions widget\");\n\t\t\t\t}\n\t\t\t});\n\t\t}", "allCustomEvents() {\n // add custom events here\n }", "setupListeners() {\n super.setupListeners();\n $('.sort-link').on('click', e => {\n const sortType = $(e.currentTarget).data('type');\n this.direction = this.sort === sortType ? -this.direction : 1;\n this.sort = sortType;\n this.updateTable();\n });\n $('.clear-pages').on('click', () => {\n this.resetView(true);\n this.focusSelect2();\n });\n $('#pv_form').on('submit', e => {\n e.preventDefault(); // prevent page from reloading\n this.processInput();\n });\n $('.another-query').on('click', () => {\n this.setState('initial');\n this.pushParams(true);\n });\n }", "function _bindEventHandlers() {\n\t\t$(\"a[data-toggle='pill'], a[data-toggle='tab']\").on('shown.bs.tab', function() {\n\t\t\t//\tevery time the tab is changed, modify footer\n\t\t\tGeneralFunctions.placeFooterToBottom();\n\t\t});\n\t\t\n\t\t$('#replyWindow').on('hidden.bs.modal', function() {\n\t\t\t//\tcache\n\t\t\tvar content = $('#reply-content').val();\n\t\t\tvar $curAnsEl = $('.question-answer[data-answer-id=\"' + $('#reply_answer_id').val() + '\"]');\n\t\t\t$curAnsEl.find('.reply_msg_cache').val(content);\n\t\t\t//\tclear\n\t\t\t$('#reply-content').val('');\n\t\t\t$('#reply_answer_id').val('');\n\t\t});\n\t\t\n helper.bindEventHandlers();\n }" ]
[ "0.7516249", "0.7350204", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7251491", "0.7153753", "0.7005838", "0.6999509", "0.6977762", "0.6917337", "0.6901427", "0.6866747", "0.6860553", "0.6850607", "0.6841356", "0.68315876", "0.67615944", "0.67525566", "0.6720686", "0.67185855", "0.67101425", "0.6709171", "0.665879", "0.6625623", "0.6622466", "0.6614418", "0.66104645", "0.6606663", "0.6597967", "0.6569089", "0.65678936", "0.6566274", "0.6564128", "0.65583783", "0.65522176", "0.6551574", "0.6544718", "0.65432745", "0.65271086", "0.6511574", "0.650261", "0.6499851", "0.6497867", "0.6497263", "0.64793444", "0.64786047", "0.6477096", "0.64757806", "0.64705956", "0.6458313", "0.6446442", "0.64370316", "0.6426056", "0.64232725", "0.6421709", "0.64215994", "0.64144033", "0.6414125", "0.64120495", "0.6404797", "0.6397011", "0.6372698", "0.63682824", "0.63604647", "0.6359344", "0.6359344", "0.6359012", "0.6358018", "0.6358018", "0.6345261", "0.634469", "0.63319814", "0.6330921", "0.63289636", "0.63243365", "0.6322135", "0.6309986", "0.63043666", "0.629477", "0.62782425", "0.6259396", "0.62586576", "0.6251247", "0.62499803" ]
0.0
-1
Detect click on background to toggle selections
function handleToggleSelection(e) { if (e.target.classList.contains("canva")) { store.removeSelection(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleBackgroundSelect() {\n if (graphicsMode == '4') {\n document.getElementById('background-select-container').style.display = 'block';\n } else {\n document.getElementById('background-select-container').style.display = 'none';\n }\n }", "function mouseDown(event) {\n mouseClicked = true;\n startPoint = new Point(event.offsetX, event.offsetY);\n var figure = getIntersectedFigure();\n\n if (ButtonState === CANVAS_STATE.SELECTED) {//? da se iznesyt\n unselectAllFigure();\n currentFigure = undefined;\n selectedFigure = undefined;\n selectFigure();\n\n }\n\n if (ButtonState === CANVAS_STATE.SELECTED && figure === false) {\n unselectAllFigure();\n }\n}", "function listenFeature(id) {\n var featureChoice = document.getElementById(id);\n if (typeof window.addEventListener === 'function') {\n featureChoice.addEventListener(\"click\", function() {\n console.log(featureChoice.style.backgroundColor);\n if (featureChoice.style.backgroundColor == 'rgb(244, 222, 199)') {\n featureChoice.style.backgroundColor = '#AB6B3A';\n featureChoice.style.color = 'white';\n selectFeature(featureChoice.innerHTML);\n } else {\n featureChoice.style.backgroundColor = '#F4DEC7';\n featureChoice.style.color = 'black';\n unselectFeature(featureChoice.innerHTML);\n }\n });\n }\n }", "function changeBackground() {\n getId('img').style.display = 'none';\n getId(\"images-colors\").style.display = \"block\";\n getSel(\".bg-colors\").style.display = \"block\";\n getSel('.file').style.display = \"none\";\n let list = document.getElementsByClassName('parts-item');\n for (let i = 0; i < list.length; i++) {\n list[i].onclick = function () {\n document.body.style.backgroundColor = event.target.style.backgroundColor;\n }\n }\n}", "function toggleSelection(image) {\n image.classList.toggle(\"selected\");\n}", "function bgClicked(e) {\n setNewSource(null);\n setTempLine(null);\n setMouseListenerOn(false);\n }", "function clickPalette() {\n colorPalette.addEventListener('click', (selectedColor) => {\n const eventTarget = selectedColor.target;\n const color = document.getElementsByClassName('color');\n for (let index = 0; index < color.length; index += 1) {\n color[index].classList.remove('selected');\n if (eventTarget.className === 'color') {\n eventTarget.classList.add('selected');\n }\n }\n });\n}", "mouseClicked(){\n //If we are highlighted and we clicked, return true\n if(this.highlighted){\n return true\n }\n //Else return false\n return false;\n }", "function listenTarget(id) {\n var targetChoice = document.getElementById(id);\n if (typeof window.addEventListener === 'function') {\n targetChoice.addEventListener(\"click\", function() {\n console.log(targetChoice.style.backgroundColor);\n if (targetChoice.style.backgroundColor == 'rgb(244, 222, 199)') {\n targetChoice.style.backgroundColor = '#AB6B3A';\n targetChoice.style.color = 'white';\n\n if (selected_target != null) {\n prevTargetChoice = selected_target;\n prevTargetChoice.style.backgroundColor = '#F4DEC7';\n prevTargetChoice.style.color = 'black';\n unselectTarget(prevTargetChoice.innerHTML);\n }\n\n selected_target = targetChoice;\n selectTarget(targetChoice.innerHTML);\n } else {\n targetChoice.style.backgroundColor = '#F4DEC7';\n targetChoice.style.color = 'black';\n unselectTarget(targetChoice.innerHTML);\n }\n });\n }\n }", "function draw() {\n let isClicked = false;\n const cells = document.querySelectorAll('.container-item');\n\n cells.forEach((item) => item.addEventListener('mousedown', () => {\n isClicked = true;\n }));\n\n cells.forEach((item) => item.addEventListener('mousemove', (event) => {\n if (isClicked === true) {\n event.target.style.background = colors[currentColor];\n }\n }));\n\n cells.forEach((item) => item.addEventListener('mouseup', () => {\n isClicked = false;\n }));\n}", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "function interactionClicked() {\r\n if (highlighted) {\r\n document.getElementById('options').style.visibility = showing ? 'hidden' : 'visible';\r\n showing = !showing;\r\n }\r\n}", "function agpColorInCanvas(evt) {\n // the blnMouseDown flag detects whether the mouse down event is triggered\n // this will be true whether activated for a single click or continuous depression\n if (blnMouseDown===true){\n evt.target.style.backgroundColor = agpColorSelected;\n }\n}", "function toggleSelectionState(e) {\n // console.log(e.target)\n // console.log(e.target.dataset.selected)\n if (e.target.dataset.selected === \"true\") {\n // console.log(\"it's true\")\n e.target.dataset.selected = \"false\"\n } else {\n // console.log(\"it's a nope\")\n e.target.dataset.selected = \"true\"\n }\n}", "function click() {\n if(seleccionado==this) {\n this.style.backgroundColor=\"transparent\";\n seleccionado=null;\n }\n else {\n if(seleccionado!=null) \n seleccionado.style.backgroundColor=\"transparent\";\n this.style.backgroundColor=\"#e0b\";\n seleccionado=this;\n }\n \n}", "function setClassSelected() {\n const colorPalette = document.querySelectorAll('.color');\n\n for (let index = 0; index < colorPalette.length; index += 1) {\n colorPalette[index].addEventListener('click', (event) => {\n removeSelectedClass();\n event.target.classList.toggle('selected');\n });\n }\n}", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function changeCell() {\n var clicked = document.getElementById(\"box\").click;\n if (clicked == true) {\n alert(\"box clicked\")\n document.getElementById(\"box\").background = colorSelected;\n }\n // mouse clicks on cell change to colorSelecetd value\n}", "function mousedown() {\n \"use strict\";\n mouseclicked = !mouseclicked;\n}", "function toggleSelection() {\r\n // we want to update our UI to make it look like\r\n //we're making a selection\r\n //debugger;\r\n // toggle CSS class to the element with JavaScript\r\n this.classList.toggle(\"selected\");\r\n console.log(this.id);\r\n }", "function mouseClick(event) {\n const id = event.target.id;\n\n // Check if click was made on the background\n if (id === \"background\")\n return;\n\n // Update selector if it wasn't over the clicked card \n // (mixed controls behaviour bug)\n if (mouseOver !== selectorOver)\n updateSelector(mouseOver);\n\n pickCard();\n}", "function chooseBG() {\n let startScreen = document.getElementById(\"title-page\");\n startScreen.style.display = \"none\";\n let bgScreen = document.getElementById(\"show-bg\");\n bgScreen.style.display = \"flex\";\n let bgDay = document.getElementById(\"day\");\n bgDay.addEventListener(\"click\", function () {\n startPicture();\n });\n let bgNight = document.getElementById(\"night\");\n bgNight.addEventListener(\"click\", function () {\n day = false;\n startPicture();\n });\n }", "handleContextClick(args){\n if(this.shapeSelectionEnabled) {\n this.selectShape(args);\n }\n }", "function toggleSelection() {\n\t\t//we want uodate our UI to look like we are making a selection\n\t\t//debugger;\n\t\t//toggle a css class to the element with JavaScript\n\t\tthis.classList.toggle(\"selected\");\n\t\tconsole.log(this.id);\n\t}", "click(event){\n if(event.target.tagName === \"MULTI-SELECTION\"){\n const onContainerMouseClick = this.onContainerMouseClick;\n\n if(onContainerMouseClick){\n onContainerMouseClick();\n }\n }\n }", "function clickFunction(e){\n var currLine = getCurrentLine(this);\n num_lines_selected = 1; //returns to default, in case just clicking, if it is selected that's taken care of in subsequent onselect\n prevLine = currLine;\n}", "function selectColor(e) {\n e.siblings().removeClass(\"selected\");\n e.addClass(\"selected\");\n }", "toggleSelected() {\n\t\t\tthis._selected = !this._selected;\n\t\t}", "function OnMouseDown()\n{\t\n if(manager.turn == color)\n {\n if(color == 0 && gameObject.tag == \"Inactive White Piece\")\n {\n transform.gameObject.tag = \"Active White Piece\";\n movement();\n }\n else if(color == 0 && gameObject.tag == \"Active White Piece\")\n {\n \tmanager.unhighlightAllSquares();\n \ttransform.gameObject.tag = \"Inactive White Piece\";\n }\n else if(color == 1 && gameObject.tag == \"Inactive Black Piece\")\n {\n transform.gameObject.tag = \"Active Black Piece\";\n movement();\n }\n else if(color == 1 && gameObject.tag == \"Active Black Piece\")\n {\n \tmanager.unhighlightAllSquares();\n \ttransform.gameObject.tag = \"Inactive Black Piece\";\n }\n }\n}", "toggleOverlay(){\n this.overlay = document.querySelector(\".background-overlay\");\n (this.overlay.classList.contains(\"dis-none\"))?this.overlay.classList.remove(\"dis-none\"):this.overlay.classList.add(\"dis-none\");\n this.overlay.addEventListener(\"click\", (e)=>{\n e.preventDefault();\n this.overlay.classList.add(\"dis-none\");\n [\"file\",\"rotate\",\"brush\",\"outline\",\"fills\",\"size\"].forEach(e=> {\n this.listShow = document.querySelector(`.${e}-list`);\n this.listShow.classList.add(\"dis-none\"); \n this.listShow.classList.remove(\"dis-grid\");\n }) \n })\n }", "function selectButtonOnClick(ev)\n{\n\t//console.log(\"selectButtonOnClick(\", ev, \")\");\n\tstopPointTable.toggleCheckBoxVisibility();\n}", "clicked(x, y) {}", "function toggle() {\n toggleSelected(!selected);\n handleThemeChange();\n }", "function clickHandler(e) {\n var layer = e.target;\n if (plugin.selectionLegend.isSelected(layer)) {\n plugin.selectionLegend.removeSelection(layer);\n plugin.unhighlightFeature(layer);\n }\n else {\n plugin.selectionLegend.addSelection(layer);\n plugin.highlightFeature(layer);\n plugin.zoomToFeature(layer);\n }\n }", "function highlight_toggle(div_name){\n\n\tif(div_name.highlight==false){\n\t\tdiv_name.highlight=true;\n\t\tdrag_manager.selected+=1;\n\t\tdiv_name.style.backgroundColor = \"#e8edf3\";\t\t\n\t\tdiv_name.style.zIndex = \"1\";\n\t}else{\n\t\tdiv_name.highlight=false;\n\t\tdrag_manager.selected-=1;\n\t\tdiv_name.style.backgroundColor = \"#ffffff\";\t\t\n\t\tdiv_name.style.zIndex = \"0\";\n\t}\n\t\n}", "function menuHighlightClick(event) {\n // console.log('menuHighlightClick');\n\n event.preventDefault();\n\n SvgModule.Data.Highlighting = !SvgModule.Data.Highlighting;\n\n updateMenu();\n}", "function toggleBackground() {\n const width = displayedImage.width();\n const height = displayedImage.height();\n overlay.width(width).height(height);\n if (btn.html().match(/Darken/)) {\n overlay.css({background: 'rgba(0,0,0,0.5)'});\n btn.html('Lighten');\n } else {\n overlay.css({background: 'rgba(0,0,0,0)'});\n btn.html('Darken');\n }\n }", "function initColorChange(){\n var colorButton = document.querySelectorAll('.circle');\n [].forEach.call(colorButton,function(item) {\n item.addEventListener('click',function (e) {\n [].forEach.call(colorButton,function (item) {\n if(item.classList.contains('selected')){\n item.classList.remove('selected');\n }\n })\n model.data.currentColor = colorList.indexOf(item.id);\n update();\n })\n\n })\n}", "function click_color_selection(id, color) {\n var split_id = id.split('-');\n var filetype = split_id[1];\n var forebackground = split_id[2];\n var filetype_id = available_filetypes.indexOf(filetype);\n (forebackground == 'foreground' ? selected_foreground_colors : selected_background_colors)[filetype_id] = color;\n\n update_everything();\n }", "function setDrawFlgWhenClick() {\n console.log(\"setDrawFlgWhenClick\");\n for (var i in selectedAnnos) {\n var e = SVG.get(selectedAnnos[i]);\n if (hasIntersection(iv.sMultipleSvg, e)) {\n return false;\n }\n }\n\n if (clickOnSelectedBound) {\n return false;\n }\n return true;\n}", "function toggleSelectedPicture() {\n\t$(\"#selectedPicture\").toggle();\n\t$(\".glass\").toggle();\n}", "function blindBackgroundClicked() {\n\tblindBeingControlled = false;\n\thideBlindControl();\n}", "function sketchClick(e) {\n\n if (eraser) {\n e.target.style.backgroundColor = '';\n console.log(e.target.style.backgroundColor);\n } else if (rainbow) {\n e.target.style.backgroundColor = randomColor();\n\n } else if (shading) {\n e.target.style.backgroundColor = adjust(RGBToHex, e.target.style.backgroundColor, -15);\n\n } else if (lighten) {\n e.target.style.backgroundColor = adjust(RGBToHex, e.target.style.backgroundColor, +15);\n\n } else {\n e.target.style.backgroundColor = ink;\n }\n}", "function selectColor(event) {\n const selectedColor = document.querySelector('.selected');\n const currentColor = event.target;\n selectedColor.classList.remove('selected');\n currentColor.classList.add('selected');\n presentColor = currentColor.style.backgroundColor;\n}", "function paintSelected() {\n const selectTask = taskList;\n selectTask.addEventListener('click', (selectEvent) => {\n const listItem = document.querySelectorAll('.list-item');\n for (let index = 0; index < listItem.length; index += 1) {\n if (listItem[index] === selectEvent.target) {\n selectEvent.target.classList.add('selected');\n } else {\n listItem[index].classList.remove('selected');\n }\n }\n });\n}", "function OnMouseDownDiagram(e) {\n if (multipleSelectionMode == true) {\n var multipleSelectorDiv = document.getElementById('multipleSelectorDiv');\n multipleSelectorDiv.hidden = 0;\n x1mDiv = e.screenX - 365;\n y1mDiv = e.screenY - 85;\n reCalc();\n }\n}", "function highlight_main_toggle(div_name){\n\n\tif(div_name.mainhightlight == undefined){\n\n\t\tdiv_name.mainhighlight == true;\n\n\t}\n\n\tif(!div_name.mainhighlight){\n\t\tdiv_name.style.backgroundColor = \"#e8edf3\";\t\t\n\t\tdiv_name.mainhighlight = true;\n\t}else{\n\t\tdiv_name.style.backgroundColor = \"#ffffff\";\t\t\n\t\tdiv_name.mainhighlight = false;\n\t}\n\n\tfor(q=0;q<drag_manager.selected_items.length;q++){\n\n\t\tif(drag_manager.selected_items[q].highlight){\n\n\t\t\thighlight(drag_manager.selected_items[q]);\n\n\t\t}\n\n\t}\n\n\tif(div_name.id==\"recyclebin\"){\n\n\t\tdocument.getElementById(\"folder_workspace\").style.backgroundColor = \"#ffffff\";\t\t\n\t\tdocument.getElementById(\"folder_workspace\").mainhighlight = false;\n\n\t}else{\n\n\t\tdocument.getElementById(\"recyclebin\").style.backgroundColor = \"#ffffff\";\t\t\n\t\tdocument.getElementById(\"recyclebin\").mainhighlight = false;\n\n\t}\n\n\tdrag_manager.selected_items.splice(0,drag_manager.selected_items.length);\n\n\tbutton_check();\n\t\n}", "function click() {\r\n\t// if the piece is highlighted, move the piece\r\n\tif(this.className == \"highlight\") {\r\n\t\tmove(this);\r\n\t}\r\n}", "function clickBG(btnId) {\n if (btnId.style.backgroundColor == 'white') {\n btnId.style.backgroundColor = '#7C3AED';\n btnId.style.color = 'white';\n } else {\n btnId.style.backgroundColor = 'white';\n btnId.style.color = 'black';\n }\n}", "function buttonClicked(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function click() {\n\t// If clicking on a cell with your piece in it, highlight the cell\n\tif (!selectedBox) { // 1st click\n\t\tif ((!blueTurn && this.hasClassName(\"red\")) || (blueTurn && this.hasClassName(\"blue\"))) {\n\t\t\tthis.addClassName(\"selected\");\n\t\t\tselectedBox = this;\n\t\t}\n\t}\n\t\n\t// Player is trying to move a piece\n\telse { // 2nd click\n\t\tselectedBox.removeClassName(\"selected\");\n\t\tthis.onmouseout();\n\t\t\n\t\t// If there are forced jumps and player is not jumping, highlight forced jumps\n\t\tif (forcedJumps != false) {\n\t\t\tif (!jump(this)) {\n\t\t\t\thighlightForcedJumps(forcedJumps);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Try moving, then try jumping\n\t\telse if (!move(this))\n\t\t\tjump(this);\n\t\t\t\n\t\tselectedBox = null;\n\t\tcheckVictory();\n\t}\n}", "function highlightFlavors(flavors) {\n flavors.forEach(function(flavor) {\n\tvar flavElem = flavor.element;\n\tflavElem.addEventListener(\"click\", function(event) {\n\tif(!flavElem.classList.contains(\"highlighted\")) \n\t flavElem.classList.add(\"highlighted\");\n \telse flavElem.classList.remove(\"highlighted\");\n })});\n }", "function hero_selected(){\n $('.option_select_sound').trigger('play');\n $('.ultron').addClass('grayscale').removeClass('dropshadow');\n $('.select_villain').removeClass('dropshadow');\n $('.select_hero').addClass('dropshadow');\n $('.captain_america').removeClass('grayscale').addClass('dropshadow');\n $('.select_play').off('click', play_game).on('click', play_game);\n game_mode = 'hero';\n}", "function backgroundColorSincrire() {\r\n $(li2).addClass('backgroundColorClick');\r\n if(li1.hasClass('backgroundColorClick')){\r\n li1.removeClass('backgroundColorClick');\r\n }\r\n if(li3.hasClass('backgroundColorClick')){\r\n li3.removeClass('backgroundColorClick');\r\n }\r\n }", "function clickListener() {\n document.addEventListener(\"click\", function (e) {\n if (e.target.className != \"context-menu__link\")\n selectedImg = null;\n toggleMenuOff();\n });\n //var imgs = document.getElementsByTagName(\"img\");\n ////console.log(imgs);\n //for (var i = 0; i < imgs.length;i++)\n //{\n // var img = imgs[i];\n // img.oncontextmenu = function (e) {\n // toggleMenuOn();\n // };\n //}\n \n }", "function mode1_onclick(e) {\n var x = Math.floor((e.offsetX) / brickSize);\n var y = Math.floor((e.offsetY) / brickSize);\n\n if(!checkBounds(x, y)) return;\n\n if(selected) {\n var sx = selected.x;\n var sy = selected.y;\n if(adjacent(x, y, sx, sy)) {\n if((!bricks[x][y] || !bricks[x][y].set)) {\n swap(x, y, sx, sy);\n }\n selected = null;\n } else {\n selected = (x == sx && y == sy) ? null : {x: x, y: y};\n }\n } else if(bricks[x][y] && !bricks[x][y].set) {\n selected = {x: x, y: y};\n } else {\n selected = null;\n }\n}", "function mouseDoubleClickBox(){\n box.style.backgroundColor = \"green\"\n}", "function UISelection(){\n\n }", "function changeColorSelected() {\n const getColorsPallete = document.querySelector('#color-palette');\n getColorsPallete.addEventListener('click', function (event) {\n removeSelectedClass();\n event.target.classList.add('selected');\n applySelectedColor()\n getSelectedColor()\n })\n}", "onToggle() {}", "function changeColorPixel(event) {\n const selected = document.querySelector('.selected').style.backgroundColor;\n event.target.style.backgroundColor = selected;\n}", "change(e) {\n if(e.target.checked) {\n e.target.parentElement.parentElement.setAttribute(\"Style\", \"background-color: green\");\n }\n else {\n e.target.parentElement.parentElement.setAttribute(\"Style\", \"background-color: none\");\n }\n }", "function toggleHighlight(e) {\n if (e.target.nodeName === 'A') {\n return;\n }\n e.currentTarget.classList.toggle('highlight');\n}", "toggleBackground(){\n this.setState({background: !this.state.background})\n }", "function addClickListeners() {\n $('#bg-1').on('click', function() {\n if (!cStatus.speaking && !game.quiz[game.p].answered) answerFeedback($(this).attr('id'));\n });\n $('#bg-2').on('click', function() {\n if (!cStatus.speaking && !game.quiz[game.p].answered) answerFeedback($(this).attr('id'));\n });\n $('#bg-3').on('click', function() {\n if (!cStatus.speaking && !game.quiz[game.p].answered) answerFeedback($(this).attr('id'));\n });\n $('#bg-4').on('click', function() {\n if (!cStatus.speaking && !game.quiz[game.p].answered) answerFeedback($(this).attr('id'));\n });\n}", "function clickShape() {\n\tidName('shape-layer').style.pointerEvents = 'auto';\n\tclassName('upper-canvas')[0].style.pointerEvents = 'auto';\n\tidName('paint-layer').style.pointerEvents = 'none';\n}", "function OnMouseDown() {\n isMouseDown = true;\n\t\n}", "toggleHighlight() {\n\t\tthis.setState({\n\t\t\tcheckHighlighted: !this.state.checkHighlighted\n\t\t});\n\t}", "function onMouseDown(e) {\n\tclickStart = e;\n\tbox = L.rectangle(L.latLngBounds(e.latlng, e.latlng), {fill: false, color: SELECTED_BOX_COLOR}).addTo(map);\n\tclick = true;\n deselectBox();\n removeMiniBox();\n}", "function toggle_bg()\n{\n var preview = $(\"#preview\");\n var bg_switch = $(\"#switch-toggle-bg\");\n\n if (preview.hasClass(\"preview-light\"))\n {\n preview\n .removeClass(\"preview-light\")\n .addClass(\"preview-dark\");\n\n bg_switch\n .removeClass(\"switch-toggle-bg-light\")\n .addClass(\"switch-toggle-bg-dark\");\n }\n else\n {\n preview\n .removeClass(\"preview-dark\")\n .addClass(\"preview-light\");\n\n bg_switch\n .removeClass(\"switch-toggle-bg-dark\")\n .addClass(\"switch-toggle-bg-light\");\n }\n\n match_spectrums();\n}", "function applySelectedColor() {\n const getPaintTable = document.querySelector('#pixel-board');\n\n getPaintTable.addEventListener('click', function (event) {\n const getSelectedColor = document.querySelector('.selected');\n const compStyles = window.getComputedStyle(getSelectedColor);\n event.target.style.backgroundColor = compStyles.getPropertyValue('background-color');\n });\n}", "checkToggleHighlight() {\n for (const n of this.unflaggedNeighbours)\n n.uiBox.classList.toggle(\"highlight\");\n }", "function mousePressed() {\r\n mouseIsDown = true;\r\n}", "function selectSimulator(event, element, container){\n event.stopPropagation();\n element.siblings(container).toggleClass(\"open\"); \n }", "function clickedLight(){\n document.body.style.color = 'white';\n document.body.style.backgroundColor = 'black';\n}", "function mouseClicked(){\n mouse_bool = true; \n music_bool = true; \n\n}", "function isSelected (square) {\n if (square.classList.contains('box-select')) {\n return true;\n } else {\n return false;\n };\n}", "function toggleSelect() {\n toggleSelectTask(requireCursor());\n }", "function SelectionChange() { }", "function SelectionChange() { }", "toggle() {\n this.selected = !this.selected;\n }", "toggle() {\n this.selected = !this.selected;\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "function greenClick(){\n $(this).unbind(\"mouseleave\");\n $(this).css('background-color','green');\n \n \n if($(\".container div .zone \").stylee.background-color==='green'){\n console.log(\"congratulations!!!\"); \n }\n\n \n \n }", "function toggle() {\n if (shouldActivateBackgroundColor) {\n window.document.body.style.backgroundColor = '#333';\n shouldActivateBackgroundColor = false\n } else {\n window.document.body.style.backgroundColor = originalBackgroundColor;\n shouldActivateBackgroundColor = true\n }\n}", "toggle(value) {\n this.isSelected(value) ? this.deselect(value) : this.select(value);\n }", "function unselectByClick() {\n const points = this.getSelectedPoints();\n\n if (points.length > 0) {\n Highcharts.each(points, function(point) {\n if (selectedFlag.get() !== null) {\n point.update({\n color: flagsHash[selectedFlag.get()].color,\n name: flagsHash[selectedFlag.get()].val\n }, true);\n }\n point.select(false);\n });\n }\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function mouseClicked() {\n colorindex = ((colorindex+1)%colors.length)\n bgColor = colors[2][1]\n circleColor = colors[2][0];\n}", "toggle(value) {\n this.isSelected(value) ? this.deselect(value) : this.select(value);\n }", "toggle(value) {\n this.isSelected(value) ? this.deselect(value) : this.select(value);\n }", "function buttonClick(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "setClickSelect(state, click) {\n state.isClickSelect = click;\n }", "function highlight(){\n\t$(\"p\").unbind('click').click(function(event) {\n\t\t$(this).toggleClass(\"highlight\");\n\t});\n}", "handleClick() {\n this.canvas.addEventListener('mousedown', event => {\n if (!this.paused) {\n this.collisionTest(event);\n }\n });\n }", "function touch(){\n\tfor (var i=0; i<objects.length; i++){\n\t\tobjects[i].addEventListener(\"click\", function(){\n\t\t\tif (this.style.background === trans_color)\n\t\t\t\tclear();\n\t\t});\n\t}\n}", "function changeColorOrBg(element){\n let flag = 'color';\n getS('.colors').classList.remove('hide');\n for (let i = 0; i < getS('.colors').children.length; i++) {\n getS('.colors').children[i].style.backgroundColor = colors[i];\n getS('.colors').children[i].onclick = function(){\n if (flag == element){\n getS('.top-block').style.color = this.style.backgroundColor;\n }else{\n getS('.top-block').style.backgroundColor = this.style.backgroundColor;\n }\n getS('.colors').classList.add('hide');\n }\n }\n}" ]
[ "0.6826609", "0.6424835", "0.63468754", "0.63357145", "0.6323289", "0.6296135", "0.6235542", "0.6206825", "0.61120766", "0.60943407", "0.60400695", "0.6002417", "0.6001217", "0.59878427", "0.5977825", "0.5938097", "0.59321463", "0.5925092", "0.59235936", "0.5915533", "0.5911813", "0.5897358", "0.58908355", "0.58877885", "0.5872733", "0.58623296", "0.5850518", "0.58411646", "0.5818347", "0.58006245", "0.57816756", "0.57813543", "0.57652134", "0.57628334", "0.57610303", "0.57578933", "0.5754689", "0.57504755", "0.5748322", "0.5744508", "0.5740719", "0.5726062", "0.5723419", "0.57217586", "0.57209367", "0.57102036", "0.5707171", "0.5703969", "0.57015556", "0.56917", "0.5691613", "0.5689857", "0.5688848", "0.5682958", "0.5675054", "0.5673598", "0.5666356", "0.56657463", "0.5663025", "0.5650444", "0.5644603", "0.56436896", "0.5638653", "0.5636475", "0.56273466", "0.56246", "0.5613254", "0.56126463", "0.5610762", "0.560025", "0.55975014", "0.5596172", "0.5586778", "0.5572525", "0.5571906", "0.5564444", "0.5562697", "0.5562108", "0.55620855", "0.55620855", "0.5557774", "0.5557774", "0.5551518", "0.5550001", "0.5548119", "0.5547187", "0.55467224", "0.5545601", "0.5545601", "0.5545601", "0.5545601", "0.55450165", "0.55413425", "0.55413425", "0.55403966", "0.55386317", "0.55325735", "0.5527384", "0.5526552", "0.55257756" ]
0.6191457
8
called before dom elements are mounted, to get current user
componentWillMount() { this.fetchBookmarks() this.fetchUsers() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRendered() {\n identifyUser();\n}", "function userget(){\n document.getElementById('current-user').innerHTML = current_user;\n }", "function loadCurrentUser() {\n UserService.GetCurrentUser()\n .then(function (response) {\n vm.user = response.data;\n });\n }", "function user() {\n return currentUser;\n }", "componentDidMount() {\n\n this.loadCurrentUser();\n }", "function getUserData() {\n if (document.getElementById(\"current-user\")) {\n currentUser = JSON.parse(document.getElementById(\"current-user\").textContent);\n console.log(\"==Retrived user info:\", currentUser);\n console.log(\"Succesfully logged in as\\nUsername:\", currentUser.username, \"\\nDisplay Name:\", currentUser.displayName);\n if (!(currentUser.username && currentUser.displayName)) {\n alert(\"Error: You have been logged out due to an error in function \\\"getUserData\\\" in index.js or \\\"app.use\\\" in server.js.\");\n currentUser = \"\";\n } else {\n updateDisplayLogin();\n }\n }\n}", "init() {\n _listenToCurrentUser();\n }", "function current() {\n return user;\n }", "function getCurrentUser() {\n let userId = $('#cu').data(\"cu\");\n user = new User({id: userId});\n return user;\n}", "function getCurrentUser()\n{ \n\treturn currentUser;\n}", "function init() {\n\n UserService\n // .findUserById(userId)\n .findCurrentUser() //returning the current user from session which is stored in req.user on server\n .success(function (user) {\n if(user != '0') {\n vm.user = user;\n }\n })\n .error(function () {\n\n });\n }", "componentDidMount() {\n // this.clientTracker = Tracker.autorun(() => {}\n // const user = Users.find().fetch();\n // this.setState ({ user });\n if (!Meteor.userId()) {\n this.setState({user: 'Not Logged In'});\n } else {\n this.setState({user: Meteor.user().emails[0].address});\n }\n }", "get user() { return this.user_; }", "componentDidMount(){\n Tracker.autorun(() => {\n let user = Meteor.users.findOne({_id: this.props.currentUserId});\n if (typeof user == 'undefined') {\n this.username = 'User';\n } else {\n this.username = user.username;\n this.updateUsername(this.username);\n }\n });\n }", "function updateAuthenticatedUI() {\n const authUser = CACHE.getAuthenticatedUserFromCache();\n if (authUser) {\n STATE.authUser = authUser;\n $(\".auth-menu\").removeAttr(\"hidden\");\n } else {\n $(\".default-menu\").removeAttr(\"hidden\");\n }\n}", "function updateAuthenticatedUI() {\n const authUser = CACHE.getAuthenticatedUserFromCache();\n if (authUser) {\n STATE.authUser = authUser;\n $(\".auth-menu\").removeAttr(\"hidden\");\n } else {\n $(\".default-menu\").removeAttr(\"hidden\");\n }\n}", "function updateAuthenticatedUI() {\n const authUser = CACHE.getAuthenticatedUserFromCache();\n if (authUser) {\n STATE.authUser = authUser;\n $('.auth-menu').removeAttr('hidden');\n } else {\n $('.default-menu').removeAttr('hidden');\n }\n}", "componentDidMount() {\n Tracker.autorun(() => {\n var userId = Meteor.userId();\n if (!userId) {\n this.setState({ loggedIn: userId });\n } else {\n this.setState({ loggedIn: userId });\n }\n });\n }", "_notifyListenersIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n this.notifyAuthListeners();\r\n }\r\n }", "_notifyListenersIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n this.notifyAuthListeners();\r\n }\r\n }", "function detectLogin()\n {\n $.when(api.whoami()).done(function(user)\n {\n // update the UI to reflect the currently logged in user.\n topnav.update(user.firstName + ' ' + user.lastName);\n }).fail(function()\n {\n topnav.clear();\n });\n }", "function loadUserData() {\n firebaseFunctions.setCurrentUserData( ( user ) => {\n currentUser.innerText = user.name;\n currentUser.dataset.uid = user.id;\n currentUser.dataset.pubKey = user.chavePublica;\n } );\n}", "function getUser () {return user;}", "function load_user() {\n // get user id from local storage\n const localStorageCurrentUserId = localStorage.getItem(\"currentUserId\");\n\n // make a REST HTTP request for all users using the app\n const request = new XMLHttpRequest();\n request.open('GET', `/users`);\n request.onload = () => {\n const allAppUsers = JSON.parse(request.responseText);\n\n // if there is a locally stored user and that user is in the servers list of current users...\n if (localStorageCurrentUserId && (allAppUsers.find((user) => user.id === localStorageCurrentUserId))) {\n\n // store that user as the apps currentUser and update the DOM accordingly\n currentUserId = localStorageCurrentUserId;\n selectors.displayNameModalTextField.val(allAppUsers.find((user) => user.id === localStorageCurrentUserId).displayName);\n selectors.displayNameModal.modal('hide');\n } else {\n // else reveal the display name modal (the locally stored user isn't there or is invalid)\n selectors.displayNameModal.modal('show');\n }\n };\n request.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n request.send();\n}", "function setUserTemplate() {\n // Get handlebars template\n // And compile it (populate data)\n var userData = JSON.parse(sessionStorage.getItem('behanceUser'));\n var getTemplate = $('#profile-template').html();\n var template = Handlebars.compile(getTemplate);\n var result = template(userData);\n $('#about').html(result);\n $('#about .loading-img').remove();\n }", "getCurrentUser() {\r\n return this.users[0];\r\n }", "static getCurrentUserID() {\n const myInfo = (document.querySelector('.mmUserStats .avatar a'));\n if (myInfo) {\n const userID = this.endOfHref(myInfo);\n console.log(`[M+] Logged in userID is ${userID}`);\n return userID;\n }\n console.log('No logged in user found.');\n return '';\n }", "function getUser(){\n $.ajax({\n method: 'GET',\n url: '/users',\n success: function(userData){\n currentUser.name = userData.name;\n currentUser.handle = userData.handle;\n currentUser.id = userData.uid;\n currentUser.avatars = { small: userData.avatar };\n $('#user').text('@'+ currentUser.handle);\n $('.logged-in-avatar img').attr('src', (currentUser.avatars.small || noUserIcon ));\n if (currentUser.handle){\n $('.compose button').show();\n $('.logged-in-info').show();\n $('.logged-out-info').hide();\n } else {\n $('.compose button, .new-tweet').hide();\n $('.logged-in-info').hide();\n $('.logged-out-info').show();\n }\n $('.auth').show();\n loadTweets(); \n },\n });\n }", "function renderUsername() {\n\n $(\".username-text\").text(firebase.auth().currentUser.email);\n\n}", "function renderUserDiv() {\n return (\n <p>Check out this cool site, {currentUser.first_name}!</p>\n )\n }", "function checkIfUserInitialized() {\n if (currentuser) {\n loadHomePage();\n } else {\n updateCurrentUser().then(function () {\n loadHomePage();\n }).catch(function () {\n loadSettingsPage();\n });\n }\n}", "get currentUser() {\r\n return new CurrentUser(this);\r\n }", "get _currentUser() {\r\n return this.currentUser;\r\n }", "get _currentUser() {\r\n return this.currentUser;\r\n }", "componentDidMount() {\n firebase.auth().onAuthStateChanged(firebaseUser => {\n const topHeader = document.getElementById('top_header');\n if(firebaseUser){\n const myRef = firebase.database().ref(\"users/\" + firebaseUser.uid);\n myRef.once('value', snapshot => {\n this.setState({\n user_role: snapshot.val().user_role\n });\n });\n topHeader.classList.remove('hide');\n } else {\n topHeader.classList.add('hide');\n }\n });\n }", "componentDidMount() {\n // console.log(\"currentUserContainer Mounted\")\n this.init()\n }", "componentDidMount() {\n this._loadFontsAsync()\n firebase.auth().onAuthStateChanged(user => {\n if (user !== null) {\n console.log(user)\n }\n })\n }", "function userLoggedIn() {\n let span = $('#loggedInUser');\n let username = localStorage.getItem('username');\n span.text(`Wellcome ${username}`);\n span.show();\n\n $('#linkHome').show();\n $('#linkListAds').show();\n $('#linkCreateAd').show();\n $('#linkLogout').show();\n\n $('#linkLogin').hide();\n $('#linkRegister').hide();\n }", "function getCurrentUser() {\n\n if ($localStorage.currentUser) {\n\n $rootScope.currentUser = JSON.parse($localStorage.currentUser);\n $rootScope.loggedIn = true;\n } else {\n\n $rootScope.loggedIn = false;\n }\n }", "function initUserInfo () {\r\n\t \tvar storedUserInfo = localStorage.getItem('user'), currentUser = null;\r\n\t \tif (!!storedUserInfo) {\r\n\t \t\tcurrentUser = JSON.parse(storedUserInfo);\r\n\t \t}\r\n\t \treturn currentUser;\r\n\t }", "function getCurrentUser() {\n \n return currentUser;\n }", "get uid() {\n return \"dom\"\n }", "render(){\n return (Meteor.user() !== undefined) ? this.getContent() : <div>Loading...</div>\n }", "get currentUser() {\n const activeUsers = this.users.filter(\n (user) => user.state === UserState.Active\n );\n\n if (activeUsers.length === 0) {\n return null;\n } else {\n // Current user is the top of the stack\n return activeUsers[0];\n }\n }", "get lblUsuarioLogado() { return $('div#app-root div.userinfo') }", "componentDidMount() {\n var sessionUser = JSON.parse(localStorage.getItem('user') || null);\n if (sessionUser != null) document.getElementById(\"home\").click();\n }", "componentDidMount() {\n var sessionUser = JSON.parse(localStorage.getItem('user') || null);\n if (sessionUser != null) document.getElementById(\"home\").click();\n }", "getCurrentUserId() {\r\n return JSON.parse(localStorage.getItem(\"user\")).id;\r\n }", "getMeteorData() {\n return {\n currentUser: Meteor.user()\n };\n }", "getMeteorData() {\n return {\n currentUser: Meteor.user()\n };\n }", "get user() {\n return this.use().user;\n }", "user() {\n return Member.findOne({_id: Meteor.userId()});\n\t}", "static currentUserId() {\n return localStorage.getItem('userid');\n }", "function getSelectedSystemUser() {\n\treturn getCache(EXTRA_SYSTEM_USER);\n}", "function addUserToDom( user ) {\n var user = new User( user );\n var html = user.getUserHtmlString();\n $('#users-window').append(html);\n }", "function findCurrentUser() {\n return \"stefan\"\n }", "initUser() {\n this.app.use(function (req, res, next) {\n res.locals.user = req.user || null;\n next();\n });\n }", "function updateAuthUI() {\n const authUser = CACHE.getAuthenticatedUser();\n if (authUser) {\n STATE.authUser = authUser;\n $('#authenticated-menu').css('display', 'block');\n $('#authenticated-menu').addClass('main-menu');\n } else {\n $('#unauthenticated-menu').css('display', 'block');\n $('#unauthenticated-menu').addClass('main-menu');\n }\n}", "function currentUser (){\n return JSON.parse(window.sessionStorage.getItem(\"user_info\"));\n}", "getCurrentUser() {\n var self = this;\n return self.user;\n }", "get activeUser() {\n return CacheRequest.getActiveUser(this);\n }", "get #username() {\n return $('#user-name');\n }", "function userAuthenticated(user) {\n //appendUserData(user);\n _currentUser = user;\n hideTabbar(false);\n init();\n _spaService.showPage(\"fridge\");\n //showLoader(false);\n}", "get user() {\n return this._user;\n }", "function currentUser(callback) {\n\tsendRequest({ request: 'current user' }, callback);\n}", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "componentWillMount() {\n // Sync the state from Firebase\n base.syncState(\"users\", {\n context: this,\n state: \"users\"\n });\n\n // Check if they have logged in before\n const localStorageUser = localStorage.getItem(\"pizza-love\");\n if (localStorageUser) {\n this.setState({ currentUser: localStorageUser });\n console.log(\"User Loaded from Local Storage\");\n }\n }", "init() {\n if (!sharedData.data['currentUser']) {\n const multiplayerAllowed = this.el.getElementsByClassName('js-multiplayer')[0];\n multiplayerAllowed.style.color = '#666666';\n multiplayerAllowed.style.borderColor = 'transparent';\n multiplayerAllowed.style.cursor = 'default';\n }\n if (sharedData.data['currentUser']) {\n const toLogoutForm = this.el.getElementsByClassName('js-logout-form')[0];\n toLogoutForm.addEventListener('submit', this.onLogout);\n }\n this.colour = new Colour('colors');\n }", "get userPopulated() {\n return this.user && this.user.id;\n }", "getCurrentUser() {\n return JSON.parse(localStorage.getItem('user'));\n }", "function getCurrentUser() {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList[0];\n}", "get user() {\n return this._user;\n }", "componentDidMount() {\n if (this.props.currentUser) {\n this.setState({\n thisUser: this.props.currentUser.id,\n })\n }\n }", "get user() { return this.args.user }", "currentUser(state, user) {\n state.currentUser = user;\n }", "isLoggedInUser() {\n return Meteor.userId() ? true : false;\n }", "function setUser() {\n user = new User($(\"#idh\").html(),$(\"#nameh\").html());\n}", "get user() {\n return this.fapp.get('user');\n }", "function setUser(_user){\n user = _user;\n domAttr.set('userNameDiv', 'innerHTML', _user.name);\n }", "checkTheUserOnTheFirstLoad() {\n return this.me().toPromise();\n }", "componentDidMount () {\n db.onceGetUsers().then(snapshot =>\n this.setState(() => ({ users: snapshot.val() }))\n )\n firebase.auth.onAuthStateChanged(authUser => {\n authUser\n ? this.setState(byPropKey('currentUser', authUser))\n : this.setState(byPropKey('currentUser', null))\n })\n }", "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "function User() {\n this.dataContentObject = $('#current-user').data('user');\n this.$tilesContainer = $('#tiles-container');\n this.tileClasses = \"col-lg-3 col-md-4 col-sm-6 col-xs-12 tile\";\n\n}", "function loadUser() {\n checkAdmin(username);\n hideElement(\"#btn-invite-form\");\n if (isAdmin) {\n // showElement(\"#btn-block-user\");\n showElement(\"#btn-delete-user\");\n showElement(\"#btn-ban-user\");\n showElement(\"#btn-set-admin\");\n hideElement(\"#btn-report-user\");\n showElement(\".incoming-message .btn-group\");\n if (chatroomType === \"Private\")\n showElement(\"#btn-invite-form\");\n } else {\n // hideElement(\"#btn-block-user\");\n hideElement(\"#btn-delete-user\");\n hideElement(\"#btn-ban-user\");\n hideElement(\"#btn-set-admin\");\n showElement(\"#btn-report-user\");\n hideElement(\".incoming-message .btn-group\");\n }\n}", "function show_manage_user(){\n var manage_user = fill_template('user-management',{});\n $('#dd-log-in-menu').remove();\n $('.navbar-nav').append(manage_user);\n $('#dd-manage-alerts').click( function(e) {\n show_manage_alerts();\n });\n $('#dd-log-out').click( function(e) {\n set_cookie('dd-email','', -100);\n show_log_in();\n });\n }", "componentDidMount() {\n this.props.getCurrentUser()\n }", "function init() {\n if (vm.isAuthenticated()) {\n vm.isFollowed = vm.user.followers.find(x => x._id == vm.currentUser._id) !== undefined;\n }\n }", "function init(){\n UserService\n .findUserById(userId)\n .then(function (response) {\n vm.user = response.data;\n });\n }", "componentWillMount(){\n \tthis.renderDefaultUser();\n }", "userEventManager() {\n const loginNow = document.getElementById(\"loginNow\");\n const signupNow = document.getElementById(\"signupNow\");\n\n if (loginNow === null) {\n signupNow.addEventListener(\"click\", this.signupUser, event);\n } else {\n loginNow.addEventListener(\"click\", this.loginUser, event);\n }\n }", "function getUser() {\n return user;\n }", "function getUser(){\n return user;\n }", "async function getUserInfo() {\n let userData = await Auth.currentAuthenticatedUser();\n setUser(userData.username);\n setUserEmail(userData.attributes.email);\n }", "function userData() {\n let id = \"\"\n if (sessionStorage.getItem(\"loggedUserId\")) {\n id = JSON.parse(sessionStorage.getItem('loggedUserId'))\n }\n for (const user of users) {\n if (user._id == id) {\n document.querySelector('.avatar').src = user._avatar\n }\n }\n}", "function startUp() {\n\n // Div that contains info that tells if a user is logged in or not\n let isLoggedDiv = document.querySelector('#isLogged');\n\n // if the user is logged in, add logic for notification button\n if (isLoggedDiv.getAttribute('data-isLogged') == 'true') {\n let notification_button = document.querySelector('button.dropdown-toggle');\n\n notification_button.addEventListener('click', clickNotificationAction);\n $('.dropdown-menu').click(function (e) {\n e.stopPropagation();\n });\n }\n}", "function getUser() {\n return $localStorage.user;\n }", "componentDidMount() {\n this.authSubscription = firebase.auth().onAuthStateChanged((user) => {\n global.user = user\n this.authSubscription();\n });\n }", "get loginUsername () { return $('.loginFormArea .userNameArea #username') }", "function loadUser(){\n let userLogged = JSON.parse(localStorage.getItem(\"userLogged\"))\n setUser(userLogged)\n }", "get memberLogin(){return $('=Member Login')}", "function setupUI(user) {\n if (user) {\n loginItems.forEach(item => item.style.display = 'block');\n logoutItems.forEach(item => item.style.display = 'none');\n\n } else {\n loginItems.forEach(item => item.style.display = 'none');\n logoutItems.forEach(item => item.style.display = 'block');\n }\n}" ]
[ "0.7169608", "0.653738", "0.6256027", "0.6204822", "0.6163895", "0.6155843", "0.61463946", "0.614299", "0.61405456", "0.61057454", "0.60398513", "0.60340655", "0.60302436", "0.60178447", "0.60121804", "0.60121804", "0.59895116", "0.5989473", "0.5978593", "0.5978593", "0.5965627", "0.5961983", "0.59551126", "0.59437406", "0.5917298", "0.5908632", "0.59000814", "0.58960396", "0.5868128", "0.58575135", "0.58553845", "0.58408576", "0.58397555", "0.58397555", "0.5838882", "0.5819099", "0.5818244", "0.58048075", "0.5800917", "0.580057", "0.57927155", "0.5788211", "0.5785545", "0.57852906", "0.57794964", "0.5777098", "0.5777098", "0.5775411", "0.5772823", "0.57686675", "0.5768554", "0.5763369", "0.5756819", "0.57551706", "0.5747535", "0.5746218", "0.5739664", "0.5736915", "0.57283294", "0.5725695", "0.5725113", "0.5715633", "0.57113487", "0.5709012", "0.5703389", "0.5702748", "0.5702708", "0.56993896", "0.5697982", "0.5697323", "0.5689522", "0.56803447", "0.5674706", "0.5662397", "0.5649435", "0.5646503", "0.56349117", "0.5621389", "0.5620789", "0.56192595", "0.5616119", "0.56145906", "0.56113744", "0.5607941", "0.56072634", "0.56059444", "0.5602628", "0.5593503", "0.5593213", "0.55905104", "0.55858415", "0.55782366", "0.5576325", "0.55706507", "0.556855", "0.55595046", "0.5546185", "0.55423117", "0.55355626", "0.55340254", "0.553096" ]
0.0
-1
Here we are using the same logic of counting in both the components. We are duplicating the code. We can use the concept of LIFTING THE STATE UP but that is only possible in the current scenario where ButtonCounter and HoverCounter have same parent Example But in other scenario where the components may not have the same parent we will use the concept of Higher Order Component as mentioned in the Example2
function Example() { return ( <div> <ButtonCounter /> <br /> <HoverCounter /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Counter(props) {\n const count = props.parentCount;\n const setCount = props.parentSetCount;\n /* const [count, setCount] = useState(0); */ /* stateArray has two elements: stateArray[0] is the value we store, stateArray[1] is the function that we use to change the value \n it can the be destructured to [count, setCount]\n userState takes one paramater, whatever goes inside is the value you get from stateArray[0] otherwise known as count when destructured, the first time that you run the function\n With react, it will only be executed one time and then change linked to our onClick callback functions*/\n \n /* in order to get the total of the two buttons, we need to add the useState to the parent element (see App.js), this is why const [count, setCount] above is starred out */\n return(\n <div>\n <h2>Counter {props.counterName}</h2>\n <p>You clicked {count} times</p>\n <button onClick={()=>setCount(count+1)}>Plus</button> {/* this is a callback function, first the event fires, then the entire function is re-rendered, meaning any let will be re-rendered and start from the original number, not the new number. This is why we need State */}\n <button onClick={()=>setCount(count-1)}>Minus</button> {/* if you use a const for [count, setCount] then we can't use ++ as ++ will modify the original variable, which you can't with const */}\n </div>\n\n )\n}", "render() {\n // Just a button for now for Increment\n // this.formatCount() is an expression like 1+1\n // {} requires an expression within\n // classNames are bootstrap styling with badge and btn.\n return (\n <div>\n <div>\n <span style={this.styles} className={this.getBadgeClasses()}>\n {this.formatCount()}\n </span>\n {/* note that onClick below is no longer passing a reference to handleIncrement, \n it is passing a reference to a created arrow function that calls handleIncrement. \n That safely ensures that this will refer to the object of the method. \n Arrow functions bind to the object of the class. \n */}\n <button\n onClick={() => this.props.onIncrement(this.props.counter)}\n className=\"btn btn-secondary btn-sm\"\n >\n Increment\n </button>\n {/*access another components' prop, the onDelete, since\n state is located within Counters, onDelete must be implemented\n there to modify it locally.*/}\n <button\n onClick={() => this.props.onDelete(this.props.counter.id)}\n className=\"btn btn-danger btn-sm m-2\"\n >\n Delete\n </button>\n </div>\n </div>\n );\n }", "render() {\n // Destructuring this.props. When passing properties to counter no longer need this.props\n // E.g. onDelete={this.props.onDelete} is now onDelete={onDelete}\n const { onDelete, onIncrement, onClear, onRemoveOne, counter } = this.props;\n\n return (\n <div className=\"mainbox\">\n <div className=\"titles\">\n <h1 className=\"total\">Total</h1>\n\n <h1 className=\"price\">Price</h1>\n </div>\n <div className=\"counters\">\n {/* Map is used to insert the counters for each product into the page. data is passed in through object keys */}\n {/* This is used to pass a reference to the function to the child as a prop */}\n {/* The whole counter object can be passed using counter={counter} */}\n {/* This process now bubbles up the event from the child to the parent */}\n {this.props.counters.map(counter => (\n <Counter\n key={counter.id}\n onDelete={onDelete}\n onIncrement={onIncrement}\n onClear={onClear}\n onRemoveOne={onRemoveOne}\n counter={counter}\n />\n ))}\n </div>\n <button\n style={{ fontSize: 20, fontWeight: \"bold\" }}\n onClick={this.props.onReset}\n className=\"btn btn-danger btn-sm m-2\"\n >\n Resest all\n </button>\n </div>\n );\n }", "render() { \n\n console.log('Counter Component Rendered');\n return ( \n <div className=\"counter\">\n <span className={this.getbadgeClass()+' value'}>{this.formatCount()}</span>\n <button className=\"btn btn-primary btn-lg\" onClick={()=>this.props.onIncrement(this.props.counter)}>Increment</button>\n <button className=\"btn btn-danger btn-sm m-2\" onClick={()=>this.props.onDelete(this.props.counter.id)}>Delete</button> {/* Idea:function was passed as prop*/}\n </div> \n );\n }", "render() {\n \t// 3) Style part of a component (also in Counter.css)\n \tconst counter_style = {fontSize: \"50px\", padding: \"15px 30px\"}; // inline JavaScript css\n return (\n <div className=\"counter\">\n { /* Note that we are not making a function call. We are just passing a reference to function. */}\n { /* To call a class method, we have to call like 'this.increment' and not 'increment' */}\n { /* Component props are added in Component tag like attributes */ }\n { /* 5) props part of a component - data passed to a component */ }\n <CounterButton by={1} incrementMethod={this.increment} decrementMethod={this.decrement} />\n <CounterButton by={5} incrementMethod={this.increment} decrementMethod={this.decrement} />\n <CounterButton by={10} incrementMethod={this.increment} decrementMethod={this.decrement} />\n {/* Use className and not class */}\n <span className=\"count\" style={counter_style}>{this.state.counter}</span>\n <div><button className=\"reset\" onClick={this.reset}>Reset</button></div>\n </div>\n );\n }", "function Counter(props) {\r\n return (\r\n <div className=\"counter\">\r\n <button\r\n className=\"counter-action decrement\"\r\n onClick={function() {\r\n props.onChange(props.score > 0 ? -1 : 0);\r\n }}\r\n >\r\n {\" \"}\r\n -{\" \"}\r\n </button>\r\n <div className=\"counter-score\">\r\n {\" \"}\r\n <p style={{ fontSize: \"15px\", marginBottom: \"0px\" }}>\r\n {props.displayName}\r\n </p>\r\n <div style={{ lineHeight: \"20px\", maxHeight: \"20px\" }}>\r\n {props.score}\r\n </div>\r\n </div>\r\n <button\r\n className=\"counter-action increment\"\r\n onClick={function() {\r\n props.onChange(+1);\r\n }}\r\n >\r\n {\" \"}\r\n +{\" \"}\r\n </button>\r\n </div>\r\n );\r\n}", "function CounterApp() {\n // define a `count` value witha default value and a function to handle that count. It is important to note\n // that since the function itself is not defined, it can be used in many different ways.\n const [count, setCount] = useState(0);\n\n return (\n <div>\n <p class='m-2'>You clicked the button {count} times</p>\n {/* This button will decrease the count by one */}\n <button\n class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-1'\n onClick={() => setCount(count - 1)}\n >\n Decrement\n </button>\n {/* This button will increase the count by one */}\n <button\n class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded'\n onClick={() => setCount(count + 1)}\n >\n Increment\n </button>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <DocTitle/>\n <DocTitleTwo/>\n {/* <HookTimer/> */}\n {/* <FocusInput/> */}\n {/* <Counter/> */}\n {/* <CounterTwo/> */}\n {/* <CounterOne/> */}\n {/* <CompA/> */}\n {/* <IntervalHookCounter/> */}\n {/* <MouseContainer/> */}\n {/* <HookMouse/> */}\n {/* <HookCounterOne/> */}\n {/* <HookCounterFour/> */}\n {/* <HookCounterThree/> */}\n {/* <ClassCounter/>\n <HookCounter/> */}\n {/* <HookCounterTwo/> */}\n </div>\n );\n}", "function App() {\n const [appState, setAppState] = useState({ name: '', count: 0 });\n\n const updateName = (newName) => {\n setAppState(ps => {\n return {\n ...ps,\n name: newName\n }\n })\n }\n const updateCount = () => {\n setAppState(ps => {\n return {\n ...ps,\n count: ps.count + 1\n }\n })\n }\n console.log('[App] rendered')\n return (\n <div className=\"App\">\n {/* <Sample data={100} /> */}\n {/* <ClickCounter data={10} /> */}\n {/* <HoverCounter value={20} /> */}\n <NameComp nameValue={appState.name} updateHandler={updateName} />\n <br />\n <br />\n <CountComp countValue={appState.count} />\n <br />\n <button onClick={() => updateName('anil')}>Increase Count</button>\n </div>\n );\n}", "function Counter(props) {\n return (\n <div className=\"counter\">\n <button className=\"counter-action decrement\" onClick={() => {props.onChange(-1)}} > - </button>\n <div className=\"counter-score\"> {props.score} </div>\n <button className=\"counter-action increment\" onClick={() => {props.onChange(1)}} > + </button>\n </div>\n );\n}", "render() {\n return (\n <OriginalComponent\n count={this.state.counter}\n incrementCounter={this.incrementCounter}\n {...this.props}\n />\n );\n }", "function Counter() {\r\n // press cntrl...\r\n const [count, setCount] = useState(0);\r\n\r\n function countUp() {\r\n setCount(count + 1);\r\n }\r\n\r\n function resetCount() {\r\n setCount(0);\r\n }\r\n\r\n // return the html that will be displayed\r\n return (\r\n // good idea to give a classname that matches file\r\n <div className=\"Counter\">\r\n <h3>Counter</h3>\r\n <p>{count}</p>\r\n <p className=\"Counter__buttons\">\r\n <button onClick={() => setCount(count - 1)}>Down</button>\r\n {count !== 0 && <button onClick={resetCount}>Reset</button>}\r\n <button onClick={countUp}>Up</button>\r\n </p>\r\n </div>\r\n );\r\n}", "function Counter() {\n\n\t// 2. State, using React Hooks - here: initializing a counter. Using ES6-destructuring\n\tconst [counter, setCounter] = React.useState(0);\n\n\t// 3. A function to update the counter, using the hook setCounter().\n\t// This will NOT work: counter = counter + 1;. We NEED setCounter to update the state.\n\tconst updateCounter = () => setCounter(counter + 1);\n\n\t// 4. Return the UI of this component using JSX.\n\treturn (\n\t\t<div>\n\t\t\t<button className=\"btn btn-primary\" onClick={updateCounter}>+1</button>\n\t\t\t<button className=\"btn btn-danger\" onClick={() => alert('Workshop: implement subract of counter')}>-1\n\t\t\t</button>\n\t\t\t<h2>counter: {counter}</h2>\n\t\t</div>\n\t)\n}", "function Counter() {\n const [count, setCount] = useState(10);\n const handleIncrease = () => {\n const newCount = count + 1;\n setCount(newCount);\n };\n const handleDecrease = () => {\n const newCount = count - 1;\n setCount(newCount);\n };\n return (\n <div>\n <h1>My Awesome Counter</h1>\n <h2>Count : {count}</h2>\n <button className = \"increase-button\" onClick = {handleIncrease}>Increase</button>\n <button className = \"decrease-button\" onClick = {handleDecrease}>Increase</button>\n </div>\n )\n}", "function Counter(){\n //learning note: react will remember the current state variables valus between re-renders\n const [counter, setCounter]= useState(0);\n\n return (<div>\n <span>{counter}</span>\n <div className=\"display-items-inline\">\n <button className=\"add-button\" onClick={()=>setCounter(counter+1)}>+ </button>\n <button className=\"substract-button\" onClick={()=>setCounter(counter-1)}> - </button>\n </div>\n </div>\n )\n}", "function HookCounterTwo() {\n\tconst initialValue = 0;\n const [count, setCount] = useState(initialValue);\n \n const incrementFive =() => {\n for(let i=1; i<=5; i++) {\n setCount(prevCount => prevCount + 1);\n }\n }\n\n\treturn (\n\t\t<div>\n\t\t\t<p>Count : {count}</p>\n\t\t\t<button onClick={() => setCount(initialValue)}>Reset</button>\n\t\t\t<button onClick={() => setCount((prevCount) => prevCount + 1)}>\n\t\t\t\tIncrement\n\t\t\t</button>\n\t\t\t<button onClick={() => setCount((prevCount) => prevCount - 1)}>\n\t\t\t\tDecrement\n\t\t\t</button>\n <button onClick={incrementFive}>IncrementFive</button>\n\t\t</div>\n\t);\n}", "function Counter(){\n const [count,setCount] = useState(0);\n const handleDecrease = () => {\n const newCount = count - 1;\n setCount(newCount)\n };\n const handleIncrease = () => {\n const newCount = count + 1;\n setCount(newCount)\n };\n return(\n <div>\n <h1>Counter: {count} </h1>\n <button onClick={handleIncrease}>Increase</button>\n <button onClick={handleDecrease}>Decrease</button>\n </div>\n )\n}", "function Button() {\n const [value, setCount] = useState(0);\n\n /*state = {\n counterClass: \"counter\",\n counterButtonClass: \"counter-button\"\n };*/\n/*\n setCount = (newValue) => {\n this.setState({\n value: newValue\n });\n }*/\n\n return (<div>\n <h2 className=\"counter\">{ value }</h2>\n <button className=\"counter-button\" onClick={ () => setCount(value + 1) }>Click</button>\n </div>);\n}", "counter() {\n this.props.incrementCount(this.state.currentId);\n }", "function counterComponent() {\n document.querySelector('#counter').innerText = state.counter;\n}", "render () {\n return (\n <div>\n <Button incrementValue={1} onClickFunction={this.incrementCounter}/>\n <Button incrementValue={5} onClickFunction={this.incrementCounter}/>\n <Button incrementValue={10} onClickFunction={this.incrementCounter}/>\n <Button incrementValue={100} onClickFunction={this.incrementCounter}/>\n <Result counter={this.state.counter}/>\n </div>\n )\n }", "render() {\n //React LifeCycle Hooks\n console.log(\"Counter - Rendered\");\n //End of LifeCycle Hook\n\n //below line is called object structuring where we can remove this.props in return and simply call the object instead of this.props.onReset likewise\n const {\n onReset,\n counters,\n onDecrement,\n onDelete,\n onIncrement\n } = this.props;\n //console.log(\"Counter is \", counter);\n return (\n <div>\n <button className=\"btn btn-danger btn-sm\" onClick={onReset}>\n Reset\n </button>\n {counters.map(counter => (\n <Counter\n key={counter.id}\n onDelete={onDelete}\n onIncrement={onIncrement}\n counter={counter}\n onDecrement={onDecrement}\n ></Counter>\n ))}\n </div>\n );\n }", "function Counter() {\n const [count, setCount] = useState(11);\n\n const handleDecrease = () => setCount(count - 1);\n\n const cardStyle = {\n border: '1px solid red',\n marginTop: '10px',\n padding: '10px',\n backgroundColor: 'blue',\n\n }\n\n return (\n <div style={cardStyle}>\n <h2>Count:{count}</h2>\n <button onClick={() => setCount(count + 1)}>Increase</button>\n <button onClick={() => setCount(count - 1)}>Decrease</button>\n <button onClick={() => setCount(count + 2)}>DoubleCount</button>\n </div>\n\n )\n}", "render() { \n console.log(\"props\",this.props)\n return ( \n <div>\n <div className=\"title m-2\">{this.props.children}</div>\n {/* this is how you access children that are passed */}\n <div className={this.formatCountBage()} style={{fontSize:20}}>{this.formatCount()}</div>\n <button style={{fontSize:20, padding:10}} onClick={this.handleIncrement} className=\"btn btn-secondary m-2\">Increment</button>\n <button style={{fontSize:20, padding:10}} onClick={this.handleDecrement} className=\"btn btn-secondary m-2\">Decrement</button>\n <button style={{fontSize:20, padding:10}} onClick={()=>this.props.onDelete(this.props.id)} className=\"btn btn-danger m-2\">Delete</button>\n {/* although the delete button is here it needs to be deleted in counters */}\n {/* an event needs to be raised to delete the particular counter and the counters class will handle it */}\n\n </div>\n );\n }", "function App() {\n const [{user}, dispatch] = useStateValue(); {/*,counters,changeCounters*/}\n\n\n\n/* const generateCounters = () => {\n return counters.map( (v) => (\n <Post \n postId={v.id}\n postName= {\"Post\" + v.id}\n incrementHandler = {() => incrementCounter(v.id,true)} \n />))};\n \n const incrementCounter = (theid,arg) => {\n const updated = counters.map ( (value) => {\n if(value.id == theid){\n if(arg) {\n return {id:theid, startsAt: value.startsAt, count: value.count + 1}\n } else {\n return {id:theid, startsAt: 0, count:0}\n }\n }\n return value;\n })\n changeCounters(updated)\n } */\n\n return (\n <div className=\"app\">\n {/* <Col>{generateCounters()}</Col> */}\n {!user ? (\n <Login />\n ) : ( //Sibling components\n <>\n <Header />\n\n <div className=\"app__body\">\n <Sidebar />\n <Feed />\n </div>\n </>\n )}\n </div>\n );\n}", "render() {\n const { count } = this.state;\n\n return (\n <div>\n <button onClick={ this.onButtonClick }>\n +1\n </button>\n &nbsp;\n <NumberLabel\n text={ 'Count' }\n number={ count }\n />\n </div>\n );\n }", "function Count({ count, handleClick }) {\n return (\n <>\n <div>{count}</div>\n <button onClick={handleClick}>Click me</button>\n </>\n );\n}", "render() {\n return (\n\n <div>\n <Button variant=\"primary\">Primary</Button>\n <button className='inc' onClick={this.increment.bind(this)}>Increment!</button>\n <button className='dec' onClick={this.decrement.bind(this)}>Decrement!</button>\n <button className='reset' onClick={this.reset.bind(this)}>Reset</button>\n \n <h1>Current count: {this.state.count}</h1>\n </div>\n );\n }", "render() {\r\n return (\r\n <div>\r\n {/* <img src={this.state.imageUrl} alt=\"\" /> */}\r\n {this.props.counter.children}\r\n <span style={this.styles} className={this.getBadgeClasses()}>\r\n {this.formatCount()}\r\n </span>\r\n <button\r\n onClick={() => this.handleIncrement()}\r\n className=\"btn btn-secondary btn-sm\"\r\n >\r\n increment\r\n </button>\r\n <button\r\n onClick={() => this.props.onDelete(this.props.counter.id)}\r\n className=\"btn btn-danger btn-sm m-2\"\r\n >\r\n Delete\r\n </button>\r\n </div>\r\n );\r\n }", "function Usage() {\n return <Counter />\n}", "function plusCounter(e){\n e.stopPropagation(); \n props.setCounter(props.counter+1)\n }", "incrementCount(e){\n this.props.CounterStore.incrementCounter();\n }", "function CustomHook() { //this is not a compnent its is hook.\n const [count, setcount] = useState(0)\n const countHnadler = () =>{\n setcount(count+1)\n };\n\n return {\n \n count,\n countHnadler\n};\n \n \n}", "render() {\n return (\n <> \n {/* <Header text=\"Prop Text Here\" /> */}\n {/* <Button label=\"Hey button\" /> */}\n {/* <Counter /> */}\n\n {/* <Form /> */}\n\n {/* <CounterFunctional /> */}\n {/* <UseEffectHook /> */}\n <Seconds />\n </>);\n }", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{/* display initial state and state changes */}\n\t\t\t\t<h2>This is a counter using a class</h2>\n\t\t\t\t<h1>{this.state.count}</h1>\n\t\t\t\t{/* button that calls function to increment count */}\n\t\t\t\t<button onClick={this.setCount}>Click to Increment</button>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return (\n <div className=\"row\">\n <div className=\"col-1\">\n <h3>\n <span className={this.getBadgeClasses()}>{this.formatCount()}</span>\n </h3>\n </div>\n\n <div className=\"col\">\n <button\n onClick={() => this.props.onIncrement(this.props.counter)}\n className=\"btn btn-secondary btn-sm m-2\"\n >\n Add\n </button>\n <button\n onClick={() => this.props.onDecrement(this.props.counter)}\n className=\"btn btn-secondary btn-sm m-2\"\n disabled={this.props.counter.value === 0 ? \"disabled\" : \"\"}\n >\n Remove\n </button>\n <button\n onClick={() => this.props.onDelete(this.props.counter.id)}\n className=\"btn btn-danger btn-sm m-2\"\n >\n DELETE\n </button>\n </div>\n </div>\n );\n }", "function Counter(props){\n // let number = 0;\n const [number, setNumber] = React.useState(0);\n\n function add(){\n setNumber(number + 1);\n //number++;\n console.log(\"I add and stayed = \" + number);\n }\n\n function subtract(){\n setNumber(number - 1);\n // number--;\n console.log(\"I subtract and stayed = \" + number);\n }\n\n return (\n <React.Fragment>\n <div class=\"card\">\n <div class=\"head\">\n <h1>{props.title}</h1>\n <img src={props.url}/>\n </div>\n <h2>{number}</h2>\n <div class=\"div-btn\">\n <button class=\"btn add\" onClick={add}>+</button>\n <button class=\"btn remove\" onClick={subtract}>-</button>\n </div>\n </div>\n </React.Fragment>\n );\n}", "render() {\n return (\n <React.Fragment>\n <NavBar totalCounters={this.state.counters.filter(c => c.value > 0).length}/>\n <main className=\"container\">\n <Counters \n counters={this.state.counters}\n onReset={this.handleReset}\n onDelete={this.handleDelete}\n onIncrement={this.handleIncrement}\n />\n </main>\n </React.Fragment>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <h3>Redux toolkit</h3>\n <Counter/>\n </div>\n );\n}", "render() {\r\n const { items, delItem, top, bottom, shoes, accessories,\r\n incrementCounter, decrementCounter } = this.props\r\n return (\r\n <div>\r\n <h2>Here's your wardrobe:</h2>\r\n { items.length === 0 && <p>Sorry, you don't have any items.</p>}\r\n Tops:\r\n <div className='belt'>\r\n <button onClick={() => decrementCounter('top', 'counter1')}>Less</button>\r\n {\r\n top.map(item =>\r\n // <Item key={item.id} item={item} delItem={delItem}/>\r\n <Item key={item.id} item={item} delItem={delItem} needDelButton={true} />\r\n )\r\n }\r\n <button onClick={() => incrementCounter('top', 'counter1')}>More</button>\r\n </div>\r\n Bottom:\r\n <div className='belt'>\r\n <button onClick={() => decrementCounter('bottom', 'counter2')}>Less</button>\r\n {\r\n bottom.map(item =>\r\n // <Item key={item.id} item={item} delItem={delItem}/>\r\n <Item key={item.id} item={item} delItem={delItem} needDelButton={true} />\r\n )\r\n }\r\n <button onClick={() => incrementCounter('bottom', 'counter2')}>More</button>\r\n </div>\r\n Shoes:\r\n <div className='belt'>\r\n <button onClick={() => decrementCounter('shoes', 'counter3')}>Less</button>\r\n {\r\n shoes.map(item =>\r\n // <Item key={item.id} item={item} delItem={delItem}/>\r\n <Item key={item.id} item={item} delItem={delItem} needDelButton={true} />\r\n )\r\n }\r\n <button onClick={() => incrementCounter('shoes', 'counter3')}>More</button>\r\n </div>\r\n Accessories:\r\n <div className='belt'>\r\n <button onClick={() => decrementCounter('accessories', 'counter4')}>Less</button>\r\n {\r\n accessories.map(item =>\r\n // <Item key={item.id} item={item} delItem={delItem}/>\r\n <Item key={item.id} item={item} delItem={delItem} needDelButton={true} />\r\n )\r\n }\r\n <button onClick={() => incrementCounter('accessories', 'counter4')}>More</button>\r\n </div>\r\n\r\n {/* <button onClick={handleClick}>Add a new item</button> */}\r\n </div> \r\n )\r\n }", "style() {\n return ({\n '.counter-sheath': {\n display: 'flex',\n padding: '5px 10px',\n border: 'solid 1px #ccc',\n width: 110,\n boxSizing: 'border-box',\n backgroundColor: '#fff'\n },\n 'h2 + p': {\n margin: 0\n },\n span: {\n display: 'inline-block',\n width: 40,\n margin: '0 2px',\n textAlign: 'center',\n border: 'solid 1px #666',\n backgroundColor: '#3a6da8',\n color: '#fff'\n },\n button: {\n height: 20,\n cursor: 'pointer',\n border: 'solid 1px #ccc',\n borderRadius: '4px',\n backgroundColor: '#fff',\n ':hover': {\n backgroundColor: '#3a6da8',\n color: '#fff'\n },\n ':focus': {\n outline: 'none'\n }\n },\n 'button[disabled]': {\n cursor: 'default',\n opacity: '.5',\n backgroundColor: '#ccc',\n ':hover': {\n color: '#3a6da8',\n backgroundColor: '#ccc'\n }\n }\n })\n }", "render () {\n return (\n <div>\n <h1>Count: {this.state.count}</h1>\n <button onClick={this.handleMinusOne}>- 1</button>\n <button onClick={this.handleReset}>Reset</button>\n <button onClick={this.handleAddOne}>+ 1</button>\n </div>\n );\n }", "function keepCount(event) {\n // Added to shorten code\n const buttonId = event.target.id;\n\n // Tests condition of buttonId\n if (buttonId === \"plus-btn\") {\n count += 1; // Adds one to the count if plus button clicked\n screen.value = count; // updates output screen with value stored in count variable\n } else if (buttonId == \"minus-btn\") {\n count -= 1; // Reduces count variable by one if minus button clicked\n screen.value = count;\n } else {\n count = 0; // Resets counter to zero if reset button clicked\n screen.value = 0;\n }\n}", "function Counter() {\n // Note that it does not use 'this'!\n }", "function ParentComponent() {\n const [age, setAge] = useState(25);\n const [salary, setSalary] = useState(50000);\n\n // here we are using useCallback\n const ageHandle = useCallback(() => {\n setAge(age + 1);\n }, [age]);\n\n const salaryHandler = useCallback(() => {\n setSalary(salary + 1000);\n }, [salary]);\n\n const reset = () => {\n setAge(25);\n setSalary(50000);\n };\n\n return (\n <>\n <Title></Title>\n <Count text={\"Age\"} count={age}></Count>\n <Button func={ageHandle}>Increase Age</Button>\n <Count text={\"Salary\"} count={salary}></Count>\n <Button func={salaryHandler}>Increase Salary</Button>\n </>\n );\n}", "function App() {\n return (\n <React.Fragment>\n <ForwardCounter />\n <BackwardCounter />\n </React.Fragment>\n )\n}", "function FuncCounter(props) {\n //destructure\n const {counter, increment, decrement, reset} = props; \n return (\n <div>\n <h2>Func Counter</h2>\n <p>Counter {counter}</p>\n\n <button onClick={ () => increment(1)}>+1</button>\n <button onClick={ () => decrement(1) }>-1</button>\n <button onClick={ () => reset() }>Reset</button>\n\n <button onClick= { () => props.requestIncrement() }> Request Incr Saga</button>\n\n <button onClick={ () => props.dispatchers.increment(1)}>+1</button>\n <button onClick={ () => props.dispatchers.decrement(1) }>-1</button>\n <button onClick={ () => props.dispatchers.reset() }>Reset</button>\n\n </div>\n )\n}", "function Button(props) {\n \n \n // const plusOne = ()=> setCounter(counter+1);\n // const plusThree = ()=> setCounter(counter+3);\n // const timesTwo = ()=> setCounter(counter*2);\n // const reset = ()=> setCounter(counter-counter);\n\n return (\n\n <button id= \"+1\" onClick = {props.onClickFunc}> \n {props.label}\n </button>\n );\n}", "render(){\n return <WrappedComponent name='Marco' \n count={this.state.count} \n increment={this.clickHandler} \n // send props from Parent to wrapped Component\n {...this.props}\n />\n }", "render() {\n return (\n <div className=\"counter\">\n <h1>{this.state.count} </h1>\n <button onClick={this.handle}>add one!</button>\n </div>\n )\n }", "render() {\n return (\n <div>\n {this.props.children(this.state.count, this.incrementCount)}\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n {/* <ClassCount/> */}\n {/* <HookCounter/> */}\n {/* <HookCountertwo />\n <HookForm />\n <HookArray />\n <ClassCounterTitle />\n <HookCounteruseEffect />*/}\n <MovemouseContainer />\n </div>\n );\n}", "function ReducerCounter3() {\n const [count, dispatch] = useReducer(reducer, initialState);\n const [count2 , dispatchTwo ] = useReducer(reducer , initialState);\n\n return (\n <div>\n <div>\n <div>Count one - {count}</div>\n <button\n onClick={() => {\n dispatch(\"increment\");\n }}\n >\n +\n </button>\n <button\n onClick={() => {\n dispatch(\"decrement\");\n }}\n >\n -\n </button>\n <button\n onClick={() => {\n dispatch(\"reset\");\n }}\n >\n Reset\n </button>\n </div>\n <div>\n <div>Count two - {count2}</div>\n <button\n onClick={() => {\n dispatch(\"increment\");\n }}\n >\n +\n </button>\n <button\n onClick={() => {\n dispatchTwo(\"decrement\");\n }}\n >\n -\n </button>\n <button\n onClick={() => {\n dispatchTwo(\"reset\");\n }}\n >\n Reset\n </button>\n </div>\n </div>\n );\n}", "function FnCounter() {\n const ctx = useConcent(\"counter\");\n const add = () => ctx.setState({ count: ctx.state.count + 1 });\n return (\n <View tag=\"fn comp with useConcent\" add={add} count={ctx.state.count} />\n );\n}", "render() {\n return (\n <div>\n <button className='inc' onClick={this.increment}>Increment!</button>\n <button className='dec' onClick={this.decrement}>Decrement!</button>\n <button className='reset' onClick={this.reset}>Reset</button>\n <h1>Current Count: {this.state.count}</h1>\n </div>\n );\n }", "render() {\n return (\n <div>\n <button className='inc' onClick={this.increment}>Increment!</button>\n <button className='dec' onClick={this.decrement}>Decrement!</button>\n <button className='reset' onClick={this.reset}>Reset</button>\n <h1>Current Count: {this.state.count}</h1>\n </div>\n );\n }", "decrementCount(e){\n this.props.CounterStore.decrementCounter();\n }", "function mapStateToProps(state){\n const{counter} = state;\n return{\n counter\n }\n }", "render() { \n console.log(\"App-Rendered\");\n return (\n <React.Fragment>\n <NavBar totalCounters = {this.state.counters.filter( c => c.value > 0).length}/>\n <main \n className=\"container\">\n <Counters \n counters= {this.state.counters}\n onReset= {this.handleReset} \n onIncrement= {this.handleIncrement}\n onDelete= {this.handleDelete}\n />\n </main>\n </React.Fragment>\n );\n }", "render() {\n return (\n <div>\n <button className='inc' onClick={this.increment}>Increment!</button>\n <button className='dec' onClick={this.decrement}>Decrement!</button>\n <button className='reset' onClick={this.reset}>Reset</button>\n <h1>Current Count: {this.state.count}</h1>\n </div>\n );\n }", "function App(props) {\r\n return (\r\n <div>\r\n <h1>{props.count}</h1>\r\n <button onClick={props.decrement}>-</button>\r\n <button onClick={props.increment}>+</button>\r\n </div>\r\n );\r\n}", "render() {\n console.log('App-Rendered');\n console.log(this.state.counters);\n let x = 0;\n return (\n <React.Fragment>\n <NavBar totalCounters={\n this.state.counters.filter(c => c.value > 0).length}\n counters={\n this.state.counters.filter(c => c.value > 0)}\n />\n <main className=\"container\">\n <Counters\n counters={this.state.counters}\n onReset={this.handleReset}\n onIncreament={this.handleIncreament}\n onDelete={this.handleDelete}\n onTotalCount={this.handleTotalCount}\n >\n\n </Counters>\n </main>\n </React.Fragment>\n );\n }", "function CounterThree() {\n // 2 paramater, pertama reducer function, yang kedua initialstate \n const [count, dispatch] = useReducer(reducer, initialState)\n // useReducer itu return currentState yaitu = count dan dispatch\n // currentState itu maksudnya state yang baru jadi pertamanya itu valuenya sama dengan initialState\n\n const [countTwo, dispatchTwo] = useReducer(reducer, initialState)\n\n return (\n <div>\n <div>count- {count}</div>\n <button onClick={() => dispatch('increment')}>Increment</button>\n <button onClick={() => dispatch('decrement')}>Decrement</button>\n <button onClick={() => dispatch('reset')}>Reset</button>\n\n <div>count- {countTwo}</div>\n <button onClick={() => dispatchTwo('increment')}>Increment</button>\n <button onClick={() => dispatchTwo('decrement')}>Decrement</button>\n <button onClick={() => dispatchTwo('reset')}>Reset</button>\n </div>\n )\n}", "render() { \n\n //While returning two tags the React.createElement in bable doest know which tag to pass as it passes only 1 element as a parameter; hence wrap two tags in div; one of the solution\n console.log(this.props);\n\n return (\n <div>\n <span className={this.getBadgeClasses()}>{this.formatCount()}</span>\n\n <button\n className={\"btn btn-primary btn-sm m-2\"}\n onClick={()=>this.props.onIncrement(this.props.counter)}\n >\n Increment\n </button>\n <button\n className={\"btn btn-danger btn-sm m-2\"}\n onClick={()=>this.props.onDelete(this.props.counter.id)}\n >\n Delete\n </button>\n </div>\n ); \n \n }", "function ReactComponent(props) {\n //component to use/update redux state\n return (\n <button onClick=\"() => props.incrementCounter(9)\">im some stuff. state:{props.counter}</button>\n )\n}", "constructor(props) {\n super(props);\n // initialize component state here if needed\n // state variables are used in render()\n // you can use component state and redux at the same time\n this.state = {\n // value counter got increased/decreased by\n counterStep: 4,\n // setting counter lower limit\n counterLowerLimit: 0\n };\n\n // bind this to event function context\n this.onIncrease = this.onIncrease.bind(this);\n this.onDecrease = this.onDecrease.bind(this);\n\n // if value is not used in render() use instance variable\n // for example: this.instanceValue = 0;\n }", "function Counter() {\n let count = 0;\n\n this.up = function() {\n return ++count;\n };\n this.down = function() {\n return --count;\n };\n}", "function useCounter(initialState = 1) {\n const [count, setCount] = useState(initialState);\n\n const countRef = useRef(0);\n\n // 2 :- Expose a reset function handler to the consumer\n const reset = useCallback(() => {\n setCount(initialState);\n // 3 :- Allow for performing any side effects just after a reset\n ++countRef.current;\n }, [initialState]);\n\n return useMemo(\n () => ({\n count,\n setCount,\n reset,\n resetDef: countRef.current,\n }),\n [count, reset]\n );\n}", "render() {\n return (\n <Child handleClick={() => this.updateCount()} count={this.state.count}>\n Count\n </Child>\n );\n }", "function incrementCount() {\n setCount(prevCount => prevCount+1)\n setTheme(\"red\")\n }", "render() {\n\n if (this.likesCount() === 0) {\n return (\n <div className=\"like-counter-box\">\n <div className=\"like-counter\">\n </div>\n </div>\n )\n } else if (this.likesCount() === 1) {\n return (\n <div className=\"like-counter-box\">\n <div className=\"like-counter\">\n <span>{this.likesCount()}</span>\n <span> like</span>\n </div>\n </div>\n )\n } else {\n return(\n <div className=\"like-counter-box\">\n <div className=\"like-counter\">\n <span>{this.likesCount()}</span>\n <span> likes</span>\n </div>\n </div>\n )\n }\n }", "function App() {\n return (\n <div className=\"App\">\n <UserProvider value=\"Prince\">\n <ComponentC />\n </UserProvider>\n\n {/*\n <ClickCounter name=\"Prince\" />\n <HoverCounter name=\"Prince\"/>\n <ErrorBoundary>\n <Hero heroName=\"superman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"batman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"joker\"/>\n </ErrorBoundary>\n <PortalsDemo />\n <FRParentInput />\n <Focusfile />\n <RefsDemo />\n <ParentComp />\n <Fragmentdemo />\n <Column />\n <LifecycleA />\n <Form />\n <Namelist />\n <Usergreeting />\n <Parentcomponent />\n {/* <Eventbind />\n */}\n {/* <Functionclick />\n <Classclick />\n /* /* < Counter />\n <Message />\n <Hello lastname=\" Roy\">\n <p>Your age is 22 Years</p>\n </Hello>\n <Greet name=\"abhishek\" lastname=\" kumar\">\n <p>Your age is 31 Years</p>\n </Greet>\n <Greet name=\"Ram\" lastname=\" singh\">\n <button>show</button>\n <p>\n Your Age is 32 Years\n </p></Greet>\n <Welcome name='one'/>\n <Welcome name='two' />\n <Welcome name='three' /> } */}\n </div>\n );\n}", "incrementCounter() {\n this.setState((state,props) => {\n return {\n counter: state.counter + 1\n }\n })\n }", "function counterWrapper() {\r\n\tvar counter = 0;\r\n\tfunction updateClickCount() {\r\n\t\tcounter += 1;\r\n\t\t// do your thing with the counter\r\n\t}\r\n\tupdateClickCount();\r\n\treturn counter;\r\n}", "render() {\n return (\n /*<div>\n <img src=\"./img/teste.png\" />\n <h2 className=\"minha-classe\">Exemplo de JSX</h2>\n <ul>\n <li>Teste</li>\n <li>Teste</li>\n </ul>\n Counter\n </div>*/\n <div className={css.counterContainer}>\n <button\n onClick={this.handleClick}\n className=\"waves-effect waves-light btn red darken-4\"\n >\n -\n </button>\n <span className={css.counterValue}>{this.currentCounter}</span>\n <button\n onClick={this.handleClick}\n className=\"waves-effect waves-light btn green darken-4\"\n >\n +\n </button>\n </div>\n );\n }", "function mapStateToProps(state) {\n return {\n counter: state\n }\n}", "function Counter() {\n const [count, setCount] = useState(() => {\n console.log('helpSomeFunc');\n return 1;\n });\n\n console.log('render');\n\n return (\n <div>\n Счёт: {count}\n <button onClick={() => setCount(0)}>Сбросить</button>\n <button onClick={() => setCount(count - 1)}>-</button>\n <button onClick={() => setCount(count + 1)}>+</button>\n </div>\n );\n}", "function FunctionalComp(props) {\n const [count, setCount] = React.useState(props.start)\n return (\n <div>\n <button onClick={() => setCount(count +1)}>Functional button</button>, count: {count}\n </div>\n )\n}", "function counter(){\r\n\tlet count = 0;\r\n\tthis.incrementCounter = function(){\r\n\t\tcount++;\r\n\t\tconsole.log(count)\r\n\t}\r\n\r\n\tthis.decrementCounter =function(){\r\n\t\tcount--;\r\n\t\tconsole.log(count)\r\n\t}\r\n}", "function Counter() {\n const [count, setcount] = useState(0);\n function increment() {\n setcount(count + 1);\n }\n function decrement() {\n if (count > 0) {\n setcount(count - 1);\n } else {\n console.log('invalid');\n }\n }\n return (\n <div className=\"main\">\n <button onClick={decrement}>-</button>\n <p>Functional Counter value:{count}</p>\n <button onClick={increment}>+</button>\n </div>\n );\n}", "constructor(props) {\n super(props);\n\n this.state = {\n counter: 0,\n };\n }", "function Vote({ color, company, content }) {\r\n // console.log(props);\r\n // state - data - likes\r\n // ternary operator used\r\n // const bgStyle = { backgroundColor: likes >= dislikes ? \"green\" : \"crimson\" };\r\n const bgStyle = { backgroundColor: \"#eee\" };\r\n\r\n return (\r\n <div className=\"vote-system\">\r\n <card>\r\n <h4 style={{ color }}>{company}</h4>\r\n <Counter color=\"orchid\" emoji=\"👍\" type=\"primary\" />\r\n {/* ctrl+/ */}\r\n {/* Task is to refactor the dislike button using Counter component */}\r\n <Counter color=\"crimson\" emoji=\"👎\" type=\"secondary\" />\r\n <Content content={content} />\r\n </card>\r\n </div>\r\n );\r\n}", "function Counter(props) {\n return (\n <div className=\"card\">\n <div class=\"score\" >\n <h2 id=\"score-count\">score-count<span id=\"score-text\"></span></h2> {props.count}\n </div> \n </div>\n );\n}", "function ParentComponent() {\n return (\n <div className =\"parent\">\n <CountVowels />\n <CountConsonants />\n </div>\n );\n}", "incrementCounter() {\n /*\n The \"setState\" function is used to update the State of the\n component. The \"setState\" function will copy the properties\n of the object passed to \"setState\" and the properties of the\n current state onto a new state object.\n\n In addition to updating the state, the \"setState\" function\n will trigger a re-render of the component and its child\n components.\n */\n this.setState({\n counter: this.state.counter + 1,\n });\n }", "render() {\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<Button localHandleClick={this.handleClick} increment={1} />\n\t\t\t\t<Button localHandleClick={this.handleClick} increment={5} />\n\t\t\t\t<Button localHandleClick={this.handleClick} increment={10} />\n\t\t\t\t<Button localHandleClick={this.handleClick} increment={100} />\n\t\t\t\t<Result localCounter={this.state.counter} />\n\t\t\t</div>\n\t\t);\n\t}", "function FunctionComponent(props) {\n // 管理许多 数据、链表\n // \n // fiber.memoizedState => hook0(next) => hook1(next) \n // workInProgressHook\n // const [count1, setCount1] = useState(0) //hook0\n const [count2, setCount2] = useReducer((x) => x + 1,0 ) //hook1\n \n return (\n <div className=\"border\">\n <p>{props.name}</p>\n {/* <button onClick={() => setCount1(count1 + 1)}>\n {count1}\n </button> */}\n <button onClick={() => {\n setCount2()\n }}>\n {count2}\n </button>\n </div>\n )\n}", "function App() {\n //this is how we make state in functional components:\n const [counter, setCounter] = useState({count:0, name:\"points\"})\n\n const test = \"hello world of react\";\n const buttonText = \"click me\"\n const goToInitialState= function(){\n setCounter({count:0, name:\"points\"})\n }\n const incrementCounter = function(){\n // const copyOfArray = [...array];\n //WRONG!!!:\n //const copyOfCounter= counter;\n //RIGHT way:\n // we need to copy counter in order to be able to change it (because it is an object)\n const copyOfCounter = {...counter};\n //now we can change the copied object\n copyOfCounter.count = counter.count+1;\n //use the setCounter function to change the actual counter\n setCounter(copyOfCounter);\n }\n const decrementCounter = function(){\n const copyOfCounter = {...counter};\n copyOfCounter.count = counter.count-1;\n setCounter(copyOfCounter);\n }\n return (\n <div>\n <h1>title</h1>\n {test}\n \n <MyButton clickFunction={incrementCounter} label=\"get points\" text=\"increment counter\"/>\n <MyButton clickFunction={decrementCounter} label=\"loose points\" text=\"decrement counter\"/>\n \n <Counter data={counter}></Counter>\n </div>\n );\n}", "render() {\n console.log(this.props);\n //Here is what I want my render method to return. As I can only return \n //one element, I wrap everything into a div. \n return (\n <div>\n {/* Inside the object props I can access children, which is the data I pass to a component inside its\n closing tags. For example in my Counters element I inserted a \"Counter number\" as data inside the closing tags.\n this data is accessible here in the children property */}\n {this.props.children}\n <span className={this.getBtnClasses()}>{this.formatCount()}</span>\n {/* Here I want the click on the button to trigger an event, incrementing the value of the counter\n so I call the function handleIncrement which does exactly the incrementation of the 'value' property of \n my counter */}\n <button \n onClick={this.handleIncrement} \n className=\"btn btn-secondary btn-sm m-2\">\n Increment\n </button>\n {/* Here I am adding a button that triggers a Delete method on click. \n The component that owns a piece of the state should be the one modifying it. In this particular case,\n the piece of the state that I want to delete is owned by the counters component, so Counters should be the component\n modifying the value (deleting it). To solve this problem and allow the state to be modified through the Counter component, it has to\n raise an event. onDelete (convention for naming events). So the Counter component raises the event, but the Counters component handles it \n (therefore the method is implemented there, but passed to the Counter component via props). */}\n <button onClick={() => this.props.onDelete(this.props.id)} className=\"btn btn-danger btn-sm m2\">Delete</button>\n </div>\n );\n }", "function Counter({count, decrease, increase}){\n return (\n <div className=\"MyGrid\">\n <button onClick={increase} className=\"MyButton\" style={{gridRowStart: \"1\"}}>+</button>\n <p style={{textAlign: \"center\", gridRowStart: \"2\"}}>{count}</p>\n <button onClick={decrease} className=\"MyButton\">-</button>\n </div>\n );\n}", "function decrementCount () {\n setCount(prevCount => prevCount-1)\n setTheme(\"green\")\n }", "function App() {\n return (\n <div className=\"App\">\n <Counter />\n <CounterPlus />\n <CounterMapDispatchFn />\n <CounterMapDispatchObj />\n <CounterSaga\n onIncrement={() => action(\"INC\")}\n onDecrement={() => action(\"DEC\")}\n onIncrementAsync={() => action(\"INCREMENT_ASYNC\")}\n />\n </div>\n );\n}", "function counter() {\n return counter.count++; // counter++;\n }", "function Button() {\n const [counter, setCounter] = useState(0); //counter is getter, while setCounter is setter \n return <button onClick={() => setCounter(counter + 1)}> {counter}</button>\n}", "render() {\n const { removePlayer, score , id, name, changeScore, index, highestScoreIndex} = this.props;\n return (\n <div className=\"player\">\n <span className=\"player-name\">\n <WinningScore \n index = { index } \n highestScoreIndex = { highestScoreIndex } \n />\n <button \n className=\"remove-player\" \n onClick={() => removePlayer(id)}\n >✖\n </button>\n { name }\n </span>\n \n <Counter \n score = { score } \n changeScore = { changeScore } \n index = { index } \n />\n </div>\n );\n }", "function tapCounterFunc(tapCounter){\n tapCounter.counter++;\n }", "render () {\n return (\n <div>\n <CounterOutput value={this.props.ctr} />\n <CounterControl label=\"Increment\" clicked={this.props.onIncrementCounter} />\n <CounterControl label=\"Decrement\" clicked={this.props.onDecrementCounter} />\n <CounterControl label=\"Add 5\" clicked={this.props.onAddCounter} />\n <CounterControl label=\"Subtract 5\" clicked={this.props.onSubtractCounter} />\n <hr />\n {/* We now also convert this to an annonymous function in order to store the result of the counter */}\n <button onClick={() => this.props.onStoreResult(this.props.ctr)}>Store Result</button>\n {/* Again here we are mapping the elements of storedResults to a list item */}\n <ul>\n {this.props.storedResults.map(result => (\n // we convert onClick to an annonymous function so that we can pass result.id to the redux in mapDispatchToProps\n <li key={result.id} onClick={() => this.props.onDeleteResult(result.id)}>{result.value}</li>\n ))}\n </ul>\n </div>\n );\n }", "static metadata() { \n return {\n components: [],\n template: `\n <h3>Counter</h3>\n <input [value]=this.count >\n <button (click)='this.add()'>Increment</button>\n <button (click)='this.reset()'>Reset</button>\n `\n }\n }", "render() {\n return (\n <div className=\"app\">\n <div className=\"click-count\">\n Button presses: {this.state.count}\n </div>\n <button onClick={this.handleClick.bind(this)}>\n Add One\n </button>\n </div>\n );\n }", "function currentCount(state=0, action){\n if(action.type === \"INCREASE_COUNTER\"){\n return state + 1;\n \n }\n //or minus one depending on the action//\n if(action.type === \"DECREASE_COUNTER\"){\n \n }\n return state -1;\n}" ]
[ "0.6973765", "0.6894091", "0.6801001", "0.678876", "0.675476", "0.67252487", "0.66865134", "0.66388065", "0.6595614", "0.65876096", "0.65853024", "0.6569971", "0.65233666", "0.6485844", "0.6483722", "0.64820516", "0.6445651", "0.6429833", "0.64071256", "0.6387333", "0.6327409", "0.63089156", "0.6285383", "0.6273558", "0.6266185", "0.6255708", "0.6250482", "0.6248566", "0.6248464", "0.62418115", "0.6229602", "0.6224515", "0.6224122", "0.6217576", "0.61991906", "0.6184083", "0.61702895", "0.6170288", "0.6163435", "0.61548686", "0.61538845", "0.61479294", "0.61465967", "0.6139193", "0.6137332", "0.613681", "0.6136337", "0.61342764", "0.612483", "0.612369", "0.6106377", "0.6105806", "0.6089483", "0.6038005", "0.6031641", "0.6031641", "0.6030698", "0.6019088", "0.60180116", "0.60166276", "0.6014781", "0.6008895", "0.6006931", "0.60032433", "0.5995329", "0.5994933", "0.5990245", "0.5984815", "0.59807557", "0.5979834", "0.59787136", "0.5978058", "0.5976474", "0.5975785", "0.5961217", "0.59554857", "0.59472376", "0.59377235", "0.5931787", "0.5913243", "0.59008324", "0.5893931", "0.5893433", "0.58922464", "0.5886839", "0.58818763", "0.5881668", "0.588116", "0.58741796", "0.58733165", "0.5857172", "0.5847472", "0.58453894", "0.58423495", "0.5838623", "0.5838524", "0.5832856", "0.5831604", "0.58174413", "0.58152527" ]
0.7710295
0
True si es para actualizar atributos propios False para actualizar atributos de otro jugador
function actualizarAtributos(data,opt) { if(opt){ $( "#panel-nombre" ).text(jugador.nombre+" / "+data.raza); $( "#img1" ).attr('src', data.imagen); }else{ $( "#panel-nombre" ).text(data.nombre+" / "+data.raza); $( "#img1" ).attr('src', data.imagen); } //Ataque $( ".bar-ataque" ).attr('aria-valuenow', data.ataque); $( ".bar-ataque" ).css('width:', (data.ataque/6)*100); $( ".bar-ataque" ).text(data.ataque); //Destreza $( ".bar-destreza" ).attr('aria-valuenow', data.destreza); $( ".bar-destreza" ).css('width:', (data.destreza/6)*100); $( ".bar-destreza" ).text(data.destreza); //Dano $( ".bar-dano" ).attr('aria-valuenow', data.dano); $( ".bar-dano" ).css('width:', (data.dano/6)*100); $( ".bar-dano" ).text(data.dano); //Defensa $( ".bar-defensa" ).attr('aria-valuenow', data.defensa); $( ".bar-defensa" ).css('width:', (data.defensa/6)*100); $( ".bar-defensa" ).text(data.defensa); //Vida $( ".bar-vida" ).attr('aria-valuenow', data.vida); $( ".bar-vida" ).attr('aria-valuemax', data.vidaMax); $( ".bar-vida" ).css('width:', (data.vida/data.vidaMax)*100); $( ".bar-vida" ).text(data.vida); //Movimiento $( ".bar-movimiento" ).attr('aria-valuenow', data.movimiento); $( ".bar-movimiento" ).attr('aria-valuemax', data.movimientoMax); $( ".bar-movimiento" ).css('width:', (data.movimiento/data.movimientoMax)*100); $( ".bar-movimiento" ).text(data.movimiento); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function habilitarEdicion (){\n\t\t\t$scope.modificar = true;\n\t\t}", "editarFalse1() {\n this.activarPersonal = true;\n }", "isEdited() {\n return this._canvas.getObjects().length > 0;\n }", "function activarArrastradoPuntos(activar){\r\n if(activar){\r\n dragPuntosRuta.activate();\r\n }else{\r\n dragPuntosRuta.deactivate();\r\n selectFeatures.activate();\r\n }\r\n}", "function HabilitarControlesAvanzar() {\n window.parent.App.cmbMov.setDisabled(false);\n window.parent.App.dfFechaEmision.setDisabled(false);\n window.parent.App.txtfObservaciones.setDisabled(false);\n window.parent.App.gpVolumetriaDetalle.setDisabled(false);\n window.parent.App.imgbtnGuardar.setDisabled(false);\n window.parent.App.imgbtnBorrar.setDisabled(false);\n}", "function vacia(){\r\n\tif (this.raiz == null) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function actualizar_puntaje(){\r\n aplicar_animacion(seleccionar_combos())\r\n asignacion_de_eventos_drag_drop()\r\n}", "function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }", "function verificaAlteracao(diaMaisRecente) {\n\n\tvar horas = diaMaisRecente.dadosHoras;\n\tvar tc = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].temperaturaCorporea);\n\tvar pas = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].pressaoSistolica);\n\tvar pad = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].pressaoDiastolica);\n\tvar pam = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].pressaoMedia);\n\tvar sato2 = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].saturacaoOxigenio);\n\tvar fc = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].frequenciaCardiaca);\n\tvar fr = parseFloat(diaMaisRecente.dadosHoras[horas.length - 1].frequenciaRespiratoria);\n\n\tvar result = false;\n\n\tif (fc < 60 || fc > 100 || fr < 12 || fr > 20 || tc < 30 || tc > 37 || sato2 < 95 || pas < 90 || pas > 139) {\n\t\tresult = true;\n\t}\n\n\treturn result;\n}", "get newButtonVisible(){\n return this.editMode == true && this.newClock == false ;\n }", "function _AtualizaAtaque() {\n ImprimeSinalizado(gPersonagem.bba, DomsPorClasse('bba'));\n ImprimeNaoSinalizado(gPersonagem.numero_ataques,\n DomsPorClasse('numero-ataques'));\n // Corpo a corpo.\n var span_bba_cac = Dom('bba-corpo-a-corpo');\n ImprimeSinalizado(gPersonagem.bba_cac, span_bba_cac);\n var titulo_span_bba_cac = {};\n titulo_span_bba_cac[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_cac[Traduz('força')] = gPersonagem.atributos['forca'].modificador;\n titulo_span_bba_cac[Traduz('tamanho')] = gPersonagem.tamanho.modificador_ataque_defesa;\n TituloChaves(titulo_span_bba_cac, span_bba_cac);\n\n // Distancia.\n var span_bba_distancia = Dom('bba-distancia');\n ImprimeSinalizado(gPersonagem.bba_distancia, span_bba_distancia);\n var titulo_span_bba_distancia = {};\n titulo_span_bba_distancia[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_distancia[Traduz('destreza')] = gPersonagem.atributos['destreza'].modificador;\n titulo_span_bba_distancia[Traduz('tamanho')] = gPersonagem.tamanho.modificador_ataque_defesa;\n TituloChaves(titulo_span_bba_distancia, span_bba_distancia);\n\n // Agarrar\n var span_bba_agarrar = Dom('bba-agarrar');\n ImprimeSinalizado(gPersonagem.agarrar, span_bba_agarrar);\n var titulo_span_bba_agarrar = {};\n titulo_span_bba_agarrar[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_agarrar[Traduz('força')] = gPersonagem.atributos['forca'].modificador;\n titulo_span_bba_agarrar[Traduz('tamanho especial')] = gPersonagem.tamanho.modificador_agarrar;\n TituloChaves(titulo_span_bba_agarrar, span_bba_agarrar);\n}", "function _AtualizaModificadoresAtributos() {\n // busca a raca e seus modificadores.\n var modificadores_raca = tabelas_raca[gPersonagem.raca].atributos;\n\n // Busca cada elemento das estatisticas e atualiza modificadores.\n var atributos = [\n 'forca', 'destreza', 'constituicao', 'inteligencia', 'sabedoria', 'carisma' ];\n for (var i = 0; i < atributos.length; ++i) {\n var atributo = atributos[i];\n // Valor do bonus sem base.\n var dom_bonus = Dom(atributo + '-mod-bonus');\n ImprimeSinalizado(gPersonagem.atributos[atributo].bonus.Total(['base']), dom_bonus, false);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(['base']), dom_bonus);\n\n // Escreve o valor total.\n var dom_valor = Dom(atributo + '-valor-total');\n ImprimeNaoSinalizado(gPersonagem.atributos[atributo].bonus.Total(), dom_valor);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(), dom_valor);\n\n // Escreve o modificador.\n ImprimeSinalizado(\n gPersonagem.atributos[atributo].modificador,\n DomsPorClasse(atributo + '-mod-total'));\n }\n}", "static modifyGizmoControls ({ position, rotation, scale }) {\n // exit if in placing mode\n if (this.isPlacing) return\n\n this.gizmoManager.positionGizmoEnabled = !!position\n this.gizmoManager.rotationGizmoEnabled = !!rotation\n this.gizmoManager.scaleGizmoEnabled = !!scale\n }", "isInMovement() {\n //if(this.resOffset !== this.workResOffset || this.canvasStartTime.getJulianMinutes() !== this.workStartTime.getJulianMinutes() || this.canvasEndTime.getJulianMinutes() !== this.workEndTime.getJulianMinutes()) {\n if (this.isPanning || this.isSwiping) {\n return true;\n } else {\n return false;\n }\n }", "changerJoueur() {\n this.indexJoueurActuel = !this.indexJoueurActuel;\n }", "editarPersonal() {\n this.activarPersonal = false;\n this.activarNotificaciones = true;\n this.activarContacto = true;\n this.activarAcordeon1();\n }", "function habilitarBoton(){\n\t\toFormObject = document.forms['formPalabraEncontrada'];\n\t\tvar botonEnviar = document.getElementById('botonPalabraEncontrada');\n\t\tif (palabraEncontrada == false) {\n\t\t\tbotonEnviar.disabled = true;\n\t\t}else{\n\t\t\toFormObject.elements[\"xyLetras\"].value = xyLetras;\n\t\t\toFormObject.elements[\"xy\"].value = xy;\n\t\t\toFormObject.elements[\"tamC\"].value = tamCadena;\n\t\t\tbotonEnviar.disabled = false;\n\t\t}\n\t}", "function PersonagemRenovaFeiticos() {\n for (var chave_classe in gPersonagem.feiticos) {\n if (!gPersonagem.feiticos[chave_classe].em_uso) {\n continue;\n }\n var slots_classe = gPersonagem.feiticos[chave_classe].slots;\n for (var nivel in slots_classe) {\n for (var indice = 0; indice < slots_classe[nivel].feiticos.length; ++indice) {\n slots_classe[nivel].feiticos[indice].gasto = false;\n }\n if ('feitico_dominio' in slots_classe[nivel] && slots_classe[nivel].feitico_dominio != null) {\n slots_classe[nivel].feitico_dominio.gasto = false;\n }\n if ('feitico_especializado' in slots_classe[nivel] && slots_classe[nivel].feitico_especializado != null) {\n slots_classe[nivel].feitico_especializado.gasto = false;\n }\n }\n }\n}", "function sketchAllowsEditing() {\n return sketch.currentTouchRegime().name !== \"BackClickRegime\";\n }", "function actualizarPrepago(){\t\r\n\t//alert('actualizar prepago');\r\n\tvar frm = document.forms[0];\r\n\tfrm.buttonActualizar.disabled = false;\r\n\tfrm.buttonActualizarCuenta.disabled=true;\r\n\tfrm.buttonActualizar.value='Actualizar';\r\n\tdocument.getElementById('botoncuenta').style.display='none';\r\n\tfrm.tipo.value='actualizar';\r\n\tfrm.nombre.readOnly=true; //disabled - readOnly\r\n\tfrm.apePat.readOnly=true;\r\n\tfrm.tipoDoc.disabled=true;\r\n\tfrm.numeDoc.readOnly=true;\r\n\tfrm.teleRef.disabled=false;\r\n\tfrm.sexo[0].disabled=false;\r\n\tfrm.sexo[1].disabled=false;\r\n\tfrm.fechaNaci.disabled=false;\r\n\tfrm.lugarNaci.disabled = false;\r\n\tfrm.emailUsuario.disabled=false;\r\n\r\n}", "function esMayorDeEdad() {\r\n if (options[0]) {\r\n return true;\r\n } else {\r\n alert(\"Debes ser mayor de edad para registrarte en el sitio\");\r\n }\r\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "function disableOrEnableEditButton(){\n // gdy po przejsciu przez ponizszego for'a, flag będzie true, to znaczy\n // że wszystkie pola sa poprawnie uzupełnione i można aktywowac przycisk\n let flag = true;\n const btnRegister = $('#editUserInfoButton');\n\tfor (var k in validationObjects){\n\t\tif (validationObjects.hasOwnProperty(k)) {\n\t\t\tif(!validationObjects[k][1]){\n\t\t\t\tbtnRegister.removeClass(\"btnSaveEdit\");\n\t\t\t\tbtnRegister.addClass(\"btnSaveEditDisabled\");\n btnRegister.attr(\"disabled\", \"disabled\");\n flag = false;\n\t\t\t}\n\t\t}\n }\n if(flag){\n // wszystkie elementy poprawne, można aktywować przycisk Register\n btnRegister.removeClass(\"btnSaveEditDisabled\");\n btnRegister.addClass(\"btnSaveEdit\");\n btnRegister.removeAttr(\"disabled\");\n }\n}", "function otkljucajDugmeNastavi() {\r\n if(formValidacija.ime && formValidacija.email && formValidacija.telefon)\r\n {\r\n $('#btnDaljeKorisnik').removeAttr('disabled');\r\n }\r\n else {\r\n $('#btnDaljeKorisnik').attr('disabled', true);\r\n }\r\n}", "function shouldSetButtonEnabled() {\r\n\t//no input should be empty\r\n\tif (document.getElementById('FPF_leftGalaxy') == ''\r\n\t\t\t|| document.getElementById('FPF_rightGalaxy') == ''\r\n\t\t\t|| document.getElementById('FPF_leftSS') == ''\r\n\t\t\t|| document.getElementById('FPF_rightSS') == ''\r\n\t\t\t|| document.getElementById('FPF_closePosition') == ''\r\n\t\t\t|| document.getElementById('FPF_farPosition') == '')\r\n\t\treturn false;\r\n\r\n\t//the left system should be lefter than the right system\r\n\tvar systemDistance = getSystemDistance(document.getElementById('FPF_leftGalaxy').value\r\n\t\t\t\t\t\t\t\t\t\t,document.getElementById('FPF_leftSS').value\r\n\t\t\t\t\t\t\t\t\t\t,document.getElementById('FPF_rightGalaxy').value\r\n\t\t\t\t\t\t\t\t\t\t,document.getElementById('FPF_rightSS').value);\r\n\tif (systemDistance < 0) \r\n\t\treturn false;\r\n\r\n\t// the closest position should be closed to the sun than the further position\r\n\tvar positionDifference = document.getElementById('FPF_farPosition').value - document.getElementById('FPF_closePosition').value;\r\n\tif (positionDifference < 0)\r\n\t\treturn false;\r\n\r\n\treturn true;\r\n}", "function acabarPreInversion (){\n \n realizandoInversion = false \n}", "function asignarManejadores() {\n traerPersonajes();\n}", "function actualizaEnemigos(){\n\tif(!modo_pruebas){\n\t\tfunction agregarDisparos(enemigo,posicion_x,posicion_y){\n\n\t\t\treturn {\n\t\t\t\tx: posicion_x,\n\t\t\t\ty: posicion_y,\n\t\t\t\twidth: 10,\n\t\t\t\theight: 30,\n\t\t\t\tcontador: 0\n\t\t\t}\n\t\t}\n\t}\n\n\tif(juego.estado == 'iniciando'){\n\n\t\tif(nivel == 4)\n\t\t\tnum_enemigos = 14;\n\t\telse\n\t\t\tnum_enemigos = 20;\n\n\t\tif(nivel == 5)\n\t\t{\n\t\t\tenemigos.push({\n\t\t\t\t\tx: 450,\n\t\t\t\t\ty: 10,\n\t\t\t\t\theight: 150,\n\t\t\t\t\twidth: 150,\n\t\t\t\t\testado: 'vivo',\n\t\t\t\t\tcontador: 0,\n\t\t\t\t\tdireccion: 'abajo'\n\t\t\t});\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(var i = 0;i<num_enemigos;i++){\n\t\t\t\tenemigos.push({\n\t\t\t\t\tx: 10 + (i*50),\n\t\t\t\t\ty: 10,\n\t\t\t\t\theight: 40,\n\t\t\t\t\twidth: 40,\n\t\t\t\t\testado: 'vivo',\n\t\t\t\t\tcontador: 0,\n\t\t\t\t\tdireccion: 'abajo'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tjuego.estado = 'jugando';\n\t}\n\t//Mover los enemigos\n\tfor(var i in enemigos)\n\t{\n\t\t\tvar enemigo = enemigos[i];\n\t\t\tif(!enemigo) continue;\n\t\t\tif(enemigo && enemigo.estado == 'vivo')\n\t\t\t{\n\t\t\t\tenemigo.contador++;\n\n\t\t\t\t//Condiciones para los diferentes niveles\n\n\t\t\t\tif(enemigos.length == 1 && nivel != ultimo_nivel)\n\t\t\t\t\tenemigo.x += Math.sin(enemigo.contador * Math.PI /90)*2;\n\n\t\t\t\tif(nivel == 2)\n\t\t\t\t{\n\t\t\t\t\tenemigo.y +=0.3;\n\t\t\t\t\tif(aleatorio(0,enemigos.length * 10) == 4){\n\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x,enemigo.y));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(nivel == 3)\n\t\t\t\t{\n\t\t\t\t\tenemigo.y +=0.8;\n\t\t\t\t\tif(aleatorio(0,enemigos.length * 10) == 4){\n\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x,enemigo.y));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse if(nivel == 4)\n\t\t\t\t{\n\t\t\t\t\tenemigo.y += Math.sin(enemigos.length * Math.PI /90);\n\t\t\t\t\t\n\t\t\t\t\tenemigo.x += Math.sin(enemigo.contador * Math.PI /90)*6;\n\n\t\t\t\t\tif(aleatorio(0,enemigos.length * 10) == 4){\n\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x,enemigo.y));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse if(nivel == 5)\n\t\t\t\t{\n\t\t\t\t\tif(!modo_pruebas){\n\n\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x,enemigo.y));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x+100,enemigo.y));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x+200,enemigo.y));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x-100,enemigo.y));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(contador_jefe > 1000){\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x+300,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x+400,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(contador_jefe > 2000){\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x-200,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x-400,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(contador_jefe > 9000){\n\t\t\t\t\t\t\tenemigo.x += Math.sin(enemigo.contador * Math.PI /90)*6;\n\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x-200,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(aleatorio(0,enemigos.length * 30) == 4){\n\t\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x-400,enemigo.y,'izquierda'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(aleatorio(0,enemigos.length * 10) == 4){\n\t\t\t\t\t\tdisparosEnemigos.push(agregarDisparos(enemigo,enemigo.x,enemigo.y));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(enemigo && enemigo.estado == 'golpeado')\n\t\t\t{\n\t\t\t\tenemigo.contador++;\n\t\t\t\tif(enemigo.contador >= 20){\n\t\t\t\t\tenemigo.estado = 'muerto';\n\t\t\t\t\tpuntos_totales += 100;\n\t\t\t\t\tenemigo.contador = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((enemigo.y > canvas.height-10)){\n\t\t\t\tjuego.estado = 'perdido';\n\t\t\t\tnave.estado = 'golpeado';\n\t\t\t}\n\t\t\t//console.log(enemigo.y + \" \" + enemigo.x+ \" nave: \"+ nave.y + \" \"+nave.x);\n\t\t\tif(enemigo.y >= nave.y){\n\n\t\t\t\tjuego.estado = 'perdido';\n\t\t\t\tnave.estado = 'golpeado';\n\t\t\t}\n\n\t}\n\tenemigos = enemigos.filter(function(enemigo){\n\t\tif(enemigo && enemigo.estado != 'muerto') return true;\n\t\treturn false;\n\t});\n\n}", "function canviDeForms() {\n // Quan cliquem a Create Rocket\n if (createPropellersForm.style.display == \"none\") {\n createPropellersForm.style.display = \"block\";\n createARocketForm.style.display = \"none\";\n }\n // Quan cliquem a Add Propellers, que torni a l'estat inicial\n else if (createARocketForm.style.display == \"none\") {\n createPropellersForm.style.display = \"none\";\n createARocketForm.style.display = \"block\";\n }\n}", "saveIfEdited() {\n if (this.lastEditedTimestamp && this.notesId) {\n if (!this.sendDataToServer()) {\n alert('Failed to save notes.');\n return false;\n }\n }\n\n return true;\n }", "function onObligatorioNOrdenes() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioNOrdenes') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicio', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFin', 'S');\n\t}\t\t\n}", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "isIntact () {\n return false;\n }", "function changeBooleansToFalse() {\r\n demo = false;\r\n isLegalMovement = false;\r\n isBlackToolInsideJump = false;\r\n isWhiteToolInsideJump = false;\r\n isForcedJump = false;\r\n isToolTaken = false;\r\n isExtraForcedJump = false;\r\n}", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "_determineWhetherToWritePackageJson() {\n this.writePackageJson = this.writePackageJson && this.origin !== _constants().COMPONENT_ORIGINS.AUTHORED;\n }", "function settingsUpdate() {\r\n\t// 0.8 >> 0.9\r\n\tif ( typeof(settings.motw) != 'undefined' ) {\r\n\t\tsettings.style.disable_motw = settings.motw;\r\n\t\tdelete settings.motw;\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// 1.1 >> 1.2\r\n\tif ( typeof(settings.style.hide_time_created) == 'undefined' ) {\r\n\t\tsettings.style.hide_time_created = true;\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "static postUpdate() {\n return false;\n }", "function areCustomAttributesDirty ( material ) {\r\n\r\n\t\tfor ( var a in material.attributes ) {\r\n\r\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}", "function activarHerramientaPerfil() {\n console.log(\"Activar herramienta perfil\");\n\n crearYCargarCapaLineaPerfil();\n activarControlDibujo();\n\n\n}", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function btnAnularTarea_onClick() {\n\n //bcambios = false;\n\n //validaciones de campos obligatorios\n if (!view.requiredValidation()) return;\n\n view.initModal_AnularTarea();\n }", "get canEdit() {\n return this.isEditable && !this.alwaysEditing && !!this.recordFields.length;\n }", "shouldUpdate(_changedProperties){return!0}", "function atk(){\n\t\t\n if (butAtk.disabled == false && manaPerso.value >= manaAtk){\n\t\t\n ciblerMonstre();\n vieMonCib.value -= atkPerso;\n vieMonCib.innerHTML = vieMonCib.value;\n testMortMonstre();\n\n \n description.innerHTML = \"Il avez infligé \"+atkPerso+\" points de dégats. Il a consomé \"+manaAtk+\" points de Mana.\";\n \n\t\tbutAtk.disabled = true;\n\t\tbutDef.disabled = true;\n\t\tbutSpe.disabled = true;\n\t\t\n }\t\n else{\n description.innerHTML = \"Vous n'avez plus assez de Mana.\";\n selectionAction();\n }\n}", "function desactivarControles() {\n\n //Excepto los que no se desactivan...\n for (var i = 0 ; i < map.controls.length; i++) {\n if (map.controls[i].CLASS_NAME == \"OpenLayers.Control.PanZoomBar\" || map.controls[i].CLASS_NAME == \"OpenLayers.Control.ScaleLine\" || map.controls[i].CLASS_NAME ==\n \"OpenLayers.Control.Navigation\" || map.controls[i].CLASS_NAME == \"OpenLayers.Control.NavigationHistory\" || map.controls[i].CLASS_NAME == \"OpenLayers.Control.Button\" || map.controls[i].CLASS_NAME == \"OpenLayers.Control.Panel\")\n { }\n else {\n map.controls[i].deactivate();\n }\n\n }\n // Por alguna razon el getfeature no se desactiva correctamente, esto lo soluciona...\n navegacionControl.deactivate();\n navegacionControl.activate();\n\n}", "function imprimirSiEsMayorEdad(persona){\n if(esMayorDeEdad(persona) ) {\n console.log(`${persona.nombre} es mayor de edad`);\n }\n else{\n console.log(`${persona.nombre} es menor de edad`);\n }\n}", "function imprimirSiEsMayorDeEdad(persona) {\n // invocamos la funcion esMayorDeEdad desde-\n // esta otra funcion y la validamos dentro-\n // de un condicional\n if (esMayorDeEdad(persona)) {\n // Si la condicion se cumple imprime este console\n console.log(`${persona.nombre} es mayor de edad`);\n } else {\n // si la condicion no se comple imprime este\n console.log(`${persona.nombre} es menor de edad`);\n }\n}", "function setIsRotatable() {\r\n that.isRotatable = (isRectangle() && that.pieces.length > 1);\r\n }", "function gestioneCambioTab(e) {\n var changedInputs = inputDaControllare.findChangedValues();\n var result = true;\n if(changedInputs.length > 0) {\n e.preventDefault();\n // Apri modale conferma cambio, passandogli il this\n apriModaleConfermaCambioTab($(this));\n result = false;\n } else {\n // Posso cambiare il tab: chiudo i messaggi di errore\n alertErrori.slideUp();\n alertInformazioni.slideUp();\n }\n return result;\n }", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "function permitirAcceso(persona) {\n if (!esMayorDeEdad(persona)){ // si la persona no es mayor de edad\n console.log(\"ACCESO DENAGADO\")\n }\n}", "isUpdatePermitted() {\n return this.checkAdminPermission('update')\n }", "function setViewModified(bool) {\n // log.d('modified =' + bool);\n viewModified = bool;\n if (bool) saveButton.show(true);\n else {saveButton.hide(true);} \n }", "function editModeOn() {\n\tif(document.getElementById(\"editorTextInputField\")){\n\t\talert(\"Egyszerre egy mezot szerkeszthetsz!\");\n\t\treturn;\n\t}\n\thiddenMenusOff();\n\tif(!editMode) {\n\t\t$('#edit-mode').addClass(\"active\");\n\t\teditMode = true;\n\t\tonclickToTexts();\n\t} else {\n\t\tif(document.getElementById(\"editorTextInputField\")){\n\t\t\talert(\"Fejezd be a szerkesztest mielott kilepsz a szerkesztesmodbol!\");\n\t\t\treturn;\n\t\t}\n\t\thiddenMenusOff();\n\t\teditMode = false;\n\t}\n}", "function editA(it,sIt) {\n\t\tvar w = new winDep(top,gravador+'?_it='+it+'&_sIt='+cmpUrl(sIt));\n\t\tw.centrada = false;w.cascata = true;\n\t\tw.frame = true;\n\t\t//w.debug = true;\n\t\tw.scr = 'yes';\n\t\tw.abre();\n\t}", "function editannounement() {\n\n}", "function areCustomAttributesDirty( material ) {\n\n for ( var a in material.attributes ) {\n\n if ( material.attributes[ a ].needsUpdate ) return true;\n\n }\n\n return false;\n\n }", "function formEdited($form, isEdited) {\n \tif (isEdited) {\n \t\t$form.find(':submit,:reset').removeAttr('disabled')\n \t\t\t.removeClass('ui-state-disabled');\n \t} else if ($form.data('inform').undoEdit) {\n \t\t$form.find(':submit,:reset').attr('disabled', true)\n \t\t\t.addClass('ui-state-disabled');\n \t}\n }", "isEditable() {\n return !this.isReference();\n }", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var a in material.attributes ) {\n\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "moverAbajo(){\n this.salaActual.jugador = false;\n this.salaActual = this.salaActual.abajo;\n this.salaActual.entradaAnteriorSala = posicionSala.abajo;\n this.salaActual.jugador = true;\n\n }", "modificarContraccionHelices(){\n this.contraer_helices = !this.contraer_helices;\n }", "function habilitarMovimento(sentido, casaBaixo){\n\t\t\t\tif(sentido == 'baixo'){ baixo(casaBaixo); }\n\t\t\t\telse{ $('#baixo_btn').off(); }\n\n\t\t\t\tif(sentido == 'direita'){ direita(); }\n\t\t\t\telse{ $('#direita_btn').off(); }\n\n\t\t\t\tif(sentido == 'esquerda'){ esquerda(); }\n\t\t\t\telse{ $('#esquerda_btn').off(); }\n\t\t\t}", "function initInterfaz() {\n let status = this.g.options.status;\n\n function reflejarOpciones(opts) {\n for(const ajuste of this.ajustes.$children) {\n const input = ajuste.$el.querySelector(\"input\");\n if(opts[input.name]) {\n input.checked = true;\n input.dispatchEvent(new Event(\"change\"));\n }\n }\n }\n\n // Nos aseguramos de que al (des)aplicarse\n // un filtro o corrección se refleja en la interfaz.\n this.g.Centro.on(\"filter:* unfilter:*\", reflejarFiltro.bind(this));\n this.g.Centro.on(\"correct:* uncorrect:*\", reflejarCorreccion.bind(this));\n\n let opciones = {};\n if(status) {\n this.g.setStatus(); // Aplicamos el estado del mapa.\n // Lo único que queda por reflejar son las opciones\n // exclusivas de la interfaz virtual.\n for(const o in defaults_v) {\n const name = o.substring(0, 3);\n if(status.visual.hasOwnProperty(name)) {\n opciones[o] = status.visual[name];\n }\n }\n if(status.esp) this.selector.cambiarSidebar(status.esp);\n }\n else opciones = this.options;\n\n reflejarOpciones.call(this, opciones);\n\n // Si no se incluyen vacantes telefónicas, entonces\n // debe deshabilitarse la corrección por adjudicaciones no telefónicas.\n if(!this.options[\"correct:vt+\"]) {\n for(const f of this.filtrador.$children) {\n if(f.c.tipo === \"correct\" && f.c.nombre === \"vt\") {\n f.$children[0].disabled = true;\n break;\n }\n }\n }\n\n // Una vez aplicados todos los cambios iniciales, definimos\n // el disparador para que vaya apuntando en local los cambios de estado.\n // TODO: Esto quizás se pueda pasar a un sitio más adecuando, haciendo uso de statusset\n this.g.on(\"statuschange\", e => {\n if(localStorage && this.options.recordar) localStorage.setItem(\"status\", this.status);\n });\n\n this.g.fire(\"statusset\", {status: !!status});\n // Guardamos el estado final de la inicialización.\n this.g.fire(\"statuschange\");\n }", "function actualizarEstadoTarea(estado) {\n bcambios = false;\n _estado = estado;\n btnGrabar_onClick();\n }", "get canSave() {\n return (this.canEdit || this.alwaysEditing) && this.isEditing && this.hasChanged && !!this.recordFields.length;\n }", "function formChanged(specificWidgetArray) {\r\n// Old \r\n//function formChanged() {\r\n// END CHANGE BY Marc TABARY - 2017-03-06 - ALLOW DISABLED SPECIFIC WIDGET\r\n var updateRight = dojo.byId('updateRight');\r\n if (updateRight && updateRight.value == 'NO') {\r\n return;\r\n }\r\n disableWidget('newButton');\r\n disableWidget('newButtonList');\r\n enableWidget('saveButton');\r\n disableWidget('printButton');\r\n disableWidget('printButtonPdf');\r\n disableWidget('copyButton');\r\n enableWidget('undoButton');\r\n showWidget('undoButton');\r\n disableWidget('deleteButton');\r\n disableWidget('refreshButton');\r\n hideWidget('refreshButton');\r\n disableWidget('mailButton');\r\n disableWidget('multiUpdateButton');\r\n disableWidget('indentDecreaseButton');\r\n disableWidget('indentIncreaseButton');\r\n formChangeInProgress = true;\r\n grid = dijit.byId(\"objectGrid\");\r\n if (grid) {\r\n // saveSelection=grid.selection;\r\n grid.selectionMode = \"none\";\r\n\r\n }\r\n buttonRightLock();\r\n\r\n// ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n if (specificWidgetArray!==undefined) {\r\n // This parameter must be an array\r\n if (specificWidgetArray instanceof Array) {\r\n for (i = 0; i < specificWidgetArray.length; i++) {\r\n if (dijit.byId(specificWidgetArray[i])) { // Widget\r\n disableWidget(specificWidgetArray[i]);\r\n } else if(specificWidgetArray[i].indexOf('_spe_')!=-1) { // Specific attributes '_spe_'\r\n // Search the id DOM\r\n var theIdName = 'id_'+specificWidgetArray[i].replace('_spe_','');\r\n var theId = document.getElementById(theIdName);\r\n if (theId!==null) {\r\n theIdName = theIdName.toLowerCase();\r\n if(theIdName.indexOf('button')!=-1) { // Button => Hide\r\n theId.style.visibility = \"hidden\";\r\n } else { // Else, readonly\r\n theId.readOnly=true;\r\n theId.class +=' \"readOnly\"';\r\n}\r\n }\r\n }\r\n }\r\n }\r\n }\r\n// END ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n\r\n}", "function compruebaFin() {\r\n if( oculta.indexOf(\"_\") == -1 ) {\r\n document.getElementById(\"msg-final\").innerHTML = \"Felicidades !!\";\r\n document.getElementById(\"msg-final\").className += \"zoom-in\";\r\n document.getElementById(\"palabra\").className += \" encuadre\";//className obtine y establece el valor del atributo de la clase del elemento especificado\r\n for (var i = 0; i < buttons.length; i++) {\r\n buttons[i].disabled = true;\r\n }\r\n document.getElementById(\"reset\").innerHTML = \"Empezar\";\r\n btnInicio.onclick = function() { location.reload() };\r\n }else if( cont == 0 ) {\r\n document.getElementById(\"msg-final\").innerHTML = \"Juego Finalizado\";\r\n document.getElementById(\"msg-final\").className += \"zoom-in\";\r\n document.getElementById(\"dibujo_ahorcado\").style.display=\"none\";\r\n document.getElementById(\"segundo\").style.display=\"block\";\r\n\r\n for (var i = 0; i < buttons.length; i++) {\r\n buttons[i].disabled = true; //Desactiva el boton despues de precionarlo\r\n }\r\n document.getElementById(\"reset\").innerHTML = \"Empezar\";\r\n btnInicio.onclick = function () { location.reload() }; // el reload me sirve para volver a cargar el juego o una nueva palabra en menos palabra\r\n }\r\n}", "function atualizaOrdenacao(){\n\n var resort = true, callback = function(table){};\n\n tabela.trigger(\"update\", [resort, callback]);\n\n }", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function actualizarCuenta(){\t\t\r\n\t//alert('actualizar datos cuenta postpago');\r\n\tvar frm = document.forms[0];\r\n\tfrm.buttonActualizar.disabled=true;\r\n\tfrm.buttonActualizarCuenta.disabled=false;\r\n\tfrm.buttonActualizarCuenta.value=\"Actualizar\";\r\n\tfrm.tipo.value=\"actualizarCuenta\";\r\n\r\n\tocultarDatosPrepago();\r\n\t//datos cuenta\r\n\tfrm.teleRefCon.disabled=false;\r\n\tfrm.persCon.disabled=false;\r\n\tfrm.emailCon.disabled=false;\r\n\t//direccion facturacion\r\n\tfrm.dirCalle.disabled=false;\r\n\tfrm.nomCalle.disabled=false;\r\n\tfrm.dirNumero.disabled=false;\r\n\tfrm.dirSn.disabled=false;\r\n\tfrm.dirMz.disabled=false;\r\n\tfrm.dirNumeromz.disabled=false;\r\n\tfrm.dirTipodep.disabled=false;\r\n\tfrm.dirLote.disabled=false;\r\n\tfrm.dirNumerodep.disabled=false;\r\n\tfrm.maxCaracteres1.disabled=false;\r\n\t\r\n\t//direccion de referencia\r\n\tfrm.dirUrbanizacion.disabled=false;\r\n\tfrm.dirRefUrb.disabled=false;\r\n\tfrm.dirRefZona.disabled=false;\r\n\tfrm.dirRefNombrezona.disabled=false;\r\n\tfrm.dirReferencias.disabled=false;\r\n\tfrm.maxCaracteres2.disabled=false;\r\n\t\r\n\t//lista de ubigeos\r\n\t//frm.dirPais.disabled=false;\r\n\tfrm.dirDepartamento.disabled=false;\r\n\tfrm.dirProvincia.disabled=false;\r\n\tfrm.dirDistrito.disabled=false;\r\n\t//frm.dirCodigoPostal.disabled=false;\r\n\t\r\n\tif(frm.dirMz.selectedIndex==0){\r\n\t\tfrm.dirNumeromz.value=\"\";\r\n\t\tfrm.dirLote.value=\"\";\r\n\t\tfrm.dirNumeromz.readOnly=true;\r\n\t\tfrm.dirLote.readOnly=true;\r\n\t}\r\n}", "function formulario_recorrido_hora_habilitar() {\n $(\"#fecha-desde-hora\").prop(\"disabled\", false);\n $(\"#fecha-hasta-hora\").prop(\"disabled\", false);\n}", "function moureJugador(jugador) {\n novaDireccioJugador(jugador);\n\n if (jugador[3] == 1 && tauler[jugador[2] + 1][jugador[1]] != 0) {\n tauler[jugador[2]][jugador[1]] = 1;\n //guardem les posicions antigues per comprovar colisions\n jugador[5] = jugador[1];\n jugador[6] = jugador[2];\n //movem el jugador\n jugador[2] += 1;\n //modifiquem el tauler\n tauler[jugador[2]][jugador[1]] = 2;\n }\n if (jugador[3] == 2 && tauler[jugador[2]][jugador[1] + 1] != 0) {\n tauler[jugador[2]][jugador[1]] = 1;\n jugador[5] = jugador[1];\n jugador[6] = jugador[2];\n jugador[1] += 1;\n tauler[jugador[2]][jugador[1]] = 2;\n }\r\n if (jugador[3] == 3 && tauler[jugador[2] - 1][jugador[1]] != 0) {\n tauler[jugador[2]][jugador[1]] = 1;\n jugador[5] = jugador[1];\n jugador[6] = jugador[2];\n jugador[2] += -1;\n tauler[jugador[2]][jugador[1]] = 2;\n }\r\n if (jugador[3] == 4 && tauler[jugador[2]][jugador[1] - 1] != 0) {\n tauler[jugador[2]][jugador[1]] = 1;\n jugador[5] = jugador[1];\n jugador[6] = jugador[2];\n jugador[1] += -1;\n tauler[jugador[2]][jugador[1]] = 2;\n }\r\n}", "function modificarDOMPantallaPlantilla() {\r\n\t// Obtenemos la tabla de jugadores y todas sus filas.\r\n\tvar tablaJugadores = document.getElementById(\"content\").getElementsByTagName(\"table\")[0];\r\n\tvar filasTablaJugadores = tablaJugadores.getElementsByTagName(\"tr\");\r\n\t\r\n\t// Recorremos todas las filas de la tabla de jugadores (excepto la primera, que es la cabecera).\r\n\tfor (var fila = 1; fila < filasTablaJugadores.length; fila++) {\r\n\t\t// Obtenemos el id del jugador actual.\r\n\t\tvar columnasFila = filasTablaJugadores[fila].getElementsByTagName(\"td\");\r\n\t\tvar columnaIdJugador = columnasFila[3];\r\n\t\tvar idJugador = extraerIdJugador(columnaIdJugador.getElementsByTagName(\"a\")[0]);\r\n\t\t// Actualizamos el valor de las stats del jugador actual.\r\n\t\tprocesarCambioValorStat(columnasFila[5], idJugador, \"calidad\");\r\n\t\tprocesarCambioValorStat(columnasFila[6], idJugador, \"resistencia\");\r\n\t\tprocesarCambioValorStat(columnasFila[7], idJugador, \"velocidad\");\r\n\t\tprocesarCambioValorStat(columnasFila[8], idJugador, \"pase\");\r\n\t\tprocesarCambioValorStat(columnasFila[9], idJugador, \"remate\");\r\n\t\tprocesarCambioValorStat(columnasFila[10], idJugador, \"tiro\");\r\n\t\tprocesarCambioValorStat(columnasFila[11], idJugador, \"entradas\");\r\n\t\tprocesarCambioValorStat(columnasFila[12], idJugador, \"agresividad\");\r\n\t\tprocesarCambioValorStat(columnasFila[13], idJugador, \"conduccion\");\r\n\t\tprocesarCambioValorStat(columnasFila[14], idJugador, \"desmarque\");\r\n\t\tprocesarCambioValorStat(columnasFila[16], idJugador, \"mediareal\");\r\n\t}\r\n\t\r\n\t// Ajustamos estilos de tabla y contenedores.\r\n\teliminarAnchosColumnaTablaJugadores(filasTablaJugadores[0]);\r\n\tajustarEstilosContenedores();\r\n\t\r\n\t// Cuando tenemos todo el DOM modificado, mostramos la tabla.\r\n\tmostrarJugadores();\r\n}", "function changeActiveNeedleSStatus(){\n\t\t\t speedoActive = false;\n\t\t\t speedoLimiter = false;\n\t\t return true;\n\t\t}", "function canBtnHdlr() {\n\tvar cells = $(this).closest(\"tr\").find(\"input[data-changed=true]\");\n\tif ( cells.length > 0 ) {\n\t\tcells.each( function () { // Restore the old value\n\t\t\t$(this).val( $(this).attr( \"data-oldv\" ) );\n\t\t\t$(this).attr( \"data-changed\", \"false\" );\n\t\t}); // forEach\n\t}\n\t$(this).closest(\"tr\").find(\"input[type=text]\").prop( \"disabled\", true );\n\tchgUpd2Edit( $(this).siblings(\".updBtn\") );\n}", "function updateAvailable(available) {\n if (available.tiempo > 0) {\n mode0.innerHTML = \"PARTIDAS DISPONIBLES: \" + available.tiempo;\n enableAnchor(mode0.parentElement);\n } else {\n mode0.innerHTML = \"NO HAY PARTIDAS DISPONIBLES\";\n disableAnchor(mode0.parentElement);\n }\n if (available.puntaje > 0) {\n mode1.innerHTML = \"PARTIDAS DISPONIBLES: \" + available.puntaje;\n enableAnchor(mode1.parentElement);\n } else {\n mode1.innerHTML = \"NO HAY PARTIDAS DISPONIBLES\";\n disableAnchor(mode1.parentElement);\n }\n}", "function formulario_recorrido_hora_deshabilitar() {\n $(\"#fecha-desde-hora\").prop(\"disabled\", true);\n $(\"#fecha-hasta-hora\").prop(\"disabled\", true);\n}", "function _check_if_exist_change(){\n try{\n if(win.action_for_custom_report == 'add_job_custom_report'){\n return true;\n }\n var is_make_changed = false;\n if(_is_make_changed){\n is_make_changed = true;\n }\n return is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return false; \n } \n }", "verificarPerdida(){\n if(this.grillaLlena()){\n let aux = this.clone();\n aux.grafica = new GraficaInactiva();\n //simulo movimiento a derecha\n aux.mover(new MovimientoDerecha(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a izquierda\n aux.mover(new MovimientoIzquierda(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a abajo\n aux.mover(new MovimientoAbajo(aux));\n if(aux.compareTo(this)){ \n //simulo movimiento a arriba\n aux.mover(new MovimientoArriba(aux));\n if(aux.compareTo(this))\n this.grafica.setPerdida();\n }\n } \n }\n }\n }", "function gps_asignarFecha() {\n var sfecha = document.getElementById(\"sfecha\").value;\n \n if (sfecha == 1 || sfecha == 2 || sfecha == 3) {\n gps_fechasHoy(); \n }\n if (sfecha == 4) {\n gps_fechasAyer();\n }\n \n gps_habilitarAutoConsulta(false);\n gps_mostrarComponente('gps-controls', true);\n\n // Habilita autoconsulta para opcion predefinida 2 (localizacion actual)\n if (sfecha == 2) {\n gps_habilitarAutoConsulta(true);\n gps_mostrarComponente('gps-controls', false);\n }\n}", "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "procMorreu()\n\t// retorna se jah foi usado\n\t{\n\t\tthis._personagemJahPegou = true;\n\n\t\tif (this._informacoesPocao.ativadoInstant)\n\t\t\tControladorJogo.pers.controladorPocoesPegou.adicionarPocaoUsando(this);\n\t\telse\n\t\t\tControladorJogo.pers.controladorPocoesPegou.adicionarPocao(this);\n\n\t\treturn this._informacoesPocao.ativadoInstant;\n\t}", "updateCamera() {\n if(this.terceraPersona){\n switch(this.pacman.getOrientacion()){\n case orientaciones.UP:\n this.pacmanCamera.position.set(this.pacman.position.x, 3, this.pacman.position.z+2.75);\n this.pacmanCamera.lookAt(this.pacman.position);\n break;\n case orientaciones.DOWN:\n this.pacmanCamera.position.set(this.pacman.position.x, 3, this.pacman.position.z-2.75);\n this.pacmanCamera.lookAt(this.pacman.position);\n break;\n case orientaciones.LEFT:\n this.pacmanCamera.position.set(this.pacman.position.x+2.75, 3, this.pacman.position.z);\n this.pacmanCamera.lookAt(this.pacman.position);\n break;\n case orientaciones.RIGHT:\n this.pacmanCamera.position.set(this.pacman.position.x-2.75, 3, this.pacman.position.z);\n this.pacmanCamera.lookAt(this.pacman.position);\n break;\n }\n } else{\n this.camera.position.set(this.pacman.position.x, 20, this.pacman.position.z+10);\n this.camera.lookAt(this.pacman.position);\n }\n }", "function startSuivi() {\n\n\tsuivi = true;\n\n\tif(!geolocation) {\n\t\tstartGeolocation();\n\t}\n\n\n\t$(\"#picto-geoloc\").attr('src', \"img/btn-mesuivre-on.png\");\n}", "function updateAllCameras(overwriteLookAt) {\n\tcamera_MotherShip.up.x = motherUp[ 0 ];\n\tcamera_MotherShip.up.y = motherUp[ 1 ];\n\tcamera_MotherShip.up.z = motherUp[ 2 ];\n\tcamera_ScoutShip.up.x = scoutUp[ 0 ];\n\tcamera_ScoutShip.up.y = scoutUp[ 1 ];\n\tcamera_ScoutShip.up.z = scoutUp[ 2 ];\n\tif (overwriteLookAt) {\n\t\tcamera_MotherShip.lookAt( motherLookAt );\n\t\tcamera_ScoutShip.lookAt( scoutLootAt );\n\t}\t\n}", "function setFacilitiesInapplicable() {\n\n // Delete facilities.\n if (EventFormData.facilities.length > 0) {\n\n $scope.facilitiesError = false;\n EventFormData.facilities = [];\n\n var promise = eventCrud.updateFacilities(EventFormData);\n promise.then(function() {\n $scope.savingFacilities = false;\n $scope.facilitiesInapplicable = true;\n $scope.facilitiesCssClass = 'state-complete';\n }, function() {\n $scope.savingFacilities = false;\n $scope.facilitiesError = true;\n });\n\n }\n else {\n $scope.facilitiesInapplicable = true;\n $scope.facilitiesCssClass = 'state-complete';\n }\n }", "function finaliza_configuracao(){\n \n var var_elemento_escolhido = 0;\n\n //antes de enviar verifica se o usuario esta logado\n var sessao_expirada = valida_sessao_expirada();\n $(\"#mensagem_retorno_funcao_configuracao\").hide();\n\n\n $('#lista_plantas input[type=checkbox]').each(function () {\n if (this.checked) {\n var_elemento_escolhido = 1 ;\n }\n });\n\n if(var_elemento_escolhido==1){\n //carrega lista de plantas\n salva_configuracao_rede();\n $( \"#mensagem_retorno_valida_planta\" ).hide();\n }else{\n\n $( \"#mensagem_retorno_valida_planta\" ).show();\n document.getElementById('mensagem_retorno_valida_planta').scrollIntoView({block: 'end', behavior: 'smooth'});\n\n }\n \n }", "function verificaAlteracaoListaPac() {\n\tvar diasMonitorados;\n\tvar diaMaisRecente;\n\tpacientesRiscoAlertaAtivado = 0;\n\n\tfor ( i = 0; i < pacientesJson.length; i++) {\n\t\tdiasMonitorados = pacientesJson[i].diasMonitorados;\n\t\tdiaMaisRecente = dadosDiaAtual(diasMonitorados);\n\n\t\tif (verificaAlteracao(diaMaisRecente) && pacientesAlertaStatus[i]) {\n\t\t\tpacientesRiscoAlertaAtivado++;\n\t\t}\n\t}\n\t//alert(\"Pacientes em risco: \"+pacientesRiscoAlertaAtivado);\n}", "function imprimirSiEsMayorDeEdad (persona) {\n //llamamos a la otra funcion\n if (esMayorDeEdad (persona))\n console.log (`${persona.nombre} es mayor de edad`)\n\n else {\n console.log (`${persona.nombre} es menor de edad`)\n }\n}", "function validarFormModifyDates() {\n const cuTorre = document.forms[\"modifyDatePosition\"][\"torreCU\"];\n const serialTorre = document.forms[\"modifyDatePosition\"][\"torreSerial\"];\n const cuMoni = document.forms[\"modifyDatePosition\"][\"moniCU\"];\n const serialMoni = document.forms[\"modifyDatePosition\"][\"moniSerial\"];\n\n // Los campos no pueden ser vaciós.\n if (cuTorre.value == \"\" || cuTorre.value.length <= 3 || serialTorre.value == \"\" || serialTorre.value.length <= 3 || cuMoni.value == \"\" || cuMoni.value.length <= 3 || serialMoni.value == \"\" || serialMoni.value.length <= 3) {\n snackbar(\"Los campos no deben ser vacios y no deden ser inferiores a 4 caracteres.\");\n return false;\n }else {\n console.log(\"Datos correctos (por ahora)\");\n saveChanges(cuTorre.value, serialTorre.value, cuMoni.value, serialMoni.value, buttonSave.value);\n }\n}", "function imprimirSiEsMayorDeEdad (persona){\n if (esMayorDeEdad(persona)){\n console.log (`${persona.nombre} es mayor de edad`)\n }else {\n console.log(`${persona.nombre} es menor de edad`)\n}\n}", "function checkOption() {\n car.src = accessories[1];\n frontWheel.src = accessories[2];\n backWheel.src = accessories[2];\n storage.src = accessories[4];\n spoiler.src = accessories[3];\n done = true;\n accessories = [];\n }" ]
[ "0.5766059", "0.56830597", "0.5634316", "0.56236523", "0.5573855", "0.5496294", "0.5490309", "0.5478505", "0.54747117", "0.54638237", "0.5409179", "0.5380221", "0.53801924", "0.5348406", "0.53425497", "0.5336418", "0.53226966", "0.5322319", "0.53097516", "0.528444", "0.52804774", "0.5273833", "0.5273833", "0.5273833", "0.5273833", "0.5273833", "0.5273833", "0.525814", "0.52120394", "0.521073", "0.5206369", "0.5200796", "0.51706064", "0.51561373", "0.5144032", "0.51399106", "0.51374793", "0.5132819", "0.51224196", "0.5120906", "0.51169044", "0.511628", "0.5113001", "0.50982445", "0.5095273", "0.50907505", "0.50902593", "0.50880784", "0.5083141", "0.50795376", "0.50741553", "0.5073116", "0.5071555", "0.50699264", "0.50698227", "0.50697154", "0.5066336", "0.5066336", "0.50628185", "0.5056581", "0.50524294", "0.5052269", "0.50521123", "0.5050414", "0.5045635", "0.5043633", "0.5039325", "0.5030981", "0.50182897", "0.50144064", "0.5011999", "0.5009551", "0.50059813", "0.5002393", "0.5000998", "0.49934918", "0.49794045", "0.49773398", "0.49762288", "0.49756166", "0.49743047", "0.49651316", "0.49610463", "0.4955558", "0.49530202", "0.49495348", "0.49492544", "0.49458575", "0.49455658", "0.49442697", "0.49404988", "0.4935801", "0.493565", "0.49286434", "0.4924066", "0.49234113", "0.4922293", "0.49218145", "0.49178407", "0.49163496", "0.49105972" ]
0.0
-1
Return the entity for a given id
getEntity(id, params) { return __awaiter(this, void 0, void 0, function* () { const entityService = this.entityService; const { entity } = this.configuration; debug('Getting entity', id); if (entityService === null) { throw new errors_1.NotAuthenticated(`Could not find entity service`); } const query = yield this.getEntityQuery(params); const getParams = Object.assign({}, omit_1.default(params, 'provider'), { query }); const result = yield entityService.get(id, getParams); if (!params.provider) { return result; } return entityService.get(id, Object.assign(Object.assign({}, params), { [entity]: result })); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEntityById(id) {\n return entities[id];\n}", "entity(id) {\n if (arguments.length === 0) {\n return new Entity(this);\n } else {\n return internal(this).entities.get(id);\n }\n }", "get(id) {\n return internal(this).idToEntity.get(id);\n }", "function findById(id) {\n return _.find(entities, { '_id': id });\n }", "getById(id) {\r\n return this._byId[id]\r\n }", "getById(id)\n {\n return this.getModel()\n .find(id)\n .first();\n }", "function getEntity(id, mapId)\n{\n\tif (id == null)\n\t{\n\t\treturn null;\n\t}\n\telse if (typeof connected[mapId][id] !== 'undefined')\n\t{\n\t\treturn connected[mapId][id];\n\t}\n\telse if (typeof mapEntities[mapId][id] !== 'undefined')\n\t{\n\t\treturn mapEntities[mapId][id].entity;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "static getById(id) {\n if (!valid_string(id) && typeof id !== \"object\")\n return Promise.reject(new Error(`Invalid in getById(${id}) arguments`));\n return this.this_model().findOne({ _id: id });\n }", "function get(id) {\n let e = entities[id]\n if(e!==undefined){\n return {\n version: e.values.length,\n id: e.id,\n value: e.value\n }\n }\n return undefined\n\n}", "Get(id) {\n\t\treturn this.obj.filter(function(o){return o.id == id;})[0];\n\t}", "function findById(id) {\n\n id = parseInt(id)\n\n if (!exercises.has(id))\n throw new Error(`No entity by id: ${id}`)\n\n return exercises.get(id)\n}", "function read(id, cb) {\n const key = ds.key([kind, parseInt(id, 10)]);\n ds.get(key, (err, entity) => {\n cb(null, fromDatastore(entity));\n });\n}", "static async findById (id) {\n const criteria = {\n where: {\n id\n }\n }\n const entity = await User.findOne(criteria)\n if (!entity) {\n throw new errors.NotFoundError(`id: ${id} \"User\" doesn't exists.`)\n }\n return { id: entity.id, name: entity.name, profilePic: entity.profilePicture }\n }", "_get (id) {\n id = this._objectifyId(id);\n\n return this.Model.findOne({ [this.id]: id }, { '_revision.history': 0 })\n .then(data => {\n if (!data) {\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n return data;\n })\n .catch(errorHandler);\n }", "getOne(resource, id) {\n const url = `${baseUrl}/${resource}/${id}/`\n return this.fetchFactory(url)\n }", "findById(id) {\n let sqlRequest = \"SELECT id, name, url, actorId FROM repo WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.findOne(sqlRequest, sqlParams).then(row =>\n new Actor(row.id, row.name, row.url));\n }", "function get(id) {\n return dataStore.get(id);\n }", "get(id)\n {\n return this._fetch(this._url + '/' + id);\n }", "static async findById (id) {\n const criteria = {\n where: {\n id\n }\n }\n const entity = await Document.findOne(criteria)\n if (!entity) {\n throw new errors.NotFoundError(`id: ${id} \"Document\" doesn't exists.`)\n }\n return entity\n }", "function get(id) {\n return db.get(id);\n }", "async get(id){\n return await this.model.findById(id)\n }", "async read(entityID) {\n\n }", "async function get_item_by_id(id, KIND) {\n const key = datastore.key([KIND, parseInt(id, 10)]);\n const [item] = await datastore.get(key);\n return item;\n}", "function getById(id) {\n return db.hgetallAsync(KEYS.id2article(id))\n .then(format);\n}", "get(id) {\n return this.db.get(id)\n }", "get(id) {\n\n }", "getById(id) {\n\t\treturn this._cache[id];\n\t}", "function findById(id) {\n return fs.readFile(dbPath, \"utf-8\").then((jsonData) => {\n const articles = JSON.parse(jsonData);\n\n const article = articles.find((article) => {\n return article.id === id;\n });\n\n return article;\n });\n}", "function getObject(id) {\n\n for (var i = 0; i < MAR.objects.length; i++) {\n if (MAR.objects[i].id === id) {\n return MAR.objects[i];\n }\n }\n\n return null;\n\n}", "makeEntity(id, data) {\n const entity = new this.handle.entityClass(data);\n Entity.identify(entity, id, null);\n return entity;\n }", "static async getByID(_, {id}) {\r\n return await this.find(id)\r\n }", "static async getByID(_, {id}) {\r\n return await this.find(id)\r\n }", "static fetchById(id) {\n const result = DummyDataHelpers.findById(dummyEntries, id); \n if (!result) {\n return this.badRequest(`no entry for id ${id}`);\n }\n return this.success(`An entry with ${id} has been fetched successfully`, result);\n }", "findById(id) {\n let sqlRequest = \"SELECT id, type FROM event WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.findOne(sqlRequest, sqlParams).then(row =>\n new Event(row.id, row.type));\n }", "fetch(id) {\n return this._callApi('get', id);\n }", "function getObject(id) {\n return r.table(\"objects\").get(id).run();\n}", "fetchById(id) {\n // There should be only one match. Return first match or null if undefined.\n return this.data.filter(fruit => fruit.id === id)[0] || null;\n }", "function read (kind, id, cb) {\n const key = ds.key([kind, parseInt(id, 10)]);\n ds.get(key, (err, entity) => {\n if (err) {\n cb(err);\n return;\n }\n if (!entity) {\n cb({\n code: 404,\n message: 'Not found'\n });\n return;\n }\n cb(null, fromDatastore(entity));\n });\n}", "function read(id, req, res, next) {\n model.findById(id, function(err, entity) {\n /* istanbul ignore next */ if (err) {\n return next(err);\n }\n\n if (!entity) {\n return next(new HttpError(404, 'Not found'));\n }\n\n return next(null, entity);\n });\n}", "getById(db, id) {\n return db\n .from('activity')\n .select('*')\n .where({ id })\n .first();\n }", "getItemById (context, id) {\n return itemGetter.getItemById(context, id);\n }", "getById(id) {\n return this.get(id).then(response => {\n const item = response.data.data;\n this.setCid(item);\n return item;\n });\n }", "getDetail(id) {\n return this.fetch(`${this.api}/${this.resource}/${id}`);\n }", "findById(id) {\n return this.model.findById(id);\n }", "findById(id) {\n return this.model.findById(id);\n }", "async getById (id, options) {\n\t\t// we'll just call the getByIds method here, with one element\n\t\tconst models = await this.getByIds([id], options);\n\t\treturn models.length > 0 ? models[0] : null;\n\t}", "async getOne(id) {\n let data = {};\n\n\n data.result = await this._getOneResource(id);\n\n data.result = this._mapAttributes(data.result);\n\n\n return data;\n }", "getObjectById (id) {\n\n for (var emitters of this.emitters) {\n if (emitters.id === id) {\n return emitters\n }\n }\n\n for (var fields of this.fields) {\n if (fields.id === id) {\n return fields\n }\n }\n\n return null\n }", "function findById(id) {\n return store.items.find(item => item.id === id);\n }", "function findById(id) {\n return db('stories')\n .where({ id: Number(id) })\n .first();\n }", "async function findOneAssociatedById(entity, getter, id) {\n // example: findOneAssociatedById(match, 'getPlayers', playerId)\n const elements = await entity[getter]({ where: { id } });\n return (elements.length === 1) ? elements[0] : null;\n\n // NOTE: if the getter is a function instead of a string, then this should be done first:\n // const bindedGetter = getter.bind(entity);\n // to bind the 'this' element to the entity\n}", "static async getOne(id) {\n try {\n let result = await DatabaseService.getOne(collectionName, id);\n return result;\n } catch (err) {\n throw err;\n }\n\n }", "static findByGitId(id) {\n return this.findOne({ id });\n }", "findById(id) {\n if(!id) throw new Error('ID required');\n return this.findOne({ _id: id });\n }", "async function getbyid(id){\n if(id === undefined || id.length === 0){\n return;\n }\n if(id.constructor != ObjectID){\n if(ObjectID.isValid(id)){\n id = new ObjectID(id);\n }\n }\n\n const roomCollections = await rooms();\n const target = await roomCollections.findOne({ _id: id });\n if(target === null) return { price:0 };\n\n return target;\n}", "async findById(id) {\r\n let params = {\r\n where: {\r\n id: id\r\n },\r\n include: this.getIncludes()\r\n };\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findOne(params);\r\n\r\n if (!result) {\r\n throw new NotFoundException('Resource');\r\n }\r\n return result;\r\n }", "getArtistById(id){\n let artistFound = this.artists.find( artist => artist.id == id );\n if ( !artistFound ){ throw new modelExep.NotFoundRelException('Artista no encontrado') } \n return artistFound;\n }", "function getItemById(data, id){\n return data[id];\n}", "getById (url, id) {\n url = `${url}/${id}?f=json`;\n return this.request(url, {method: 'GET'});\n }", "function get(id) {\n return assertId(id).then(function () {\n return $http.get([baseEndpoint, id].join('/'));\n });\n }", "function returnObjectById(id){\n\n return selectableObjects.find(object=> object.id == id)\n}", "function findById(id) {\n return db(\"products\")\n .select(\"id\", \"userid\", \"title\", \"description\", \"price\", \"image\")\n .where({ id })\n .first();\n}", "async get(id) {\r\n if (!id) throw 'You must provide an id to search for';\r\n\r\n const animalCollection = await animals();\r\n const animal = await animalCollection.findOne({_id: id});\r\n if (animal === null) throw 'No animal with that id';\r\n\r\n return animal;\r\n }", "getById(id) {\r\n return new SiteUser(this, `getById(${id})`);\r\n }", "getById(id) {\n // End point for list of pets:\n const endPoint = '/' + id;\n // Return response\n return this.http\n .get(this.apiUrl + this.controllerName + endPoint)\n .map((res) => this.manageSuccess(res))\n .catch((error) => this.manageError(error));\n }", "static async getById(id) {\n return await user_model.findById(id)\n }", "async function getbyid(id){\n if(id === undefined){\n throw 'input is empty';\n }\n if(id.constructor != ObjectID){\n if(ObjectID.isValid(id)){\n id = new ObjectID(id);\n }\n else{\n // throw 'Id is invalid!(in data/reservation.getbyid)'\n return;\n }\n }\n\n const reservationCollections = await reservations();\n const target = await reservationCollections.findOne({ _id: id });\n // if(target === null) throw 'Reservation not found!';\n\n return await processReservationData(target);\n\n // return target;\n}", "async GetOneRepuesto(id) {\n\n\n return await Repuesto.findById(id);\n }", "async getById(id) {\n if (!this.availableFunctions.includes('getById')) {\n throw new GuardianJSInvalidMethodException('getById is an invalid method');\n }\n return this._request(`${this.base}/${id}?api-key=${this.key}`);\n }", "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "static findById(id) {\n return db.execute('SELECT * FROM products where products.id = ?', [id]);\n }", "static async fetchOne (id, options = {}) {\n const existingRecord = this.find(id)\n if (existingRecord && !get(options, 'force')) {\n return existingRecord\n }\n\n // The ability to have the request wait a period of time for any other multiplexed\n // Rather than requesting /:entity/:id it will instead request /:entity?id=1,2,3\n if (get(options, 'multiplex')) {\n const multiplexResult = await multiplexRequest.call(this, {\n param: 'id',\n value: id,\n options\n })\n return multiplexResult\n }\n\n return reuseRequest({\n key: `${this.entity}-fetchOne-${id}`,\n request: () => this.api().request({\n method: 'GET',\n url: `/${this.entity}/${id}`,\n ...(options.request || {})\n }),\n options\n })\n }", "getEmpireById(id) {\n return client({\n method: 'GET',\n path: `${ROOT}/empires/${id}`,\n });\n }", "async getOne(id) {\n let collection = await this.collection();\n let item = collection.findOne({_id: ObjectId(id)});\n this.dbClient.close();\n return item;\n }", "static getStoredObjectById(dbService, storename, id) {\n const store = getStore(storename)(dbService);\n return store.get(id);\n }", "function findById(id) {\n return db('transactions').where({ id }).first()\n}", "function getModelById(id){\n for(model in models){\n if(models[model].ID ===id) return models[model];\n }\n return null;\n}", "async findByID(id) {\n try {\n // busca o produto\n const findProduto = await this.dbProduto.findByPk(id)\n // retorna o produto\n return findProduto;\n } catch (error) {\n // mostra o erro no console\n console.log(error);\n // gera um erro\n throw new Error({ 'ProdutosService error: ': error.message });\n }\n }", "findById(id) {\n const posicion = indexOfPorId(id);\n return posicion == -1 ? undefined : users[posicion];\n }", "getById(id) {\r\n return new User(this, id);\r\n }", "function getPet(id) {\n function getPetById(pet) {\n return pet.id == id;\n }\n return pets.find(getPetById);\n}", "function getById(id) {\n return new Promise(function(resolve, reject) {\n dbPromised\n .then(function(db) {\n let tx = db.transaction(\"teams\", \"readonly\");\n let store = tx.objectStore(\"teams\");\n return store.get(id);\n })\n .then(function(team) {\n resolve(team);\n });\n });\n}", "get(id) {\n const index = this.indexOfId(id);\n if (index > -1) return this.items[index];\n }", "function show(id) {\n\n return resource.fetch(id)\n .then(function(data){ return data.data; });\n }", "function get(id) {\n return bus.find(id);\n}", "function get(id) {\n return bus.find(id);\n}", "findById(id) {\n let sqlRequest = \"SELECT id, name, description FROM restaurants WHERE id=$id\";\n let sqlParams = {\n $id: id\n };\n return this.common.findOne(sqlRequest, sqlParams).then(row =>\n new Restaurant(row.id, row.name, row.description));\n }", "getArtistById(id) { \n let artist = this.artists.find((a)=>a.getId()===id);\n return this.returnIfExists(artist, \"artista\");\n }", "function findById(id) {\n return db(\"property\")\n .where(\"id\", \"=\", id)\n .first();\n}", "findById(id) {\n return db.oneOrNone(`\n SELECT * FROM recipes\n WHERE id = $1\n `, id);\n }", "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "function find(id) {\n // eslint-disable-next-line eqeqeq\n return data.find(q => q.id == id);\n}", "static find(id, cb) {\n db.get('SELECT * FROM articles WHERE id = ?', id, cb);\n }", "static fetchByID(id) {\n return dbPromise.execute(\n 'SELECT * FROM shelves WHERE shelves.id = ?', [id]\n );\n }", "async function getItemById(id) {\n await validations.isIntValid(itemsDao.getItemId(id));\n let requestedItem = await itemsDao.getItemById(id);\n return requestedItem;\n}", "async getSingle(id = 1) {\n const response = await fetch(`${baseUrl}/posts/${id}`);\n const data = await response.json();\n return data;\n }", "function getById(id) {\n return db('tags').where({id}).first();\n}", "getByID(storeName, id) {\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.get(id);\n request.onsuccess = (event) => {\n resolve(event.target.result);\n };\n })\n .catch((reason) => reject(reason));\n }));\n }", "function loadModel(id) {\n return persistenceService.readObject(SPACE, id);\n }" ]
[ "0.8494383", "0.83086544", "0.8176823", "0.7675713", "0.74615425", "0.7335095", "0.72001046", "0.71879816", "0.71684396", "0.7135162", "0.71271557", "0.69847167", "0.69668895", "0.69495004", "0.6933067", "0.6859692", "0.68372744", "0.6806569", "0.6783508", "0.6777533", "0.67668116", "0.6748249", "0.6725622", "0.6717367", "0.6705866", "0.67033845", "0.6687788", "0.6680846", "0.665687", "0.6651511", "0.66427404", "0.66427404", "0.6628011", "0.66075045", "0.65984374", "0.65649146", "0.6549615", "0.6548577", "0.6546846", "0.65409875", "0.6523251", "0.648541", "0.6482794", "0.6480818", "0.6480818", "0.64755005", "0.64668584", "0.6453087", "0.644451", "0.6443123", "0.6432601", "0.64207983", "0.6416982", "0.64101535", "0.6403931", "0.64026237", "0.64007264", "0.6378127", "0.6376303", "0.6373956", "0.6348689", "0.633683", "0.6330282", "0.63232446", "0.63136536", "0.63084584", "0.63080376", "0.63033307", "0.6293802", "0.6293276", "0.6293276", "0.6293179", "0.62921256", "0.62891304", "0.62765396", "0.6276171", "0.6270054", "0.62620276", "0.6258699", "0.6254431", "0.62522185", "0.6247083", "0.62466294", "0.6243191", "0.62409616", "0.6234484", "0.6234484", "0.62264866", "0.6222564", "0.62130743", "0.62117505", "0.6210637", "0.62029326", "0.6199416", "0.6192808", "0.6191194", "0.61885566", "0.6188444", "0.6185012", "0.6176863" ]
0.6671664
28
synth, or midi port you can pass the commands for write on a file or send to another midi sequencer, synth (for playing) or midi instrument some features are still undeveloped
function MidiObject(){ //this.tracks="00";//hay que cambiarlo this.chunk_header=[];//store the header chunk here// in the future we add a funtion to include the copyright this.total_tracks=0; //number of track stored in the array this.tracks_array=[];//store the tracks with their events in this array //metodos //getters & setters MidiObject.prototype.getTrack= function(id){ return this.tracks_array[id]; }; MidiObject.prototype.getNumberTracks= function(){ return this.total_tracks; }; /*function getHex(number){ return number.toString(16); } //propuesta de herramienta para ayudar al usuario de la lib */ MidiObject.prototype.setChunk = function(user_format, tracks, user_length, user_ticks){ var track_number="00";//default values var midi_format="01"; var length="06"; var ticks="10"; // b = typeof b !== 'undefined' ? b : 1; //its ok? // return a*b; // then do it //2 line for default parameters if (user_format){ if(user_format>-1&&user_format<4){ midi_format="0"+user_format.toString(); } else{ //error no es el formato correcto console.log(user_format+" Is a wrong midi format."); } } if(tracks){ track_number=tracks.toString(); } if (user_length){ length=user_length.toString(); } if(user_ticks){ ticks==user_ticks.toString(); } //call the property and asign the headr to the MidiSketch Object this.chunk_header=["4d", "54", "68", "64", "00", "00", "00", length,// weight of the midi header chunk Allways 6 by default "00", midi_format, // single-track format //0x01 multitrack "00", track_number, // one track for testing /more tracks=poliphony "00", ticks] // 16 ticks per quarter// m0x20 === 32 ticks played more quickly } MidiObject.prototype.addTrack= function(Track){ //add a track to the Sketch-- good for writing then into a file var _ceros; var _tracknum= this.chunk_header[11]; var _new_tracknum=parseInt(_tracknum, 16)+1; if(_new_tracknum<16){ _ceros="0"; } if(_new_tracknum>15){ _ceros=""; } this.chunk_header[11]=_ceros+ _new_tracknum.toString(16); //add the new track size to the array important be exact because it doesn't work instead //console.log(Track); this.tracks_array.push(Track); this.total_tracks+=1; } //track getter //track getter midiarray MidiObject.prototype.getTrack=function(id){ if (this.tracks_array[id-1] !==undefined){ return this.tracks_array[id-1]; } else{ console.log("there is nothing inside this "+(id+1) +"track"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_synth(){\n var bus_num = create_new_bus(context.destination);\n\tadd_osc(bus_num, \"sawtooth\");\n\tadd_osc(bus_num, \"square\");\n add_osc(bus_num, \"sawtooth\");\n \n\tadd_osc(bus_num, \"sine\");\n\tadd_convolution(bus_num, \"snd/imp/impulse.wav\");\n\tadd_ADHSR_env(bus_num, 0, 0.2, 0.05, 0.5, 0.5);\n\tadd_filter(bus_num)\n\tdry_wet(0, 1, 100);\n\t\n set_bus_gain(bus_num, 0.03);\n}", "function playSynth() {\n// // What's this thing do?\n// userStartAudio();\n//\n// // note duration (in seconds)\n// let note_dur = 0.5;\n//\n// // time from right now\n// let time = 0;\n//\n// // velocity for some reason?\n// let vel = 0.1;\n//\n// // What's going on all in here then now?\n// polySynth.play('C3', vel, 0, note_dur);\n\n const note = floor(map(mouseX/4, 0, 400, 20, 80));\n const freq = midiToFreq(note);\n oscillator.freq(freq);\n envelope.triggerAttack();\n}", "function createSynth() {\n synth = new Tone.PolySynth(6, Tone.SimpleSynth)\n .set({\n oscillator: {\n type: 'sine'\n },\n envelope: {\n attack: 0.6,\n decay: 0.1,\n sustain: 0.9,\n release: 0.2\n }\n }).toMaster()\n}", "function Replayer(midiFile, synth) {\r\n var trackStates = [];\r\n var trackAccumulatedDelta = [{noteNumber:0,total:0,track:0}];\r\n var beatsPerMinute = 120;\r\n var millisecondsPerBeat= beatsPerMinute * 60000000;\r\n var ticksPerBeat = midiFile.header.ticksPerBeat;\r\n var channelCount = 16;\r\n\r\n\r\n var i;\r\n for (i = 0; i < midiFile.tracks.length; i++) {\r\n trackStates[i] = {\r\n 'nextEventIndex': 0,\r\n 'ticksToNextEvent': (\r\n midiFile.tracks[i].length ?\r\n midiFile.tracks[i][0].deltaTime :\r\n null\r\n )\r\n };\r\n }\r\n \r\n function Channel() {\r\n \r\n var generatorsByNote = {};\r\n var currentProgram = $synthService.PianoProgram; // NOT USED\r\n \r\n function noteOn(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n /* playing same note before releasing the last one. BOO */\r\n generatorsByNote[noteEvent.event.noteNumber].noteOff(); /* TODO: check whether we ought to be passing a velocity in */\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n }\r\n //console.log('playing note' + note);\r\n $rootScope.$broadcast('playmyband.midi.noteEvent',noteEvent);\r\n var generator = currentProgram.createNote(noteEvent.event.noteNumber, noteEvent.event.velocity);\r\n synth.addGenerator(generator);\r\n generatorsByNote[noteEvent.noteNumber] = generator;\r\n }\r\n function noteOff(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n generatorsByNote[noteEvent.noteNumber].noteOff(noteEvent.event.velocity);\r\n }\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n\r\n }\r\n function setProgram(programNumber) {\r\n console.debug(programNumber);\r\n currentProgram = $synthService.PianoProgram; // TODO --> custom programs PROGRAMS[programNumber] || $synthService.PianoProgram;\r\n }\r\n \r\n return {\r\n 'setProgram': setProgram,\r\n 'noteOn': noteOn,\r\n 'noteOff': noteOff\r\n };\r\n }\r\n \r\n var channels = [];\r\n for (i = 0; i < channelCount; i++) {\r\n channels[i] = new Channel();\r\n }\r\n \r\n var nextEventInfo;\r\n var samplesToNextEvent = 0;\r\n \r\n function getNextEvent() {\r\n var ticksToNextEvent = null;\r\n var nextEventTrack = null;\r\n var nextEventIndex = null;\r\n \r\n var i;\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null && (ticksToNextEvent === null || trackStates[i].ticksToNextEvent < ticksToNextEvent) ) {\r\n ticksToNextEvent = trackStates[i].ticksToNextEvent;\r\n nextEventTrack = i;\r\n nextEventIndex = trackStates[i].nextEventIndex;\r\n }\r\n }\r\n if (nextEventTrack !== null) {\r\n /* consume event from that track */\r\n var nextEvent = midiFile.tracks[nextEventTrack][nextEventIndex];\r\n if (midiFile.tracks[nextEventTrack][nextEventIndex + 1]) {\r\n trackStates[nextEventTrack].ticksToNextEvent += midiFile.tracks[nextEventTrack][nextEventIndex + 1].deltaTime;\r\n } else {\r\n trackStates[nextEventTrack].ticksToNextEvent = null;\r\n }\r\n trackStates[nextEventTrack].nextEventIndex += 1;\r\n /* advance timings on all tracks by ticksToNextEvent */\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null) {\r\n trackStates[i].ticksToNextEvent -= ticksToNextEvent;\r\n }\r\n }\r\n nextEventInfo = {\r\n 'ticksToEvent': ticksToNextEvent,\r\n 'event': nextEvent,\r\n 'track': nextEventTrack\r\n };\r\n var beatsToNextEvent = ticksToNextEvent / ticksPerBeat;\r\n var secondsToNextEvent = beatsToNextEvent / (beatsPerMinute / 60);\r\n //if (typeof(nextEvent.noteNumber) !== 'undefined') {\r\n //console.debug('track:' + nextEventTrack + 'last accumulated:' + trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + 'secondToNextEvet:' + (secondsToNextEvent * 1000));\r\n var millisecondsToNextEvent= beatsToNextEvent * millisecondsPerBeat;\r\n\r\n var nextAccumulatedDelta = trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + millisecondsToNextEvent;\r\n //console.log(nextEventTrack+') nextAccumulatedDelta: '+nextAccumulatedDelta);\r\n\r\n\r\n trackAccumulatedDelta[trackAccumulatedDelta.length] = { noteNumber : nextEvent.noteNumber, total : nextAccumulatedDelta, track : nextEventTrack}; \r\n nextEvent.accumulatedDelta=nextAccumulatedDelta;\r\n //}\r\n samplesToNextEvent += secondsToNextEvent * synth.sampleRate;\r\n } else {\r\n nextEventInfo = null;\r\n samplesToNextEvent = null;\r\n self.finished = true;\r\n }\r\n }\r\n \r\n getNextEvent();\r\n \r\n function generate(samples) {\r\n var data = new Array(samples*2);\r\n var samplesRemaining = samples;\r\n var dataOffset = 0;\r\n \r\n while (true) {\r\n if (samplesToNextEvent !== null && samplesToNextEvent <= samplesRemaining) {\r\n /* generate samplesToNextEvent samples, process event and repeat */\r\n var samplesToGenerate = Math.ceil(samplesToNextEvent);\r\n if (samplesToGenerate > 0) {\r\n synth.generateIntoBuffer(samplesToGenerate, data, dataOffset);\r\n dataOffset += samplesToGenerate * 2;\r\n samplesRemaining -= samplesToGenerate;\r\n samplesToNextEvent -= samplesToGenerate;\r\n }\r\n \r\n handleEvent();\r\n getNextEvent();\r\n } else {\r\n /* generate samples to end of buffer */\r\n if (samplesRemaining > 0) {\r\n synth.generateIntoBuffer(samplesRemaining, data, dataOffset);\r\n samplesToNextEvent -= samplesRemaining;\r\n }\r\n break;\r\n }\r\n }\r\n return data;\r\n }\r\n \r\n function handleEvent() {\r\n var event = nextEventInfo.event;\r\n switch (event.type) {\r\n case 'meta':\r\n switch (event.subtype) {\r\n case 'setTempo':\r\n beatsPerMinute = 60000000 / event.microsecondsPerBeat;\r\n millisecondsPerBeat= event.microsecondsPerBeat/1000;\r\n //console.log('\\n\\n\\nBeats per minute '+beatsPerMinute);\r\n }\r\n break;\r\n case 'channel':\r\n switch (event.subtype) {\r\n case 'noteOn':\r\n channels[event.channel].noteOn(nextEventInfo); \r\n break;\r\n case 'noteOff':\r\n channels[event.channel].noteOff(nextEventInfo);\r\n break;\r\n case 'programChange':\r\n //console.log('program change to ' + event.programNumber);\r\n channels[event.channel].setProgram(event.programNumber);\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n function replay(audio) {\r\n console.log('replay');\r\n audio.write(generate(44100));\r\n setTimeout(function() {replay(audio);}, 10);\r\n }\r\n\r\n function isANoteThere(noteNumber, accumulatedDelta, marginOfError, track)\r\n {\r\n var isThere = false;\r\n var i = trackAccumulatedDelta.length;\r\n //start from the back, where more recent notes should match\r\n while (i--) {\r\n //for (var i = 0; i < trackAccumulatedDelta.length; i++) {\r\n var userNoteDif = Math.abs(trackAccumulatedDelta[i].total - accumulatedDelta);\r\n //console.debug('UserNoteDif:' + userNoteDif);\r\n if ( trackAccumulatedDelta[i].track === track &&\r\n trackAccumulatedDelta[i].noteNumber &&\r\n trackAccumulatedDelta[i].noteNumber>0 &&\r\n trackAccumulatedDelta[i].noteNumber === noteNumber && \r\n userNoteDif <= marginOfError) {\r\n isThere = true;\r\n break;\r\n } else if (userNoteDif > 10000) {\r\n //remove accumulated, no longer required. reduces comparisons on next note\r\n trackAccumulatedDelta.splice(i,1);\r\n //by now just stop\r\n break;\r\n }\r\n }\r\n return isThere;\r\n }\r\n \r\n var self = {\r\n 'replay': replay,\r\n 'generate': generate,\r\n 'finished': false,\r\n 'isANoteThere': isANoteThere\r\n };\r\n return self;\r\n }", "setupInstrument() {\n // //CREATE SYNTH FROM data.synthSetting\n this.meter = new Tone.Meter().toDestination();\n this.volume = new Tone.Volume(0).connect(this.meter);\n this.feedbackDelay = new Tone.FeedbackDelay().connect(this.volume);\n this.chorus = new Tone.Chorus().connect(this.feedbackDelay);\n this.distortion = new Tone.Distortion().connect(this.chorus);\n this.waveform = new Tone.Waveform().connect(this.distortion);\n let synthType = \"new Tone.\" + this.synthSetting + \".connect(this.waveform)\";\n this.instrument = eval(synthType);\n\n // //LOOP THROUGH data.controls TO GET PARTS OF SYNTH TO CONTROL\n for (i = 0; i < this.controls.length; i++) {\n if (this.controls[i].name === \"pitch\") {\n //ADD this.controls[i].target\n this.controls[i].target = \"this.note\";\n }\n if (this.controls[i].name === \"volume\") {\n //ADD this.controls[i].target and set initial value\n this.controls[i].target = \"this.volume.volume.value\";\n this.volume.volume.value = this.controls[i].startVal;\n }\n if (this.controls[i].name === \"duration\") {\n //ADD this.controls[i].target and set initial value\n this.controls[i].target = \"this.duration\";\n this.duration = this.controls[i].startVal;\n }\n if (this.controls[i].name === \"delay\") {\n //ADD this.controls[i].target and set initial value\n this.controls[i].target = \"this.feedbackDelay.delayTime.value\";\n this.feedbackDelay.delayTime.value = this.controls[i].startVal;\n }\n if (this.controls[i].name === \"feedback\") {\n //ADD this.controls[i].target and set initial value\n this.controls[i].target= \"this.feedbackDelay.feedback.value\";\n this.feedbackDelay.feedback.value = this.controls[i].startVal\n }\n //ENVELOPE FOR THOSE USING SAMPLER\n if (this.controls[i].name === \"envelope\") {\n //ADD this.controls[i].target and set initial value\n // this.controls[i].target = \"this.instrument.envelope\";\n this.instrument.attack = this.controls[i].attack;\n this.instrument.decay = this.controls[i].decay;\n this.instrument.sustain = this.controls[i].sustain;\n this.instrument.release = this.controls[i].release;\n }\n if (this.controls[i].name === \"chorus\") {\n this.chorus.frequency.value = this.controls[i].frequency;\n this.chorus.delayTime = this.controls[i].delayTime;\n this.chorus.depth = this.controls[i].depth;\n }\n if (this.controls[i].name === \"distortion\") {\n //ADD this.controls[i].target and set initial value\n this.controls[i].target = \"this.distortion.distortion\";\n this.distortion.distortion = this.controls[i].startVal;\n }\n }\n ready = true;\n }", "setMidiOutput (output) {\n this._output = output\n }", "function init() {\n //Request midi accsess\n navigator.requestMIDIAccess().then(function (midi_access) {\n console.log('MIDI ready!');\n const inputs = midi_access.inputs.values();\n\n outputs = midi_access.outputs.values();\n\n for (let input = inputs.next(); input && !input.done; input = inputs.next()) {\n input.value.onmidimessage = on_midi_msg;\n console.log('input:', input.value.name);\n }\n\n for (let output = outputs.next(); output && !output.done; output = outputs.next()) {\n outputs_by_name[output.value.name] = output.value;\n console.log('output:', output.value.name);\n }\n }, function (msg) {\n console.log('Failed to get MIDI access - ', msg);\n });\n\n // Respond to MIDI messages\n function on_midi_msg(event) {\n const cc = event.data[1];\n const val = event.data[2];\n\n console.log(event.data);\n\n switch (cc) {\n case 115:\n // The Command ID of a custom action that toggles the FX rack\n wwr_req('_dabc7267fcf7854e80a59865f2e6c261');\n break;\n case PLAY_CC:\n // The play button is a toggle button, so when it is\n // in active state pause the mix, otherwise play it\n if (last_transport_state & 1 > 0) {\n wwr_req(1008); // 1008 is pause, 1016 is stop if you prefer\n } else {\n wwr_req(1007);\n }\n break;\n case VOL_1_CC:\n send_trk_vol(1, val);\n break;\n case VOL_2_CC:\n send_trk_vol(2, val);\n break;\n case VOL_3_CC:\n send_trk_vol(3, val);\n break;\n case VOL_4_CC:\n send_trk_vol(4, val);\n break;\n case VOL_5_CC:\n send_trk_vol(5, val);\n break;\n case VOL_6_CC:\n send_trk_vol(6, val);\n break;\n case VOL_7_CC:\n send_trk_vol(7, val);\n break;\n case VOL_8_CC:\n send_trk_vol(8, val);\n break;\n case PREV_TRK_CC:\n wwr_req(40286);\n wwr_req('TRACK');\n break;\n case NEXT_TRK_CC:\n wwr_req(40285);\n wwr_req('TRACK');\n break;\n case MEDIA_EXPLR_CC:\n wwr_req(50124);\n break;\n case SEL_TRK_MUTE_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/MUTE/-1;TRACK/${sel_trk_idx}`);\n break;\n case SEL_TRK_SOLO_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/SOLO/-1;TRACK/${sel_trk_idx}`);\n break;\n default:\n break;\n }\n }\n\n function send_trk_vol(trackIndex, encoderValue) {\n // My controller sends values from 0 to 127 which should map to (-inf, +12dB] in REAPER.\n // Read 'main.js' for more information. The formula is also dealing with the fact that\n // There are more numbers from -inf to 0 than from 0 to +12. It makes the encoder less jumpy.\n wwr_req(`SET/TRACK/${trackIndex}/VOL/${(encoderValue / 127) * 4 ** (encoderValue / 127)}`);\n }\n}", "makeSynthSeq(tone, notesArr) {\n let pattern = new Tone.Sequence( (time, note) => {\n this.tone.triggerAttackRelease(note, \"4n\", time)\n }, notesArr, \"4n\").start()\n\n pattern.loop = false\n}", "function QwerToMidi() {\n this.duration = function () {\n var len = 1;\n while (this.tune.length > this.ix) {\n ch = this.tune.charAt(this.ix);\n if (ch == '/') {\n len++;\n } else if (ch == '\\\\') {\n len/=2;\n } else {\n break;\n }\n ++this.ix;\n }\n return len;\n };\n\n this.convert = function (tune) {\n this.tune = tune;\n this.ix = 0;\n var beat = this.duration();\n var oct = 0;\n trax = [ [ /* meta */ ] ];\n voice = [];\n while (this.ix < this.tune.length) {\n var ch = this.tune.charAt(this.ix++);\n var semitones = \"qasedrfgyhujikSEDRFGYHUJIKLP:\".indexOf(ch);\n if (semitones >= 0) {\n var midi = semitones + oct * 12 + 60; // = MIDI.pianoKeyOffset;\n var t = this.duration() * beat * 64;\n voice.push({deltaTime: 0, type: \"channel\", subtype: 'noteOn', channel: trax.length, noteNumber: midi, velocity:127});\n voice.push({deltaTime: t, type: \"channel\", subtype: 'noteOff', channel: trax.length, noteNumber: midi, velocity:0});\n }\n else {\n var tpos = \"-*+\".indexOf(ch) - 1;\n if (tpos == 0) {\n trax.push(voice);\n voice = [];\n oct = 0;\n }\n if (tpos >= -1) {\n oct += tpos;\n }\n }\n }\n trax.push(voice);\n return {\n header: {\n formatType: 1,\n trackCount: trax.length,\n ticksPerBeat: 64 // per crotchet\n },\n tracks: trax\n };\n };\n}", "function _midi_send_cmd1_impl(cmd, data1) {\r\n cmd = i8tou8(cmd);\r\n data1 = i8tou8(data1);\r\n\r\n // TODO: add commentary about recognized commands\r\n var f = \"\" + hex2(cmd) + \" \" + hex2(data1) + \"\\n\";\r\n midi_log(f);\r\n\r\n if (!midiSupport) return;\r\n if (!midiOutput) return;\r\n // TODO: maybe queue up bytes and deliver at end of main loop?\r\n try {\r\n midiOutput.send([cmd, data1]);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n}", "function _midi_send_cmd2_impl(cmd, data1, data2) {\r\n cmd = i8tou8(cmd);\r\n data1 = i8tou8(data1);\r\n data2 = i8tou8(data2);\r\n\r\n // TODO: add commentary about recognized commands\r\n var f = \"\" + hex2(cmd) + \" \" + hex2(data1) + \" \" + hex2(data2) + \"\\n\";\r\n midi_log(f);\r\n\r\n if (!midiSupport) return;\r\n if (!midiOutput) return;\r\n // TODO: maybe queue up bytes and deliver at end of main loop?\r\n try {\r\n midiOutput.send([cmd, data1, data2]);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n}", "function send(midiMessage,callback){\r\n if(output){\r\n output.sendMIDIMessage(midiMessage);\r\n logMessage(JMB.getNoteName(midiMessage.data1) + \" notenumber:\" + midiMessage.data1 + \" velocity:\" + midiMessage.data2);\r\n }\r\n callback();\r\n }", "constructor(instr, keyoff, poff, pitch, sus) { \n\n this.channel = instr;\n this.poff = poff; //diatonic pitch offset;\n this.keyoff = keyoff;\n\n if(pitch > -1) {\n this.pitch = pitch;\n } else {\n this.pitch = this.getMidiPitch();\n }\n\n this.velocity = 127;\n this.sustain = sus; // 0 = off\n }", "function triggerSynthSound(x, y){\n // Deterministically generate a note and its octave based on the (x,y) of mouse position\n var note = notes[x % notes.length];\n var octave = octaves[y % octaves.length];\n var fullNote = note + octave;\n console.log(fullNote + \" \" + x + \" \" + y);\n synth.triggerAttackRelease(fullNote, \"16n\");\n}", "function playSound(nota){\n var freq = midiToFreq(nota);\n //console.log('Sound Playing: ' + nota);\n // oscilator.freq(freq);\n // oscilator.start();\n // envel.play();\n}", "function playNote() {\n // Pick a random frequency from the array\n let frequency = frequencies[Math.floor(Math.random() * frequencies.length)];\n // Set the synth's frequency\n synth.frequency = frequency;\n // If it's note already play, play the synth\n synth.play();\n}", "rawMidiEvent (data) {\n if (this._output) {\n this._output._midiOutput.send(data)\n }\n }", "function onMidi(status, data1, data2)\r\n{\r\n\t//printMidi(status, data1, data2)\r\n\tif (isChannelController(status)) //&& MIDIChannel(status) == alias_channel) //removing status check to include MasterFader\r\n\t{\r\n\t\tvar chMult = (status-177)*8;\r\n\t\t//post('CC: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tif(data1==10){\r\n\t\t\tCC_OBJECTS[chMult].receive(data2);\r\n\t\t\t//post(CC_OBJECTS[chMult]._name + ' ' + data2);\r\n\t\t}\r\n\t\telse if(data1==11){\r\n\t\t\tCC_OBJECTS[chMult+1].receive(data2);\r\n\t\t}\r\n\t\telse if(data1==12){\r\n\t\t\tCC_OBJECTS[chMult+2].receive(data2);\r\n\t\t}\r\n\t}\r\n\telse if (isNoteOn(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n\telse if (isNoteOff(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n}", "function playNote(midiNote) {\n var res = playMidiNote(midiNote);\n myapp.ports.playedNote.send(res);\n}", "speak(text){this.__text=text;if(this.synth){this.utter=new SpeechSynthesisUtterance(this.__text);this.utter.pitch=this.pitch;this.utter.rate=this.rate;this.utter.lang=this.language;this.utter.voice=this.defaultVoice;// THOU SPEAKITH\nthis.synth.speak(this.utter)}else{console.warn(\"I have no voice...\")}}", "constructor() {\n super();\n /**\n * Object containing system-wide default values that can be changed to customize how the library\n * works.\n *\n * @type {object}\n *\n * @property {object} defaults.note - Default values relating to note\n * @property {number} defaults.note.attack - A number between 0 and 127 representing the\n * default attack velocity of notes. Initial value is 64.\n * @property {number} defaults.note.release - A number between 0 and 127 representing the\n * default release velocity of notes. Initial value is 64.\n * @property {number} defaults.note.duration - A number representing the default duration of\n * notes (in seconds). Initial value is Infinity.\n */\n\n this.defaults = {\n note: {\n attack: Utilities.from7bitToFloat(64),\n release: Utilities.from7bitToFloat(64),\n duration: Infinity\n }\n };\n /**\n * The [`MIDIAccess`](https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess)\n * instance used to talk to the lower-level Web MIDI API. This should not be used directly\n * unless you know what you are doing.\n *\n * @type {MIDIAccess}\n * @readonly\n */\n\n this.interface = null;\n /**\n * Indicates whether argument validation and backwards-compatibility checks are performed\n * throughout the WebMidi.js library for object methods and property setters.\n *\n * This is an advanced setting that should be used carefully. Setting `validation` to `false`\n * improves performance but should only be done once the project has been thoroughly tested with\n * `validation` turned on.\n *\n * @type {boolean}\n */\n\n this.validation = true;\n /**\n * Array of all (Input) objects\n * @type {Input[]}\n * @private\n */\n\n this._inputs = [];\n /**\n * Array of disconnected [`Input`](Input) objects. This is used when inputs are plugged back in\n * to retain their previous state.\n * @type {Input[]}\n * @private\n */\n\n this._disconnectedInputs = [];\n /**\n * Array of all [`Output`](Output) objects\n * @type {Output[]}\n * @private\n */\n\n this._outputs = [];\n /**\n * Array of disconnected [`Output`](Output) objects. This is used when outputs are plugged back\n * in to retain their previous state.\n * @type {Output[]}\n * @private\n */\n\n this._disconnectedOutputs = [];\n /**\n * Array of statechange events to process. These events must be parsed synchronously so they do\n * not override each other.\n *\n * @type {string[]}\n * @private\n */\n\n this._stateChangeQueue = [];\n /**\n * @type {number}\n * @private\n */\n\n this._octaveOffset = 0;\n }", "function Synth(oscType){\n\n // declare type of synth; and type of filter\n this.synthType= oscType;\n this.filtAtt= \"LP\";\n // envelope setup\n this.attackLevel= 0;\n this.releaseLevel= 0;\n this.attackTime= 0;\n this.decayTime= 0;\n this.susLevel= 0;\n this.releaseTime= 0;\n // next 4 parameters hold p5.sound.js objects\n this.env=0;\n this.thisSynth=0;\n this.filter=0;\n this.delay=0;\n // filter frequency\n this.fFreq=0;\n // delay parameters\n this.delayFX= false;\n this.delayLength=0;\n this.delayFB= 0;\n this.delayFilter= 0;\n // phrase and loop\n this.phrase= 0;\n this.loop= 0;\n // loop rate\n this.rate= 0;\n // note values\n this.notes=[0];\n // transposition factor.\n // doesn't really have to be an octave (12).\n this.oct=0;\n // rhythm array\n this.rhythm= 0;\n this.rType= 0;\n this.nextNote= 0;\n this.isPlaying=true;\n\n}", "function MidiMessage( event_name, data1, data2, user_delta, user_channel){\n //user channel number from 0 to 15 no string, integer please\n this.hex;\n this.messageLength;\n var _delta=\"00\";\n var _channel=\"0\";\n var _data1def=\"3c\";//default middle C decimal 60\n var _data2def=\"7f\"; //default velocity d 127\n\n if(user_delta){\n _delta=user_delta;\n }\n if(user_channel){\n if(user_channel<0||user_channel>15){\n console.log(user_channel+\" Its not a correct channel (1-16\");\n }\n else{\n _channel=(user_channel-1).toString(16);\n }\n }\n if(data1){\n if(data1<0||data1>127){\n console.log(data1+\" It's not a correct note number 0-127// in decimal\")\n } \n else{\n _data1def=data1.toString(16);\n }\n } \n else{\n console.log(\"please, define the data1 value\");\n } \n if(data2){ \n if(data2<0||data2>127){\n console.log(data1+\" It's not a correct velocity value number 0-127// in decimal\")\n }\n else{ \n _data2def=data2.toString(16);\n }\n }\n else{\n console.log(\"please, define the data2 value\");\n } \n\n \n\n //event executions\n if(event_name===\"noteOn\"){//noteOn midi message\n var _noteOn=_delta+\"9\"+_channel+_data1def+_data2def;//data1- note number \n this.hex=_noteOn;//data2- velocity\n this.messageLength=4;// this event is 4 byte long\n } \n if (event_name===\"noteOff\") {//noteOff midi message\n var _noteOff=_delta+\"8\"+_channel+_data1def+_data2def;//data1-note number \n this.hex=_noteOff; //ata2 -velocity of key release\n this.messageLength=4;\n }\n \n if (event_name===\"endTrack\"){\n var _fin_track=\"01ff2f00\";\n this.hex=_fin_track; //ata2 -velocity of key release\n this.messageLength=4; \n }\n /*if (event_name===\"key\"){\n var _key=_delta+\"ff590200\";//event name\n //control of the key signature-- in decimals 0 == no accidents\n // negative numbers, number of flats-- -2 === 2 flats\n //positive numbers, number of sharps in the equal tonal mode \n var _accidents=\n this.hex=_key+hex_accidents;\n//revisar con el pdf////////////////////////////\n this.messageLength=6;\n\n }\n*/\n }", "initSynth() {\n throw new Error('You have to implement the \"initSynth\" method !');\n }", "_emitCommandsd() {\n const commands = [];\n\n for (const [cmd, { description }] of this.commands) {\n commands.push({ cmd, description });\n }\n\n process.send({ type: 'commands', commands });\n }", "function leerPesoyRacion(){\n port.on('open', function() {\n port.write('main screen turn on', function(err) {\n if (err) {\n return console.log('Error: ', err.message);\n }\n console.log('mensaje 4 escrito');\n });\n setTimeout(function(){\n port.write('>4', function(err) {\n if (err) {\n return console.log('Error: ', err.message);\n }\n console.log('cmd 4');\n });\n }, 2000);\n });\n}", "function setupSynth(type, amp, freq) {\n wave.setType(type);\n wave.amp(amp);\n wave.freq(freq);\n}", "function Write(data) {\n Serial.Write({\n Command: data,\n Debug: 'False',\n Port: ArdPort,\n });\n}", "function sendCommand(degrees) {\n console.log(`Degrees`, degrees);\n console.log(`G0 X${degrees} Y${degrees} Z${degrees}\\r`);\n\n arduinoport.write(`G0X${degrees}Y${degrees}Z${degrees}\\r`, error => {\n if (error) {\n return console.log(`Error on write:`, error.message);\n }\n return console.log(`message written`);\n });\n}", "function onMidi0(status, data1, data2) {\n\n // printMidi(status, data1, data2);\n\n if (isChannelController(status)) {\n if (data1 == CC.RECORD) {\n if (data2 > 0) {\n cursorTrack.arm().set(true);\n transport.record();\n }\n else {\n cursorTrack.arm().set(false);\n transport.stop();\n }\n }\n\n if (data1 == CC.SELECT) {\n if (data2 > 0) {\n hostApp.selectAll();\n }\n else {\n hostApp.selectNone();\n }\n }\n\n if (data1 == CC.PANEL) {\n switch (previousView) {\n case 0:\n hostApp.setPanelLayout(\"ARRANGE\");\n break;\n case 1:\n hostApp.setPanelLayout(\"MIX\");\n break;\n case 2:\n hostApp.setPanelLayout(\"EDIT\");\n break;\n case 3:\n hostApp.setPanelLayout(\"ARRANGE\");\n previousView = 0;\n break;\n }\n previousView++;\n }\n\n if (data1 == CC.ZOOM) {\n if (data2 > previousZoom) {\n hostApp.zoomIn();\n }\n else {\n hostApp.zoomOut();\n }\n previousZoom = data2;\n }\n\n if (data1 == CC.POSITION) {\n if (data2 > previousPosition) {\n transport.incPosition(1.0, true);\n }\n else {\n transport.incPosition(-1.0, true);\n }\n previousPosition = data2;\n }\n\n if (data1 >= CC.CONTROL1 && data1 <= CC.UNDO && data1 != 112 && data2 > 0) {\n switch (data1) {\n case CC.PREV_TRACK:\n cursorTrack.selectPrevious();\n cursorTrack.makeVisibleInMixer();\n cursorTrack.makeVisibleInArranger();\n clearPads();\n break;\n case CC.NEXT_TRACK:\n cursorTrack.selectNext();\n cursorTrack.makeVisibleInMixer();\n cursorTrack.makeVisibleInArranger();\n clearPads();\n break;\n case CC.REWIND:\n transport.rewind();\n break;\n case CC.FORWARD:\n transport.fastForward();\n break;\n case CC.SOLO:\n cursorTrack.solo().toggle();\n break;\n case CC.MUTE:\n cursorTrack.mute().toggle();\n break;\n case CC.DUPLICATE:\n cursorTrack.duplicate();\n break;\n case CC.BROWSE:\n hostApp.toggleBrowserVisibility();\n break;\n case CC.FIT:\n hostApp.zoomToFit();\n break;\n case CC.SELECTION:\n hostApp.zoomToSelection();\n break;\n case CC.DELETE:\n host.showPopupNotification(\"Delete\");\n hostApp.remove();\n break;\n case CC.UNDO:\n host.showPopupNotification(\"Undo\");\n hostApp.undo();\n break;\n case CC.REDO:\n host.showPopupNotification(\"Redo\");\n hostApp.redo();\n break;\n case CC.VIEW:\n hostApp.nextSubPanel();\n break;\n case CC.TAP:\n transport.tapTempo();\n break;\n case CC.INSPECT:\n hostApp.toggleInspector();\n break;\n case CC.PATTERN:\n hostApp.toggleNoteEditor();\n break;\n case CC.ENTER:\n hostApp.enter();\n host.showPopupNotification(\"Enter\");\n break;\n case CC.CUT:\n hostApp.cut();\n host.showPopupNotification(\"Cut\");\n break;\n case CC.COPY:\n hostApp.copy();\n host.showPopupNotification(\"Copy\");\n break;\n case CC.PASTE:\n hostApp.paste();\n host.showPopupNotification(\"Paste\");\n break;\n case CC.STOP:\n transport.stop();\n break;\n case CC.PLAY:\n transport.togglePlay();\n break;\n case CC.LOOP:\n host.showPopupNotification(\"Toggle Loop On/Off\");\n transport.isArrangerLoopEnabled().toggle();\n break;\n case CC.CLICK:\n host.showPopupNotification(\"Toggle Metronome On/Off\");\n transport.isMetronomeEnabled().toggle();\n break;\n case CC.FULLSCREEN:\n hostApp.toggleFullScreen();\n host.showPopupNotification(\"Full Screen\");\n break;\n case CC.STOPTRACK:\n host.showPopupNotification(\"Stop Track\");\n cursorTrack.stop();\n break;\n case CC.CONTROL1:\n controllerToSend = 0;\n host.showPopupNotification(\"Control 1 Selected\");\n updateControlSelectors();\n break;\n case CC.CONTROL2:\n controllerToSend = 1;\n host.showPopupNotification(\"Control 2 Selected\");\n updateControlSelectors();\n break;\n case CC.CONTROL3:\n controllerToSend = 2;\n host.showPopupNotification(\"Control 3 Selected\");\n updateControlSelectors();\n break;\n }\n }\n else if (data1 == CC.SLIDER) {\n currentVolume = cursorTrack.volume().value().inc(previousVolume > data2 ? -1 : 1, 128);\n previousVolume = data2;\n }\n else if (data1 == CC.CONTROL) {\n userControls.getControl(controllerToSend).inc(previousController > data2 ? -1 : 1, 128);\n previousController = data2;\n }\n }\n}", "sendHello() {\n this.write({cmd: 'hello', str: 'Hello, client!'})\n this.write({cmd: 'hello2', str: 'Hello again, client!'})\n }", "function writting() {\n socket.emit('writting', pseudo);\n}", "function playNote(note){\n MIDI.noteOn(0, note, velocity, delay);\n MIDI.noteOff(0, note, delay + 0.75);\n}", "function sendCommand(commandNum) {\n //console.log('In sendCommand. Command: ' + commandNum);\n sp.open(function(error) {\n if (error) {\n console.log('There was an error');\n } else {\n //console.log('Open');\n sp.write(commandNum);\n console.log('Sent Command ID: ' + commandNum);\n }\n });\n}", "function send(instrument) {\n socket.emit('selected instrument', instrument);\n\n}", "function talk() {\n console.log('talking...');\n myVoice.setVoice(voice); //change here\n myVoice.speak(textos_columnas); // change here put text\n\n myVoice.setRate(0.8); // speed of speach\n myVoice.setPitch(0.5); //.9 es mas agudo,\n myVoice.setVolume(0.5);\n\n // myVoice.setRate(.8); // speed of speach (.1 lento, .9 rapido)\n\n // //siempre empieza con un standard y despues cambia a este valor\n // myVoice.setPitch(.9); //.9 es mas agudo, .1 es mas grave y computarizadp\n // myVoice.setVolume(.3);\n\n //add voice castellano\n //add voice frances\n // maybe change the pitch to generate different voices\n\n\n}", "function MidiSketch(command, SketchObject){\n if(command===\"write\"){\n //console.log(SketchObject);\n if(SketchObject instanceof MidiMessage){\n return SketchObject.hex;\n }\n if(SketchObject instanceof MidiTrack) {\n return SketchObject.track_chunk+ SketchObject.track_length+ SketchObject.midi_events_array;\n }\n if(SketchObject instanceof MidiObject){\n //primero la cabecera\n var hexstring=\"\";\n var _array_ojt=SketchObject.tracks_array;\n //we run inside the headerchunk parameter, and extract all the values and store it into a hexadecimalstring\n for (i=0; i<SketchObject.chunk_header.length; i++){\n hexstring+=SketchObject.chunk_header[i];//write the chunck header concatenated in one hexadecimal string\n }\n //thes same but now run inside the tracks array, where the stored tracks would be attached\n for (i=0; i<SketchObject.tracks_array.length; i++){\n//use console log for debugg\n//console.log(i+ \" y \"+ hexstring+ \"Y\" + SketchObject.tracks_array[i]);\n hexstring+= SketchObject.tracks_array[i].track_chunk+ _array_ojt[i].track_length+ _array_ojt[i].midi_events_array;\n }\n return hexstring;\n // return all together into the hexadecimal string, ready for writting on a file or other staff\n }\n\n }\n }", "function Note( freq ) {\n this.frequency = freq;\n\n this.attack = attack;\n this.release = release;\n\n this.gain = audioContext.createGainNode();\n this.gain.gain.value = 0;\n\n this.oscillator = audioContext.createOscillator();\n this.oscillator.frequency.value = this.frequency;\n this.oscillator.type = 'sine';\n\n this.oscillator.connect( this.gain );\n this.oscillator.start(0);\n }", "function handleMidiMessage(note) {\n\t// filter active sense messages\n\tif(note.data[0] == 254) {\n\t\treturn;\n\t}\n\tif( !( (0xF0 & note.data[0]) == 128 || (0xF0 & note.data[0]) == 144) ) {\n\t\treturn;\n\t}\n\n\tif (trace) {\n\t\tconsole.log(note.data);\n\t}\n\n\tconsole.log(convertCommand(note)); \n\tvar command = convertCommand(note); \n\t// notes[command.noteName + command.octave] = {number: note.data[1], playing: command.command};\n\tnotes[note.data[1]] = command.command;\n\tconsole.log(notes);\n\tdisplayNotes(printNotes().join(', '));\n\tvar chord = searchInversions(findChord(printNotes())); \n\tif(chord.chord) {\n\t\tdisplayChord(\n\t\t\tnumberToNote(printNotes()[chord.inversion]).note + \n\t\t\tchord.chord + ' ' +\n\t\t\tchord.inversion\n\t\t);\n\t}\n\telse {\n\t\tdisplayChord('');\n\t}\n\tif (\n\t\tnumberToNote(printNotes()[chord.inversion]).note+chord.chord == \n\t\tquiz.current\n\t) {\n\t\tquiz.next();\n\t}\n\t// var key = document.getElementById(numberToNote(note.data[1]).note);\n\tvar key = document.querySelector(\n\t\t'#octave' + numberToNote(note.data[1]).octave + ' #' +\n\t\tnumberToNote(note.data[1]).note\n\t);\n\tkey.classList.toggle('pressed');\n}", "function changeMIDIOut(e) {\n var id = e.target[e.target.selectedIndex].value;\n if ((typeof(midiAccess.outputs) == \"function\")) {\n midiDevice = midiAccess.outputs()[e.target.selectedIndex];\n } \n else {\n midiDevice = midiAccess.outputs.get(id);\n }\n if (midiDevice && e.target[e.target.selectedIndex] != \"No Device Available\") {\n $('#play').removeClass('disabled');\n }\n}", "function sendToSerial(data) {\n console.log(\"sending to serial: \" + data);\n port.write(data);\n}", "function playMidiNoteSequence(midiNotes) {\n /* console.log(\"play sequence\"); */\n if (myapp.buffers) {\n midiNotes.map(playMidiNote);\n myapp.ports.playSequenceStarted.send(true);\n }\n else {\n myapp.ports.playSequenceStarted.send(false);\n }\n}", "function osc(freq, type, dtn) {\n\tvar duration = dtn;\n\tvar startTime = audioContext.currentTime;\n \tvar endTime = startTime + duration;\n\n\tvar oscillator = audioContext.createOscillator();\n\toscillator.type = type;\n\toscillator.frequency.value = freq;\n\t// *** Master effects ***\n\t// envelope\n\tvar ramp = audioContext.createGain()\n\tramp.gain.value = 0;\n\toscillator.connect(ramp);\n\t// bandpass\n \tvar bandpass = audioContext.createBiquadFilter()\n \tbandpass.type = 'bandpass';\n \tbandpass.frequency.value = 1200;\n \tbandpass.Q.value = 0.9;\n\t// compressor --ToDo\n\t// overdrive\n\tvar shaper = audioContext.createWaveShaper()\n\tshaper.curve = generateCurve(22050)\n\n\tfunction generateCurve(steps){\n \t\tvar curve = new Float32Array(steps)\n \t\tvar deg = Math.PI / 180\n\n\t \tfor (var i=0;i<steps;i++) {\n \t\tvar x = i * 2 / steps - 1\n \tcurve[i] = (3 + 10) * x * 20 * deg / (Math.PI + 10 * Math.abs(x))\n \t\t}\n\n \t\treturn curve\n}\n\n\tvar amp = audioContext.createGain()\n\tamp.gain.value = 3;\n\tramp.connect(amp);\n\tramp.connect(bandpass);\n\tamp.connect(bandpass);\n\tbandpass.connect(shaper);\n\tbandpass.connect(volumeCh1);\n\tshaper.connect(volumeCh2);\n\t// connect to analyser\n\tshaper.connect(analyser);\n\t// reverb --ToDo\n\n\toscillator.start(startTime);\n\tramp.gain.setTargetAtTime(1, startTime, 0.1);\n \tramp.gain.setTargetAtTime(0, endTime, duration/2);\n\toscillator.stop(endTime + 2);\n}", "_onMidiMessage(e) {\n // Create Message object from MIDI data\n const message = new Message(e.data);\n /**\n * Event emitted when any MIDI message is received on an `Input`.\n *\n * @event Input#midimessage\n *\n * @type {object}\n *\n * @property {Input} port The `Input` that triggered the event.\n * @property {Input} target The object that dispatched the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n * @property {string} type `midimessage`\n *\n * @since 2.1\n */\n\n const event = {\n port: this,\n target: this,\n message: message,\n timestamp: e.timeStamp,\n type: \"midimessage\",\n data: message.data,\n // @deprecated (will be removed in v4)\n rawData: message.data,\n // @deprecated (will be removed in v4)\n statusByte: message.data[0],\n // @deprecated (will be removed in v4)\n dataBytes: message.dataBytes // @deprecated (will be removed in v4)\n\n };\n this.emit(\"midimessage\", event); // Messages are forwarded to InputChannel if they are channel messages or parsed locally for\n // system messages.\n\n if (message.isSystemMessage) {\n // system messages\n this._parseEvent(event);\n } else if (message.isChannelMessage) {\n // channel messages\n this.channels[message.channel]._processMidiMessageEvent(event);\n } // Forward message if forwarders have been defined\n\n\n this._forwarders.forEach(forwarder => forwarder.forward(message));\n }", "addCommandEvents() {\n const { conf, command, creator } = this;\n const totalFrames = creator.getTotalFrames();\n const debug = conf.getVal('debug');\n\n // start\n command.on('start', commandLine => {\n const log = conf.getVal('log');\n if (log) console.log(commandLine);\n this.emits({ type: 'synthesis-start', command: commandLine });\n });\n\n // progress\n command.on('progress', progress => {\n const percent = progress.frames / totalFrames;\n this.emits({ type: 'synthesis-progress', percent });\n });\n\n // complete\n command.on('end', () => {\n if (!debug) this.deleteCacheFile();\n const output = conf.getVal('output');\n this.emits({ type: 'synthesis-complete', path: output, output });\n });\n\n // error\n command.on('error', (error, stdout, stderr) => {\n if (!debug) this.deleteCacheFile();\n this.emits({\n type: 'synthesis-error',\n error: `${error} \\n stdout: ${stdout} \\n stderr: ${stderr}`,\n pos: 'Synthesis',\n });\n });\n }", "function msg_int(c) {\n\tif(c==0) {\n\t\toutlet(0, \"bang\");\n\t\toutlet(0, t, off);\n\t\toutlet(0, vol, all, 0, 25);\n\t\toutlet(0, loop, all, 0);\n\t\toutlet(0, clearSelection, all);\n\t\toutlet(0, pitch, all, 1);\n\t\toutlet(0, speed, all, 1);\n\t\toutlet(0, vol, 1, -128, 25);\t\n\t}\n\tif(c==1) {\n\t\toutlet(0, play, 1);\n\t\toutlet(0, vol, 1, 0, 4000);\t\n\t\t}\n\tif(c==2) {\n\t\toutlet(0, loop, 2, 1);\n\t\toutlet(0, play, 2);\n\t\toutlet(0, vol, 1, -128, 100);\n\t\t}\t\n\tif(c==3) {\n\t\toutlet(0, loop, 2, 0);\n\t\toutlet(0, t, on);\n\t\toutlet(0, loop, 3, 1);\n\t\toutlet(0, play, 3);\n\t\t}\n\tif(c==4) {\n\t\toutlet(0, speed, 3, 2);\t\n\t\t}\n\tif(c==5) {\n\t\toutlet(0, speed, 3, .25);\n\t\toutlet(0, vol, 3, 6);\n\t\toutlet(0, pitch, 3, 1);\n\t\toutlet(0, loop, 2, 1);\n\t\toutlet(0, speed, 2, 8);\n\t\toutlet(0, vol, 2, -30, 100);\n\t\toutlet(0, play, 2);\t\t\n\t\t}\n\tif(c==6) {\t\t\n\t\toutlet(0, t, off);\n\t\toutlet(0, vol, all, 0, 25);\n\t\toutlet(0, loop, all, 0);\n\t\toutlet(0, clearSelection, all);\n\t\toutlet(0, pitch, all, 1);\n\t\toutlet(0, speed, all, 1);}\t\t\n}", "constructor (props) {\n super(props)\n\n this.triggerCowbellSynth = this.triggerCowbellSynth.bind(this)\n \n this.state = {\n HIGH_OSC_FREQ: 835,\n LOW_OSC_FREQ: 555,\n ENVELOPE: {\n attack : 0.005 ,\n decay : 0.05 ,\n sustain : 0.1 ,\n release : 0.3\n },\n FILTER_ENVELOPE: {\n attack : 0.06 ,\n decay : 0.06 ,\n sustain : 0.5 ,\n release : 2 ,\n baseFrequency : 20000,\n octaves : 7 ,\n exponent : 2,\n },\n BandPassFilterCutoff: 2640,\n cowbellLength: 0.1\n }\n\n \n this.bandPassFilter = new Tone.Filter( this.state.BandPassFilterCutoff, \"bandpass\" ).toMaster()\n\n this.cowbellSynthLow = new Tone.MonoSynth( { oscillator: {type: 'square'}, envelope: this.state.ENVELOPE, filterEnvelope: this.state.FILTER_ENVELOPE}).connect(this.bandPassFilter)\n this.cowbellSynthLow.filter.type = 'allpass'\n this.cowbellSynthHigh = new Tone.MonoSynth( { oscillator: {type: 'square'}, envelope: this.state.ENVELOPE, filterEnvelope: this.state.FILTER_ENVELOPE}).connect(this.bandPassFilter)\n this.cowbellSynthHigh.filter.type = 'allpass'\n\n }", "function Sonix (modelo, chassi, qtdPortas) {\n Carro.call(this, modelo, chassi, qtdPortas);\n}", "function ProcessMIDI() {\n\n var info = GetTimingInfo(); //get the timing info from the host\n\t\n \t//if the transport is playing\n\t if (info.playing)\n\t\t Trace(info.blockStartBeat); //print the beat position\n}", "start() {\r\n process.on(\"message\", (message) => {\r\n const type = message.type;\r\n const data = message.data;\r\n\r\n switch (type) {\r\n\r\n case Operations.AUDIO_PLAY:\r\n this.player.play(data);\r\n\r\n break;\r\n\r\n case Operations.AUDIO_STOP:\r\n this.player.stop();\r\n this.player.disconnect();\r\n this.destroy();\r\n\r\n break;\r\n\r\n case Operations.AUDIO_VOLUME:\r\n this.player.setVolume(data.volume);\r\n\r\n break;\r\n\r\n case Operations.AUDIO_PAUSE:\r\n this.player.pause();\r\n\r\n break;\r\n\r\n case Operations.AUDIO_RESUME:\r\n this.player.resume();\r\n\r\n break;\r\n\r\n default:\r\n console.log(`Unknown IPC type: ${type}`);\r\n break;\r\n\r\n }\r\n });\n\n this.player.on(\"ready\", () => {\n let data = {\n type: Events.AUDIO_READY,\n data: {\n guildId: this.voiceData.guildId\n }\n };\n\n process.send(data);\n });\n\r\n this.player.on(\"start\", () => {\r\n let data = {\r\n type: Events.AUDIO_START,\r\n data: {\r\n guildId: this.voiceData.guildId\r\n }\r\n };\r\n\r\n process.send(data);\r\n });\r\n\r\n this.player.on(\"end\", () => {\r\n let data = {\r\n type: Events.AUDIO_END,\r\n data: {\r\n guildId: this.voiceData.guildId\r\n }\r\n };\r\n\r\n process.send(data);\r\n });\r\n }", "moveSynth(){\r\n if (mouseX > this.posx && mouseX < this.posx + this.w && \r\n mouseY > this.posy && mouseY < this.posy + this.h){\r\n if (dist(mouseX, mouseY, this.ampKnob.x, this.ampKnob.y) < this.ampKnob.radius){\r\n this.ampKnob.knobHeld = true;\r\n \r\n }\r\n else if (dist(mouseX, mouseY, this.panKnob.x, this.panKnob.y) < this.panKnob.radius){\r\n this.panKnob.knobHeld = true;\r\n }\r\n else if (dist(mouseX, mouseY, this.freqKnob.x, this.freqKnob.y) < this.freqKnob.radius){\r\n if (this.toOther) this.freqKnob.knobHeld = true;\r\n }\r\n else{\r\n if (!this.ampKnob.knobHeld && !this.outlet.dragged && !this.freqKnob.knobHeld && !this.panKnob.knobHeld ){\r\n this.posx = mouseX - this.w * 0.5;\r\n this.posy = mouseY - this.h * 0.5;\r\n }\r\n }\r\n }\r\n \r\n else if (dist(mouseX, mouseY, this.outlet.x, this.outlet.y) < this.outlet.radius){\r\n this.outlet.dragged = true;\r\n SimpleSynth.outletDragged =true;\r\n }\r\n else if (dist(mouseX, mouseY, this.delayTimeKnob.x, this.delayTimeKnob.y) < this.delayTimeKnob.radius){\r\n this.delayTimeKnob.knobHeld = true;\r\n this.delayTime = this.delayTimeKnob.mapDegToVal();\r\n this.delay.process(this.osc, this.delayTime, this.delayFeedback, this.delayFilterFreq);\r\n \r\n }\r\n else if (dist(mouseX, mouseY, this.delayFeedbackKnob.x, this.delayFeedbackKnob.y) < \r\n this.delayFeedbackKnob.radius){\r\n this.delayFeedbackKnob.knobHeld = true;\r\n this.delayFeedback = this.delayFeedbackKnob.mapDegToVal();\r\n this.delay.process(this.osc, this.delayTime, this.delayFeedback, this.delayFilterFreq);\r\n }\r\n else if (dist(mouseX, mouseY, this.delayFilterFreqKnob.x, this.delayFilterFreqKnob.y) < \r\n this.delayFilterFreqKnob.radius){\r\n this.delayFilterFreqKnob.knobHeld = true;\r\n this.delayFilterFreq = this.delayFilterFreqKnob.mapDegToVal();\r\n this.delay.process(this.osc, this.delayTime, this.delayFeedback, this.delayFilterFreq);\r\n }\r\n else if (dist(mouseX, mouseY, this.reverbTimeKnob.x, this.reverbTimeKnob.y) < \r\n this.reverbTimeKnob.radius){\r\n this.reverbTimeKnob.knobHeld = true;\r\n this.reverbTime = this.reverbTimeKnob.mapDegToVal();\r\n this.reverb.process(this.osc, this.reverbTime, this.reverbDecayRate);\r\n }\r\n else if (dist(mouseX, mouseY, this.reverbDecayRateKnob.x, this.reverbDecayRateKnob.y) < \r\n this.reverbDecayRateKnob.radius){\r\n this.reverbDecayRateKnob.knobHeld = true;\r\n this.reverbDecayRate = this.reverbDecayRateKnob.mapDegToVal();\r\n this.reverb.process(this.osc, this.reverbTime, this.reverbDecayRate);\r\n }\r\n \r\n this.ampKnob.x = this.posx + this.w * 0.1;\r\n this.ampKnob.y = this.posy + this.h * 0.5;\r\n\r\n this.panKnob.x = this.posx + this.w * 0.1;\r\n this.panKnob.y = this.posy + this.h * 0.2;\r\n \r\n this.typeButton.x = this.posx + this.w * 0.2;\r\n this.typeButton.y = this.ampKnob.y - this.ampKnob.radius * 0.5;\r\n \r\n\r\n this.freqButton.x = this.posx + this.w * 0.6;\r\n this.freqButton.y = this.ampKnob.y - this.ampKnob.radius * 0.5;\r\n \r\n\r\n \r\n \r\n this.freqKnob.x = this.posx + this.w * 0.1;\r\n this.freqKnob.y = this.posy + this.h * 0.75;\r\n \r\n \r\n this.oscViewBox.x = this.posx;\r\n this.oscViewBox.y = this.posy - this.w;\r\n \r\n this.outlet.x = this.oscViewBox.x + this.oscViewBox.width;\r\n if (!this.toOther) this.outlet.y = this.oscViewBox.y + (this.oscViewBox.height + this.h) * 0.5;\r\n else this.outlet.y = this.posy + this.h * 0.5;\r\n this.inputArea.x = this.oscViewBox.x;\r\n if (!this.toOther) this.inputArea.y = this.outlet.y;\r\n else this.inputArea.y = this.posy + this.h * 0.5;\r\n \r\n \r\n this.effectsButton.x = this.posx + this.w * 0.8;\r\n this.effectsButton.y = this.ampKnob.y - this.ampKnob.radius * 0.5;\r\n \r\n \r\n this.effectsBox.x = this.oscViewBox.x + this.oscViewBox.width;\r\n this.effectsBox.y = this.oscViewBox.y;\r\n \r\n \r\n this.delayTimeKnob.updatePosition(this.effectsBox.x + this.effectsBox.width * 0.25, \r\n this.effectsBox.y + this.ekr * 2);\r\n this.delayFeedbackKnob.updatePosition(this.effectsBox.x + this.effectsBox.width * 0.75, \r\n this.effectsBox.y + this.ekr * 2);\r\n this.delayFilterFreqKnob.updatePosition(this.effectsBox.x + this.effectsBox.width * 0.25, \r\n this.effectsBox.y + this.ekr * 4);\r\n \r\n this.reverbTimeKnob.updatePosition(this.effectsBox.x + this.effectsBox.width * 0.25,\r\n this.effectsBox.y + this.ekr * 7);\r\n this.reverbDecayRateKnob.updatePosition(this.effectsBox.x + this.effectsBox.width * 0.75,\r\n this.effectsBox.y + this.ekr * 7);\r\n \r\n }", "makeSynthPart(notesArr) {\n let pattern = new Tone.Part((time, note) => {\n this.tone.triggerAttackRelease(note.val, note.dur, time, note.vel)\n\n //this.setState({ millSec: time })\n\n // Tone.Draw.schedule(() => {\n // this.state.text.split('').map(element => {\n // //console.log(element)\n\n // })\n\n // }, time)\n\n }, notesArr).start()\n}", "function SfxrSynth() {\n // All variables are kept alive through function closures\n\n //--------------------------------------------------------------------------\n //\n // Sound Parameters\n //\n //--------------------------------------------------------------------------\n\n this._params = new SfxrParams(); // Params instance\n\n //--------------------------------------------------------------------------\n //\n // Synth Variables\n //\n //--------------------------------------------------------------------------\n\n var _envelopeLength0, // Length of the attack stage\n _envelopeLength1, // Length of the sustain stage\n _envelopeLength2, // Length of the decay stage\n\n _period, // Period of the wave\n _maxPeriod, // Maximum period before sound stops (from minFrequency)\n\n _slide, // Note slide\n _deltaSlide, // Change in slide\n\n _changeAmount, // Amount to change the note by\n _changeTime, // Counter for the note change\n _changeLimit, // Once the time reaches this limit, the note changes\n\n _squareDuty, // Offset of center switching point in the square wave\n _dutySweep; // Amount to change the duty by\n\n //--------------------------------------------------------------------------\n //\n // Synth Methods\n //\n //--------------------------------------------------------------------------\n\n /**\n * Resets the runing variables from the params\n * Used once at the start (total reset) and for the repeat effect (partial reset)\n */\n this.reset = function() {\n // Shorter reference\n var p = this._params;\n\n _period = 100 / (p['f'] * p['f'] + .001);\n _maxPeriod = 100 / (p['g'] * p['g'] + .001);\n\n _slide = 1 - p['h'] * p['h'] * p['h'] * .01;\n _deltaSlide = -p['i'] * p['i'] * p['i'] * .000001;\n\n if (!p['a']) {\n _squareDuty = .5 - p['n'] / 2;\n _dutySweep = -p['o'] * .00005;\n }\n\n _changeAmount = 1 + p['l'] * p['l'] * (p['l'] > 0 ? -.9 : 10);\n _changeTime = 0;\n _changeLimit = p['m'] == 1 ? 0 : (1 - p['m']) * (1 - p['m']) * 20000 + 32;\n }\n\n // I split the reset() function into two functions for better readability\n this.totalReset = function() {\n this.reset();\n\n // Shorter reference\n var p = this._params;\n\n // Calculating the length is all that remained here, everything else moved somewhere\n _envelopeLength0 = p['b'] * p['b'] * 100000;\n _envelopeLength1 = p['c'] * p['c'] * 100000;\n _envelopeLength2 = p['e'] * p['e'] * 100000 + 12;\n // Full length of the volume envelop (and therefore sound)\n // Make sure the length can be divided by 3 so we will not need the padding \"==\" after base64 encode\n return ((_envelopeLength0 + _envelopeLength1 + _envelopeLength2) / 3 | 0) * 3;\n }\n\n /**\n * Writes the wave to the supplied buffer ByteArray\n * @param buffer A ByteArray to write the wave to\n * @return If the wave is finished\n */\n this.synthWave = function(buffer, length) {\n // Shorter reference\n var p = this._params;\n\n // If the filters are active\n var _filters = p['s'] != 1 || p['v'],\n // Cutoff multiplier which adjusts the amount the wave position can move\n _hpFilterCutoff = p['v'] * p['v'] * .1,\n // Speed of the high-pass cutoff multiplier\n _hpFilterDeltaCutoff = 1 + p['w'] * .0003,\n // Cutoff multiplier which adjusts the amount the wave position can move\n _lpFilterCutoff = p['s'] * p['s'] * p['s'] * .1,\n // Speed of the low-pass cutoff multiplier\n _lpFilterDeltaCutoff = 1 + p['t'] * .0001,\n // If the low pass filter is active\n _lpFilterOn = p['s'] != 1,\n // masterVolume * masterVolume (for quick calculations)\n _masterVolume = p['x'] * p['x'],\n // Minimum frequency before stopping\n _minFreqency = p['g'],\n // If the phaser is active\n _phaser = p['q'] || p['r'],\n // Change in phase offset\n _phaserDeltaOffset = p['r'] * p['r'] * p['r'] * .2,\n // Phase offset for phaser effect\n _phaserOffset = p['q'] * p['q'] * (p['q'] < 0 ? -1020 : 1020),\n // Once the time reaches this limit, some of the iables are reset\n _repeatLimit = p['p'] ? ((1 - p['p']) * (1 - p['p']) * 20000 | 0) + 32 : 0,\n // The punch factor (louder at begining of sustain)\n _sustainPunch = p['d'],\n // Amount to change the period of the wave by at the peak of the vibrato wave\n _vibratoAmplitude = p['j'] / 2,\n // Speed at which the vibrato phase moves\n _vibratoSpeed = p['k'] * p['k'] * .01,\n // The type of wave to generate\n _waveType = p['a'];\n\n var _envelopeLength = _envelopeLength0, // Length of the current envelope stage\n _envelopeOverLength0 = 1 / _envelopeLength0, // (for quick calculations)\n _envelopeOverLength1 = 1 / _envelopeLength1, // (for quick calculations)\n _envelopeOverLength2 = 1 / _envelopeLength2; // (for quick calculations)\n\n // Damping muliplier which restricts how fast the wave position can move\n var _lpFilterDamping = 5 / (1 + p['u'] * p['u'] * 20) * (.01 + _lpFilterCutoff);\n if (_lpFilterDamping > .8) {\n _lpFilterDamping = .8;\n }\n _lpFilterDamping = 1 - _lpFilterDamping;\n\n var _finished = false, // If the sound has finished\n _envelopeStage = 0, // Current stage of the envelope (attack, sustain, decay, end)\n _envelopeTime = 0, // Current time through current enelope stage\n _envelopeVolume = 0, // Current volume of the envelope\n _hpFilterPos = 0, // Adjusted wave position after high-pass filter\n _lpFilterDeltaPos = 0, // Change in low-pass wave position, as allowed by the cutoff and damping\n _lpFilterOldPos, // Previous low-pass wave position\n _lpFilterPos = 0, // Adjusted wave position after low-pass filter\n _periodTemp, // Period modified by vibrato\n _phase = 0, // Phase through the wave\n _phaserInt, // Integer phaser offset, for bit maths\n _phaserPos = 0, // Position through the phaser buffer\n _pos, // Phase expresed as a Number from 0-1, used for fast sin approx\n _repeatTime = 0, // Counter for the repeats\n _sample, // Sub-sample calculated 8 times per actual sample, averaged out to get the super sample\n _superSample, // Actual sample writen to the wave\n _vibratoPhase = 0; // Phase through the vibrato sine wave\n\n // Buffer of wave values used to create the out of phase second wave\n var _phaserBuffer = new Array(1024),\n // Buffer of random values used to generate noise\n _noiseBuffer = new Array(32);\n for (var i = _phaserBuffer.length; i--; ) {\n _phaserBuffer[i] = 0;\n }\n for (var i = _noiseBuffer.length; i--; ) {\n _noiseBuffer[i] = Math.random() * 2 - 1;\n }\n\n for (var i = 0; i < length; i++) {\n if (_finished) {\n return i;\n }\n\n // Repeats every _repeatLimit times, partially resetting the sound parameters\n if (_repeatLimit) {\n if (++_repeatTime >= _repeatLimit) {\n _repeatTime = 0;\n this.reset();\n }\n }\n\n // If _changeLimit is reached, shifts the pitch\n if (_changeLimit) {\n if (++_changeTime >= _changeLimit) {\n _changeLimit = 0;\n _period *= _changeAmount;\n }\n }\n\n // Acccelerate and apply slide\n _slide += _deltaSlide;\n _period *= _slide;\n\n // Checks for frequency getting too low, and stops the sound if a minFrequency was set\n if (_period > _maxPeriod) {\n _period = _maxPeriod;\n if (_minFreqency > 0) {\n _finished = true;\n }\n }\n\n _periodTemp = _period;\n\n // Applies the vibrato effect\n if (_vibratoAmplitude > 0) {\n _vibratoPhase += _vibratoSpeed;\n _periodTemp *= 1 + Math.sin(_vibratoPhase) * _vibratoAmplitude;\n }\n\n _periodTemp |= 0;\n if (_periodTemp < 8) {\n _periodTemp = 8;\n }\n\n // Sweeps the square duty\n if (!_waveType) {\n _squareDuty += _dutySweep;\n if (_squareDuty < 0) {\n _squareDuty = 0;\n } else if (_squareDuty > .5) {\n _squareDuty = .5;\n }\n }\n\n // Moves through the different stages of the volume envelope\n if (++_envelopeTime > _envelopeLength) {\n _envelopeTime = 0;\n\n switch (++_envelopeStage) {\n case 1:\n _envelopeLength = _envelopeLength1;\n break;\n case 2:\n _envelopeLength = _envelopeLength2;\n }\n }\n\n // Sets the volume based on the position in the envelope\n switch (_envelopeStage) {\n case 0:\n _envelopeVolume = _envelopeTime * _envelopeOverLength0;\n break;\n case 1:\n _envelopeVolume = 1 + (1 - _envelopeTime * _envelopeOverLength1) * 2 * _sustainPunch;\n break;\n case 2:\n _envelopeVolume = 1 - _envelopeTime * _envelopeOverLength2;\n break;\n case 3:\n _envelopeVolume = 0;\n _finished = true;\n }\n\n // Moves the phaser offset\n if (_phaser) {\n _phaserOffset += _phaserDeltaOffset;\n _phaserInt = _phaserOffset | 0;\n if (_phaserInt < 0) {\n _phaserInt = -_phaserInt;\n } else if (_phaserInt > 1023) {\n _phaserInt = 1023;\n }\n }\n\n // Moves the high-pass filter cutoff\n if (_filters && _hpFilterDeltaCutoff) {\n _hpFilterCutoff *= _hpFilterDeltaCutoff;\n if (_hpFilterCutoff < .00001) {\n _hpFilterCutoff = .00001;\n } else if (_hpFilterCutoff > .1) {\n _hpFilterCutoff = .1;\n }\n }\n\n _superSample = 0;\n for (var j = 8; j--; ) {\n // Cycles through the period\n _phase++;\n if (_phase >= _periodTemp) {\n _phase %= _periodTemp;\n\n // Generates new random noise for this period\n if (_waveType == 3) {\n for (var n = _noiseBuffer.length; n--; ) {\n _noiseBuffer[n] = Math.random() * 2 - 1;\n }\n }\n }\n\n // Gets the sample from the oscillator\n switch (_waveType) {\n case 0: // Square wave\n _sample = ((_phase / _periodTemp) < _squareDuty) ? .5 : -.5;\n break;\n case 1: // Saw wave\n _sample = 1 - _phase / _periodTemp * 2;\n break;\n case 2: // Sine wave (fast and accurate approx)\n _pos = _phase / _periodTemp;\n _pos = (_pos > .5 ? _pos - 1 : _pos) * 6.28318531;\n _sample = 1.27323954 * _pos + .405284735 * _pos * _pos * (_pos < 0 ? 1 : -1);\n _sample = .225 * ((_sample < 0 ? -1 : 1) * _sample * _sample - _sample) + _sample;\n break;\n case 3: // Noise\n _sample = _noiseBuffer[Math.abs(_phase * 32 / _periodTemp | 0)];\n }\n\n // Applies the low and high pass filters\n if (_filters) {\n _lpFilterOldPos = _lpFilterPos;\n _lpFilterCutoff *= _lpFilterDeltaCutoff;\n if (_lpFilterCutoff < 0) {\n _lpFilterCutoff = 0;\n } else if (_lpFilterCutoff > .1) {\n _lpFilterCutoff = .1;\n }\n\n if (_lpFilterOn) {\n _lpFilterDeltaPos += (_sample - _lpFilterPos) * _lpFilterCutoff;\n _lpFilterDeltaPos *= _lpFilterDamping;\n } else {\n _lpFilterPos = _sample;\n _lpFilterDeltaPos = 0;\n }\n\n _lpFilterPos += _lpFilterDeltaPos;\n\n _hpFilterPos += _lpFilterPos - _lpFilterOldPos;\n _hpFilterPos *= 1 - _hpFilterCutoff;\n _sample = _hpFilterPos;\n }\n\n // Applies the phaser effect\n if (_phaser) {\n _phaserBuffer[_phaserPos % 1024] = _sample;\n _sample += _phaserBuffer[(_phaserPos - _phaserInt + 1024) % 1024];\n _phaserPos++;\n }\n\n _superSample += _sample;\n }\n\n // Averages out the super samples and applies volumes\n _superSample *= .125 * _envelopeVolume * _masterVolume;\n\n // Clipping if too loud\n buffer[i] = _superSample >= 1 ? 32767 : _superSample <= -1 ? -32768 : _superSample * 32767 | 0;\n }\n\n return length;\n }\n}", "function SfxrSynth() {\n // All variables are kept alive through function closures\n\n //--------------------------------------------------------------------------\n //\n // Sound Parameters\n //\n //--------------------------------------------------------------------------\n\n this._params = new SfxrParams(); // Params instance\n\n //--------------------------------------------------------------------------\n //\n // Synth Variables\n //\n //--------------------------------------------------------------------------\n\n var _envelopeLength0, // Length of the attack stage\n _envelopeLength1, // Length of the sustain stage\n _envelopeLength2, // Length of the decay stage\n\n _period, // Period of the wave\n _maxPeriod, // Maximum period before sound stops (from minFrequency)\n\n _slide, // Note slide\n _deltaSlide, // Change in slide\n\n _changeAmount, // Amount to change the note by\n _changeTime, // Counter for the note change\n _changeLimit, // Once the time reaches this limit, the note changes\n\n _squareDuty, // Offset of center switching point in the square wave\n _dutySweep; // Amount to change the duty by\n\n //--------------------------------------------------------------------------\n //\n // Synth Methods\n //\n //--------------------------------------------------------------------------\n\n /**\n * Resets the runing variables from the params\n * Used once at the start (total reset) and for the repeat effect (partial reset)\n */\n this.reset = function() {\n // Shorter reference\n var p = this._params;\n\n _period = 100 / (p['f'] * p['f'] + .001);\n _maxPeriod = 100 / (p['g'] * p['g'] + .001);\n\n _slide = 1 - p['h'] * p['h'] * p['h'] * .01;\n _deltaSlide = -p['i'] * p['i'] * p['i'] * .000001;\n\n if (!p['a']) {\n _squareDuty = .5 - p['n'] / 2;\n _dutySweep = -p['o'] * .00005;\n }\n\n _changeAmount = 1 + p['l'] * p['l'] * (p['l'] > 0 ? -.9 : 10);\n _changeTime = 0;\n _changeLimit = p['m'] == 1 ? 0 : (1 - p['m']) * (1 - p['m']) * 20000 + 32;\n }\n\n // I split the reset() function into two functions for better readability\n this.totalReset = function() {\n this.reset();\n\n // Shorter reference\n var p = this._params;\n\n // Calculating the length is all that remained here, everything else moved somewhere\n _envelopeLength0 = p['b'] * p['b'] * 100000;\n _envelopeLength1 = p['c'] * p['c'] * 100000;\n _envelopeLength2 = p['e'] * p['e'] * 100000 + 12;\n // Full length of the volume envelop (and therefore sound)\n // Make sure the length can be divided by 3 so we will not need the padding \"==\" after base64 encode\n return ((_envelopeLength0 + _envelopeLength1 + _envelopeLength2) / 3 | 0) * 3;\n }\n\n /**\n * Writes the wave to the supplied buffer ByteArray\n * @param buffer A ByteArray to write the wave to\n * @return If the wave is finished\n */\n this.synthWave = function(buffer, length) {\n // Shorter reference\n var p = this._params;\n\n // If the filters are active\n var _filters = p['s'] != 1 || p['v'],\n // Cutoff multiplier which adjusts the amount the wave position can move\n _hpFilterCutoff = p['v'] * p['v'] * .1,\n // Speed of the high-pass cutoff multiplier\n _hpFilterDeltaCutoff = 1 + p['w'] * .0003,\n // Cutoff multiplier which adjusts the amount the wave position can move\n _lpFilterCutoff = p['s'] * p['s'] * p['s'] * .1,\n // Speed of the low-pass cutoff multiplier\n _lpFilterDeltaCutoff = 1 + p['t'] * .0001,\n // If the low pass filter is active\n _lpFilterOn = p['s'] != 1,\n // masterVolume * masterVolume (for quick calculations)\n _masterVolume = p['x'] * p['x'],\n // Minimum frequency before stopping\n _minFreqency = p['g'],\n // If the phaser is active\n _phaser = p['q'] || p['r'],\n // Change in phase offset\n _phaserDeltaOffset = p['r'] * p['r'] * p['r'] * .2,\n // Phase offset for phaser effect\n _phaserOffset = p['q'] * p['q'] * (p['q'] < 0 ? -1020 : 1020),\n // Once the time reaches this limit, some of the iables are reset\n _repeatLimit = p['p'] ? ((1 - p['p']) * (1 - p['p']) * 20000 | 0) + 32 : 0,\n // The punch factor (louder at begining of sustain)\n _sustainPunch = p['d'],\n // Amount to change the period of the wave by at the peak of the vibrato wave\n _vibratoAmplitude = p['j'] / 2,\n // Speed at which the vibrato phase moves\n _vibratoSpeed = p['k'] * p['k'] * .01,\n // The type of wave to generate\n _waveType = p['a'];\n\n var _envelopeLength = _envelopeLength0, // Length of the current envelope stage\n _envelopeOverLength0 = 1 / _envelopeLength0, // (for quick calculations)\n _envelopeOverLength1 = 1 / _envelopeLength1, // (for quick calculations)\n _envelopeOverLength2 = 1 / _envelopeLength2; // (for quick calculations)\n\n // Damping muliplier which restricts how fast the wave position can move\n var _lpFilterDamping = 5 / (1 + p['u'] * p['u'] * 20) * (.01 + _lpFilterCutoff);\n if (_lpFilterDamping > .8) {\n _lpFilterDamping = .8;\n }\n _lpFilterDamping = 1 - _lpFilterDamping;\n\n var _finished = false, // If the sound has finished\n _envelopeStage = 0, // Current stage of the envelope (attack, sustain, decay, end)\n _envelopeTime = 0, // Current time through current enelope stage\n _envelopeVolume = 0, // Current volume of the envelope\n _hpFilterPos = 0, // Adjusted wave position after high-pass filter\n _lpFilterDeltaPos = 0, // Change in low-pass wave position, as allowed by the cutoff and damping\n _lpFilterOldPos, // Previous low-pass wave position\n _lpFilterPos = 0, // Adjusted wave position after low-pass filter\n _periodTemp, // Period modified by vibrato\n _phase = 0, // Phase through the wave\n _phaserInt, // Integer phaser offset, for bit maths\n _phaserPos = 0, // Position through the phaser buffer\n _pos, // Phase expresed as a Number from 0-1, used for fast sin approx\n _repeatTime = 0, // Counter for the repeats\n _sample, // Sub-sample calculated 8 times per actual sample, averaged out to get the super sample\n _superSample, // Actual sample writen to the wave\n _vibratoPhase = 0; // Phase through the vibrato sine wave\n\n // Buffer of wave values used to create the out of phase second wave\n var _phaserBuffer = new Array(1024),\n // Buffer of random values used to generate noise\n _noiseBuffer = new Array(32);\n for (var i = _phaserBuffer.length; i--; ) {\n _phaserBuffer[i] = 0;\n }\n for (var i = _noiseBuffer.length; i--; ) {\n _noiseBuffer[i] = Math.random() * 2 - 1;\n }\n\n for (var i = 0; i < length; i++) {\n if (_finished) {\n return i;\n }\n\n // Repeats every _repeatLimit times, partially resetting the sound parameters\n if (_repeatLimit) {\n if (++_repeatTime >= _repeatLimit) {\n _repeatTime = 0;\n this.reset();\n }\n }\n\n // If _changeLimit is reached, shifts the pitch\n if (_changeLimit) {\n if (++_changeTime >= _changeLimit) {\n _changeLimit = 0;\n _period *= _changeAmount;\n }\n }\n\n // Acccelerate and apply slide\n _slide += _deltaSlide;\n _period *= _slide;\n\n // Checks for frequency getting too low, and stops the sound if a minFrequency was set\n if (_period > _maxPeriod) {\n _period = _maxPeriod;\n if (_minFreqency > 0) {\n _finished = true;\n }\n }\n\n _periodTemp = _period;\n\n // Applies the vibrato effect\n if (_vibratoAmplitude > 0) {\n _vibratoPhase += _vibratoSpeed;\n _periodTemp *= 1 + Math.sin(_vibratoPhase) * _vibratoAmplitude;\n }\n\n _periodTemp |= 0;\n if (_periodTemp < 8) {\n _periodTemp = 8;\n }\n\n // Sweeps the square duty\n if (!_waveType) {\n _squareDuty += _dutySweep;\n if (_squareDuty < 0) {\n _squareDuty = 0;\n } else if (_squareDuty > .5) {\n _squareDuty = .5;\n }\n }\n\n // Moves through the different stages of the volume envelope\n if (++_envelopeTime > _envelopeLength) {\n _envelopeTime = 0;\n\n switch (++_envelopeStage) {\n case 1:\n _envelopeLength = _envelopeLength1;\n break;\n case 2:\n _envelopeLength = _envelopeLength2;\n }\n }\n\n // Sets the volume based on the position in the envelope\n switch (_envelopeStage) {\n case 0:\n _envelopeVolume = _envelopeTime * _envelopeOverLength0;\n break;\n case 1:\n _envelopeVolume = 1 + (1 - _envelopeTime * _envelopeOverLength1) * 2 * _sustainPunch;\n break;\n case 2:\n _envelopeVolume = 1 - _envelopeTime * _envelopeOverLength2;\n break;\n case 3:\n _envelopeVolume = 0;\n _finished = true;\n }\n\n // Moves the phaser offset\n if (_phaser) {\n _phaserOffset += _phaserDeltaOffset;\n _phaserInt = _phaserOffset | 0;\n if (_phaserInt < 0) {\n _phaserInt = -_phaserInt;\n } else if (_phaserInt > 1023) {\n _phaserInt = 1023;\n }\n }\n\n // Moves the high-pass filter cutoff\n if (_filters && _hpFilterDeltaCutoff) {\n _hpFilterCutoff *= _hpFilterDeltaCutoff;\n if (_hpFilterCutoff < .00001) {\n _hpFilterCutoff = .00001;\n } else if (_hpFilterCutoff > .1) {\n _hpFilterCutoff = .1;\n }\n }\n\n _superSample = 0;\n for (var j = 8; j--; ) {\n // Cycles through the period\n _phase++;\n if (_phase >= _periodTemp) {\n _phase %= _periodTemp;\n\n // Generates new random noise for this period\n if (_waveType == 3) {\n for (var n = _noiseBuffer.length; n--; ) {\n _noiseBuffer[n] = Math.random() * 2 - 1;\n }\n }\n }\n\n // Gets the sample from the oscillator\n switch (_waveType) {\n case 0: // Square wave\n _sample = ((_phase / _periodTemp) < _squareDuty) ? .5 : -.5;\n break;\n case 1: // Saw wave\n _sample = 1 - _phase / _periodTemp * 2;\n break;\n case 2: // Sine wave (fast and accurate approx)\n _pos = _phase / _periodTemp;\n _pos = (_pos > .5 ? _pos - 1 : _pos) * 6.28318531;\n _sample = 1.27323954 * _pos + .405284735 * _pos * _pos * (_pos < 0 ? 1 : -1);\n _sample = .225 * ((_sample < 0 ? -1 : 1) * _sample * _sample - _sample) + _sample;\n break;\n case 3: // Noise\n _sample = _noiseBuffer[Math.abs(_phase * 32 / _periodTemp | 0)];\n }\n\n // Applies the low and high pass filters\n if (_filters) {\n _lpFilterOldPos = _lpFilterPos;\n _lpFilterCutoff *= _lpFilterDeltaCutoff;\n if (_lpFilterCutoff < 0) {\n _lpFilterCutoff = 0;\n } else if (_lpFilterCutoff > .1) {\n _lpFilterCutoff = .1;\n }\n\n if (_lpFilterOn) {\n _lpFilterDeltaPos += (_sample - _lpFilterPos) * _lpFilterCutoff;\n _lpFilterDeltaPos *= _lpFilterDamping;\n } else {\n _lpFilterPos = _sample;\n _lpFilterDeltaPos = 0;\n }\n\n _lpFilterPos += _lpFilterDeltaPos;\n\n _hpFilterPos += _lpFilterPos - _lpFilterOldPos;\n _hpFilterPos *= 1 - _hpFilterCutoff;\n _sample = _hpFilterPos;\n }\n\n // Applies the phaser effect\n if (_phaser) {\n _phaserBuffer[_phaserPos % 1024] = _sample;\n _sample += _phaserBuffer[(_phaserPos - _phaserInt + 1024) % 1024];\n _phaserPos++;\n }\n\n _superSample += _sample;\n }\n\n // Averages out the super samples and applies volumes\n _superSample *= .125 * _envelopeVolume * _masterVolume;\n\n // Clipping if too loud\n buffer[i] = _superSample >= 1 ? 32767 : _superSample <= -1 ? -32768 : _superSample * 32767 | 0;\n }\n\n return length;\n }\n}", "function onMidiPort1(status, data1, data2) {\n /*\n Macro knob mode for selected device\n */\n var index = data1;\n if (M32.modeName[M32.isMode][M32.isSubMode] == \"DEVICE\") {\n if (isChannelController(status)) {\n if (isInDeviceParametersRange(data1)) {\n var index = data1 - M32.KNOB_START_CC;\n cursorDevice.getMacro(index).getAmount().set(data2, 128);\n } else if (data1 >= M32.LOWEST_CC && data1 <= M32.HIGHEST_CC) {\n var index = data1 - M32.LOWEST_CC;\n userControls.getControl(index).set(data2, 128);\n }\n }\n }\n /*\n TRACK mode knobs for selected track\n */\n if (M32.modeName[M32.isMode] == TRACK && M32.modeName[M32.isMode][M32.isSubMode] == \"CURSOR\") {\n if (data2 > 0) // ignore button release\n {\n switch (data1) {\n case M32.KNOB_1: // Volume selected track\n cursorTrack.getVolume().set(data2, 128);\n break;\n\n case M32.KNOB_2: // Pan selected track\n cursorTrack.getPan().set(data2, 128);\n break;\n\n case M32.KNOB_3: // Send 1 selected track\n cursorTrack.getSend(0).set(data2, 128);\n break;\n\n case M32.KNOB_4: // Send 2 selected track\n cursorTrack.getSend(1).set(data2, 128);\n break;\n\n case M32.KNOB_5:\n // TBD\n break;\n\n case M32.KNOB_6:\n // TBD\n break;\n\n case M32.KNOB_7: // Adjust click volume\n transport.setMetronomeValue(data2, 128);\n metroVolume = Math.round((data2 / 127) * 100);\n host.showPopupNotification(\"Click Volume: \" + metroVolume + \" %\");\n break;\n\n case M32.KNOB_8: // Adjust tempo. + shift Master Vol.\n M32.isShift ? masterTrack_0.getVolume().set(data2, 128) : transport.getTempo().setRaw(data2 + 49);\n break;\n }\n }\n }\n /*\n MIXER mode knobs for selected track\n */\n // Volume controls\n if (M32.modeName[M32.isMode] == MIXER && M32.modeName[M32.isMode][M32.isSubMode] == \"VOLUME\") {\n if (isChannelController(status)) {\n if (isInDeviceParametersRange(data1) && M32.isShift == false) { // Volume control for first 8 exiting tracks\n var index = data1 - M32.KNOB_START_CC;\n trackBank.getTrack(index).getVolume().set(data2, 128);\n } else if (data1 >= M32.LOWEST_CC && data1 <= M32.HIGHEST_CC) {\n var index = data1 - M32.LOWEST_CC;\n userControls.getControl(index).set(data2, 128);\n }\n }\n }\n // Pan controls\n if (M32.modeName[M32.isMode] == MIXER && M32.modeName[M32.isMode][M32.isSubMode] == \"PAN\") {\n if (isChannelController(status)) {\n if (isInDeviceParametersRange(data1)) {\n var index = data1 - M32.KNOB_START_CC;\n trackBank.getTrack(index).getPan().set(data2, 128);\n } else if (data1 >= M32.LOWEST_CC && data1 <= M32.HIGHEST_CC) {\n var index = data1 - M32.LOWEST_CC;\n userControls.getControl(index).set(data2, 128);\n }\n }\n }\n // Send 1 controls\n if (M32.modeName[M32.isMode] == MIXER && M32.modeName[M32.isMode][M32.isSubMode] == \"SEND 1\") {\n if (isChannelController(status)) {\n if (isInDeviceParametersRange(data1)) {\n var index = data1 - M32.KNOB_START_CC;\n trackBank.getTrack(index).getSend(0).set(data2, 128);\n } else if (data1 >= M32.LOWEST_CC && data1 <= M32.HIGHEST_CC) {\n var index = data1 - M32.LOWEST_CC;\n userControls.getControl(index).set(data2, 128);\n }\n }\n }\n // Send 2 controls\n if (M32.modeName[M32.isMode] == MIXER && M32.modeName[M32.isMode][M32.isSubMode] == \"SEND 2\") {\n if (isChannelController(status)) {\n if (isInDeviceParametersRange(data1)) {\n var index = data1 - M32.KNOB_START_CC;\n trackBank.getTrack(index).getSend(1).set(data2, 128);\n } else if (data1 >= M32.LOWEST_CC && data1 <= M32.HIGHEST_CC) {\n var index = data1 - M32.LOWEST_CC;\n userControls.getControl(index).set(data2, 128);\n }\n }\n }\n /*\n Transport and cursor for tracks (up, down) and devices (left, right)\n\t*/\n if (data2 > 0) // ignore button release\n {\n switch (data1) {\n case M32.PLAY: // Play = play. Play + shift = solo selected track\n M32.isShift ? cursorTrack.getSolo().toggle() : transport.play();\n break;\n\n case M32.STOP: // Stop = Stop. Stop + shift = mute selected track\n M32.isShift ? cursorTrack.getMute().toggle() : transport.stop();\n break;\n\n case M32.REC: // Rec = Record. Rec + shift = arm selected track\n M32.isShift ? cursorTrack.getArm().toggle() : transport.record();\n break;\n\n case M32.UP: // Up = previous track. Up + shift = metronome toggle\n M32.isShift ? transport.toggleOverdub() : cursorAction(M32.UP); // cursorTrack.selectPrevious();\n break;\n\n case M32.DOWN: // Down = next track\n M32.isShift ? transport.toggleClick() : cursorAction(M32.DOWN); // cursorTrack.selectNext();\n break;\n\n case M32.LEFT: // Left = previous device. Left + shift = undo\n M32.isShift ? application.undo() : cursorAction(M32.LEFT); // cursorDevice.selectPrevious();\n break;\n\n case M32.RIGHT: // Right = next device. Right + shift = redo\n M32.isShift ? application.redo() : cursorAction(M32.RIGHT); // cursorDevice.selectNext();\n break;\n\n case M32.KNOB_8: //\n if (M32.isShift == true) {\n masterTrack_0.getVolume().set(data2, 128);\n }\n break;\n }\n }\n // Shift button\n switch (data1) {\n case M32.SHIFT:\n M32.isShift = data2 > 0;\n break;\n }\n}", "function msg_int(v){\n if(v>=128 && v<=239){ \n counter = 0;\n midichunk = new Array();\n\t}\n if(v>=128 && v<=143) miditype = 7; //notes off <noteID&ch,note#,vel>\n if(v>=144 && v<=159) miditype = 1; //notes <noteID&ch,note#,vel>\n if(v>=160 && v<=175) miditype = 2; //after(poly)touch <polyID&ch,note#,val>\n if(v>=176 && v<=191) miditype = 3; //ctlr <ctlID&ch, cc#, val>\n if(v>=192 && v<=207) miditype = 4; //pgm ch <pgmID&ch,val>\n if(v>=208 && v<=223) miditype = 5; //ch. pressure <chprID&ch, val>\n if(v>=224 && v<=239) miditype = 6; //pitch bend <pbID&ch, msb, lsb>\n\n switch(miditype){\n case 1: //note ON\n midichunk[counter] = v;\n\t\t\tif (counter==2) {\n\t\t\t\tlog(\"noteon:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\tif (playingNote > 0 && this.patcher.getnamed('forceMono').getvalueof() > 0)\n\t\t\t\t{\t//if its in force mono mode and a note was already playing then kill it\n\t\t\t\t\toutlet(0,midichunk[0]-16); outlet(0,playingNote); outlet(0,64);\n\t\t\t\t\tlog(\"force note off:\",midichunk[0]-16,midichunk[1]);\n\t\t\t\t}\n\t\t\t\tplayingNote = midichunk[1];\n\t\t\t\tif (holdingNote == 0) \n\t\t\t\t{ //if a note isn't already being held\n\t\t\t\t\tif (pedalHeld > 0) \n\t\t\t\t\t{//if the pedal is already down and this is the next note, then hold it\n\t\t\t\t\t\tholdingNote = midichunk[1];\n\t\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,holdingNote ); outlet(0,midichunk[2]);\n\t\t\t\t\t\t//this.patcher.getnamed('holdingText').hidden = false;\n\t\t\t\t\t\tlog(\"holding note:\",midichunk[0],holdingNote);\n\t\t\t\t\t} else {//the pedal isn't down\n\t\t\t\t\t\tif (this.patcher.getnamed('toggleUnheldNotes').getvalueof() == 0 ) \n\t\t\t\t\t\t{ //if its set to play notes inbetween holders then output the note\n\t\t\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\t\t\tlog(\"playing note:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog(\"ignore\");\n\t\t\t\t\t//a note is being held. ignore this note\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n \n case 2: //after(poly)touch\n midichunk[counter] = v;\n //if (counter==2) printlet(\"aftertouch\",midichunk[1],midichunk[2]);\n counter++;\n break;\n \n case 3: //cc\n midichunk[counter] = v;\n if (counter==2) {\n //printlet(\"cc\",midichunk[1],midichunk[2]);\n }\n counter++;\n break;\n \n case 4: //pgm changes\n midichunk[counter] = v;\n if (counter==1) {\n\t\t\t\tlog(\"pgm\")\n\t\t\t\tif (0 <= midichunk[1] <= (arrMasterList.length/2 -1)) {\n\t\t\t\t\tfor (var midiByte in midichunk) outlet(0,midiByte);\n\t\t\t\t\t//currentPatch = midichunk[1]; //can cause infinte loop\n\t\t\t\t\t//Refresh();\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n \n case 5: //ch. pressure\n midichunk[counter] = v;\n //if (counter==1) printlet(\"ch. pressure\",midichunk[1]);\n counter++;\n break;\n \n case 6://pitch bend\n midichunk[counter] = v;\n //if (counter==2) printlet(\"bend\",midichunk[0]-223,midichunk[1]);\n counter++;\n break;\n \n case 7: //note OFF \n midichunk[counter] = v;\n if (counter==2) {\n\t\t\t\tlog(\"noteoff:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\tmidichunk[2] = 64; //hack:ableton only responds to nonzero but it receives as 0\n\t\t\t\tif (holdingNote == 0 && this.patcher.getnamed('toggleUnheldNotes').getvalueof() == 0)\n\t\t\t\t{ //if no note is being held then send the note off\n\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\tlog(\"note off:\",midichunk[0],midichunk[1]);\n\t\t\t\t}\n\t\t\t\tif (playingNote == midichunk[1])\n\t\t\t\t{ //if the most recently played note released then mark nothing as recent\n\t\t\t\t\toutlet(0,127+midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\tplayingNote = 0;\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n }\n}", "function on_midi_msg(event) {\n const cc = event.data[1];\n const val = event.data[2];\n\n console.log(event.data);\n\n switch (cc) {\n case 115:\n // The Command ID of a custom action that toggles the FX rack\n wwr_req('_dabc7267fcf7854e80a59865f2e6c261');\n break;\n case PLAY_CC:\n // The play button is a toggle button, so when it is\n // in active state pause the mix, otherwise play it\n if (last_transport_state & 1 > 0) {\n wwr_req(1008); // 1008 is pause, 1016 is stop if you prefer\n } else {\n wwr_req(1007);\n }\n break;\n case VOL_1_CC:\n send_trk_vol(1, val);\n break;\n case VOL_2_CC:\n send_trk_vol(2, val);\n break;\n case VOL_3_CC:\n send_trk_vol(3, val);\n break;\n case VOL_4_CC:\n send_trk_vol(4, val);\n break;\n case VOL_5_CC:\n send_trk_vol(5, val);\n break;\n case VOL_6_CC:\n send_trk_vol(6, val);\n break;\n case VOL_7_CC:\n send_trk_vol(7, val);\n break;\n case VOL_8_CC:\n send_trk_vol(8, val);\n break;\n case PREV_TRK_CC:\n wwr_req(40286);\n wwr_req('TRACK');\n break;\n case NEXT_TRK_CC:\n wwr_req(40285);\n wwr_req('TRACK');\n break;\n case MEDIA_EXPLR_CC:\n wwr_req(50124);\n break;\n case SEL_TRK_MUTE_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/MUTE/-1;TRACK/${sel_trk_idx}`);\n break;\n case SEL_TRK_SOLO_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/SOLO/-1;TRACK/${sel_trk_idx}`);\n break;\n default:\n break;\n }\n }", "function setup() {\n\n let kick = new Pizzicato.Sound('/assets/sounds/kick.wav');\n let hihat = new Pizzicato.Sound('/assets/sounds/hihat.wav');\n let snare = new Pizzicato.Sound('/assets/sounds/snare.wav');\n\n synth = new Pizzicato.Sound({\n source: 'wave',\n options: {\n type: 'sine', // This is the default anyway\n }\n });\n}", "function synthVoice(text) {\n\n // CREATE CONTEXT FOR SPEECH SYNTHESIS\n const synth = window.speechSynthesis;\n const msg = new SpeechSynthesisUtterance();\n var voices = synth.getVoices();\n\n // window.speechSynthesis.onvoiceschanged = function() {\n // voices = window.speechSynthesis.getVoices();\n // console.log(\"VOICES: \", voices);\n // };\n\n // DEFINE WHAT TEXT ZEIZA WILL BE SPEAKING\n msg.text = text;\n\n // CUSTOMIZE ZEIZA'S VOICE\n msg.voiceURI = 'Native';\n msg.volume = 1;\n msg.rate = 1;\n msg.lang = 'en-IE';\n\n synth.speak(msg);\n}", "_onWriteLine() {\n this.rl.on(\"line\", input => {\n this.client.write(input);\n });\n }", "function monoSynth() {\n userStartAudio();\n\n // let level = amplitude.getLevel();\n // let size = map(level, 0,1,0,200);\n\n if(soundLoop.isPlaying) {\n soundLoop.stop();\n } else {\n soundLoop.start();\n }\n}", "function song(time) {\n for(let sequencerIndex = 0; sequencerIndex < 3; sequencerIndex++){\n mainSynth[sequencerIndex].set({\n 'volume': (mainSequencer[sequencerIndex].polySeq[counter].length * -1.0) + mainVolumeSlider[sequencerIndex].value()\n });\n\n userSynth[sequencerIndex].set({\n 'volume': (userSequencer[sequencerIndex].polySeq[counter].length * -1.0) + userVolumeSlider[sequencerIndex].value(),\n 'envelope': {\n 'attack': attackSlider[sequencerIndex].value(),\n 'decay': decaySlider[sequencerIndex].value(),\n 'sustain': sustainSlider[sequencerIndex].value(),\n 'release': releaseSlider[sequencerIndex].value()\n }\n });\n \n mainSynth[sequencerIndex].triggerAttackRelease(mainSequencer[sequencerIndex].polySeq[counter].filter(filterUndefined), '8n', time);\n userSynth[sequencerIndex].triggerAttackRelease(userSequencer[sequencerIndex].polySeq[counter].filter(filterUndefined), '8n', time);\n }\n\n counter = (counter + 1) % 16;\n\n}", "function playNote(frequency) {\n\toscillators[frequency] = context.createOscillator();\n\toscillators[frequency].type = \"sine\";\n\toscillators[frequency].frequency.value = frequency;\n\toscillators[frequency].connect(context.destination);\n\toscillators[frequency].start(context.currentTime);\n\n}", "function simpleSynth(buf, pitch, pitchFun, formantShift, dontStart) {\n formantShift = formantShift || 1.0;\n var rate = audioCtx.sampleRate;\n var start = audioCtx.currentTime;\n var t = 0;\n var choose = 0;\n var outbuf = audioCtx.createBuffer(1, buf.length, audioCtx.sampleRate);\n var out = outbuf.getChannelData(0);\n for (var i = 0; i < pitch.length-1; i++) {\n var delta = pitch[i][1] ? 1/pitch[i][1] : Math.random() * 0.004 + 0.008;\n \n while (t < pitch[i+1][0]) {\n while (choose < t) choose += delta;\n var from = (t-delta/formantShift) * rate | 0;\n var to = (t+delta/formantShift) * rate | 0;\n for (var j = from; j < to; j++) {\n var w = (j - t*rate) / (delta*rate) * formantShift;\n w = Math.cos(w * Math.PI) * 0.5 + 0.5;\n var pos = choose * rate + (j - from) * formantShift;\n if (pos < buf.length-1) {\n var frac = pos - Math.floor(pos);\n var h = Math.floor(pos);\n out[j] += w * ((1-frac) * buf[h] + frac * buf[h+1]);\n }\n }\n if (pitch[i][1] > 1) {\n t += 1/pitchFun(pitch[i][1]);\n }\n else {\n // unvoiced\n t += delta;\n }\n }\n }\n var n = audioCtx.createBufferSource();\n n.connect(audioCtx.destination);\n n.buffer = outbuf;\n n.onended = function () {\n showProgress(\"finished\");\n };\n if (!dontStart) n.start(start);\n return n;\n}", "function handleNoteOn(key_number) {\n\tvar pitch = parseInt($(\"#lowestPitch\").val()) + key_number;\nif (pressed[pitch-21]) return;\n // Find the pitch\n const push = (amplitude, pitch, timeStamp, duration, type) => {\n recorded.push({'vol': amplitude, 'pitch': pitch, 'start': timeStamp, 'duration': duration, 'type': type})\n };\n \n var amplitude = parseInt($(\"#amplitude\").val());\n var timeStamp = performance.now()\n MIDI.noteOn(0, pitch, amplitude);\n pressed[pitch-21] = true;\n if (recording) push(amplitude, pitch, timeStamp, 0, document.getElementById(\"play-mode-major\").checked ? 1 : (document.getElementById(\"play-mode-minor\").checked ? 2 : 0));\n /*\n * You need to handle the chord mode here\n */\n if (document.getElementById(\"play-mode-major\").checked) {\n if (pitch+4 <= 108) {\n MIDI.noteOn(0, pitch + 4, amplitude);\n pressed[pitch+4-21] = true;\n if (recording) push(amplitude, pitch + 4, timeStamp, 0, 1);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 1);\n }\n } else if (document.getElementById(\"play-mode-minor\").checked) {\n if (pitch+3 <= 108) {\n MIDI.noteOn(0, pitch + 3, amplitude);\n pressed[pitch + 3-21] = true;\n if (recording) push(amplitude, pitch + 3, timeStamp, 0, 2);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 2);\n }\n }\n}", "function Sequencer() {\n this._bpm = 120;\n this._matrixNotes = 16;\n this._matrixSteps = 16;\n this._activeStep = 0;\n this._playheadTimeout = null;\n this._buttonWidth = 40;\n this._buttonMargin = 10;\n this._socket = io.connect('http://localhost:8080');\n\n this.attachSocketHandlers();\n}", "function playNote(note, duration) {\n osc.freq(midiToFreq(note));\n // Fading the tone\n osc.fade(0.5, 0.2);\n //Fading out the tone\n if (duration) {\n setTimeout(function() {\n osc.fade(0, 0.2);\n }, duration - 50);\n }\n}", "function AudioOutputStream() {\n }", "function speak(){}", "function send_motor_on_command()\n{\n\tif (ui_mode_current.prop(\"checked\")) {\n\t\tsend_torque_setpoint();\n\t\tws.setRegister(COMMAND_MOTOR, CONTROL_TORQUE);\n\t}\n\telse if (ui_mode_speed_notorque.prop(\"checked\")) {\n\t\tsend_torque_setpoint();\n\t\tws.setRegister(COMMAND_MOTOR, CONTROL_SPEED_WITHOUT_TORQUE);\n\t}\n\telse {\n\t\tws.setRegister(COMMAND_MOTOR, CONTROL_SPEED);\n\t}\n\tws.queryRegister(REG_MODE);\n}", "function onSysex0(data) {\n // MMC Transport Controls:\n switch (data) {\n case \"f07f7f0605f7\":\n transport.rewind();\n break;\n case \"f07f7f0604f7\":\n transport.fastForward();\n break;\n case \"f07f7f0601f7\":\n transport.stop();\n break;\n case \"f07f7f0602f7\":\n transport.play();\n break;\n case \"f07f7f0606f7\":\n transport.record();\n break;\n //using MMC code for \"record exit\" on the \"loop\" button\n case \"f07f7f0607f7\":\n transport.isClipLauncherOverdubEnabled().toggle()\n break;\n }\n}", "function sendNote(noteValue, channel) {\n if (checkConnection()) {\n output.send([0x90 + parseInt(channel - 1), noteValue, 0x7f]);\n output.send([0x80 + parseInt(channel - 1), noteValue, 0x40], window.performance.now() + 1000.0);\n // note off delay: now + 1000ms\n }\n}", "function SynthesizeSpeechCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function playNote(delay, duration, pitch){\n var startTime = audioContext.currentTime + delay;\n\n var oscillator = audioContext.createOscillator();\n oscillator.type = 'sine';\n oscillator.frequency.value = pitch;\n oscillator.connect(audioContext.destination);\n oscillator.start(startTime);\n oscillator.stop(startTime + (duration/1000));\n}", "function BasicSynthWrapper(synth, addFx = false) {\n\tthis.synth = synth;\n\tthis.addFx = addFx;\n\tthis.collide = (note = \"C1\", duration = \"8n\", time = Tone.now(), vel = 0.5, height = -1) => { \n\t\tthis.synth.triggerAttackRelease(note, duration, time, vel)\n\t}\n}", "function onMidi(status, data1, data2) {\n printMidi(status, data1, data2);\n for (i = 0; i < midiListeners.length; i++) {\n midiListeners[i](status, data1, data2);\n }\n}", "function playNote(audioID, action) {\n $('#' + audioID).jWebAudio('play');\n\n\tvar sustain = currInstrument == 'marimba' ? 1600 : 6000;\n\tif (action == 'playthrough'){\n \tsetTimeout(function(){\n \t\tstopNote(audioID);\n \t}, sustain);\n\t}\n}", "function speak(text){\n //micInstance.stop();\n var params = {\n text: text,\n voice: config.TextToSpeech.voice,\n accept: 'audio/wav'\n };\n /* Streaming the resulting audio to file and play the file using aplay */\n text_to_speech.synthesize(params).pipe(fs.createWriteStream('output.wav')).on('close', function() {\n var create_audio = exec('aplay output.wav', function(error, stdout, stderr) {\n if (error !== null) {\n console.log('Error occurred while playing back: ' + error);\n }\n });\n });\n}", "function playRandomNote() {\r\n playSound(newFreq);\r\n}", "function playNote(num, note, duration) {\n console.log('Playing ', note);\n osc.freq(midiToFreq(note));\n // fade it in\n osc.fade(0.5, 0.2);\n // // fade it out\n if (duration) {\n setTimeout(function() {\n osc.fade(0, 0.2);\n }, duration - 50);\n }\n if (num < generated_length-1) {\n setTimeout(function() {\n //play from midi note num\n playNote(num + 1, notes[num + 1], noteDuration);\n }, noteDuration);\n }\n}", "function start(client, mud, session) {\n // Make sure the client is paused while we setup the pipelines\n client.pause();\n\n // The session needs a handle directly to the mudsock so it can write raw\n // data directly to the mud from scripts\n session._out = mud;\n\n let telinp1 = new TelnetStream(client);\n let telinp2 = new TelnetStream(mud);\n\n let triggers = new TriggerStream(session);\n let aliases = new AliasStream(session);\n\n mud.pipe(telinp1).pipe(triggers).pipe(client);\n client.pipe(telinp2).pipe(aliases).pipe(mud);\n\n }", "function testOutput(outputType, outputNo) {\n if (outputType == controlEnum.cv) {\n var ctlType = parseInt(document.getElementById(\"cType\" + outputNo).value);\n\n switch (ctlType) {\n case cvEnum.controller:\n var channel = document.getElementById(\"cChannel\" + outputNo).value;\n var controller = document.getElementById(\"cController\" + outputNo).value;\n for (var o = 0; o < 128; o++) {\n output.send([0xB0 + parseInt(channel - 1), controller, o], window.performance.now() + (o * 5));\n }\n break;\n\n case cvEnum.pitchbend:\n break;\n\n case cvEnum.aftertouch:\n var channel = document.getElementById(\"cChannel\" + outputNo).value;\n for (var o = 0; o < 128; o++) {\n output.send([0xD0 + parseInt(channel - 1), o], window.performance.now() + (o * 5));\n }\n break;\n }\n\n } else {\n var ctlType = parseInt(document.getElementById(\"gType\" + outputNo).value);\n\n switch (ctlType) {\n case gateEnum.specificNote:\n var channel = document.getElementById(\"gChannel\" + outputNo).value;\n var note = document.getElementById(\"gNote\" + outputNo).value;\n output.send([0x90 + parseInt(channel - 1), note, 0x7f]);\n // send each note on command after each interval\n output.send([0x80 + parseInt(channel - 1), note, 0x40], window.performance.now() + 500);\n // send off notes 50ms before next note\n break;\n case gateEnum.clock:\n break;\n }\n }\n\n // to test MIDI channel send sequence of notes\n if ((outputType == controlEnum.cv && ctlType == cvEnum.channel) || outputType == controlEnum.gate && ctlType == gateEnum.channelNote) {\n var channel = document.getElementById(\"cChannel\" + outputNo).value;\n // send out C1 to C7\n var interval = 500.0;\n // interval between each note\n for (var o = 0; o < 7; o++) {\n output.send([0x90 + parseInt(channel - 1), 24 + (o * 12), 0x7f], window.performance.now() + (o * interval));\n // send each note on command after each interval\n output.send([0x80 + parseInt(channel - 1), 24 + (o * 12), 0x40], window.performance.now() + (o * interval) + (interval - 50));\n // send off notes 50ms before next note\n }\n }\n}", "coolantMistOn() {\n this.sendMessage('command', this.options.port, 'gcode', 'M7');\n }", "function play() {\n //unmute\n loops.forEach(x => (x.mute = false));\n\n if (pickedGlyphs[0] && idList[0] == myId) {\n loops[0] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(0), 2);\n }, \"4m\").start();\n }\n\n if (pickedGlyphs[1] && idList[1] == myId) {\n loops[1] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(1), 2);\n }, \"4m\").start();\n }\n if (pickedGlyphs[2] && idList[2] == myId) {\n loops[2] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(2), 1);\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+2m\");\n }, \"5m\").start();\n }\n if (pickedGlyphs[3] && idList[3] == myId) {\n loops[3] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(3), 1);\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+1m\");\n }, \"4m\").start();\n }\n if (pickedGlyphs[4] && idList[4] == myId) {\n loops[4] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(4), 1);\n synth.triggerAttackRelease(Nexus.note(0), 1, \"+1m\");\n }, \"5m\").start();\n }\n if (pickedGlyphs[5] && idList[5] == myId) {\n loops[5] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(5), 1);\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+1m\");\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+2m\");\n }, \"4m\").start();\n }\n if (pickedGlyphs[6] && idList[6] == myId) {\n loops[6] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(6), 1);\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+1m\");\n synth.triggerAttackRelease(Nexus.note(2), 1, \"+2m\");\n }, \"5m\").start();\n }\n if (pickedGlyphs[7] && idList[7] == myId) {\n loops[7] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(7), 1);\n synth.triggerAttackRelease(Nexus.note(5), 1, \"+4n\");\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+8n\");\n }, \"4m\").start();\n }\n if (pickedGlyphs[8] && idList[8] == myId) {\n loops[8] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(8), 1);\n synth.triggerAttackRelease(Nexus.note(7), 1, \"+1m\");\n synth.triggerAttackRelease(Nexus.note(6), 1, \"+2n\");\n }, \"5m\").start();\n }\n if (pickedGlyphs[9] && idList[9] == myId) {\n loops[9] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(9), 1);\n synth.triggerAttackRelease(Nexus.note(5), 1, \"+8n\");\n // synth.triggerAttackRelease(Nexus.note(2), 1, \"+2n\");\n }, \"1m\").start();\n }\n if (pickedGlyphs[10] && idList[10] == myId) {\n loops[10] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(11), 1);\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+8n\");\n }, \"1m\").start();\n }\n if (pickedGlyphs[11] && idList[11] == myId) {\n loops[11] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(9), 1);\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+16n\");\n }, \"2n\").start();\n }\n if (pickedGlyphs[12] && idList[12] == myId) {\n loops[12] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(2), 1);\n synth.triggerAttackRelease(Nexus.note(4), 1, \"+8n\");\n synth.triggerAttackRelease(Nexus.note(6), 1, \"+1m\");\n }, \"2m\").start();\n }\n if (pickedGlyphs[13] && idList[13] == myId) {\n loops[13] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(7), 1);\n synth.triggerAttackRelease(Nexus.note(4), 1, \"+8n\");\n synth.triggerAttackRelease(Nexus.note(2), 1, \"+1m\");\n }, \"2m\").start();\n }\n if (pickedGlyphs[14] && idList[14] == myId) {\n loops[14] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(8), 1);\n synth.triggerAttackRelease(Nexus.note(5), 1, \"+8n\");\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+1m\");\n }, \"3m\").start();\n }\n if (pickedGlyphs[15] && idList[15] == myId) {\n loops[15] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(8), 1);\n synth.triggerAttackRelease(Nexus.note(5), 1, \"+1m\");\n synth.triggerAttackRelease(Nexus.note(1), 1, \"+2m\");\n }, \"2m\").start();\n }\n if (pickedGlyphs[16] && idList[16] == myId) {\n loops[16] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(6), 1);\n synth.triggerAttackRelease(Nexus.note(4), 1, \"+8n\");\n synth.triggerAttackRelease(Nexus.note(2), 1, \"+4n.\");\n }, \"4m\").start();\n }\n if (pickedGlyphs[17] && idList[17] == myId) {\n loops[17] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(6), 1);\n synth.triggerAttackRelease(Nexus.note(2), 1, \"+4n.\");\n synth.triggerAttackRelease(Nexus.note(4), 1, \"+8n\");\n }, \"1m.\").start();\n }\n if (pickedGlyphs[18] && idList[18] == myId) {\n loops[18] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(11), 1);\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+8n.\");\n }, \"2m\").start();\n }\n if (pickedGlyphs[18] && idList[18] == myId) {\n loops[18] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(11), 1);\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+8n.\");\n }, \"3m\").start();\n }\n if (pickedGlyphs[19] && idList[19] == myId) {\n loops[19] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(10), 1);\n synth.triggerAttackRelease(Nexus.note(2), 1, \"+8n\");\n }, \"4m\").start();\n }\n if (pickedGlyphs[20] && idList[20] == myId) {\n loops[20] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(10), 1);\n synth.triggerAttackRelease(Nexus.note(3), 1, \"+8n\");\n }, \"5m\").start();\n }\n if (pickedGlyphs[21] && idList[21] == myId) {\n loops[21] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(9), 1);\n synth.triggerAttackRelease(Nexus.note(4), 1, \"+8n\");\n }, \"6m\").start();\n }\n if (pickedGlyphs[22] && idList[22] == myId) {\n loops[22] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(5), 1);\n }, \"1m\").start();\n }\n if (pickedGlyphs[23] && idList[23] == myId) {\n loops[23] = new Tone.Loop(time => {\n synth.triggerAttackRelease(Nexus.note(11), 1);\n }, \"1m\").start();\n }\n}", "write() {\n const toWrite = this.machineTable[this.state][this.lastRead].write;\n\n this.tape[this.y][this.x] = toWrite;\n }", "function sendSeq(deviceName, commandID) {\n Scheduler.queue(\"sequence\", deviceName, commandID);\n}", "play() {\n const music = {\n uuid: this.uuid,\n instrument: this.instrument,\n sound: this.music,\n };\n\n const payload = Buffer.from(JSON.stringify(music));\n\n // Send payload\n socket.send(payload, 0, payload.length, protocol.PROTOCOL_PORT,\n protocol.PROTOCOL_MULTICAST_ADDRESS, () => {\n console.log(`Sending payload: ${payload}\\nvia port ${socket.address().port}.`);\n });\n }", "function onSysex0(data) {\n // MMC Transport Controls:\n switch (data) {\n case \"f07f7f0605f7\":\n transport.rewind();\n break;\n case \"f07f7f0604f7\":\n transport.fastForward();\n break;\n case \"f07f7f0601f7\":\n transport.stop();\n break;\n case \"f07f7f0602f7\":\n transport.play();\n break;\n case \"f07f7f0606f7\":\n transport.record();\n break;\n }\n}", "function payChord(chord_id) {\n\n if (chord_id == \"cmaj\") {\n\n //set note duration\n notes[12].currentTime = note_duration;\n notes[4].currentTime = note_duration;\n notes[7].currentTime = note_duration;\n\n //Play a combination of notes\n notes[12].play();\n notes[4].play();\n notes[7].play();\n\n\n } else if (chord_id == \"fmaj_7\") {\n\n notes[5].currentTime = note_duration;\n notes[9].currentTime = note_duration;\n notes[0].currentTime = note_duration;\n notes[6].currentTime = note_duration;\n\n notes[0].play();\n notes[9].play();\n notes[0].play();\n notes[16].play();\n\n } else if (chord_id == \"amin\") {\n\n notes[9].currentTime = note_duration;\n notes[12].currentTime = note_duration;\n notes[4].currentTime = note_duration;\n\n notes[9].play();\n notes[12].play();\n notes[4].play();\n\n } else if (chord_id == \"gmaj\") {\n\n notes[7].currentTime = note_duration;\n notes[11].currentTime = note_duration;\n notes[2].currentTime = note_duration;\n notes[19].currentTime = note_duration;\n\n notes[7].play();\n notes[11].play();\n notes[2].play();\n notes[19].play();\n\n } else if (chord_id == \"emin_7\") {\n\n notes[7].currentTime = note_duration;\n notes[11].currentTime = note_duration;\n notes[14].currentTime = note_duration;\n notes[4].currentTime = note_duration;\n\n notes[7].play();\n notes[11].play();\n notes[14].play();\n notes[4].play();\n\n } else if (chord_id == \"dmin\") {\n\n notes[2].currentTime = note_duration;\n notes[5].currentTime = note_duration;\n notes[9].currentTime = note_duration;\n\n notes[2].play();\n notes[5].play();\n notes[9].play();\n\n }\n}", "function stageOneMusic () {\n Clock.rate = 0.6\n\n a = EDrums('x...ox.x....o...')\n a.snare.snappy = 1.5\n a.kick.decay = 0.3\n a.amp = 2\n\n b = Synth({ maxVoices:4, waveform:'Saw', attack:ms(200), decay:ms(3000) })\n c = FM('bass',{decay:ms(200)})\n\n score = Score([\n 0, c.note.score( [],2 ),\n measures(1), function() {\n b.amp = 0.2\n c.amp = 2\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(4), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n c.note.seq(['c2','c3','a#3','c3','f3','g3','a#2','c2'], [2/16,2/16,1/16,3/16,1/16,1/16,1/16,5/16])\n },\n ]).start()\n}", "function toggleNote() {\n if ($('#playNoteToggle').html()[0] == \"▶\") {\n synth.playFreq(0, res.hertz, organ);\n $('#playNoteToggle').html(\"■ Stop note\");\n }\n else {\n stopNoteIfActive();\n }\n}", "function writePause (){\n\t\n// if ( beat === measure){\n// beat = 0;\n// melodyArray.push(\"|\");\n// column++;\n//\t \n// if ( column === 4){\n//\t\t\t\n// melodyArray.push(\"\\n\");\n// column = 0;\n// }\n// }\n\n\t\n\tif ( canWritePause && canTranscribe){\n// console.log(\"writing a pause\");\n\tmelodyArray.push(\"z1\"); \n\ttimingArray.push(1);\n\tnoteNameArray.push(\"z\");\n\t\n\t\n\t}\n}", "noteOn(note, velocity) {\n this.note = note;\n\n // setting the frequency\n let noteDelta = this.pitchBendRange * this.pitchBendValue;\n this.operators.forEach((op, index) => {\n let freq = frequencyFromMidi(note + noteDelta) * (1 + this.detune * this.detuneScale[index]);\n let f = op.source.parameters.get('frequency');\n f.linearRampToValueAtTime(freq, this.audioContext.currentTime + this.glideTime);\n });\n\n // triggering the envelopes\n this.outEnv.noteOn(this.maxOutputGain, velocity);\n for (let i = 1; i < 4; i++) { // the first operator's envelope isn't triggered\n this.operatorsEnv[i].noteOn(this.operatorsEnvAmount[i], 127);\n }\n }", "function sendAplay2HumixSpeech( file ) {\n if( hs ) {\n hs.play(file);\n }\n}", "function sendDatCommand(data) {\n console.log( Date(Date.now()) + \" Sending command: /serverMessageDatCommand/\" + data.behaviour + \"->\" + data.name + \": \" + data.value);\n behaviourOscClient.send('/serverMessageDatCommand/' +data.behaviour +\" \" + data.name + \" \" + data.value);\n\n // don't need to sync clients b/c this was a function call, not an update.\n }", "function playTone(key) {\n\t\t\t// Set frequency\n\t\t\tvar frequencyHz = notes[key] || 440;\n\n\t\t\t// Connect oscillator to output.\n\t\t\toscillator = audioCtx.createOscillator();\n\t\t\toscillator.frequency.value = frequencyHz;\n\t\t\toscillator.connect(gain); // from oscillator.connect(audioCtx.destination);\n\t\t\toscillator.start();\n\t\t}", "function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}", "function Transcribe(note , duration) {\n\tif (canTranscribe) {\n\t// inserire pezzo come contenitore per l'output\n\t\t\n\t\tmelodyArray.push(transcription_map[note] + duration);\n\t\ttimingArray.push(duration);\n\t\tnoteNameArray.push(transcription_map[note]);\n\t\t\n\t\tvar tune = transcription_map[note];\n\t\t// console.log(\"Sto Trascrivendo una nota:\", tune);\n\t\t\n\t}\n}", "function HandleMIDI(event)\n{\n\n //Here we filter incoming note messages\n if (event instanceof NoteOn) { \n\n if(voiceCounter === GetParameter(\"Voice Index\") - 1){\n heldNotes[event.pitch] = true;\n event.send();\n }\n voiceCounter++;\n voiceCounter %= GetParameter(\"Group Polyphony\");\n }\n \n //If we get a 'note off' message that this voice is holding, turn it off. \n else if(event instanceof NoteOff) {\n\n //Listen for MIDI Note 0 to reset the voiceCounter if needed\n if(event.pitch === 0){\n voiceCounter = 0;\n }\n\n if(event.pitch in heldNotes) {\n event.send();\n delete heldNotes[event.pitch];\n }\n }\n \n //pass all other MIDI through\n else {\n event.send();\n } \n \n}", "_respondsToChanged(newValue,oldValue){// remove all as our voice changed\nif(this.annyang){this.annyang.removeCommands()}var commands={};for(var i in this.commands){if(i.replace(oldValue,newValue)!==i){commands[i.replace(oldValue,newValue)]=this.commands[i]}else{commands[i]=this.commands[i]}}this.set(\"commands\",commands)}" ]
[ "0.632904", "0.6183572", "0.6147109", "0.6067324", "0.59835654", "0.5917651", "0.59020144", "0.5870789", "0.5868602", "0.58533233", "0.5818", "0.5776972", "0.57464194", "0.5691697", "0.5684632", "0.56511664", "0.56489295", "0.55789477", "0.55648226", "0.55604744", "0.55288064", "0.5515591", "0.5476066", "0.54737985", "0.5423185", "0.5421456", "0.5417856", "0.53889805", "0.53839725", "0.537835", "0.5365229", "0.53304076", "0.5323454", "0.5322856", "0.532059", "0.53084683", "0.5295817", "0.52909184", "0.5280118", "0.52752763", "0.5254181", "0.5252071", "0.52518606", "0.5241874", "0.5235256", "0.5225114", "0.5224418", "0.52147067", "0.52077633", "0.52076703", "0.5201806", "0.5200077", "0.5198408", "0.5198408", "0.51896477", "0.5189165", "0.5188712", "0.5171238", "0.5158139", "0.5157767", "0.51576287", "0.5154705", "0.5149627", "0.5149245", "0.5147111", "0.5145558", "0.5144775", "0.51436466", "0.51360613", "0.5132441", "0.51306725", "0.51061726", "0.50970787", "0.5092219", "0.5091494", "0.50835645", "0.50810266", "0.5077197", "0.5075455", "0.5073737", "0.50676805", "0.5064056", "0.5059118", "0.5043028", "0.5037008", "0.50360155", "0.50349134", "0.5033995", "0.50324565", "0.5026172", "0.5024871", "0.5011671", "0.50100774", "0.50090945", "0.5008028", "0.50079715", "0.5007918", "0.50059927", "0.50008684", "0.4987561" ]
0.50105923
92
end of Track object class
function MidiMessage( event_name, data1, data2, user_delta, user_channel){ //user channel number from 0 to 15 no string, integer please this.hex; this.messageLength; var _delta="00"; var _channel="0"; var _data1def="3c";//default middle C decimal 60 var _data2def="7f"; //default velocity d 127 if(user_delta){ _delta=user_delta; } if(user_channel){ if(user_channel<0||user_channel>15){ console.log(user_channel+" Its not a correct channel (1-16"); } else{ _channel=(user_channel-1).toString(16); } } if(data1){ if(data1<0||data1>127){ console.log(data1+" It's not a correct note number 0-127// in decimal") } else{ _data1def=data1.toString(16); } } else{ console.log("please, define the data1 value"); } if(data2){ if(data2<0||data2>127){ console.log(data1+" It's not a correct velocity value number 0-127// in decimal") } else{ _data2def=data2.toString(16); } } else{ console.log("please, define the data2 value"); } //event executions if(event_name==="noteOn"){//noteOn midi message var _noteOn=_delta+"9"+_channel+_data1def+_data2def;//data1- note number this.hex=_noteOn;//data2- velocity this.messageLength=4;// this event is 4 byte long } if (event_name==="noteOff") {//noteOff midi message var _noteOff=_delta+"8"+_channel+_data1def+_data2def;//data1-note number this.hex=_noteOff; //ata2 -velocity of key release this.messageLength=4; } if (event_name==="endTrack"){ var _fin_track="01ff2f00"; this.hex=_fin_track; //ata2 -velocity of key release this.messageLength=4; } /*if (event_name==="key"){ var _key=_delta+"ff590200";//event name //control of the key signature-- in decimals 0 == no accidents // negative numbers, number of flats-- -2 === 2 flats //positive numbers, number of sharps in the equal tonal mode var _accidents= this.hex=_key+hex_accidents; //revisar con el pdf//////////////////////////// this.messageLength=6; } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Track() {}", "function MasterTrack() {}", "function Track(o)\r\n{\r\n\tthis.nodename = \"\"; //nodename\r\n\tthis.property = \"\"; //property\r\n\tthis.duration = 0; //length of the animation\r\n\tthis.value_size = 0; //how many numbers contains every sample of this property\r\n\tthis.data = null;\r\n\r\n\tif(o)\r\n\t\tthis.configure(o);\r\n}", "function Track(title, rating, length) {\n this.title = title;\n this.rating = rating;\n this.length = length;\n}", "function trackEnd(){\n}", "getTracks(){\r\n return this.tracks;\r\n }", "addTrack(track){\r\n this.tracks.push(track);\r\n \r\n }", "function Take(o)\r\n{\r\n\tthis.tracks = [];\r\n\tthis.duration = 0;\r\n}", "get trackOffset() {\n return this._trackOffset;\n }", "get currentTrack() {\n // XXX: no logging here for performance reasons.\n return this._currentTrack;\n }", "addTrack(albumName, params) {\n let aTrack = new track.Track( params.name, params.duration, params.genres);\n let aAlbum = this.getAlbumByName(albumName);\n aAlbum.tracks.push( aTrack );\n /* El objeto track creado debe soportar (al menos) las propiedades:\n name (string),\n duration (number),\n genres (lista de strings)\n */\n }", "getCurrentTrack() {\n this.mopidyCall('playback','getCurrentTrack',{},(d) => {\n this.currentTrack = d;\n this.title = d.name;\n });\n }", "constructor() {\r\n this._componentsTracked = [];\r\n\r\n this.play = null;\r\n this.entities = [];\r\n }", "function getTrack() {\n return tdInstance.track();\n }", "function TrackEvent( track ) {\n Abstract.put.call( this, track );\n }", "function newTrack() {\r\n smf = new JZZ.MIDI.SMF(0, config.ticks_per_quarter_note); // type 0, 192 ticks per quarter note\r\n trk = new JZZ.MIDI.SMF.MTrk();\r\n smf.push(trk);\r\n recording = true;\r\n trk.add(0, JZZ.MIDI.smfSeqName('Drumlog'))\r\n .add(0, JZZ.MIDI.smfBPM(120));\r\n \r\n startTime = new Date().getTime();\r\n}", "sendMusic (state,obj){\n state.tracks.tracks=[obj];\n }", "constructor() { \n \n TrackableCount.initialize(this);\n }", "static receiveTracks(data) {\n return {\n type: this.FETCH_TRACKS,\n status: 'success',\n tracks: data.tracks || []\n };\n }", "function TrackCollection(player, job)\n{\n var me = this;\n //console.log(player);\n this.player = player;\n this.job = job;\n this.tracks = [];\n\n this.onnewobject = [];\n\n player.onupdate.push(function() {\n me.update(player.frame);\n });\n\n /*player.onpause.push(function() {\n for (var i in me.tracks)\n {\n me.tracks[i].recordposition();\n }\n });*/\n\n // if the window moves, we have to update boxes\n $(window).resize(function() {\n me.update(me.player.frame);\n });\n\n /*\n * Creates a new object.\n */\n this.add = function(frame, position, color)\n {\n var track = new Track(this.player, color, position);\n this.tracks.push(track);\n\n console.log(\"Added new track\");\n\n for (var i = 0; i < this.onnewobject.length; i++)\n {\n console.log(onnewobject[i]);\n this.onnewobject[i](track);\n }\n\n return track;\n }\n\n /*\n * Changes the draggable functionality. If true, allow dragging,\n * otherwise disable.\n */\n this.draggable = function(value)\n {\n for (var i in this.tracks)\n {\n this.tracks[i].draggable(value);\n }\n }\n\n /*\n * Changes the resize functionality. If true, allow resize, otherwise disable.\n */\n this.resizable = function(value)\n {\n for (var i in this.tracks)\n {\n this.tracks[i].resizable(value);\n }\n }\n\n /*\n * Changes the visibility on the boxes. If true, show boxes, otherwise hide.\n */\n this.visible = function(value)\n {\n for (var i in this.tracks)\n {\n this.tracks[i].visible(value);\n }\n }\n\n /*\n * Changes the opacity on the boxes.\n */\n this.dim = function(value)\n {\n for (var i in this.tracks)\n {\n this.tracks[i].dim(value);\n }\n }\n\n this.drawingnew = function(value)\n {\n for (var i in this.tracks)\n {\n this.tracks[i].drawingnew = value;\n }\n }\n\n\tthis.merge = function(track1, track2){\n\t\tconsole.log(track1 + track1);\n\t}\n\n var linear = function (anno1, anno2){\n\n var coordinateX_1 = [], coordinateY_1 = [];\n var boxArea = [];\n for (var i in anno1){\n if( (anno1[i].occluded == false) && (anno1[i].outside == false)){\n var midx = (parseInt(anno1[i].xtl) + parseInt(anno1[i].xbr)) / 2.0;\n var midy = (parseInt(anno1[i].ytl) + parseInt(anno1[i].ybr)) / 2.0;\n var area = (parseInt(anno1[i].xbr) - parseInt(anno1[i].xtl)) * (parseInt(anno1[i].ybr) - parseInt(anno1[i].ytl));\n var tempX = [i, midx];\n var tempY = [i, midy];\n var tempArea = [i, area];\n //console.log(temp);\n coordinateX_1.push(tempX);\n coordinateY_1.push(tempY);\n boxArea.push(tempArea);\n }\n }\n //console.log(\"X array \" + coordinateX_1);\n //console.log(\"Y array \" + coordinateY_1);\n\n /*var regressionX_1 = methods.linear(coordinateX_1, { order: 2, precision: 2, period: null });\n var regressionY_1 = methods.linear(coordinateY_1, { order: 2, precision: 2, period: null });\n\n console.log(regressionX_1);\n console.log(regressionY_1);*/\n\n\n\n //var coordinateX_2 = [], coordinateY_2 = [];\n for (var i in anno2){\n if( (anno2[i].occluded == false) && (anno2[i].outside == false)){\n var midx = (parseInt(anno2[i].xtl) + parseInt(anno2[i].xbr)) / 2.0;\n var midy = (parseInt(anno2[i].ytl) + parseInt(anno2[i].ybr)) / 2.0;\n var area = (parseInt(anno2[i].xbr) - parseInt(anno2[i].xtl)) * (parseInt(anno2[i].ybr) - parseInt(anno2[i].ytl));\n var tempX = [i, midx];\n var tempY = [i, midy];\n var tempArea = [i, area];\n //console.log(temp);\n //coordinateX_2.push(tempX);\n //coordinateY_2.push(tempY);\n\n coordinateX_1.push(tempX);\n coordinateY_1.push(tempY);\n boxArea.push(tempArea);\n }\n }\n //console.log(\"X array \" + coordinateX_1);\n //console.log(\"Y array \" + coordinateY_1);\n\n /*\n var regressionX_2 = methods.linear(coordinateX_2, { order: 2, precision: 2, period: null });\n var regressionY_2 = methods.linear(coordinateY_2, { order: 2, precision: 2, period: null });\n console.log(regressionX_2);\n console.log(regressionY_2);*/\n\n\n\n var regressionX_1 = methods.linear(coordinateX_1, { order: 4, precision: 3, period: null });\n var regressionY_1 = methods.linear(coordinateY_1, { order: 4, precision: 3, period: null });\n var regression_area = methods.linear(boxArea, { order: 4, precision: 3, period: null });\n\n if (regressionX_1.r2 > 0.5 && regressionY_1.r2 > 0.5 && regression_area.r2 > 0.5){\n //caseMerge2++;\n console.log(regressionX_1);\n console.log(regressionY_1);\n console.log(regression_area);\n return 1;\n }\n return 0;\n\n }\n\n\n\tvar mergeFunc = function (track1, track2){\n\t\tconsole.log(me.tracks);\n\n\t console.log(me.tracks[track1].journal.annotations);\n\t\tconsole.log(me.tracks[track2].journal.annotations);\n\n\t\tvar anno1 = Object.keys(me.tracks[track1].journal.annotations);\n\t\tvar anno2 = Object.keys(me.tracks[track2].journal.annotations);\n\n\t\tvar track1start = parseInt(anno1[1]);\n\t\tvar track2start = parseInt(anno2[1]);\n\n //console.log(me.tracks[track1].journal.annotations);\n //console.log(anno1);\n\n\n\t\tif (track1start < track2start){\n\t\t\tconsole.log(\"track\" + track1 + \" is going to merge track\" + track2 + \"...\" );\n\t\t\tfor(var frameNum in anno2){\n\t\t\t\tif (anno1.includes(parseInt(anno2[frameNum]).toString()) || anno1.includes((parseInt(anno2[frameNum])+1).toString()) ||\n anno1.includes((parseInt(anno2[frameNum])+2).toString()) || anno1.includes((parseInt(anno2[frameNum])+3).toString()) ||\n anno1.includes((parseInt(anno2[frameNum])-1).toString()) || anno1.includes((parseInt(anno2[frameNum])-2).toString()) ||\n anno1.includes((parseInt(anno2[frameNum])-3).toString()) )\n\t\t\t\t{\n\t\t\t\t\tconsole.log(\"annotations is within blow radius ... abandon\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tconsole.log(\"merging ...\");\n\t\t\t\t\tconsole.log(anno2[frameNum]);\n me.tracks[track1].journal.annotations[anno2[frameNum]] = me.tracks[track2].journal.annotations[anno2[frameNum]];\n console.log(me.tracks[track2].journal.annotations[anno2[frameNum]]);\n\t\t\t\t\t// wait for implemntation, done\n\t\t\t\t}\n\t\t\t}\n console.log(me.tracks[track1].journal.annotations);\n\t\t\tme.tracks[track2].remove(); // remove track2\n\t\t\tconsole.log(me.tracks[track2]);\n //me.tracks.splice(track2, 1);\n\t\t}\n\n\t\telse {\n\t\t\tconsole.log(\"track\" + track2 + \" is going to merge track\" + track1 + \"...\" );\n for(var frameNum in anno1){\n if (anno2.includes(parseInt(anno1[frameNum]).toString()) || anno2.includes((parseInt(anno1[frameNum])+1).toString()) ||\n anno2.includes((parseInt(anno1[frameNum])+2).toString()) || anno2.includes((parseInt(anno1[frameNum])+3).toString()) ||\n anno2.includes((parseInt(anno1[frameNum])-1).toString()) || anno2.includes((parseInt(anno1[frameNum])-2).toString()) ||\n anno2.includes((parseInt(anno1[frameNum])-3).toString()))\n {\n console.log(\"annotations is within blow radius ... abandon\");\n }\n else{\n console.log(\"merging ...\");\n console.log(anno1[frameNum]);\n me.tracks[track2].journal.annotations[anno1[frameNum]] = me.tracks[track1].journal.annotations[anno1[frameNum]];\n console.log(me.tracks[track1].journal.annotations[anno1[frameNum]]);\n // wait for implemntation, done\n }\n }\n console.log(me.tracks[track2].journal.annotations);\n me.tracks[track1].remove(); // remove track1\n console.log(me.tracks[track1]);\n //me.tracks.splice(track1, 1);\n\t\t}\n }\n\n this.mergeEventDetect1 = function(frame, i, j){\n //console.log(frame);\n if(stageButton == 1){\n //stage ++;\n stageButton = 0;\n //$(\"#nextStage\").empty();\n $(\"#nextStage\").click(function() {\n stageButton = 1;\n stage ++;\n console.log(\"test\" + stage);\n console.log(frame);\n\n $(this).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n\n $(\"#mergeTable\").empty();\n $(\"#stageText\").text(\"STAGE2 : Same object? Press \\\"Merge\\\" button to merge them. (\" + caseMerge2 + \" cases detected.)\");\n mergeLog = {};\n me.player.seek(0);\n //me.player.play();\n\n }).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n }\n\n if(this.tracks[i].estimate(frame).outside != true && this.tracks[j].estimate(frame).outside != true && (this.tracks[i].label == this.tracks[j].label)){\n var overlap = this.overlapRatio(parseInt(this.tracks[i].estimate(frame).xtl),\n parseInt(this.tracks[i].estimate(frame).ytl),\n parseInt(this.tracks[i].estimate(frame).xbr),\n parseInt(this.tracks[i].estimate(frame).ybr),\n parseInt(this.tracks[j].estimate(frame).xtl),\n parseInt(this.tracks[j].estimate(frame).ytl),\n parseInt(this.tracks[j].estimate(frame).xbr),\n parseInt(this.tracks[j].estimate(frame).ybr)\n );\n //console.log(overlap);\n\n if(overlap>0.5 && overlap<1 && mergeLog[i.toString()+\"_\"+j.toString()] != 1 && mergeLog[j.toString()+\"_\"+i.toString()] != 1){ // consider as the same object, ask if to merge\n\n\n $(\"#stageText\").text(\"STAGE1 : Same object? Press \\\"Merge\\\" button to merge them. (\" + caseMerge1 + \" cases detected.)\");\n\n mergeLog[i.toString()+\"_\"+j.toString()] = 1; // avoid repeat\n\n console.log(overlap);\n console.log(this.tracks[i].label);\n console.log(this.tracks[j].label);\n console.log(this.tracks[i].estimate(frame));\n console.log(this.tracks[j].estimate(frame));\n console.log(frame);\n\n var buttonID = \"track\" + i.toString() + \"_\" + j.toString(); // track1_5\n\n var toFrame = \"To\" + frame;\n\n var frameURL = job.frameurl(frame);\n //console.log(frameURL);\n\n var track1Img = frame+\"_\"+i.toString();\n var track2Img = frame+\"_\"+j.toString();\n\n if(caseMerge1 %2 == 0){\n merge1ID = \"merge\" + (caseMerge1/2).toString();\n $(\"#mergeTable\").append(\"<tr id=\\\"\" + merge1ID + \"\\\" style= \\\"height : 100px; \\\"></tr>\");\n }\n\n //$(\"#mergeTable\").append(\"<tr id=\\\"\" + merge1ID + \"\\\" style= \\\"height : 100px; \\\"></tr>\");\n\n\n\n\n $(\"#\" + merge1ID ).append(\"<td>\" + job.labels[this.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + track1Img +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n $(\"#\" + merge1ID ).append(\"<td>\" + job.labels[this.tracks[j].label] + (parseInt(j)+1).toString() + \"<div id=\\\"\" + track2Img +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n\n //$(\"#\" + buttonID + \"frame\"+ frame ).append(\"<td border=\\\"0\\\"><div class='button' id='\"+ toFrame +\"' style = \\\"margin-top : 0\\\">\" + toFrame + \"</div></td>\");\n\n $(\"#\" + merge1ID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>\" + toFrame + \"</button> <button id='\"+buttonID+\"_\"+frame+\"''>Merge</button></div></td>\");\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(frame).xbr) - parseInt(this.tracks[i].estimate(frame).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(frame).ybr) - parseInt(this.tracks[i].estimate(frame).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(frame).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(frame).ytl))).toString()+\";\\\"\";\n\n $('<img class =\"'+i.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load i\n $(this).appendTo(\"#\" + track1Img );\n });\n\n scaleX = 100 / (parseInt(this.tracks[j].estimate(frame).xbr) - parseInt(this.tracks[j].estimate(frame).xtl));\n scaleY = 100 / (parseInt(this.tracks[j].estimate(frame).ybr) - parseInt(this.tracks[j].estimate(frame).ytl));\n style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[j].estimate(frame).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[j].estimate(frame).ytl))).toString()+\";\\\"\";\n\n $('<img class =\"'+j.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load j\n $(this).appendTo(\"#\" + track2Img );\n });\n\n\n $(\"#\"+toFrame).click(function() { // change to that frame\n me.player.seek($(this).attr('id').split(\"o\")[1]);\n console.log($(this).attr('id'));\n $('html, body').scrollTop(0);\n });\n\n $(\"#\"+buttonID+\"_\"+frame).click(function() { // merge implementation\n var track1 = $(this).attr('id').split(\"k\")[1].split(\"_\")[0];\n var track2 = $(this).attr('id').split(\"k\")[1].split(\"_\")[1];\n console.log(track1 + track2);\n mergeFunc(track1,track2);\n caseMerge1--;\n\n $(this).prop('disabled',true); // disable the button.\n $(this).text(\"Done\");\n merge1Count++;\n\n //console.log(i.toString() + j.toString());\n });\n caseMerge1++;\n\n }\n }\n\n }\n\n this.mergeEventDetect2 = function(frame, i, j){\n\n if(stageButton == 1){\n $(\"#nextStage\").unbind();\n stageButton = 0;\n //$(\"#nextStage\").empty();\n //$(\"#nextStage .ui-button-text\").text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(\"#nextStage\").click(function() {\n stageButton = 1;\n stage ++;\n console.log(\"test2\");\n $(this).empty();\n //$(this).text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(this).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n\n $(\"#mergeTable\").empty();\n $(\"#stageText\").text(\"STAGE3 : FP? Press \\\"FP\\\" button to delete them. (\" + caseFP + \" cases detected.)\");\n me.player.seek(0);\n me.player.play();\n }).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n }\n\n //console.log(me.tracks[track1].journal.annotations);\n //console.log(me.tracks[track2].journal.annotations);\n\n var anno1 = Object.keys(this.tracks[i].journal.annotations);\n var anno2 = Object.keys(this.tracks[j].journal.annotations);\n\n\n\n\n //console.log(\"!!\");\n if(frame == 0 && !(this.tracks[i].deleted) && !(this.tracks[j].deleted) &&(this.tracks[i].label == this.tracks[j].label) && (mergeLog[i.toString()+\"_\"+j.toString()] != 1) && (mergeLog[j.toString()+\"_\"+i.toString()] != 1)) {\n mergeLog[i.toString()+\"_\"+j.toString()] = 1;\n //console.log(i.toString() + \" \" + j.toString());\n\n if ( ((i<j) && (parseInt(anno1[anno1.length - 2]) > parseInt(anno2[1])))\n || ((i>j) && (parseInt(anno2[anno2.length - 2]) > parseInt(anno1[1])))\n || (i == j)\n ){\n console.log(anno1);\n console.log(anno2);\n return 0;\n }\n\n /*for(var frameNum in anno2){\n\n\n\n if(( anno1.includes(parseInt(anno2[frameNum]).toString())\n || anno1.includes((parseInt(anno2[frameNum])+1).toString())\n || anno1.includes((parseInt(anno2[frameNum])+2).toString())\n || anno1.includes((parseInt(anno2[frameNum])+3).toString())\n || anno1.includes((parseInt(anno2[frameNum])-1).toString())\n || anno1.includes((parseInt(anno2[frameNum])-2).toString())\n || anno1.includes((parseInt(anno2[frameNum])-3).toString())\n )\n && (parseInt(frameNum) != 0)\n && (parseInt(frameNum) != (anno2.length - 1)) )\n {\n return 0;\n }\n }*/\n console.log(i.toString() + \" \" + j.toString());\n console.log(\"-------------------------------\");\n\n\n console.log(anno1);\n console.log(anno2);\n\n console.log(caseMerge2);\n\n if (linear(this.tracks[i].journal.annotations, this.tracks[j].journal.annotations) == 1){\n $(\"#stageText\").text(\"STAGE2 : Same object? Press \\\"Merge\\\" button to merge them. (\" + (caseMerge2 + 1) + \" cases detected.)\");\n if (caseMerge2 % 2 == 0){\n merge2ID = \"merge\" + (caseMerge2/2).toString();\n $(\"#mergeTable\").append(\"<tr id=\\\"\" + merge2ID + \"\\\" style= \\\"height : 100px; \\\"></tr>\");\n }\n var buttonID = \"track\" + i.toString() + \"_\" + j.toString(); // track1_5\n\n var track1Img = caseMerge2.toString() + \"path_\" + i.toString();\n var track2Img = caseMerge2.toString() + \"path_\" + j.toString();\n\n var toFrame1 = caseMerge2.toString() + \"To\" + anno1[1];\n var toFrame2 = caseMerge2.toString() + \"To\" + anno2[1];\n var toFrame1Text = \"To\" + anno1[1];\n var toFrame2Text = \"To\" + anno2[1];\n\n\n\n $(\"#\" + merge2ID ).append(\"<td>\" + job.labels[this.tracks[i].label] + (parseInt(i)+1).toString() + \"_\" + anno1[1] + \"<div id=\\\"\" + track1Img +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n $(\"#\" + merge2ID ).append(\"<td>......</td>\");\n $(\"#\" + merge2ID ).append(\"<td>\" + job.labels[this.tracks[j].label] + (parseInt(j)+1).toString() + \"_\" + anno2[1] + \"<div id=\\\"\" + track2Img +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n\n $(\"#\" + merge2ID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame1 +\"'>\" + toFrame1Text + \"</button><button id='\"+ toFrame2 +\"'>\" + toFrame2Text + \"</button> <button id='\"+buttonID+\"''>Merge</button></div></td>\");\n\n var frameURL = job.frameurl(anno1[1]);\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(anno1[1]).xbr) - parseInt(this.tracks[i].estimate(anno1[1]).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(anno1[1]).ybr) - parseInt(this.tracks[i].estimate(anno1[1]).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(anno1[1]).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(anno1[1]).ytl))).toString()+\";\\\"\";\n\n $('<img class =\"'+i.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load i\n $(this).appendTo(\"#\" + track1Img );\n });\n\n frameURL = job.frameurl(anno2[1]);\n\n scaleX = 100 / (parseInt(this.tracks[j].estimate(anno2[1]).xbr) - parseInt(this.tracks[j].estimate(anno2[1]).xtl));\n scaleY = 100 / (parseInt(this.tracks[j].estimate(anno2[1]).ybr) - parseInt(this.tracks[j].estimate(anno2[1]).ytl));\n style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[j].estimate(anno2[1]).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[j].estimate(anno2[1]).ytl))).toString()+\";\\\"\";\n\n $('<img class =\"'+j.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load j\n $(this).appendTo(\"#\" + track2Img );\n });\n\n\n $(\"#\"+toFrame1).click(function() { // change to that frame\n\n me.player.seek($(this).attr('id').split(\"o\")[1]);\n console.log($(this).attr('id'));\n $('html, body').scrollTop(0);\n });\n $(\"#\"+toFrame2).click(function() { // change to that frame\n\n me.player.seek($(this).attr('id').split(\"o\")[1]);\n console.log($(this).attr('id'));\n $('html, body').scrollTop(0);\n });\n\n $(\"#\"+buttonID).click(function() { // change to that frame\n mergeFunc(i,j);\n $(this).prop('disabled',true); // disable the button.\n $(this).text(\"Done\");\n caseMerge2 = 0;\n mergeLog = {};\n $(\"#mergeTable\").empty();\n me.player.seek(0);\n merge2Count++;\n\n });\n\n\n caseMerge2++;\n }\n }\n }\n\n\n this.FPEvent = function(frame, i){\n if(stageButton == 1){\n $(\"#nextStage\").unbind();\n stageButton = 0;\n //$(\"#nextStage\").empty();\n //$(\"#nextStage .ui-button-text\").text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(\"#nextStage\").click(function() {\n disappear = disappearDoubt(me.tracks);\n console.log(disappear);\n stageButton = 1;\n stage ++;\n console.log(\"test2\");\n $(this).empty();\n //$(this).text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(this).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n\n $(\"#mergeTable\").empty();\n $(\"#stageText\").text(\"STAGE4 : Exist? Press \\\"Recover\\\" button to recover them. (\" + caseDisappear + \" cases detected.)\");\n\n\n me.player.seek(0);\n me.player.play();\n }).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n }\n if (this.tracks[i].estimate(frame).outside != true && appearLog[i.toString()] != 1 && !(this.tracks[i].deleted)) {\n appearLog[i.toString()] = 1;\n console.log(this.tracks[i]);\n console.log(frame);\n var frameURL = job.frameurl(frame);\n var buttonID = \"track\" + i.toString(); // track1\n var toFrame = i + \"To\" + frame;\n\n var trackImg = frame+\"_\"+i.toString();\n if (caseFP % 5 == 0){\n fpTrID = \"FP\"+caseFP.toString();\n $(\"#mergeTable\").append(\"<tr id=\\\"\" + fpTrID + \"\\\" style= \\\"height : 100px; \\\"></tr>\"); //track1frame1\n }\n $(\"#\" + fpTrID ).append(\"<td>\" + job.labels[this.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + trackImg +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n\n $(\"#\" + fpTrID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>To\" + frame + \"</button> <button id='\"+buttonID+\"_\"+frame+\"''>FP</button></div></td>\");\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(frame).xbr) - parseInt(this.tracks[i].estimate(frame).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(frame).ybr) - parseInt(this.tracks[i].estimate(frame).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(frame).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(frame).ytl))).toString()+\";\\\"\";\n $('<img class =\"'+i.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load i\n $(this).appendTo(\"#\" + trackImg );\n });\n\n $(\"#\"+toFrame).click(function() { // change to that frame\n me.player.seek($(this).attr('id').split(\"o\")[1]);\n console.log($(this).attr('id'));\n $('html, body').scrollTop(0);\n });\n\n $(\"#\"+buttonID+\"_\"+frame).click(function(){\n console.log(\"test\");\n me.tracks[i].remove();\n //me.tracks.splice(i, 1);\n console.log(me.tracks);\n\n $(this).prop('disabled',true); // disable the button.\n $(this).text(\"Done\");\n fpCount++;\n });\n\n caseFP++;\n $(\"#stageText\").text(\"STAGE3 : FP? Press \\\"FP\\\" button to delete them. (\" + caseFP + \" cases detected.)\");\n }\n }\n\n\n\n this.disappearEvent = function(frame, i){\n \tif(stageButton == 1){\n $(\"#nextStage\").unbind();\n stageButton = 0;\n //$(\"#nextStage\").empty();\n //$(\"#nextStage .ui-button-text\").text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(\"#nextStage\").click(function() {\n //disappear = disappearDoubt(me.tracks);\n //console.log(disappear);\n stageButton = 1;\n stage ++;\n console.log(\"test2\");\n $(this).empty();\n //$(this).text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(this).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n\n $(\"#mergeTable\").empty();\n $(\"#stageText\").text(\"STAGE5 : You might want to resize/relocate these objects.\");\n\n\n me.player.seek(0);\n me.player.play();\n }).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n }\n\n var trackImg1;\n if (me.tracks[i].deleted){\n \treturn;\n }\n\n if(disappear[i.toString()].includes(frame.toString()) && DAlog[i.toString() + \"_\" + frame] != 1 ) {\n\n\n $(\"#stageText\").text(\"STAGE4 : Exist? Press \\\"Recover\\\" button to recover them. (\" + (caseDisappear+1) + \" cases detected.)\");\n //console.log(me.tracks);\n trackImg1 = i.toString() + \"_\" + frame;\n DAlog[trackImg1] = 1;\n var frameURL = job.frameurl(frame);\n console.log(frameURL);\n\n var toFrame = \"path_\" + i.toString() + \"_To\" + frame;\n if (caseDisappear % 5 == 0){\n DATrID = \"DA\"+caseDisappear.toString();\n $(\"#mergeTable\").append(\"<tr id=\\\"\" + DATrID + \"\\\" style= \\\"height : 100px; \\\"></tr>\"); //track1frame1\n }\n var disappearID = \"path_\" + i.toString() + \"_\" + frame;\n $(\"#\" + DATrID ).append(\"<td>\" + job.labels[me.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + trackImg1 +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n\n $(\"#\" + DATrID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>To\" + frame + \"</button> <button id='\"+disappearID+\"_\"+frame+\"''>Recover</button></div></td>\");\n\n var keys = Object.keys(me.tracks[i].journal.annotations);\n console.log(keys);\n var DSIndex = keys.indexOf(frame.toString());\n console.log(DSIndex);\n\n var ratio = (parseInt(keys[DSIndex]) - parseInt(keys[DSIndex-1])) / (parseInt(keys[DSIndex+1]) - parseInt(keys[DSIndex-1]));\n\n var xbr = parseInt(parseInt(me.tracks[i].estimate(keys[DSIndex-1]).xbr) + (parseInt(me.tracks[i].estimate(keys[DSIndex+1]).xbr) - parseInt(me.tracks[i].estimate(keys[DSIndex-1]).xbr)) * ratio);\n var xtl = parseInt(parseInt(me.tracks[i].estimate(keys[DSIndex-1]).xtl) + (parseInt(me.tracks[i].estimate(keys[DSIndex+1]).xtl) - parseInt(me.tracks[i].estimate(keys[DSIndex-1]).xtl)) * ratio);\n var ybr = parseInt(parseInt(me.tracks[i].estimate(keys[DSIndex-1]).ybr) + (parseInt(me.tracks[i].estimate(keys[DSIndex+1]).ybr) - parseInt(me.tracks[i].estimate(keys[DSIndex-1]).ybr)) * ratio);\n var ytl = parseInt(parseInt(me.tracks[i].estimate(keys[DSIndex-1]).ytl) + (parseInt(me.tracks[i].estimate(keys[DSIndex+1]).ytl) - parseInt(me.tracks[i].estimate(keys[DSIndex-1]).ytl)) * ratio);\n console.log(parseInt(me.tracks[i].estimate(keys[DSIndex-1]).xbr));\n console.log(xbr);\n console.log(xtl);\n console.log(ybr);\n console.log(ytl);\n console.log(parseInt(me.tracks[i].estimate(keys[DSIndex+1]).xbr));\n console.log(\"--------\");\n\n\n console.log(xtl);\n console.log(ybr);\n console.log(ytl);\n\n\n var scaleX = 100 / (xbr-xtl);\n var scaleY = 100 / (ybr-ytl);\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * xtl)).toString()+\"; margin-top : \" + (-Math.round(scaleY * ytl)).toString()+\";\\\"\";\n $('<img class =\"'+i.toString()+'\"src=\"'+ frameURL +'\"'+style +' >').load(function() { // load i\n $(this).appendTo(\"#\" + trackImg1 );\n });\n\n $(\"#\"+toFrame).click(function() { // change to that frame\n me.player.seek($(this).attr('id').split(\"o\")[1]);\n console.log($(this).attr('id'));\n $('html, body').scrollTop(0);\n });\n\n $(\"#\"+disappearID+\"_\"+frame).click(function() { // change to that frame\n me.tracks[i].journal.annotations[frame].outside = false;\n console.log(me.tracks[i].journal.annotations[frame]);\n me.player.seek(frame);\n $(this).prop('disabled',true); // disable the button.\n $(this).text(\"Done\");\n DACount++;\n });\n\n caseDisappear++;\n }\n }\n\n this.displacementEvent = function(frame, i){\n \tif(stageButton == 1){\n $(\"#nextStage\").unbind();\n stageButton = 0;\n $(\"#nextStage\").click(function() {\n stage ++;\n $(this).empty();\n //$(this).text(\"Nexxxxxt Stage (current \" + stage + \")\");\n $(this).button({\n //disabled: true,\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n\n\t $(\"#mergeTable\").empty();\n\t $(\"#stageText\").text(\"All stages are finished, now you can create bounding boxes with unannotated objects.\");\n\t console.log(\"merge1Count : \" + merge1Count);\n\t console.log(\"merge2Count : \" + merge2Count);\n\t console.log(\"fpCount : \" + fpCount);\n\t console.log(\"DACount : \" + DACount);\n\t console.log(\"DPCount : \" + DPCount);\n\t me.player.seek(0);\n\t me.player.play();\n\t $(\"#nextStage\").button(\"option\", \"disabled\", true);\n\t $(\"#nextStage\").unbind();\n }).button({\n icons: {\n primary: \"ui-icon-arrowthick-1-e\"\n }\n });\n }\n\n if ( (frame == 0) && (!me.tracks[i].deleted) && DPlog[i] != 1){ //this.tracks[i].journal.annotations\n \tDPlog[i] = 1;\n \tvar coordinateX = [], coordinateY = [];\n var boxArea = [];\n var anno1 = this.tracks[i].journal.annotations;\n for (var j in anno1){\n\t if( (anno1[j].occluded == false) && (anno1[j].outside == false)){\n\t var midx = (parseInt(anno1[j].xtl) + parseInt(anno1[j].xbr)) / 2.0;\n\t var midy = (parseInt(anno1[j].ytl) + parseInt(anno1[j].ybr)) / 2.0;\n\t var area = (parseInt(anno1[j].xbr) - parseInt(anno1[j].xtl)) * (parseInt(anno1[j].ybr) - parseInt(anno1[j].ytl));\n\t var tempX = [j, midx];\n\t var tempY = [j, midy];\n\t var tempArea = [j, area];\n\t coordinateX.push(tempX);\n\t coordinateY.push(tempY);\n\t boxArea.push(tempArea);\n }\n }\n\n var regressionX = methods.linear(coordinateX, { order: 3, precision: 3, period: null });\n var regressionY = methods.linear(coordinateY, { order: 3, precision: 3, period: null });\n var regression_area = methods.linear(boxArea, { order: 3, precision: 3, period: null });\n var ratio = 0.1\n if (regressionX.r2 < 0.5){\n\n \tvar xindex = [];\n \tvar xvalue = [];\n console.log(\"X regression r2 < 0.5 ... \");\n for (var j in anno1){\n \tif( (anno1[j].occluded == false) && (anno1[j].outside == false)){\n\t\t\t xindex.push(j);\n\t\t\t var midx = (parseInt(anno1[j].xtl) + parseInt(anno1[j].xbr)) / 2.0;\n\t\t\t //console.log(midx);\n\t\t\t //console.log(regressionX.predict(parseInt(j))[1]);\n\t xvalue.push(parseInt(Math.abs(regressionX.predict(parseInt(j))[1] - midx).toFixed(2) * 100));\n }\n }\n \tconsole.log(xindex);\n \tconsole.log(xvalue);\n var times = parseInt(xindex.length * ratio);\n console.log(times);\n for (var n=0; n<times; n++){\n \t\n\n \tvar index = xvalue.indexOf(Math.max(...xvalue));\n \tconsole.log(Math.max(...xvalue));\n \tconsole.log(index);\n \tconsole.log(xindex[index]); // object frame \n \tif (DPlog[i+\"_\"+xindex[index]] == 1){\n \t\tcontinue;\n \t}\n \tDPlog[i+\"_\"+xindex[index]] = 1;\n\n \tif(caseDisplacement % 5 == 0){\n\t DPTrID = \"DP\"+caseDisplacement.toString();\n\t $(\"#mergeTable\").append(\"<tr id=\\\"\" + DPTrID + \"\\\" style= \\\"height : 100px; \\\"></tr>\"); //track1frame1\n }\n\n var toFrame = \"path_\" + i.toString() + \"_To\" + xindex[index].toString();\n var frameURL = job.frameurl(xindex[index].toString());\n\n var trackImg1 = i.toString() + \"_\" + xindex[index].toString() + caseDisplacement;\n\n $(\"#\" + DPTrID ).append(\"<td>\" + job.labels[me.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + trackImg1 +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n $(\"#\" + DPTrID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>To\" + xindex[index] + \"</button> </div></td>\");\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).xbr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).ybr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl))).toString()+\";\\\"\";\n\t\t\t \n\t\t\t $('<img class =\"'+trackImg1+'\"src=\"'+ frameURL +'\"'+style +'>').load(function() { // load i\n\t\t\t $(this).appendTo(\"#\" + $(this).attr(\"class\"));\n\t\t\t });\n\t\t\t \n\t\t\t $(\"#\"+toFrame).click(function() { // change to that frame\n\t\t me.player.seek($(this).attr('id').split(\"o\")[1]);\n\t\t console.log($(this).attr('id'));\n\t\t $('html, body').scrollTop(0);\n\t\t DPCount++;\n });\n\n \txvalue.splice(index, 1);\n \txindex.splice(index, 1);\n \tcaseDisplacement++;\n\n }\n }\n if (regressionY.r2 < 0.5){\n \tvar xindex = [];\n \tvar xvalue = [];\n console.log(\"X regression r2 < 0.5 ... \");\n for (var j in anno1){\n \tif( (anno1[j].occluded == false) && (anno1[j].outside == false)){\n\t\t\t xindex.push(j);\n\t\t\t var midx = (parseInt(anno1[j].ytl) + parseInt(anno1[j].ybr)) / 2.0;\n\t\t\t //console.log(midx);\n\t\t\t //console.log(regressionX.predict(parseInt(j))[1]);\n\t xvalue.push(parseInt(Math.abs(regressionX.predict(parseInt(j))[1] - midx).toFixed(2) * 100));\n }\n }\n \tconsole.log(xindex);\n \tconsole.log(xvalue);\n var times = parseInt(xindex.length * ratio);\n console.log(times);\n for (var n=0; n<times; n++){\n\n \tvar index = xvalue.indexOf(Math.max(...xvalue));\n \tconsole.log(Math.max(...xvalue));\n \tconsole.log(index);\n \tconsole.log(xindex[index]); // object frame \n\n \tif (DPlog[i+\"_\"+xindex[index]] == 1){\n \t\tcontinue;\n \t}\n \tDPlog[i+\"_\"+xindex[index]] = 1;\n\n \tif(caseDisplacement % 5 == 0){\n\t DPTrID = \"DP\"+caseDisplacement.toString();\n\t $(\"#mergeTable\").append(\"<tr id=\\\"\" + DPTrID + \"\\\" style= \\\"height : 100px; \\\"></tr>\"); //track1frame1\n }\n\n var toFrame = \"path_\" + i.toString() + \"_To\" + xindex[index].toString();\n var frameURL = job.frameurl(xindex[index].toString());\n\n var trackImg1 = i.toString() + \"_\" + xindex[index].toString() + caseDisplacement;\n\n $(\"#\" + DPTrID ).append(\"<td>\" + job.labels[me.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + trackImg1 +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n $(\"#\" + DPTrID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>To\" + xindex[index] + \"</button> </div></td>\");\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).xbr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).ybr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl))).toString()+\";\\\"\";\n\t\t\t \n\t\t\t $('<img class =\"'+trackImg1+'\"src=\"'+ frameURL +'\"'+style +'>').load(function() { // load i\n\t\t\t $(this).appendTo(\"#\" + $(this).attr(\"class\"));\n\t\t\t });\n\t\t\t \n\t\t\t $(\"#\"+toFrame).click(function() { // change to that frame\n\t\t me.player.seek($(this).attr('id').split(\"o\")[1]);\n\t\t console.log($(this).attr('id'));\n\t\t $('html, body').scrollTop(0);\n\t\t DPCount++;\n });\n\n \txvalue.splice(index, 1);\n \txindex.splice(index, 1);\n \tcaseDisplacement++;\n\n }\n \t\n }\n if (regression_area.r2 < 0.5){\n \tvar xindex = [];\n \tvar xvalue = [];\n console.log(\"X regression r2 < 0.5 ... \");\n for (var j in anno1){\n \tif( (anno1[j].occluded == false) && (anno1[j].outside == false)){\n\t\t\t xindex.push(j);\n\t\t\t var midx = (parseInt(anno1[j].xbr) - parseInt(anno1[j].xtl)) * (parseInt(anno1[j].ybr) - parseInt(anno1[j].ytl));\n\t\t\t //console.log(midx);\n\t\t\t //console.log(regressionX.predict(parseInt(j))[1]);\n\t xvalue.push(parseInt(Math.abs(regressionX.predict(parseInt(j))[1] - midx).toFixed(2) * 100));\n }\n }\n \tconsole.log(xindex);\n \tconsole.log(xvalue);\n var times = parseInt(xindex.length * ratio);\n console.log(times);\n for (var n=0; n<times; n++){\n\n \tvar index = xvalue.indexOf(Math.max(...xvalue));\n \tconsole.log(Math.max(...xvalue));\n \tconsole.log(index);\n \tconsole.log(xindex[index]); // object frame \n\n \tif (DPlog[i+\"_\"+xindex[index]] == 1){\n \t\tcontinue;\n \t}\n \tDPlog[i+\"_\"+xindex[index]] = 1;\n\n \tif(caseDisplacement % 5 == 0){\n\t DPTrID = \"DP\"+caseDisplacement.toString();\n\t $(\"#mergeTable\").append(\"<tr id=\\\"\" + DPTrID + \"\\\" style= \\\"height : 100px; \\\"></tr>\"); //track1frame1\n }\n\n var toFrame = \"path_\" + i.toString() + \"_To\" + xindex[index].toString();\n var frameURL = job.frameurl(xindex[index].toString());\n\n var trackImg1 = i.toString() + \"_\" + xindex[index].toString() + caseDisplacement;\n\n $(\"#\" + DPTrID ).append(\"<td>\" + job.labels[me.tracks[i].label] + (parseInt(i)+1).toString() + \"<div id=\\\"\" + trackImg1 +\"\\\" style= \\\"width : 100px; height : 100px; overflow: hidden\\\"></div> </td>\");\n $(\"#\" + DPTrID ).append(\"<td><div class = \\\"btn-group\\\"><button id='\"+ toFrame +\"'>To\" + xindex[index] + \"</button> </div></td>\");\n\n var scaleX = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).xbr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl));\n var scaleY = 100 / (parseInt(this.tracks[i].estimate(xindex[index].toString()).ybr) - parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl));\n var style = \"style = \\\"width :\"+ (scaleX*parseInt(job.width)).toString() +\"; height:\" +(scaleY*parseInt(job.height)).toString() +\"; margin-left : \"+ (-Math.round(scaleX * parseInt(this.tracks[i].estimate(xindex[index].toString()).xtl))).toString()+\"; margin-top : \" + (-Math.round(scaleY * parseInt(this.tracks[i].estimate(xindex[index].toString()).ytl))).toString()+\";\\\"\";\n\t\t\t \n\t\t\t $('<img class =\"'+trackImg1+'\"src=\"'+ frameURL +'\"'+style +'>').load(function() { // load i\n\t\t\t $(this).appendTo(\"#\" + $(this).attr(\"class\"));\n\t\t\t });\n\t\t\t \n\t\t\t $(\"#\"+toFrame).click(function() { // change to that frame\n\t\t me.player.seek($(this).attr('id').split(\"o\")[1]);\n\t\t console.log($(this).attr('id'));\n\t\t $('html, body').scrollTop(0);\n\t\t DPCount++;\n });\n\n \txvalue.splice(index, 1);\n \txindex.splice(index, 1);\n \tcaseDisplacement++;\n\n }\n \n }\n }\n\n \t//console.log(\"test displacement event\");\n \t//console.log(me.tracks);\n\n }\n\n\n /*\n * Updates boxes with the given frame\n */\n this.update = function(frame)\n {\n //$('#mergeArea').empty();\n for (var i in this.tracks)\n {\n this.tracks[i].draw(frame);\n if(stage == 0){\n for (var j in this.tracks){\n this.mergeEventDetect1(frame, i, j); // type 1 merge\n }\n }\n else if (stage == 1){ // type 2 merge\n for (var j in this.tracks){\n this.mergeEventDetect2(frame, i, j);\n }\n }\n else if (stage == 2){ // FP case\n this.FPEvent(frame, i);\n }\n else if (stage == 3){ // disappear case\n this.disappearEvent(frame, i);\n\n }\n else if (stage == 4){\n \tthis.displacementEvent(frame, i);\n\n }\n }\n //console.log(caseMerge1);\n }\n\n\n\n\n\n this.overlapRatio = function(K, L, M, N, P, Q, R, S){\n \tvar area1 = (M - K) * (N - L);\n \tvar area2 = (R - P) * (S - Q);\n \tvar overlap;\n \tif ((P>=M) || (Q>=N) || (K>=R) || (L>=S)){\n \t\toverlap = 0;\n \t}\n \telse{\n blX = Math.max(K, P);\n blY = Math.max(L, Q);\n trX = Math.min(M, R);\n trY = Math.min(N, S);\n overlap = (trX - blX) * (trY - blY);\n \t}\n \treturn overlap / (area1 + area2 - overlap);\n }\n\n /*\n * Returns the number of tracks.\n */\n this.count = function()\n {\n var count = 0;\n for (var i in this.tracks)\n {\n if (!this.tracks[i].deleted)\n {\n count++;\n }\n }\n return count;\n }\n\n this.recordposition = function()\n {\n for (var i in this.tracks)\n {\n this.tracks[i].recordposition();\n }\n }\n\n /*\n * Serializes all tracks for sending to server.\n */\n this.serialize = function()\n {\n var count = 0;\n var str = \"[\";\n for (var i in this.tracks)\n {\n if (!this.tracks[i].deleted)\n {\n str += this.tracks[i].serialize() + \",\";\n count++;\n }\n }\n if (count == 0)\n {\n return \"[]\";\n }\n return str.substr(0, str.length - 1) + \"]\";\n }\n\n track_collection_dump = function() {\n return me.serialize();\n };\n}", "getTrackById(id){\r\n return this.getTracks().find((track) => track.id === id);\r\n }", "beginTracking_() {\n this.tracking_ = true;\n }", "function processCurrenttrack (data) {\n setSongInfo(data)\n}", "function processCurrenttrack(data) {\n setSongInfo(data);\n}", "function La(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=bt.generateUUID(),// this means it should figure out its duration by scanning the tracks\nthis.duration<0&&this.resetDuration(),this.optimize()}", "function Track(options) {\n\n this.mashome = null;\n this.elm = $(\"<div></div>\");\n this.elm.css({\"overflow\": \"hidden\",\n \"width\": \"100%\"});\n this.width = 0;\n this.sidebarWidth = 0;\n this.mainWidth = 0;\n\n if (typeof options == \"undefined\")\n options = {};\n if (typeof options.name == \"undefined\")\n options.name = \"user track\";\n if (typeof options.height == \"undefined\")\n options.height = 100;\n \n this.name = options.name;\n this.height = options.height;\n \n \n // create default track layout\n this.create = function () {\n this.elm.empty();\n \n this.width = this.mashome.width;\n this.sidebarWidth = this.mashome.sidebarWidth;\n this.mainWidth = this.mashome.mainWidth;\n \n this.sidebar = $(\"<div></div>\");\n this.sidebar.text(this.name);\n this.sidebar.css({\"width\": this.sidebarWidth - 1,\n \"background-color\": \"#fff\",\n \"border-right\": \"solid 1px #fcc\",\n \"height\": this.height,\n \"float\": \"left\"});\n this.main = $(\"<div></div>\");\n this.main.css({\"width\": this.mainWidth,\n \"background-color\": \"#fff\",\n \"height\": this.height,\n \"float\": \"left\"});\n \n this.elm.append(this.sidebar);\n this.elm.append(this.main);\n };\n \n // change the height of a track\n this.setHeight = function (height) {\n this.height = height;\n if (this.main)\n this.main.css(\"height\", height);\n if (this.sidebar)\n this.sidebar.css(\"height\", height);\n };\n\n //-------------------------------------------\n // callbacks\n\n // callback for when track is added to mashome\n this.onAddTrack = function(view) {};\n \n // callback for when genomic position changes\n this.onViewChange = function(view) {}; \n}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n let track = this.getAlbumById(albumId).addTrack(this.generateID(), trackData);\n this.notificationObserver.update(this);\n return track;\n }", "_internalTrack(eventName, properties, time, onComplete) {\n time = _.isDate(time) ? time : new Date();\n if (this._isReady()) {\n this._sendRequest({\n type: 'track',\n eventName,\n properties,\n onComplete,\n }, time);\n } else {\n this._queue.push(['_internalTrack', [eventName, properties, time, onComplete]]);\n }\n }", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const trackID = this._idManager.nextIdForTrack();\n const newTrack = new Track(trackID,trackData.name,trackData.duration,trackData.genres);\n this.addTrackToAlbum(albumId,newTrack);\n return newTrack;\n\n }", "constructor() {\n this.context = null;\n this.buffers = new Map();\n this.playingMusicInfo = null;\n }", "addTrack(albumId, trackData) \n {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n if (album!= undefined && !(this.trackExists(trackData.name)) )\n {\n const track = new Track(trackData);\n track.id = this.idManager.getIdCancion();\n album.addTrack(track);\n this.tracks.push(track);\n console.log('Se agregó el track ', track.name);\n this.save('data.json')\n notificador.notificarElementoAgregado(track);\n return track\n }\n else\n {\n notificador.notificarError(ElementAlreadyExistsError)\n console.log(\"No se completó la operación, controle que la canción no haya sido ingresada anteriormente\");\n throw(ElementAlreadyExistsError) \n \n }\n \n }", "function StaticTrack(name, labelClass, posHeight) {\n Track.call(this, name, name, true, function() {});\n this.labelClass = labelClass;\n this.posHeight = posHeight;\n this.height = posHeight;\n}", "get tracks() {\n return this.data.tracks.items ? {\n limit: this.data.tracks.limit,\n total: this.data.tracks.total,\n offset: this.data.tracks.offset,\n items: this.data.tracks.items.map(x => PlaylistTrack(x, this.client))\n } : this.data.tracks;\n }", "function HelicosTrack(gsvg,data,trackClass,density){\n\tvar that= CountTrack(gsvg,data,trackClass,density);\n\tthat.graphColorText=\"#DD0000\";\n\tvar lbl=\"Brain Helicos RNA Read Counts\";\n\tthat.updateLabel(lbl);\n\tthat.redrawLegend();\n\tthat.redraw();\n\treturn that;\n}", "function PlaylistTrack(data, client) {\n return {\n addedAt: data.added_at,\n local: data.is_local,\n get addedBy() {\n return data.added_by ? new User_1.default(data.added_by, client) : null;\n },\n get track() {\n if(data.track){\n return data.track.type == 'track' ? new Track_1.default(data.track, client) : new Episode_1.default(data.track, client);\n }\n return null\n }\n };\n}", "constructor() {\n super();\n this.talk = {};\n this.analytics = {};\n }", "static toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': AnimationUtils.convertArray( track.times, Array ),\n\t\t\t\t'values': AnimationUtils.convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}", "function zenbuNewTrack() {\n var glyphTrack = new Object;\n glyphTrack.hideTrack = 0;\n glyphTrack.title = \"\";\n glyphTrack.description = \"\";\n glyphTrack.default_exptype = \"raw\";\n glyphTrack.exptype = \"\";\n glyphTrack.datatype = \"\";\n glyphTrack.expfilter = \"\";\n glyphTrack.exp_filter_incl_matching = false;\n glyphTrack.exp_matching_mdkey = \"\";\n glyphTrack.exp_matching_post_filter = \"\";\n glyphTrack.exppanelmode = \"experiments\";\n glyphTrack.exppanel_use_rgbcolor = false;\n glyphTrack.mdgroupkey = \"\";\n glyphTrack.exp_name_mdkeys = \"\";\n glyphTrack.errorbar_type = \"stddev\";\n glyphTrack.ranksum_display = \"\";\n glyphTrack.logscale = 0;\n glyphTrack.noCache = false;\n glyphTrack.noNameSearch = true;\n glyphTrack.colorMode = \"strand\";\n glyphTrack.color_mdkey = \"bed:itemRgb\";\n glyphTrack.backColor = \"#F6F6F6\";\n glyphTrack.posStrandColor = \"#008000\";\n glyphTrack.revStrandColor = \"#800080\";\n glyphTrack.posTextColor = \"black\";\n glyphTrack.revTextColor = \"black\";\n glyphTrack.source_outmode = \"full_feature\";\n glyphTrack.strandless = false;\n glyphTrack.overlap_mode = \"5end\";\n glyphTrack.binning = \"sum\";\n glyphTrack.experiment_merge = \"mean\";\n glyphTrack.maxlevels = 100;\n glyphTrack.track_height = 100;\n glyphTrack.expscaling = \"auto\";\n glyphTrack.scale_min_signal = 0;\n glyphTrack.exp_mincut = 0.0;\n glyphTrack.exprbin_strandless = false;\n glyphTrack.exprbin_add_count = false;\n glyphTrack.exprbin_subfeatures = false;\n glyphTrack.exprbin_binsize = \"\";\n glyphTrack.createMode = \"single\";\n glyphTrack.whole_chrom_scale = false;\n\n //just some test config for now\n glyphTrack.sources = \"\";\n glyphTrack.source_ids = \"\";\n glyphTrack.peerName = \"\";\n glyphTrack.glyphStyle = \"thick-arrow\";\n glyphTrack.uuid = \"\";\n glyphTrack.hashkey = \"\";\n glyphTrack.has_expression = false;\n glyphTrack.has_subfeatures = false;\n\n return glyphTrack;\n}", "function CountTrack(gsvg,data,trackClass,density){\n\tvar that= Track(gsvg,data,trackClass,\"Generic Counts\");\n\tthat.loadedDataMin=that.xScale.domain()[0];\n\tthat.loadedDataMax=that.xScale.domain()[1];\n\tthat.dataFileName=that.trackClass;\n\tthat.scaleMin=1;\n\tthat.scaleMax=5000;\n\tthat.graphColorText=\"steelblue\";\n\tthat.colorScale=d3.scaleLinear().domain([that.scaleMin,that.scaleMax]).range([\"#EEEEEE\",\"#000000\"]);\n\tthat.ttSVG=1;\n\tthat.data=data;\n\tthat.density=density;\n\tthat.prevDensity=density;\n\tthat.displayBreakDown=null;\n\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\tvar len=tmpMax-tmpMin;\n\t\n\tthat.fullDataTimeOutHandle=0;\n\n\tthat.ttTrackList=[];\n\tif(trackClass.indexOf(\"illuminaSmall\")>-1){\n\t\tthat.ttTrackList.push(\"ensemblsmallnc\");\n\t\tthat.ttTrackList.push(\"brainsmallnc\");\n\t\tthat.ttTrackList.push(\"liversmallnc\");\n\t\tthat.ttTrackList.push(\"heartsmallnc\");\n\t\tthat.ttTrackList.push(\"repeatMask\");\n\t}else{\n\t\tthat.ttTrackList.push(\"ensemblcoding\");\n\t\tthat.ttTrackList.push(\"braincoding\");\n\t\tthat.ttTrackList.push(\"liverTotal\");\n\t\tthat.ttTrackList.push(\"heartTotal\");\n\t\tthat.ttTrackList.push(\"mergedTotal\");\n\t\tthat.ttTrackList.push(\"refSeq\");\n\t\tthat.ttTrackList.push(\"ensemblnoncoding\");\n\t\tthat.ttTrackList.push(\"brainnoncoding\");\n\t\tthat.ttTrackList.push(\"probe\");\n\t\tthat.ttTrackList.push(\"polyASite\");\n\t\tthat.ttTrackList.push(\"spliceJnct\");\n\t\tthat.ttTrackList.push(\"liverspliceJnct\");\n\t\tthat.ttTrackList.push(\"heartspliceJnct\");\n\t\tthat.ttTrackList.push(\"repeatMask\");\n\t}\n\n\n\n\tthat.calculateBin= function(len){\n\t\tvar w=that.gsvg.width;\n\t\tvar bpPerPixel=len/w;\n\t\tbpPerPixel=Math.floor(bpPerPixel);\n\t\tvar bpPerPixelStr=new String(bpPerPixel);\n\t\tvar firstDigit=bpPerPixelStr.substr(0,1);\n\t\tvar firstNum=firstDigit*Math.pow(10,(bpPerPixelStr.length-1));\n\t\tvar bin=firstNum/2;\n\t\tbin=Math.floor(bin);\n\t\tif(bin<5){\n\t\t\tbin=0;\n\t\t}\n\t\treturn bin;\n\t};\n\tthat.bin=that.calculateBin(len);\n\n\n\tthat.color= function (d){\n\t\tvar color=\"#FFFFFF\";\n\t\tif(d.getAttribute(\"count\")>=that.scaleMin){\n\t\t\tcolor=d3.rgb(that.colorScale(d.getAttribute(\"count\")));\n\t\t\t//color=d3.rgb(that.colorScale(d.getAttribute(\"count\")));\n\t\t}\n\t\treturn color;\n\t};\n\n\tthat.redraw= function (){\n\n\t\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t//var len=tmpMax-tmpMin;\n\t\tvar tmpBin=that.bin;\n\t\tvar tmpW=that.xScale(tmpMin+tmpBin)-that.xScale(tmpMin);\n\t\t/*if(that.gsvg.levelNumber<10 && (tmpW>2||tmpW<0.5)) {\n\t\t\tthat.updateFullData(0,1);\n\t\t}*//*else if(tmpMin<that.prevMinCoord||tmpMax>that.prevMaxCoord){\n\t\t\tthat.updateFullData(0,1);\n\t\t}*/\n\t\t//else{\n\n\t\t\tthat.prevMinCoord=tmpMin;\n\t\t\tthat.prevMaxCoord=tmpMax;\n\n\t\t\tvar tmpMin=that.xScale.domain()[0];\n\t\t\t\tvar tmpMax=that.xScale.domain()[1];\n\t\t\t\tvar newData=[];\n\t\t\t\tvar newCount=0;\n\t\t\t\tvar tmpYMax=0;\n\t\t\t\tfor(var l=0;l<that.data.length;l++){\n\t\t\t\t\tif(typeof that.data[l]!=='undefined' ){\n\t\t\t\t\t\tvar start=parseInt(that.data[l].getAttribute(\"start\"),10);\n\t\t\t\t\t\tvar stop=parseInt(that.data[l].getAttribute(\"stop\"),10);\n\t\t\t\t\t\tvar count=parseInt(that.data[l].getAttribute(\"count\"),10);\n\t\t\t\t\t\tif(that.density!=1 ||(that.density==1 && start!=stop)){\n\t\t\t\t\t\t\tif((l+1)<that.data.length){\n\t\t\t\t\t\t\t\tvar startNext=parseInt(that.data[l+1].getAttribute(\"start\"),10);\n\t\t\t\t\t\t\t\tif(\t(start>=tmpMin&&start<=tmpMax) || (startNext>=tmpMin&&startNext<=tmpMax)\n\t\t\t\t\t\t\t\t\t){\n\t\t\t\t\t\t\t\t\tnewData[newCount]=that.data[l];\n\t\t\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t\t\t}else{\n\n\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\tif(start>=tmpMin&&start<=tmpMax){\n\t\t\t\t\t\t\t\t\tnewData[newCount]=that.data[l];\n\t\t\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(that.density==1){\n\t\t\t\tif(that.density!=that.prevDensity){\n\t\t\t\t\tthat.redrawLegend();\n\t\t\t\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t\t\t\tthat.prevDensity=that.density;\n\t\t\t\t\tthat.svg.selectAll(\".area\").remove();\n\t\t\t\t\tthat.svg.selectAll(\"g.y\").remove();\n\t\t\t\t\tthat.svg.selectAll(\".grid\").remove();\n\t\t\t\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\t\t\t\tvar points=that.svg.selectAll(\".\"+that.trackClass).data(newData,keyStart)\n\t\t\t \tpoints.enter()\n\t\t\t\t\t\t\t.append(\"rect\")\n\t\t\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t\t\t.attr(\"y\",15)\n\t\t\t\t\t\t\t.attr(\"class\", that.trackClass)\n\t\t\t\t \t\t.attr(\"height\",10)\n\t\t\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\n\t\t\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t.attr(\"fill\",that.color)\n\t\t\t\t\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\t\t\t\t\tif(that.gsvg.isToolTip==0){\n\t\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"green\");\n\t\t\t \t\t\ttt.transition()\n\t\t\t\t\t\t\t\t\t\t.duration(200)\n\t\t\t\t\t\t\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\t\t\t\t\t\ttt.html(that.createToolTip(d))\n\t\t\t\t\t\t\t\t\t\t.style(\"left\", function(){return that.positionTTLeft(d3.event.pageX);})\n\t\t\t\t\t\t\t\t\t\t.style(\"top\", function(){return that.positionTTTop(d3.event.pageY);});\n\t\t\t\t\t\t\t\t}\n\t\t \t\t\t})\n\t\t\t\t\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",that.color);\n\t\t\t\t\t tt.transition()\n\t\t\t\t\t\t\t\t\t .delay(500)\n\t\t\t\t\t .duration(200)\n\t\t\t\t\t .style(\"opacity\", 0);\n\t\t\t\t\t });\n\t\t\t\t\tpoints.exit().remove();\n\t\t\t\t}else{\n\t\t\t\t\tthat.svg.selectAll(\".\"+that.trackClass)\n\t\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t /*if((i+1)<that.data.length){\n\t\t\t\t\t\t\t\t\t\t\t \t\tif(that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t\t \t\twX=that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}/*else{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(d3.select(this).attr(\"width\")>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twX=d3.select(this).attr(\"width\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\twX=that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t.attr(\"fill\",that.color);\n\t\t\t\t}\n\t\t\t\tthat.svg.attr(\"height\", 30);\n\t\t\t}else if(that.density==2){\n\n\n\t\t\t\tthat.svg.selectAll(\".\"+that.trackClass).remove();\n\t\t\t\tthat.svg.select(\".y.axis\").remove();\n\t\t\t\tthat.svg.select(\"g.grid\").remove();\n\t\t\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\t\t\tthat.yScale.domain([0, tmpYMax]);\n\t\t\t\tthat.svg.select(\".area\").remove();\n\t\t\t\tthat.area = d3.area()\n\t \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t\t .y0(140)\n\t\t\t\t\t .y1(function(d) { return that.yScale(d.getAttribute(\"count\")); });\n\t\t\t\tthat.redrawLegend();\n\t\t\t\tthat.prevDensity=that.density;\n\t\t\t\tthat.svg.append(\"g\")\n\t\t\t\t\t .attr(\"class\", \"y axis\")\n\t\t\t\t\t .call(that.yAxis);\n\t\t\t\tthat.svg.append(\"g\")\n\t\t\t \t.attr(\"class\", \"grid\")\n\t\t\t \t.call(that.yAxis\n\t\t\t \t\t.tickSize((-that.gsvg.width+10), 0, 0)\n\t\t\t \t\t.tickFormat(\"\")\n\t\t\t \t\t);\n\t\t\t\tthat.svg.select(\"g.y\").selectAll(\"text\").each(function(d){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar str=new String(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td3.select(this).attr(\"x\",function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\treturn str.length*7.7+5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.05em\");\n\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\tthat.svg.append(\"svg:text\").attr(\"class\",\"leftLbl\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"x\",that.gsvg.width-(str.length*7.8+5))\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"y\",function(){return that.yScale(d)})\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.01em\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"font-weight\",\"bold\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.text(numberWithCommas(d));\n\n\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t that.svg.append(\"path\")\n\t\t\t\t \t.datum(newData)\n\t\t\t\t \t.attr(\"class\", \"area\")\n\t\t\t\t \t.attr(\"stroke\",that.graphColorText)\n\t\t\t\t \t.attr(\"fill\",that.graphColorText)\n\t\t\t\t \t.attr(\"d\", that.area);\n\n\t\t\t\tthat.svg.attr(\"height\", 140);\n\t\t\t}\n\t\t\tthat.redrawSelectedArea();\n\t\t//}\n\t};\n\n\tthat.createToolTip=function (d){\n\t\tvar tooltip=\"\";\n\t\ttooltip=\"<BR><div id=\\\"ttSVG\\\" style=\\\"background:#FFFFFF;\\\"></div><BR>Read Count=\"+ numberWithCommas(d.getAttribute(\"count\"));\n\t\tif(that.bin>0){\n\t\t\tvar tmpEnd=parseInt(d.getAttribute(\"start\"),10)+parseInt(that.bin,10);\n\t\t\ttooltip=tooltip+\"*<BR><BR>*Data compressed for display. Using 90th percentile of<BR>region:\"+numberWithCommas(d.getAttribute(\"start\"))+\"-\"+numberWithCommas(tmpEnd)+\"<BR><BR>Zoom in further to see raw data(roughly a region <1000bp). The bin size will decrease as you zoom in thus the resolution of the count data will improve as you zoom in.\";\n\t\t}/*else{\n\t\t\ttooltip=tooltip+\"<BR>Read Count:\"+d.getAttribute(\"count\");\n\t\t}*/\n\t\treturn tooltip;\n\t};\n\n\tthat.update=function (d){\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\t\tif(that.loadedDataMin<=tmpMin &&tmpMax<=that.loadedDataMax){\n\t\t\tthat.redraw();\n\t\t}else{\n\t\t\tthat.updateFullData(0,1);\n\t\t}\n\t};\n\n\tthat.updateFullData = function(retry,force){\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\n\t\tvar len=tmpMax-tmpMin;\n\n\t\tthat.showLoading();\n\t\tthat.bin=that.calculateBin(len);\n\t\t//console.log(\"update \"+that.trackClass);\n\t\tvar tag=\"Count\";\n\t\tvar file=dataPrefix+\"tmpData/browserCache/\"+genomeVer+\"/regionData/\"+that.gsvg.folderName+\"/tmp/\"+tmpMin+\"_\"+tmpMax+\".count.\"+that.trackClass+\".xml\";\n\t\tif(that.bin>0){\n\t\t\ttmpMin=tmpMin-(that.bin*2);\n\t\t\ttmpMin=tmpMin-(tmpMin%(that.bin*2));\n\t\t\ttmpMax=tmpMax+(that.bin*2);\n\t\t\ttmpMax=tmpMax+(that.bin*2-(tmpMax%(that.bin*2)));\n\t\t\tfile=dataPrefix+\"tmpData/browserCache/\"+genomeVer+\"/regionData/\"+that.gsvg.folderName+\"/tmp/\"+tmpMin+\"_\"+tmpMax+\".bincount.\"+that.bin+\".\"+that.trackClass+\".xml\";\n\t\t}\n\t\t//console.log(\"file=\"+file);\n\t\t//console.log(\"folder=\"+that.gsvg.folderName);\n\t\td3.xml(file,function (error,d){\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tif(retry==0||force==1){\n\t\t\t\t\t\t\tvar tmpContext=contextPath +\"/\"+ pathPrefix;\n\t\t\t\t\t\t\tif(!pathPrefix){\n\t\t\t\t\t\t\t\ttmpContext=\"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttmpPanel=panel;\n\t\t\t\t\t\t\tif(that.trackClass.indexOf(\"-\")>-1){\n\t\t\t\t\t\t\t\ttmpPanel=that.trackClass.substr(that.trackClass.indexOf(\"-\")+1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\turl: tmpContext +\"generateTrackXML.jsp\",\n\t\t\t\t\t\t\t\t \t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t \t\t\t\tcache: false,\n\t\t\t\t\t\t\t\t\t\t\t\tdata: {chromosome: chr,minCoord:tmpMin,maxCoord:tmpMax,panel:tmpPanel,rnaDatasetID:rnaDatasetID,arrayTypeID: arrayTypeID, myOrganism: organism,genomeVer:genomeVer, track: that.trackClass, folder: that.gsvg.folderName,binSize:that.bin},\n\t\t\t\t\t\t\t\t\t\t\t\t//data: {chromosome: chr,minCoord:minCoord,maxCoord:maxCoord,panel:panel,rnaDatasetID:rnaDatasetID,arrayTypeID: arrayTypeID, myOrganism: organism, track: that.trackClass, folder: folderName,binSize:that.bin},\n\t\t\t\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t \t\t\tsuccess: function(data2){\n\t\t\t\t\t\t\t\t \t\t\t\t//console.log(\"generateTrack:DONE\");\n\t\t\t\t\t\t\t\t \t\t\t\tif(ga){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tga('send','event','browser','generateTrackCount');\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t \t\t\t},\n\t\t\t\t\t\t\t\t \t\t\terror: function(xhr, status, error) {\n\n\t\t\t\t\t\t\t\t \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//console.log(error);\n\t\t\t\t\t\tif(retry<8){//wait before trying again\n\t\t\t\t\t\t\tvar time=500;\n\t\t\t\t\t\t\t/*if(retry==0){\n\t\t\t\t\t\t\t\ttime=10000;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else if(retry<30){\n\t\t\t\t\t\t\tvar time=1000;\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else if(retry<32){\n\t\t\t\t\t\t\tvar time=10000;\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\td3.select(\"#Level\"+that.levelNumber+that.trackClass).select(\"#trkLbl\").text(\"An errror occurred loading Track:\"+that.trackClass);\n\t\t\t\t\t\t\td3.select(\"#Level\"+that.levelNumber+that.trackClass).attr(\"height\", 15);\n\t\t\t\t\t\t\tthat.gsvg.addTrackErrorRemove(that.svg,\"#Level\"+that.gsvg.levelNumber+that.trackClass);\n\t\t\t\t\t\t\tthat.hideLoading();\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,1);\n\t\t\t\t\t\t\t\t},15000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//console.log(\"update data\");\n\t\t\t\t\t\t//console.log(d);\n\t\t\t\t\t\tif(d==null){\n\t\t\t\t\t\t\t//console.log(\"is null\");\n\t\t\t\t\t\t\tif(retry>=32){\n\t\t\t\t\t\t\t\tdata=new Array();\n\t\t\t\t\t\t\t\tthat.draw(data);\n\t\t\t\t\t\t\t\t//that.hideLoading();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t\t},5000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//console.log(\"not null is drawing\");\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=0;\n\t\t\t\t\t\t\tthat.loadedDataMin=tmpMin;\n\t\t\t\t \t\tthat.loadedDataMax=tmpMax;\n\t\t\t\t\t\t\tvar data=d.documentElement.getElementsByTagName(\"Count\");\n\t\t\t\t\t\t\tthat.draw(data);\n\t\t\t\t\t\t\t//that.hideLoading();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//that.hideLoading();\n\t\t\t\t});\n\t};\n\n\tthat.updateCountScale= function(minVal,maxVal){\n\t\tthat.scaleMin=minVal;\n\t\tthat.scaleMax=maxVal;\n\t\tthat.colorScale=d3.scaleLinear().domain([that.scaleMin,that.scaleMax]).range([\"#EEEEEE\",\"#000000\"]);\n\t\tif(that.density==1){\n\t\t\tthat.redrawLegend();\n\t\t\tthat.redraw();\n\t\t}\n\t};\n\n\tthat.setupToolTipSVG=function(d,perc){\n\t\t//Setup Tooltip SVG\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\t\tvar start=parseInt(d.getAttribute(\"start\"),10);\n\t\tvar stop=parseInt(d.getAttribute(\"stop\"),10);\n\t\tvar len=stop-start;\n\t\tvar margin=Math.floor((tmpMax-tmpMin)*perc);\n\t\tif(margin<20){\n\t\t\tmargin=20;\n\t\t}\n\t\tvar tmpStart=start-margin;\n\t\tvar tmpStop=stop+margin;\n\t\tif(tmpStart<1){\n\t\t\ttmpStart=1;\n\t\t}\n\t\tif(typeof that.ttSVGMinWidth!=='undefined'){\n\t\t\tif(tmpStop-tmpStart<that.ttSVGMinWidth){\n\t\t\t\ttmpStart=start-(that.ttSVGMinWidth/2);\n\t\t\t\ttmpStop=stop+(that.ttSVGMinWidth/2);\n\t\t\t}\n\t\t}\n\n\t\tvar newSvg=toolTipSVG(\"div#ttSVG\",450,tmpStart,tmpStop,99,d.getAttribute(\"ID\"),\"transcript\");\n\t\t//Setup Track for current feature\n\t\t//var dataArr=new Array();\n\t\t//dataArr[0]=d;\n\t\tnewSvg.addTrack(that.trackClass,3,\"\",that.data);\n\t\t//Setup Other tracks included in the track type(listed in that.ttTrackList)\n\t\tfor(var r=0;r<that.ttTrackList.length;r++){\n\t\t\tvar tData=that.gsvg.getTrackData(that.ttTrackList[r]);\n\t\t\tvar fData=new Array();\n\t\t\tif(typeof tData!=='undefined' && tData.length>0){\n\t\t\t\tvar fCount=0;\n\t\t\t\tfor(var s=0;s<tData.length;s++){\n\t\t\t\t\tif((tmpStart<=parseInt(tData[s].getAttribute(\"start\"),10)&&parseInt(tData[s].getAttribute(\"start\"),10)<=tmpStop)\n\t\t\t\t\t\t|| (parseInt(tData[s].getAttribute(\"start\"),10)<=tmpStart&&parseInt(tData[s].getAttribute(\"stop\"),10)>=tmpStart)\n\t\t\t\t\t\t){\n\t\t\t\t\t\tfData[fCount]=tData[s];\n\t\t\t\t\t\tfCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(fData.length>0){\n\t\t\t\t\tnewSvg.addTrack(that.ttTrackList[r],3,\"DrawTrx\",fData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tthat.draw=function(data){\n\t\tthat.hideLoading();\n\n\t\t//d3.selectAll(\".\"+that.trackClass).remove();\n\t\t//data.sort(function(a, b){return a.getAttribute(\"start\")-b.getAttribute(\"start\")});\n\t\tthat.data=data;\n\t\t/*if($(\"#\"+that.trackClass+\"Dense\"+that.gsvg.levelNumber+\"Select\").length>0){\n\t\t\tthat.density=$(\"#\"+that.trackClass+\"Dense\"+that.gsvg.levelNumber+\"Select\").val();\n\t\t}*/\n\t\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t//var len=tmpMax-tmpMin;\n\t\tvar tmpBin=that.bin;\n\t\tvar tmpW=that.xScale(tmpMin+tmpBin)-that.xScale(tmpMin);\n\t\t/*if(that.gsvg.levelNumber<10 && (tmpW>2||tmpW<0.5)) {\n\t\t\tthat.updateFullData(0,1);\n\t\t}else{\n\t\t*/\n\t\tthat.redrawLegend();\n\t\t//var tmpMin=that.xScale.domain()[0];\n\t\t//var tmpMax=that.xScale.domain()[1];\n\t\tvar newData=[];\n\t\tvar newCount=0;\n\t\tvar tmpYMax=0;\n\t\tfor(var l=0;l<data.length;l++){\n\t\t\tif(typeof data[l]!=='undefined' ){\n\t\t\t\tvar start=parseInt(data[l].getAttribute(\"start\"),10);\n\t\t\t\tvar stop=parseInt(data[l].getAttribute(\"stop\"),10);\n\t\t\t\tvar count=parseInt(data[l].getAttribute(\"count\"),10);\n\t\t\t\tif(that.density!=1 ||(that.density==1 && start!=stop)){\n\t\t\t\t\tif((l+1)<data.length){\n\t\t\t\t\t\tvar startNext=parseInt(data[l+1].getAttribute(\"start\"),10);\n\t\t\t\t\t\tif(\t(start>=tmpMin&&start<=tmpMax) || (startNext>=tmpMin&&startNext<=tmpMax)){\n\t\t\t\t\t\t\tnewData[newCount]=data[l];\n\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif((start>=tmpMin&&start<=tmpMax)){\n\t\t\t\t\t\t\tnewData[newCount]=data[l];\n\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t}else{\n\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\tdata=newData;\n\t\tthat.svg.selectAll(\".\"+that.trackClass).remove();\n\t\tthat.svg.select(\".y.axis\").remove();\n\t\tthat.svg.select(\"g.grid\").remove();\n\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\tthat.svg.select(\".area\").remove();\n\t\tthat.svg.selectAll(\".area\").remove();\n\t\tif(that.density==1){\n\t\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t \tvar points=that.svg.selectAll(\".\"+that.trackClass)\n\t \t\t\t.data(data,keyStart);\n\t \tpoints.enter()\n\t\t\t\t\t.append(\"rect\")\n\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t.attr(\"y\",15)\n\t\t\t\t\t.attr(\"class\", that.trackClass)\n\t\t \t\t.attr(\"height\",10)\n\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t /*if((i+1)<that.data.length){\n\t\t\t\t\t\t\t\t\t\t if(that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif(that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t \twX=that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t.attr(\"fill\",that.color)\n\t\t\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\t\t\t\t//console.log(\"mouseover count track\");\n\t\t\t\t\t\t\tif(that.gsvg.isToolTip==0){\n\t\t\t\t\t\t\t\t//console.log(\"setup tooltip:countTrack\");\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"green\");\n\t\t \t\t\ttt.transition()\n\t\t\t\t\t\t\t\t\t.duration(200)\n\t\t\t\t\t\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\t\t\t\t\ttt.html(that.createToolTip(d))\n\t\t\t\t\t\t\t\t\t.style(\"left\", function(){return that.positionTTLeft(d3.event.pageX);})\n\t\t\t\t\t\t\t\t\t.style(\"top\", function(){return that.positionTTTop(d3.event.pageY);});\n\t\t\t\t\t\t\t\tif(that.ttSVG==1){\n\t\t\t\t\t\t\t\t\t//Setup Tooltip SVG\n\t\t\t\t\t\t\t\t\tthat.setupToolTipSVG(d,0.005);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t\t\t})\n\t\t\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\t\t\td3.select(this).style(\"fill\",that.color);\n\t\t\t tt.transition()\n\t\t\t\t\t\t\t .delay(500)\n\t\t\t .duration(200)\n\t\t\t .style(\"opacity\", 0);\n\t\t\t });\n\t\t\tthat.svg.attr(\"height\", 30);\n\t }else if(that.density==2){\n\t \tthat.yScale.domain([0, tmpYMax]);\n\t \tthat.yAxis = d3.axisLeft(that.yScale)\n \t\t\t\t.ticks(5);\n \t\tthat.svg.select(\"g.grid\").remove();\n \t\tthat.svg.select(\".y.axis\").remove();\n \t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t \tthat.svg.append(\"g\")\n\t\t .attr(\"class\", \"y axis\")\n\t\t .call(that.yAxis);\n\n\t\t that.svg.select(\"g.y\").selectAll(\"text\").each(function(d){\n\t\t \t\t\t\t\t\t\t\t\t\t\t\tvar str=new String(d);\n\t\t \t\t\t\t\t\t\t\t\t\t\t\tthat.svg.append(\"svg:text\").attr(\"class\",\"leftLbl\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"x\",that.gsvg.width-(str.length*7.8+5))\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"y\",function(){return that.yScale(d)})\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.01em\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"font-weight\",\"bold\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.text(numberWithCommas(d));\n\n\t\t\t\t\t\t\t\t \t\t\t\t\t\td3.select(this).attr(\"x\",function(){\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t\treturn str.length*7.7+5;\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t.attr(\"dy\",\"0.05em\");\n\t\t\t\t\t\t \t\t\t\t\t\t});\n\n\t \tthat.svg.append(\"g\")\n\t\t .attr(\"class\", \"grid\")\n\t\t .call(that.yAxis\n\t\t \t\t.tickSize((-that.gsvg.width+10), 0, 0)\n\t\t \t\t.tickFormat(\"\")\n\t\t \t\t);\n\t\t that.svg.select(\".area\").remove();\n\t\t that.area = d3.area()\n \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t .y0(140)\n\t\t\t\t .y1(function(d,i) { return that.yScale(d.getAttribute(\"count\"));; });\n\t\t that.svg.append(\"path\")\n\t\t \t.datum(data)\n\t\t \t.attr(\"class\", \"area\")\n\t\t \t.attr(\"stroke\",that.graphColorText)\n\t\t \t.attr(\"fill\",that.graphColorText)\n\t\t \t.attr(\"d\", that.area);\n\t\t\tthat.svg.attr(\"height\", 140);\n\t\t}\n\t\tthat.redrawSelectedArea();\n\t\t//}\n\t};\n\n\tthat.redrawLegend=function (){\n\n\t\tif(that.density==2){\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".legend\").remove();\n\t\t}else if(that.density==1){\n\t\t\tvar lblStr=new String(that.label);\n\t\t\tvar x=that.gsvg.width/2+(lblStr.length/2)*7.5-10;\n\t\t\tvar ltLbl=new String(\"<\"+that.scaleMin);\n\t\t\tthat.drawScaleLegend(that.scaleMin,numberWithCommas(that.scaleMax)+\"+\",\"Read Counts\",\"#EEEEEE\",\"#00000\",15+(ltLbl.length*7.6));\n\t\t\tthat.svg.append(\"text\").text(\"<\"+that.scaleMin).attr(\"class\",\"legend\").attr(\"x\",x).attr(\"y\",12);\n\t\t\tthat.svg.append(\"rect\")\n\t\t\t\t\t.attr(\"class\",\"legend\")\n\t\t\t\t\t.attr(\"x\",x+ltLbl.length*7.6+5)\n\t\t\t\t\t.attr(\"y\",0)\n\t\t\t\t\t.attr(\"rx\",2)\n\t\t\t\t\t.attr(\"ry\",2)\n\t\t\t \t.attr(\"height\",12)\n\t\t\t\t\t.attr(\"width\",15)\n\t\t\t\t\t.attr(\"fill\",\"#FFFFFF\")\n\t\t\t\t\t.attr(\"stroke\",\"#CECECE\");\n\t\t}\n\n\t};\n\n\tthat.redrawSelectedArea=function(){\n\t\tif(that.density>1){\n\t\t\tvar rectH=that.svg.attr(\"height\");\n\t\t\t\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".selectedArea\").remove();\n\t\t\tif(that.selectionStart>-1&&that.selectionEnd>-1){\n\t\t\t\tvar tmpStart=that.xScale(that.selectionStart);\n\t\t\t\tvar tmpW=that.xScale(that.selectionEnd)-tmpStart;\n\t\t\t\tif(tmpW<1){\n\t\t\t\t\ttmpW=1;\n\t\t\t\t}\n\t\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).append(\"rect\")\n\t\t\t\t\t\t\t\t.attr(\"class\",\"selectedArea\")\n\t\t\t\t\t\t\t\t.attr(\"x\",tmpStart)\n\t\t\t\t\t\t\t\t.attr(\"y\",0)\n\t\t\t\t \t\t\t.attr(\"height\",rectH)\n\t\t\t\t\t\t\t\t.attr(\"width\",tmpW)\n\t\t\t\t\t\t\t\t.attr(\"fill\",\"#CECECE\")\n\t\t\t\t\t\t\t\t.attr(\"opacity\",0.3)\n\t\t\t\t\t\t\t\t.attr(\"pointer-events\",\"none\");\n\t\t\t}\n\t\t}else{\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".selectedArea\").remove();\n\t\t}\n\t};\n\n\n\tthat.savePrevious=function(){\n\t\tthat.prevSetting={};\n\t\tthat.prevSetting.density=that.density;\n\t\tthat.prevSetting.scaleMin=that.scaleMin;\n\t\tthat.prevSetting.scaleMax=that.scaleMax;\n\t};\n\n\tthat.revertPrevious=function(){\n\t\tthat.density=that.prevSetting.density;\n\t\tthat.scaleMin=that.prevSetting.scaleMin;\n\t\tthat.scaleMax=that.prevSetting.scaleMax;\n\t};\n\n\tthat.generateTrackSettingString=function(){\n\t\treturn that.trackClass+\",\"+that.density+\",\"+that.include+\";\";\n\t};\n\n\tthat.generateSettingsDiv=function(topLevelSelector){\n\t\tvar d=trackInfo[that.trackClass];\n\t\tthat.savePrevious();\n\t\t//console.log(trackInfo);\n\t\t//console.log(d);\n\t\td3.select(topLevelSelector).select(\"table\").select(\"tbody\").html(\"\");\n\t\tif(d && d.Controls && d.Controls.length>0 ){\n\t\t\tvar controls=new String(d.Controls).split(\",\");\n\t\t\tvar table=d3.select(topLevelSelector).select(\"table\").select(\"tbody\");\n\t\t\ttable.append(\"tr\").append(\"td\").style(\"font-weight\",\"bold\").html(\"Track Settings: \"+d.Name);\n\t\t\tfor(var c=0;c<controls.length;c++){\n\t\t\t\tif(typeof controls[c]!=='undefined' && controls[c]!=\"\"){\n\t\t\t\t\tvar params=controls[c].split(\";\");\n\n\t\t\t\t\tvar div=table.append(\"tr\").append(\"td\");\n\t\t\t\t\tvar lbl=params[0].substr(5);\n\n\t\t\t\t\tvar def=\"\";\n\t\t\t\t\tif(params.length>3 && params[3].indexOf(\"Default=\")==0){\n\t\t\t\t\t\tdef=params[3].substr(8);\n\t\t\t\t\t}\n\t\t\t\t\tif(params[1].toLowerCase().indexOf(\"select\")==0){\n\t\t\t\t\t\tdiv.append(\"text\").text(lbl+\": \");\n\t\t\t\t\t\tvar selClass=params[1].split(\":\");\n\t\t\t\t\t\tvar opts=params[2].split(\"}\");\n\t\t\t\t\t\tvar id=that.trackClass+\"Dense\"+that.level+\"Select\";\n\t\t\t\t\t\tif(selClass[1]==\"colorSelect\"){\n\t\t\t\t\t\t\tid=that.trackClass+that.level+\"colorSelect\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar sel=div.append(\"select\").attr(\"id\",id)\n\t\t\t\t\t\t\t.attr(\"name\",selClass[1]);\n\t\t\t\t\t\tfor(var o=0;o<opts.length;o++){\n\t\t\t\t\t\t\tvar option=opts[o].substr(1).split(\":\");\n\t\t\t\t\t\t\tif(option.length==2){\n\t\t\t\t\t\t\t\tvar tmpOpt=sel.append(\"option\").attr(\"value\",option[1]).text(option[0]);\n\t\t\t\t\t\t\t\tif(id.indexOf(\"Dense\")>-1){\n\t\t\t\t\t\t\t\t\tif(option[1]==that.density){\n\t\t\t\t\t\t\t\t\t\ttmpOpt.attr(\"selected\",\"selected\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else if(option[1]==def){\n\t\t\t\t\t\t\t\t\ttmpOpt.attr(\"selected\",\"selected\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\td3.select(\"select#\"+id).on(\"change\", function(){\n\t\t\t\t\t\t\tif($(this).attr(\"id\")==that.trackClass+\"Dense\"+that.level+\"Select\" && $(this).val()==1){\n\t\t\t\t\t\t\t\t$(\"#scaleControl\"+that.level).show();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$(\"#scaleControl\"+that.level).hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthat.updateSettingsFromUI();\n\t\t\t\t\t\t\tthat.redraw();\n\t\t\t\t\t\t});\n\t\t\t\t\t}else if(params[1].toLowerCase().indexOf(\"slider\")==0){\n\t\t\t\t\t\tvar disp=\"none\";\n\t\t\t\t\t\tif(that.density==1){\n\t\t\t\t\t\t\tdisp=\"inline-block\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiv=div.append(\"div\").attr(\"id\",\"scaleControl\"+that.level).style(\"display\",disp);\n\t\t\t\t\t\tdiv.append(\"text\").text(lbl+\": \");\n\t\t\t\t\t\tdiv.append(\"input\").attr(\"type\",\"text\").attr(\"id\",\"amount\").attr(\"value\",that.scaleMin+\"-\"+that.scaleMax).style(\"border\",0).style(\"color\",\"#f6931f\").style(\"font-weight\",\"bold\").style(\"background-color\",\"#EEEEEE\");\n\t\t\t\t\t\tvar selClass=params[1].split(\":\");\n\t\t\t\t\t\tvar opts=params[2].split(\"}\");\n\n\t\t\t\t\t\tdiv=div.append(\"div\");\n\t\t\t\t\t\tdiv.append(\"text\").text(\"Min:\");\n\t\t\t\t\t\tdiv.append(\"div\").attr(\"id\",\"min-\"+selClass[1])\n\t\t\t\t\t\t\t.style(\"width\",\"60%\")\n\t\t\t\t\t\t\t.style(\"display\",\"inline-block\")\n\t\t\t\t\t\t\t.style(\"float\",\"right\");\n\t\t\t\t\t\tdiv.append(\"br\");\n\t\t\t\t\t\tdiv.append(\"text\").text(\"Max:\");\n\t\t\t\t\t\tdiv.append(\"div\").attr(\"id\",\"max-\"+selClass[1])\n\t\t\t\t\t\t\t.style(\"width\",\"60%\")\n\t\t\t\t\t\t\t.style(\"display\",\"inline-block\")\n\t\t\t\t\t\t\t.style(\"float\",\"right\");\n\n\t\t\t\t\t\t$( \"#min-\"+selClass[1] ).slider({\n\t\t\t\t\t\t\t min: 1,\n\t\t\t\t\t\t\t max: 1000,\n\t\t\t\t\t\t\t step:1,\n\t\t\t\t\t\t\t value: that.scaleMin\t ,\n\t\t\t\t\t\t\t slide: that.processSlider\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t$( \"#max-\"+selClass[1] ).slider({\n\t\t\t\t\t\t\t min: 1000,\n\t\t\t\t\t\t\t max: 20000,\n\t\t\t\t\t\t\t step:100,\n\t\t\t\t\t\t\t value: that.scaleMax ,\n\t\t\t\t\t\t\t slide: that.processSlider\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tthat.updateSettingsFromUI();\n\t\t\t\t\t\tthat.redraw();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar buttonDiv=table.append(\"tr\").append(\"td\");\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Remove Track\").style(\"float\",\"left\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\tthat.gsvg.removeTrack(that.trackClass);\n\t\t\t\tvar viewID=svgList[that.gsvg.levelNumber].currentView.ViewID;\n\t\t\t\tvar track=viewMenu[that.gsvg.levelNumber].findTrackByClass(that.trackClass,viewID);\n\t\t\t\tvar indx=viewMenu[that.gsvg.levelNumber].findTrackIndexWithViewID(track.TrackID,viewID);\n\t\t\t\tviewMenu[that.gsvg.levelNumber].removeTrackWithIDIdx(indx,viewID);\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Apply\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t\tif(that.density!=that.prevSetting.density || that.scaleMin!=that.prevSetting.scaleMin || that.scaleMax!= that.prevSetting.scaleMax){\n\t\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\t}\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Cancel\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\tthat.revertPrevious();\n\t\t\t\tthat.updateCountScale(that.scaleMin,that.scaleMax);\n\t\t\t\tthat.draw(that.data);\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t}else{\n\t\t\tvar table=d3.select(topLevelSelector).select(\"table\").select(\"tbody\");\n\t\t\ttable.append(\"tr\").append(\"td\").style(\"font-weight\",\"bold\").html(\"Track Settings: \"+d.Name);\n\t\t\ttable.append(\"tr\").append(\"td\").html(\"Sorry no settings for this track.\");\n\t\t\tvar buttonDiv=table.append(\"tr\").append(\"td\");\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Remove Track\").style(\"float\",\"left\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Cancel\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t}\n\t};\n\n\tthat.processSlider=function(event,ui){\n\t\tvar min=$( \"#min-rangeslider\" ).slider( \"value\");\n\t\tvar max=$( \"#max-rangeslider\" ).slider( \"value\");\n\t\t$( \"#amount\" ).val( min+ \" - \" + max );\n\t\tthat.updateCountScale(min,max);\n\t};\n\n\tthat.yScale = d3.scaleLinear()\n\t\t\t\t.range([140, 20])\n\t\t\t\t.domain([0, d3.max(data, function(d) { return d.getAttribute(\"count\"); })]);\n\n that.area = d3.area()\n \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t .y0(140)\n\t\t\t\t .y1(function(d) { return d.getAttribute(\"count\"); });\n\n that.yAxis = d3.axisLeft(that.yScale)\n \t\t\t\t.ticks(5);\n\n \tthat.redrawLegend();\n that.draw(data);\n\n\treturn that;\n}", "function TrackByFunction(){}", "constructor() {\n this._elapsedTime = 0\n this._timeScale = 1.0\n this._objects = []\n this._objectIDs = new WeakMap()\n }", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrackConstructor.apply( this, arguments );\n\n}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t \tKeyframeTrackConstructor.apply( this, arguments );\n\n\t }", "constructor() {\n super();\n //endregion\n //region Events\n //endregion\n //region Properties\n /**\n * Property field\n */\n this._record = null;\n }", "function KeyframeTrack( name, times, values, interpolation ) {\n\t\n\t\t\tKeyframeTrackConstructor.apply( this, arguments );\n\t\n\t\t}", "function Record() { }", "function Record() { }", "function Record() { }", "function Record(){}", "stopTracking() {\n HyperTrack.onTrackingStop();\n }", "addTrack() {\n\t\tthis.props.onAdd(this.props.track);\n\t}", "function analyse(track) {\n // This function is where the bulk of the API calls are being made from,\n // it gathers the info from Spotify and EchoNest which we load into the\n // track object in tracks[]\n\n track.echo = ENSearch(track) || null; // This lets us set a variable to\n // the results of ENSearch, or if\n // there are no results, null\n if (track.echo) { // if we had results\n track.echo.audio_summary = ENAudioSummary(track);\n track.echo.audio_analysis = ENAudioAnalysis(track);\n }\n\n track.spotify = track.spotify || SPMetadata(track);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9852f9c6;\n this.SUBCLASS_OF_ID = 0xf729eb9b;\n\n this.voice = args.voice || null;\n this.duration = args.duration;\n this.title = args.title || null;\n this.performer = args.performer || null;\n this.waveform = args.waveform || null;\n }", "constructor() {\n super();\n this.trackedAssets = new Map();\n this.totalTransferredBytes = 0;\n }", "constructor() {\n super();\n //region Private Methods\n //endregion\n //region Methods\n //endregion\n //region Events\n //endregion\n //region Properties\n /**\n * Property field\n */\n this._record = null;\n }", "function TrackEvents( parent ) {\n this.parent = parent;\n\n this.byStart = [{\n start: -1,\n end: -1\n }];\n\n this.byEnd = [{\n start: -1,\n end: -1\n }];\n this.animating = [];\n this.startIndex = 0;\n this.endIndex = 0;\n this.previousUpdateTime = -1;\n\n this.count = 1;\n }", "add(...args){ \n // value.constuctor.name; - return Class name \"Track,Artist,Album\";\n // value.name - return class.name \"Linkin park exemple\";\n // IF :for classes! if one value - this CLASS. if more value: first - Class, nexts - parameters this Class;\n //ELSE: For class parameters. If we have more then one parameters = > [new Class,...parametrs for this class ];\n let myArguments = [];\n myArguments.push(...args); \n // TRACK \n if(myArguments[0].constructor.name === \"Track\"){\n if(myArguments.length === 1){\n this.Track.push(myArguments[0]); \n }\n //FOR TRACK WE DON'T HAVE NECESSARY ADD ADDITIONAL PARAMETERS. IT'S NOT LOGICAL\n else{ return \"Pls using update for Track.\" } \n };\n\n // ALBUM\n if(myArguments[0].constructor.name === \"Album\"){\n if(myArguments.length === 1){\n this.Album.push(myArguments[0]);\n }\n else{\n this.Album.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n } \n }\n } \n });\n } \n };\n //ARTIST\n if(myArguments[0].constructor.name === \"Artist\"){\n if(myArguments.length === 1){\n this.Artist.push(myArguments[0]);\n }\n else{\n this.Artist.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n }\n if(myArguments[i][i-1].constructor.name === \"Album\"){\n element.albums = element.albums.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n }\n if(myArguments[i].constructor.name === \"Album\"){\n element.albums.push(myArguments[i]);\n }\n \n }\n } \n });\n } \n }; \n }", "constructor(songTitle, artistName, year) {\n console.log(\"Creating a new Song...\", songTitle);\n // \"this\" is the generic name you use to REFER TO THE OBJECT\n this.title = songTitle;\n this.artist = artistName;\n this.releaseYear = year;\n }", "function _itemHandler() {\n\t _tracks = [];\n\t _tracksById = {};\n\t _unknownCount = 0;\n\t }", "function Record() {}", "function Record() {}", "function Record() {}", "constructor (framework) {\n this.framework = framework\n this.id = null\n this.active = true\n\n this.tracker = new OoyalaTracker()\n nrvideo.Core.addTracker(this.tracker)\n\n this.getName = function () {\n return 'newrelic'\n }\n\n this.getVersion = function () {\n return this.tracker.getTrackerVersion()\n }\n\n this.setPluginID = function (id) {\n this.id = id\n }\n\n this.getPluginID = function () {\n return this.id\n }\n\n this.init = function () {\n if (this.framework) {\n this.framework.getRecordedEvents().forEach((event) => {\n this.tracker.onEvent(event.eventName, event.params)\n })\n }\n }\n\n this.setMetadata = function (data) {}\n\n this.processEvent = function (event, params) {\n try {\n this.tracker.onEvent(event, params)\n } catch (err) {\n nrvideo.Log.error(err)\n }\n }\n\n this.destroy = function () {\n nrvideo.Core.removeTracker(this.tracker)\n delete this.tracker\n delete this.framework\n }\n }", "track({eventType, args}) {\n this.handleEvent(eventType, args);\n }", "pushTrack() {\n console.log('pushing a song to the local DB')\n }", "function track(/* obj, event, uid */) {\n\tvar that = this;\n\tvar args = arguments;\n\tsetTimeout(function() { doTrack.apply(that, args); }, 0);\n}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n const newTrack = new Track(this.idGenerator.generateId(), trackData.name, trackData.duration, trackData.genres);\n album.addTrack(newTrack);\n return newTrack;\n }", "getQueue() {\n return this.trackInfo;\n }", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}", "function onPlayerTrackChanged(event){\n\t\tClientSocket.sendJSON({ \"propertyName\": \"artist\", \"propertyValue\": event.artist });\n\t\tClientSocket.sendJSON({ \"propertyName\": \"artistUri\", \"propertyValue\": event.artistUri });\n\t\tClientSocket.sendJSON({ \"propertyName\": \"track\", \"propertyValue\": event.track });\n\t\tClientSocket.sendJSON({ \"propertyName\": \"trackUri\", \"propertyValue\": event.trackUri });\t\t\n\t}", "static toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': convertArray( track.times, Array ),\n\t\t\t\t'values': convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n return album.addTrack(trackData);\n }", "function KeyframeTrack( name, times, values, interpolation ) {\n\n\t\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t\t}", "function CanvasTrack(options) {\n // call super\n this.Track = Track;\n this.Track(options);\n \n this.onAddTrack = function (view) {\n this.canvas = $(\"<canvas></canvas>\");\n this.canvas.attr(\"width\", this.mainWidth);\n this.canvas.attr(\"height\", this.height);\n this.ctx = this.canvas.get(0).getContext(\"2d\");\n\n this.main.append(this.canvas);\n };\n \n this.beginTransform = function(view) {\n var c = this.ctx;\n var scale = this.mainWidth / (view.end - view.start);\n\n c.clearRect(0, 0, this.mainWidth, this.height);\n c.save();\n c.scale(scale, 1);\n c.translate(-view.start, 0);\n c.lineWidth /= scale; \n };\n \n this.endTransform = function() {\n this.ctx.restore();\n }\n}", "startTracking() {\n HyperTrack.onTrackingStart();\n }", "function Lagomoro_Recorder() {\r\n this.initialize.apply(this, arguments);\r\n}", "function Track(url, left) {\n var thisTrack = this;\n var e = document.createElement(\"div\");\n e.track = thisTrack;\n e.className = \"track loading\";\n thisTrack.isLeftTrack = left;\n\n // It is important that this element be the first child!\n // when we load a new file, it changes child[0].\n var nameElement = document.createElement(\"div\");\n nameElement.className = \"name\";\n var name = url.slice(url.lastIndexOf(\"/\") + 1);\n var dot = name.lastIndexOf(\".\");\n if (dot != -1) name = name.slice(0, dot);\n nameElement.appendChild(document.createTextNode(name));\n this.nameElement = nameElement;\n e.appendChild(nameElement);\n\n var cueButton = document.createElement(\"div\");\n cueButton.className = \"cueButton\";\n cueButton.appendChild(document.createTextNode(\"CUE\"));\n cueButton.onclick = cue;\n e.appendChild(cueButton);\n\n var powerButton = document.createElement(\"div\");\n powerButton.className = \"powerButton\";\n\n var powerImg = document.createElement(\"img\");\n powerImg.src = \"img/power.png\";\n powerButton.appendChild(powerImg);\n powerButton.onclick = function (e) {\n if (this.parentNode.track) {\n if (this.parentNode.track.togglePlaybackSpinUpDown())\n this.classList.add(\"active\");\n else this.classList.remove(\"active\");\n }\n };\n e.appendChild(powerButton);\n\n var bufferdrawer = document.createElement(\"div\");\n bufferdrawer.className = \"audiobuffer\";\n bufferdrawer.onclick = function (ev) {\n this.parentNode.track.jumpToPoint(\n (ev.offsetX / 370.0) * this.parentNode.track.buffer.duration\n );\n };\n\n var canvas = document.createElement(\"canvas\");\n canvas.width = \"370\";\n canvas.height = \"50\";\n this.bufferCanvas = canvas;\n //\tbufferdrawer.appendChild(canvas);\n\n canvas = document.createElement(\"canvas\");\n canvas.width = \"370\";\n canvas.height = \"50\";\n canvas.style.zIndex = \"100\";\n this.trackDisplayCanvas = canvas;\n bufferdrawer.appendChild(canvas);\n\n e.appendChild(bufferdrawer);\n\n var deck = document.createElement(\"div\");\n deck.className = \"deck\";\n var disc = document.createElement(\"div\");\n disc.className = \"disc\";\n\n var platter = document.createElement(\"canvas\");\n platter.className = \"platter\";\n this.platter = platter;\n this.platterContext = platter.getContext(\"2d\");\n this.platterContext.fillStyle = \"white\";\n platter.width = 300;\n platter.height = 300;\n this.platterContext.translate(150, 150);\n this.platterContext.font = \"22px 'Chango', sans-serif\";\n\n disc.appendChild(platter);\n deck.appendChild(disc);\n e.appendChild(deck);\n\n e.appendChild(document.createTextNode(\"rate\"));\n\n var pbrSlider = document.createElement(\"input\");\n pbrSlider.className = \"slider\";\n pbrSlider.type = \"range\";\n pbrSlider.min = \"-2\";\n pbrSlider.max = \"2\";\n pbrSlider.step = \"0.01\";\n pbrSlider.value = \"1\";\n pbrSlider.oninput = function (event) {\n this.parentNode.track.changePlaybackRate(event.target.value);\n };\n e.appendChild(pbrSlider);\n\n var pbrText = document.createElement(\"span\");\n pbrText.appendChild(document.createTextNode(\"1.00\"));\n e.appendChild(pbrText);\n this.pbrText = pbrText;\n\n e.appendChild(document.createElement(\"br\"));\n e.appendChild(document.createTextNode(\"gain\"));\n\n var gainSlider = document.createElement(\"input\");\n gainSlider.className = \"slider\";\n gainSlider.type = \"range\";\n gainSlider.min = \"0\";\n gainSlider.max = \"2\";\n gainSlider.step = \"0.01\";\n gainSlider.value = \"1\";\n gainSlider.oninput = function (event) {\n this.parentNode.track.changeGain(event.target.value);\n };\n e.appendChild(gainSlider);\n\n var gainText = document.createElement(\"span\");\n gainText.appendChild(document.createTextNode(\"1.00\"));\n e.appendChild(gainText);\n this.gainText = gainText;\n\n document.getElementById(\"trackContainer\").appendChild(e);\n this.trackElement = e;\n\n e.addEventListener(\n \"dragover\",\n function (evt) {\n evt.stopPropagation();\n evt.preventDefault();\n evt.dataTransfer.dropEffect = \"copy\"; // Explicitly show this is a copy.\n },\n false\n );\n\n e.addEventListener(\n \"dragenter\",\n function () {\n e.classList.add(\"droptarget\");\n return false;\n },\n false\n );\n e.addEventListener(\n \"dragleave\",\n function () {\n e.classList.remove(\"droptarget\");\n return false;\n },\n false\n );\n\n e.addEventListener(\n \"drop\",\n function (ev) {\n ev.preventDefault();\n e.classList.remove(\"droptarget\");\n e.firstChild.innerHTML = ev.dataTransfer.files[0].name;\n e.classList.add(\"loading\");\n\n var reader = new FileReader();\n reader.onload = function (event) {\n audioCtx.decodeAudioData(\n event.target.result,\n function (buffer) {\n if (thisTrack.isPlaying) thisTrack.togglePlayback();\n\n thisTrack.buffer = buffer;\n thisTrack.postLoadTasks();\n },\n function () {\n alert(\"error loading!\");\n }\n );\n };\n reader.onerror = function (event) {\n alert(\"Error: \" + reader.error);\n };\n reader.readAsArrayBuffer(ev.dataTransfer.files[0]);\n return false;\n },\n false\n );\n\n this.gain = 1.0;\n this.gainSlider = gainSlider;\n this.pbrSlider = pbrSlider;\n this.currentPlaybackRate = 1.0;\n this.lastBufferTime = 0.0;\n this.isPlaying = false;\n this.loadNewTrack(url);\n this.xfadeGain = audioCtx.createGain();\n this.xfadeGain.gain.value = 0.5;\n this.xfadeGain.connect(masterGain);\n\n this.low = audioCtx.createBiquadFilter();\n this.low.type = \"lowshelf\";\n this.low.frequency.value = 320.0;\n this.low.gain.value = 0.0;\n this.low.connect(this.xfadeGain);\n\n this.mid = audioCtx.createBiquadFilter();\n this.mid.type = \"peaking\";\n this.mid.frequency.value = 1000.0;\n this.mid.Q.value = 0.5;\n this.mid.gain.value = 0.0;\n this.mid.connect(this.low);\n\n this.high = audioCtx.createBiquadFilter();\n this.high.type = \"highshelf\";\n this.high.frequency.value = 3200.0;\n this.high.gain.value = 0.0;\n this.high.connect(this.mid);\n\n this.filter = audioCtx.createBiquadFilter();\n this.filter.frequency.value = 20000.0;\n this.filter.type = this.filter.LOWPASS;\n this.filter.connect(this.high);\n this.cues = [null, null, null, null];\n this.cueButton = cueButton;\n this.cueDeleteMode = false;\n}", "function linkTrack(zn,vl) {\r\nif ((typeof(vl)!=\"string\")||(typeof(zn)!= \"string\")||(typeof s_account!='string'))return false;\r\nvl = _oChr(vl.substring(0,200));\r\nvar s_time = s_gi(s_account);\r\ns_time.linkTrackVars = \"events,eVar12,products,list2\";\r\ns_time.linkTrackEvents = s_time.events = \"event12\";\r\ns_time.eVar12 = zn+\" | \"+vl;\r\ns_time.products = \";\"+s_time.getTimeParting(\"h\",\"-5\",s_time.tiiGetFullYear());\r\nif(/^premium\\:/i.test(vl)){s_time.linkTrackEvents = s_time.events = \"event12,event30\";s_time.list2 = s_time.eVar12;}\r\ns_time.tl(this,\"o\",\"LinkTrack:\"+zn);\r\ns_time.eVar12 = s_time.list2 = s_time.events = \"\";\r\ns_time.linkTrackVars = s_time.linkTrackEvents = \"None\";\r\n}", "function uv_track() {\n\t\n\t//var hours = currentTime.getHours();\n\t//var minutes = currentTime.getMinutes();\n\t//Ti.API.info(hours+':'+minutes);\n\t\n\tTi.API.info('prevLocTime' + prevLocTime);\n\tTi.API.info('currLocTime' + currLocTime);\n\n\tif (prevLocTime.tracking) { // if previous location was a tracking location\n\t\t// do the actual tracking here\n\t}\t\t\n\tget_uvi_data(currLocTime.latitude,currLocTime.longitude, show_uvi_tracking);\n\t// Show the current location tracking characteristics on the window\n\t// Now the currLocTime is saved into previous. Prepare for next tracking\n\tprevLocTime = currLocTime;\n}", "onrecord() {}", "get trackingDuration(){\n return this._trackingDuration;\n }", "addTrack() {\n this.props.onAdd(this.props.track);\n }", "constructor(){\n this.startTime = 0;\n this.endTime = 0; \n this.running = 0;\n this.duration = 0;\n }", "__init10() {this._stopRecording = null;}", "function Song(artist, songName, trackNumber, songSource){\n this.artist = artist;\n this.songName = songName;\n this.trackNumber = trackNumber;\n this.songSource = songSource;\n}", "addTrack(albumId, trackData) {\n return this.artistManager.createTrack(trackData, undefined, albumId);\n }", "track() {\n return this.reference('href');\n }" ]
[ "0.80746186", "0.69578147", "0.66246176", "0.65037555", "0.6486355", "0.63549525", "0.63521606", "0.6281663", "0.617277", "0.6158071", "0.61524516", "0.6124985", "0.60306877", "0.59384924", "0.5901742", "0.58975875", "0.58496034", "0.58457863", "0.5836015", "0.58100414", "0.58080417", "0.57710797", "0.57689947", "0.5768218", "0.57661337", "0.5741358", "0.5719132", "0.57157475", "0.5661443", "0.5656207", "0.56560624", "0.56535697", "0.5651287", "0.5618996", "0.56182754", "0.5603081", "0.55981207", "0.55879885", "0.55812985", "0.5573614", "0.5569285", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5562578", "0.5556362", "0.55497605", "0.5547171", "0.5543951", "0.5543951", "0.5543951", "0.5541736", "0.5535863", "0.5533496", "0.55195194", "0.55165666", "0.54988474", "0.5494017", "0.5488804", "0.54743785", "0.547369", "0.5468497", "0.54636884", "0.54636884", "0.54636884", "0.5457742", "0.54571706", "0.54557353", "0.54524046", "0.5445854", "0.5444086", "0.54300445", "0.54300445", "0.54300445", "0.54300445", "0.54300445", "0.5425611", "0.5421694", "0.54168224", "0.54154164", "0.54040956", "0.54039395", "0.5397309", "0.5395745", "0.5384966", "0.5383584", "0.53817326", "0.5377131", "0.5375751", "0.5367218", "0.5363698", "0.53577363", "0.5351796", "0.5345744" ]
0.0
-1
add more midiEventsmessages >here the objective is to include all standard midi messages end of class object MidiMessage construction and send objects transforma los Sketchobjetos en strings de midi en hexadecimal
function MidiSketch(command, SketchObject){ if(command==="write"){ //console.log(SketchObject); if(SketchObject instanceof MidiMessage){ return SketchObject.hex; } if(SketchObject instanceof MidiTrack) { return SketchObject.track_chunk+ SketchObject.track_length+ SketchObject.midi_events_array; } if(SketchObject instanceof MidiObject){ //primero la cabecera var hexstring=""; var _array_ojt=SketchObject.tracks_array; //we run inside the headerchunk parameter, and extract all the values and store it into a hexadecimalstring for (i=0; i<SketchObject.chunk_header.length; i++){ hexstring+=SketchObject.chunk_header[i];//write the chunck header concatenated in one hexadecimal string } //thes same but now run inside the tracks array, where the stored tracks would be attached for (i=0; i<SketchObject.tracks_array.length; i++){ //use console log for debugg //console.log(i+ " y "+ hexstring+ "Y" + SketchObject.tracks_array[i]); hexstring+= SketchObject.tracks_array[i].track_chunk+ _array_ojt[i].track_length+ _array_ojt[i].midi_events_array; } return hexstring; // return all together into the hexadecimal string, ready for writting on a file or other staff } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MidiMessage( event_name, data1, data2, user_delta, user_channel){\n //user channel number from 0 to 15 no string, integer please\n this.hex;\n this.messageLength;\n var _delta=\"00\";\n var _channel=\"0\";\n var _data1def=\"3c\";//default middle C decimal 60\n var _data2def=\"7f\"; //default velocity d 127\n\n if(user_delta){\n _delta=user_delta;\n }\n if(user_channel){\n if(user_channel<0||user_channel>15){\n console.log(user_channel+\" Its not a correct channel (1-16\");\n }\n else{\n _channel=(user_channel-1).toString(16);\n }\n }\n if(data1){\n if(data1<0||data1>127){\n console.log(data1+\" It's not a correct note number 0-127// in decimal\")\n } \n else{\n _data1def=data1.toString(16);\n }\n } \n else{\n console.log(\"please, define the data1 value\");\n } \n if(data2){ \n if(data2<0||data2>127){\n console.log(data1+\" It's not a correct velocity value number 0-127// in decimal\")\n }\n else{ \n _data2def=data2.toString(16);\n }\n }\n else{\n console.log(\"please, define the data2 value\");\n } \n\n \n\n //event executions\n if(event_name===\"noteOn\"){//noteOn midi message\n var _noteOn=_delta+\"9\"+_channel+_data1def+_data2def;//data1- note number \n this.hex=_noteOn;//data2- velocity\n this.messageLength=4;// this event is 4 byte long\n } \n if (event_name===\"noteOff\") {//noteOff midi message\n var _noteOff=_delta+\"8\"+_channel+_data1def+_data2def;//data1-note number \n this.hex=_noteOff; //ata2 -velocity of key release\n this.messageLength=4;\n }\n \n if (event_name===\"endTrack\"){\n var _fin_track=\"01ff2f00\";\n this.hex=_fin_track; //ata2 -velocity of key release\n this.messageLength=4; \n }\n /*if (event_name===\"key\"){\n var _key=_delta+\"ff590200\";//event name\n //control of the key signature-- in decimals 0 == no accidents\n // negative numbers, number of flats-- -2 === 2 flats\n //positive numbers, number of sharps in the equal tonal mode \n var _accidents=\n this.hex=_key+hex_accidents;\n//revisar con el pdf////////////////////////////\n this.messageLength=6;\n\n }\n*/\n }", "_onMidiMessage(e) {\n // Create Message object from MIDI data\n const message = new Message(e.data);\n /**\n * Event emitted when any MIDI message is received on an `Input`.\n *\n * @event Input#midimessage\n *\n * @type {object}\n *\n * @property {Input} port The `Input` that triggered the event.\n * @property {Input} target The object that dispatched the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n * @property {string} type `midimessage`\n *\n * @since 2.1\n */\n\n const event = {\n port: this,\n target: this,\n message: message,\n timestamp: e.timeStamp,\n type: \"midimessage\",\n data: message.data,\n // @deprecated (will be removed in v4)\n rawData: message.data,\n // @deprecated (will be removed in v4)\n statusByte: message.data[0],\n // @deprecated (will be removed in v4)\n dataBytes: message.dataBytes // @deprecated (will be removed in v4)\n\n };\n this.emit(\"midimessage\", event); // Messages are forwarded to InputChannel if they are channel messages or parsed locally for\n // system messages.\n\n if (message.isSystemMessage) {\n // system messages\n this._parseEvent(event);\n } else if (message.isChannelMessage) {\n // channel messages\n this.channels[message.channel]._processMidiMessageEvent(event);\n } // Forward message if forwarders have been defined\n\n\n this._forwarders.forEach(forwarder => forwarder.forward(message));\n }", "function MidiObject(){\n //this.tracks=\"00\";//hay que cambiarlo\n this.chunk_header=[];//store the header chunk here// in the future we add a funtion to include the copyright \n this.total_tracks=0; //number of track stored in the array\n this.tracks_array=[];//store the tracks with their events in this array\n \n \n//metodos\n\n\n\n\n//getters & setters\n MidiObject.prototype.getTrack= function(id){\n return this.tracks_array[id];\n };\n \n MidiObject.prototype.getNumberTracks= function(){\n return this.total_tracks;\n };\n\n/*function getHex(number){\n return number.toString(16);\n}\n\n//propuesta de herramienta para ayudar al usuario de la lib\n\n*/ \n\nMidiObject.prototype.setChunk = function(user_format, tracks, user_length, user_ticks){\n var track_number=\"00\";//default values\n var midi_format=\"01\";\n var length=\"06\";\n var ticks=\"10\";\n // b = typeof b !== 'undefined' ? b : 1; //its ok? \n // return a*b; // then do it\n //2 line for default parameters\n if (user_format){\n if(user_format>-1&&user_format<4){\n midi_format=\"0\"+user_format.toString();\n }\n else{\n //error no es el formato correcto\n console.log(user_format+\" Is a wrong midi format.\");\n }\n } \n if(tracks){\n track_number=tracks.toString();\n }\n if (user_length){\n length=user_length.toString();\n }\n if(user_ticks){\n ticks==user_ticks.toString();\n }\n//call the property and asign the headr to the MidiSketch Object\n \n this.chunk_header=[\"4d\", \"54\", \"68\", \"64\", \"00\", \"00\", \n \"00\", length,// weight of the midi header chunk Allways 6 by default\n \"00\", midi_format, // single-track format //0x01 multitrack\n \"00\", track_number, // one track for testing /more tracks=poliphony\n \"00\", ticks] // 16 ticks per quarter// m0x20 === 32 ticks played more quickly\n\n }\n \n\n\n\nMidiObject.prototype.addTrack= function(Track){\n //add a track to the Sketch-- good for writing then into a file\n var _ceros;\n var _tracknum= this.chunk_header[11];\n var _new_tracknum=parseInt(_tracknum, 16)+1;\n \n if(_new_tracknum<16){\n _ceros=\"0\";\n }\n if(_new_tracknum>15){\n _ceros=\"\";\n } \n \n\n this.chunk_header[11]=_ceros+ _new_tracknum.toString(16);\n //add the new track size to the array important be exact because it doesn't work instead\n //console.log(Track);\n this.tracks_array.push(Track);\n this.total_tracks+=1;\n }\n\n//track getter\n//track getter midiarray\n\nMidiObject.prototype.getTrack=function(id){\n if (this.tracks_array[id-1] !==undefined){\n return this.tracks_array[id-1];\n }\n else{\n console.log(\"there is nothing inside this \"+(id+1) +\"track\");\n }\n\n }\n \n\n}", "function MIDIEvents() {\n\t\t\t\tthrow new Error('MIDIEvents function not intended to be run.');\n\t\t\t}", "_parseEventForStandardMessages(e) {\n const event = Object.assign({}, e);\n event.type = event.message.type || \"unknownmessage\";\n const data1 = e.message.dataBytes[0];\n const data2 = e.message.dataBytes[1];\n\n if (event.type === \"noteoff\" || event.type === \"noteon\" && data2 === 0) {\n this.notesState[data1] = false;\n event.type = \"noteoff\"; // necessary for note on with 0 velocity\n\n /**\n * Event emitted when a **note off** MIDI message has been received on the channel.\n *\n * @event InputChannel#noteoff\n *\n * @type {object}\n * @property {string} type `noteoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the incoming\n * MIDI message.\n * @property {number} timestamp The moment\n * ([`DOMHighResTimeStamp`](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp))\n * when the event occurred (in milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name,\n * octave and release velocity.\n * @property {number} value The release velocity amount expressed as a float between 0 and 1.\n * @property {number} rawValue The release velocity amount expressed as an integer (between 0\n * and 127).\n */\n // The object created when a noteoff event arrives is a Note with an attack velocity of 0.\n\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset), {\n rawAttack: 0,\n rawRelease: data2\n });\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // Those are kept for backwards-compatibility but are gone from the documentation. They will\n // be removed in future versions (@deprecated).\n\n event.velocity = event.note.release;\n event.rawVelocity = event.note.rawRelease;\n } else if (event.type === \"noteon\") {\n this.notesState[data1] = true;\n /**\n * Event emitted when a **note on** MIDI message has been received.\n *\n * @event InputChannel#noteon\n *\n * @type {object}\n * @property {string} type `noteon`\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name,\n * octave and release velocity.\n * @property {number} value The attack velocity amount expressed as a float between 0 and 1.\n * @property {number} rawValue The attack velocity amount expressed as an integer (between 0\n * and 127).\n */\n\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset), {\n rawAttack: data2\n });\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // Those are kept for backwards-compatibility but are gone from the documentation. They will\n // be removed in future versions (@deprecated).\n\n event.velocity = event.note.attack;\n event.rawVelocity = event.note.rawAttack;\n } else if (event.type === \"keyaftertouch\") {\n /**\n * Event emitted when a **key-specific aftertouch** MIDI message has been received.\n *\n * @event InputChannel#keyaftertouch\n *\n * @type {object}\n * @property {string} type `\"keyaftertouch\"`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name\n * and number.\n * @property {number} value The aftertouch amount expressed as a float between 0 and 1.\n * @property {number} rawValue The aftertouch amount expressed as an integer (between 0 and\n * 127).\n */\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset)); // Aftertouch value\n\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // @deprecated\n\n event.identifier = event.note.identifier;\n event.key = event.note.number;\n event.rawKey = data1;\n } else if (event.type === \"controlchange\") {\n /**\n * Event emitted when a **control change** MIDI message has been received.\n *\n * @event InputChannel#controlchange\n *\n * @type {object}\n * @property {string} type `controlchange`\n * @property {string} subtype The type of control change message that was received.\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n event.controller = {\n number: data1,\n name: Enumerations.CONTROL_CHANGE_MESSAGES[data1].name,\n description: Enumerations.CONTROL_CHANGE_MESSAGES[data1].description,\n position: Enumerations.CONTROL_CHANGE_MESSAGES[data1].position\n };\n event.subtype = event.controller.name || \"controller\" + data1;\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2;\n /**\n * Event emitted when a **control change** MIDI message has been received and that message is\n * targeting the controller numbered \"xxx\". Of course, \"xxx\" should be replaced by a valid\n * controller number (0-127).\n *\n * @event InputChannel#controlchange-controllerxxx\n *\n * @type {object}\n * @property {string} type `controlchange-controllerxxx`\n * @property {string} subtype The type of control change message that was received.\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n const numberedEvent = Object.assign({}, event);\n numberedEvent.type = `${event.type}-controller${data1}`;\n delete numberedEvent.subtype;\n this.emit(numberedEvent.type, numberedEvent);\n /**\n * Event emitted when a **controlchange-bankselectcoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-bankselectcoarse\n *\n * @type {object}\n * @property {string} type `controlchange-bankselectcoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-modulationwheelcoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-modulationwheelcoarse\n *\n * @type {object}\n * @property {string} type `controlchange-modulationwheelcoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-breathcontrollercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-breathcontrollercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-breathcontrollercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-footcontrollercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-footcontrollercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-footcontrollercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentotimecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentotimecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-portamentotimecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataentrycoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataentrycoarse\n *\n * @type {object}\n * @property {string} type `controlchange-dataentrycoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-volumecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-volumecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-volumecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-balancecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-balancecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-balancecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-pancoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-pancoarse\n *\n * @type {object}\n * @property {string} type `controlchange-pancoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-expressioncoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-expressioncoarse\n *\n * @type {object}\n * @property {string} type `controlchange-expressioncoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol1coarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol1coarse\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol1coarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol2coarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol2coarse\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol2coarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller1** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller1\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller1`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller2** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller2\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller2`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller3** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller3\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller3`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller4** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller4\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller4`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-bankselectfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-bankselectfine\n *\n * @type {object}\n * @property {string} type `controlchange-bankselectfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-modulationwheelfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-modulationwheelfine\n *\n * @type {object}\n * @property {string} type `controlchange-modulationwheelfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-breathcontrollerfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-breathcontrollerfine\n *\n * @type {object}\n * @property {string} type `controlchange-breathcontrollerfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-footcontrollerfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-footcontrollerfine\n *\n * @type {object}\n * @property {string} type `controlchange-footcontrollerfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentotimefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentotimefine\n *\n * @type {object}\n * @property {string} type `controlchange-portamentotimefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataentryfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataentryfine\n *\n * @type {object}\n * @property {string} type `controlchange-dataentryfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-channelvolumefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-channelvolumefine\n *\n * @type {object}\n * @property {string} type `controlchange-channelvolumefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-balancefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-balancefine\n *\n * @type {object}\n * @property {string} type `controlchange-balancefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-panfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-panfine\n *\n * @type {object}\n * @property {string} type `controlchange-panfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-expressionfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-expressionfine\n *\n * @type {object}\n * @property {string} type `controlchange-expressionfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol1fine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol1fine\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol1fine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol2fine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol2fine\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol2fine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-damperpedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-damperpedal\n *\n * @type {object}\n * @property {string} type `controlchange-damperpedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamento** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamento\n *\n * @type {object}\n * @property {string} type `controlchange-portamento`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-sostenuto** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-sostenuto\n *\n * @type {object}\n * @property {string} type `controlchange-sostenuto`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-softpedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-softpedal\n *\n * @type {object}\n * @property {string} type `controlchange-softpedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-legatopedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-legatopedal\n *\n * @type {object}\n * @property {string} type `controlchange-legatopedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-hold2** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-hold2\n *\n * @type {object}\n * @property {string} type `controlchange-hold2`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-soundvariation** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-soundvariation\n *\n * @type {object}\n * @property {string} type `controlchange-soundvariation`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-resonance** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-resonance\n *\n * @type {object}\n * @property {string} type `controlchange-resonance`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-releasetime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-releasetime\n *\n * @type {object}\n * @property {string} type `controlchange-releasetime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-attacktime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-attacktime\n *\n * @type {object}\n * @property {string} type `controlchange-attacktime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-brightness** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-brightness\n *\n * @type {object}\n * @property {string} type `controlchange-brightness`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-decaytime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-decaytime\n *\n * @type {object}\n * @property {string} type `controlchange-decaytime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratorate** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratorate\n *\n * @type {object}\n * @property {string} type `controlchange-vibratorate`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratodepth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratodepth\n *\n * @type {object}\n * @property {string} type `controlchange-vibratodepth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratodelay** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratodelay\n *\n * @type {object}\n * @property {string} type `controlchange-vibratodelay`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller5** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller5\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller5`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller6** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller6\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller6`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller7** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller7\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller7`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller8** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller8\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller8`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentocontrol** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentocontrol\n *\n * @type {object}\n * @property {string} type `controlchange-portamentocontrol`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-highresolutionvelocityprefix** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-highresolutionvelocityprefix\n *\n * @type {object}\n * @property {string} type `controlchange-highresolutionvelocityprefix`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect1depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect1depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect1depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect2depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect2depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect2depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect3depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect3depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect3depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect4depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect4depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect4depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect5depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect5depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect5depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataincrement** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataincrement\n *\n * @type {object}\n * @property {string} type `controlchange-dataincrement`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-datadecrement** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-datadecrement\n *\n * @type {object}\n * @property {string} type `controlchange-datadecrement`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-nonregisteredparameterfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-nonregisteredparameterfine\n *\n * @type {object}\n * @property {string} type `controlchange-nonregisteredparameterfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-nonregisteredparametercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-nonregisteredparametercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-nonregisteredparametercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-registeredparameterfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-registeredparameterfine\n *\n * @type {object}\n * @property {string} type `controlchange-registeredparameterfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-registeredparametercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-registeredparametercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-registeredparametercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-allsoundoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-allsoundoff\n *\n * @type {object}\n * @property {string} type `controlchange-allsoundoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-resetallcontrollers** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-resetallcontrollers\n *\n * @type {object}\n * @property {string} type `controlchange-resetallcontrollers`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-localcontrol** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-localcontrol\n *\n * @type {object}\n * @property {string} type `controlchange-localcontrol`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-allnotesoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-allnotesoff\n *\n * @type {object}\n * @property {string} type `controlchange-allnotesoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-omnimodeoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-omnimodeoff\n *\n * @type {object}\n * @property {string} type `controlchange-omnimodeoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-omnimodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-omnimodeon\n *\n * @type {object}\n * @property {string} type `controlchange-omnimodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-monomodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-monomodeon\n *\n * @type {object}\n * @property {string} type `controlchange-monomodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-polymodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-polymodeon\n *\n * @type {object}\n * @property {string} type `controlchange-polymodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n const namedEvent = Object.assign({}, event);\n namedEvent.type = `${event.type}-` + Enumerations.CONTROL_CHANGE_MESSAGES[data1].name;\n delete namedEvent.subtype; // Dispatch controlchange-\"function\" events only if the \"function\" is defined (not the generic\n // controllerXXX nomenclature)\n\n if (namedEvent.type.indexOf(\"controller\") !== 0) {\n this.emit(namedEvent.type, namedEvent);\n } // Trigger channel mode message events (if appropriate)\n\n\n if (event.message.dataBytes[0] >= 120) this._parseChannelModeMessage(event); // Parse the inbound event to see if its part of an RPN/NRPN sequence\n\n if (this.parameterNumberEventsEnabled && this._isRpnOrNrpnController(event.message.dataBytes[0])) {\n this._parseEventForParameterNumber(event);\n }\n } else if (event.type === \"programchange\") {\n /**\n * Event emitted when a **program change** MIDI message has been received.\n *\n * @event InputChannel#programchange\n *\n * @type {object}\n * @property {string} type `programchange`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as an integer between 0 and 127.\n * @property {number} rawValue The raw MIDI value expressed as an integer between 0 and 127.\n */\n event.value = data1;\n event.rawValue = event.value;\n } else if (event.type === \"channelaftertouch\") {\n /**\n * Event emitted when a control change MIDI message has been received.\n *\n * @event InputChannel#channelaftertouch\n *\n * @type {object}\n * @property {string} type `channelaftertouch`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The raw MIDI value expressed as an integer between 0 and 127.\n */\n event.value = Utilities.from7bitToFloat(data1);\n event.rawValue = data1;\n } else if (event.type === \"pitchbend\") {\n /**\n * Event emitted when a pitch bend MIDI message has been received.\n *\n * @event InputChannel#pitchbend\n *\n * @type {object}\n * @property {string} type `pitchbend`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The raw MIDI value expressed as an integer (between 0 and\n * 16383).\n */\n event.value = ((data2 << 7) + data1 - 8192) / 8192;\n event.rawValue = (data2 << 7) + data1;\n } else {\n event.type = \"unknownmessage\";\n }\n\n this.emit(event.type, event);\n }", "function MidiFile(data) {\n function readChunk(stream) {\n let id = stream.read(4);\n let length = stream.readInt32();\n return {\n 'id': id,\n 'length': length,\n 'data': stream.read(length)\n };\n }\n\n let lastEventTypeByte;\n\n function readEvent(stream) {\n let event = {};\n event.deltaTime = stream.readletInt();\n let eventTypeByte = stream.readInt8();\n if ((eventTypeByte & 0xf0) == 0xf0) {\n /* system / meta event */\n if (eventTypeByte == 0xff) {\n /* meta event */\n event.type = 'meta';\n let subtypeByte = stream.readInt8();\n let length = stream.readletInt();\n switch (subtypeByte) {\n case 0x00:\n event.subtype = 'sequenceNumber';\n if (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n event.number = stream.readInt16();\n return event;\n case 0x01:\n event.subtype = 'text';\n event.text = stream.read(length);\n return event;\n case 0x02:\n event.subtype = 'copyrightNotice';\n event.text = stream.read(length);\n return event;\n case 0x03:\n event.subtype = 'trackName';\n event.text = stream.read(length);\n return event;\n case 0x04:\n event.subtype = 'instrumentName';\n event.text = stream.read(length);\n return event;\n case 0x05:\n event.subtype = 'lyrics';\n event.text = stream.read(length);\n return event;\n case 0x06:\n event.subtype = 'marker';\n event.text = stream.read(length);\n return event;\n case 0x07:\n event.subtype = 'cuePoint';\n event.text = stream.read(length);\n return event;\n case 0x20:\n event.subtype = 'midiChannelPrefix';\n if (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n event.channel = stream.readInt8();\n return event;\n case 0x2f:\n event.subtype = 'endOfTrack';\n if (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n return event;\n case 0x51:\n event.subtype = 'setTempo';\n if (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n event.microsecondsPerBeat = (\n (stream.readInt8() << 16) + (stream.readInt8() << 8) + stream.readInt8()\n )\n return event;\n case 0x54:\n event.subtype = 'smpteOffset';\n if (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n let hourByte = stream.readInt8();\n event.frameRate = {\n 0x00: 24,\n 0x20: 25,\n 0x40: 29,\n 0x60: 30\n }[hourByte & 0x60];\n event.hour = hourByte & 0x1f;\n event.min = stream.readInt8();\n event.sec = stream.readInt8();\n event.frame = stream.readInt8();\n event.subframe = stream.readInt8();\n return event;\n case 0x58:\n event.subtype = 'timeSignature';\n if (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n event.numerator = stream.readInt8();\n event.denominator = Math.pow(2, stream.readInt8());\n event.metronome = stream.readInt8();\n event.thirtyseconds = stream.readInt8();\n return event;\n case 0x59:\n event.subtype = 'keySignature';\n if (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n event.key = stream.readInt8(true);\n event.scale = stream.readInt8();\n return event;\n case 0x7f:\n event.subtype = 'sequencerSpecific';\n event.data = stream.read(length);\n return event;\n default:\n // console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n event.subtype = 'unknown'\n event.data = stream.read(length);\n return event;\n }\n event.data = stream.read(length);\n return event;\n } else if (eventTypeByte == 0xf0) {\n event.type = 'sysEx';\n let length = stream.readletInt();\n event.data = stream.read(length);\n return event;\n } else if (eventTypeByte == 0xf7) {\n event.type = 'dividedSysEx';\n let length = stream.readletInt();\n event.data = stream.read(length);\n return event;\n } else {\n throw \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n }\n } else {\n /* channel event */\n let param1;\n if ((eventTypeByte & 0x80) == 0) {\n /* running status - reuse lastEventTypeByte as the event type.\n \teventTypeByte is actually the first parameter\n */\n param1 = eventTypeByte;\n eventTypeByte = lastEventTypeByte;\n } else {\n param1 = stream.readInt8();\n lastEventTypeByte = eventTypeByte;\n }\n let eventType = eventTypeByte >> 4;\n event.channel = eventTypeByte & 0x0f;\n event.type = 'channel';\n switch (eventType) {\n case 0x08:\n event.subtype = 'noteOff';\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n return event;\n case 0x09:\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n if (event.velocity == 0) {\n event.subtype = 'noteOff';\n } else {\n event.subtype = 'noteOn';\n }\n return event;\n case 0x0a:\n event.subtype = 'noteAftertouch';\n event.noteNumber = param1;\n event.amount = stream.readInt8();\n return event;\n case 0x0b:\n event.subtype = 'controller';\n event.controllerType = param1;\n event.value = stream.readInt8();\n return event;\n case 0x0c:\n event.subtype = 'programChange';\n event.programNumber = param1;\n return event;\n case 0x0d:\n event.subtype = 'channelAftertouch';\n event.amount = param1;\n return event;\n case 0x0e:\n event.subtype = 'pitchBend';\n event.value = param1 + (stream.readInt8() << 7);\n return event;\n default:\n throw \"Unrecognised MIDI event type: \" + eventType\n /* \n console.log(\"Unrecognised MIDI event type: \" + eventType);\n stream.readInt8();\n event.subtype = 'unknown';\n return event;\n */\n }\n }\n }\n\n let stream = new Stream(data);\n let headerChunk = readChunk(stream);\n if (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n throw \"Bad .mid file - header not found\";\n }\n const headerStream = new Stream(headerChunk.data);\n const formatType = headerStream.readInt16();\n const trackCount = headerStream.readInt16();\n const timeDivision = headerStream.readInt16();\n\n if (timeDivision & 0x8000) {\n throw \"Expressing time division in SMTPE frames is not supported yet\"\n }\n const ticksPerBeat = timeDivision;\n\n const header = {\n 'formatType': formatType,\n 'trackCount': trackCount,\n 'ticksPerBeat': ticksPerBeat\n }\n const tracks = [];\n for (let i = 0; i < header.trackCount; i++) {\n tracks[i] = [];\n let trackChunk = readChunk(stream);\n if (trackChunk.id != 'MTrk') {\n throw \"Unexpected chunk - expected MTrk, got \" + trackChunk.id;\n }\n let trackStream = new Stream(trackChunk.data);\n while (!trackStream.eof()) {\n let event = readEvent(trackStream);\n tracks[i].push(event);\n //console.log(event);\n }\n }\n\n return {\n 'header': header,\n 'tracks': tracks\n }\n}", "_constructMIDIListeners () {\n this._player.on('fileLoaded', () => {\n this.emit('midiLoaded')\n })\n\n this._player.on('playing', () => {\n this.emit('midiPlaying')\n })\n\n this._player.on('midiEvent', event => {\n this.emit('midiEvent', event)\n })\n\n this._player.on('endOfFile', () => {\n this.emit('midiEnded')\n })\n }", "function MidiFile(data) {\n var lastEventTypeByte;\n\n function readChunk(stream) {\n var id = stream.read(4);\n var length = stream.readInt32();\n return {\n id: id,\n length: length,\n data: stream.read(length)\n };\n }\n\n function readEvent(stream) {\n var event = {};\n event.deltaTime = stream.readVarInt();\n var eventTypeByte = stream.readInt8();\n\n if ((eventTypeByte & 0xf0) === 0xf0) {\n /* system / meta event */\n if (eventTypeByte === 0xff) {\n /* meta event */\n event.type = 'meta';\n var subtypeByte = stream.readInt8();\n var length = stream.readVarInt();\n\n switch (subtypeByte) {\n case 0x00:\n event.subtype = 'sequenceNumber';\n if (length !== 2) throw new Error(\"Expected length for sequenceNumber event is 2, got \".concat(length));\n event.number = stream.readInt16();\n return event;\n\n case 0x01:\n event.subtype = 'text';\n event.text = stream.read(length);\n return event;\n\n case 0x02:\n event.subtype = 'copyrightNotice';\n event.text = stream.read(length);\n return event;\n\n case 0x03:\n event.subtype = 'trackName';\n event.text = stream.read(length);\n return event;\n\n case 0x04:\n event.subtype = 'instrumentName';\n event.text = stream.read(length);\n return event;\n\n case 0x05:\n event.subtype = 'lyrics';\n event.text = stream.read(length);\n return event;\n\n case 0x06:\n event.subtype = 'marker';\n event.text = stream.read(length);\n return event;\n\n case 0x07:\n event.subtype = 'cuePoint';\n event.text = stream.read(length);\n return event;\n\n case 0x20:\n event.subtype = 'midiChannelPrefix';\n if (length !== 1) throw new Error(\"Expected length for midiChannelPrefix event is 1, got \".concat(length));\n event.channel = stream.readInt8();\n return event;\n\n case 0x2f:\n event.subtype = 'endOfTrack';\n if (length !== 0) throw new Error(\"Expected length for endOfTrack event is 0, got \".concat(length));\n return event;\n\n case 0x51:\n event.subtype = 'setTempo';\n if (length !== 3) throw new Error(\"Expected length for setTempo event is 3, got \".concat(length));\n event.microsecondsPerBeat = (stream.readInt8() << 16) + (stream.readInt8() << 8) + stream.readInt8();\n return event;\n\n case 0x54:\n event.subtype = 'smpteOffset';\n if (length !== 5) throw new Error(\"Expected length for smpteOffset event is 5, got \".concat(length));\n var hourByte = stream.readInt8();\n event.frameRate = {\n 0x00: 24,\n 0x20: 25,\n 0x40: 29,\n 0x60: 30\n }[hourByte & 0x60];\n event.hour = hourByte & 0x1f;\n event.min = stream.readInt8();\n event.sec = stream.readInt8();\n event.frame = stream.readInt8();\n event.subframe = stream.readInt8();\n return event;\n\n case 0x58:\n event.subtype = 'timeSignature';\n if (length !== 4) throw new Error(\"Expected length for timeSignature event is 4, got \".concat(length));\n event.numerator = stream.readInt8();\n event.denominator = Math.pow(2, stream.readInt8());\n event.metronome = stream.readInt8();\n event.thirtyseconds = stream.readInt8();\n return event;\n\n case 0x59:\n event.subtype = 'keySignature';\n if (length !== 2) throw new Error(\"Expected length for keySignature event is 2, got \".concat(length));\n event.key = stream.readInt8(true);\n event.scale = stream.readInt8();\n return event;\n\n case 0x7f:\n event.subtype = 'sequencerSpecific';\n event.data = stream.read(length);\n return event;\n\n default:\n // console.log(\"Unrecognised meta event subtype: \" + subtypeByte)\n event.subtype = 'unknown';\n event.data = stream.read(length);\n return event;\n }\n /*\n * event.data = stream.read(length)\n * return event\n */\n\n } else if (eventTypeByte === 0xf0) {\n event.type = 'sysEx';\n\n var _length = stream.readVarInt();\n\n event.data = stream.read(_length);\n return event;\n } else if (eventTypeByte === 0xf7) {\n event.type = 'dividedSysEx';\n\n var _length2 = stream.readVarInt();\n\n event.data = stream.read(_length2);\n return event;\n } else {\n throw new Error(\"Unrecognised MIDI event type byte: \".concat(eventTypeByte));\n }\n } else {\n /* channel event */\n var param1;\n\n if ((eventTypeByte & 0x80) === 0) {\n /*\n * running status - reuse lastEventTypeByte as the event type.\n * eventTypeByte is actually the first parameter\n */\n param1 = eventTypeByte;\n eventTypeByte = lastEventTypeByte;\n } else {\n param1 = stream.readInt8();\n lastEventTypeByte = eventTypeByte;\n }\n\n var eventType = eventTypeByte >> 4;\n event.channel = eventTypeByte & 0x0f;\n event.type = 'channel';\n\n switch (eventType) {\n case 0x08:\n event.subtype = 'noteOff';\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n return event;\n\n case 0x09:\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n\n if (event.velocity === 0) {\n event.subtype = 'noteOff';\n } else {\n event.subtype = 'noteOn';\n }\n\n return event;\n\n case 0x0a:\n event.subtype = 'noteAftertouch';\n event.noteNumber = param1;\n event.amount = stream.readInt8();\n return event;\n\n case 0x0b:\n event.subtype = 'controller';\n event.controllerType = param1;\n event.value = stream.readInt8();\n return event;\n\n case 0x0c:\n event.subtype = 'programChange';\n event.programNumber = param1;\n return event;\n\n case 0x0d:\n event.subtype = 'channelAftertouch';\n event.amount = param1;\n return event;\n\n case 0x0e:\n event.subtype = 'pitchBend';\n event.value = param1 + (stream.readInt8() << 7);\n return event;\n\n default:\n throw new Error(\"Unrecognised MIDI event type: \".concat(eventType));\n\n /*\n *console.log(\"Unrecognised MIDI event type: \" + eventType)\n *stream.readInt8()\n *event.subtype = 'unknown'\n *return event\n */\n }\n }\n }\n\n var stream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data);\n var headerChunk = readChunk(stream);\n\n if (headerChunk.id !== 'MThd' || headerChunk.length !== 6) {\n throw new Error('Bad .mid file - header not found');\n }\n\n var headerStream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(headerChunk.data);\n var formatType = headerStream.readInt16();\n var trackCount = headerStream.readInt16();\n var timeDivision = headerStream.readInt16();\n var ticksPerBeat;\n\n if (timeDivision & 0x8000) {\n throw new Error('Expressing time division in SMTPE frames is not supported yet');\n } else {\n ticksPerBeat = timeDivision;\n }\n\n var header = {\n formatType: formatType,\n trackCount: trackCount,\n ticksPerBeat: ticksPerBeat\n };\n var tracks = [];\n\n for (var i = 0; i < header.trackCount; i++) {\n tracks[i] = [];\n var trackChunk = readChunk(stream);\n\n if (trackChunk.id !== 'MTrk') {\n throw new Error(\"Unexpected chunk - expected MTrk, got \".concat(trackChunk.id));\n }\n\n var trackStream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(trackChunk.data);\n\n while (!trackStream.eof()) {\n var event = readEvent(trackStream);\n tracks[i].push(event); // console.log(event)\n }\n }\n\n return {\n header: header,\n tracks: tracks\n };\n}", "function onMidi(status, data1, data2) {\n printMidi(status, data1, data2);\n for (i = 0; i < midiListeners.length; i++) {\n midiListeners[i](status, data1, data2);\n }\n}", "function handleMidiMessage(note) {\n\t// filter active sense messages\n\tif(note.data[0] == 254) {\n\t\treturn;\n\t}\n\tif( !( (0xF0 & note.data[0]) == 128 || (0xF0 & note.data[0]) == 144) ) {\n\t\treturn;\n\t}\n\n\tif (trace) {\n\t\tconsole.log(note.data);\n\t}\n\n\tconsole.log(convertCommand(note)); \n\tvar command = convertCommand(note); \n\t// notes[command.noteName + command.octave] = {number: note.data[1], playing: command.command};\n\tnotes[note.data[1]] = command.command;\n\tconsole.log(notes);\n\tdisplayNotes(printNotes().join(', '));\n\tvar chord = searchInversions(findChord(printNotes())); \n\tif(chord.chord) {\n\t\tdisplayChord(\n\t\t\tnumberToNote(printNotes()[chord.inversion]).note + \n\t\t\tchord.chord + ' ' +\n\t\t\tchord.inversion\n\t\t);\n\t}\n\telse {\n\t\tdisplayChord('');\n\t}\n\tif (\n\t\tnumberToNote(printNotes()[chord.inversion]).note+chord.chord == \n\t\tquiz.current\n\t) {\n\t\tquiz.next();\n\t}\n\t// var key = document.getElementById(numberToNote(note.data[1]).note);\n\tvar key = document.querySelector(\n\t\t'#octave' + numberToNote(note.data[1]).octave + ' #' +\n\t\tnumberToNote(note.data[1]).note\n\t);\n\tkey.classList.toggle('pressed');\n}", "rawMidiEvent (data) {\n if (this._output) {\n this._output._midiOutput.send(data)\n }\n }", "function MidiFile(data) {\n\tfunction readChunk(stream) {\n\t\tvar id = stream.read(4);\n\t\tvar length = stream.readInt32();\n\t\treturn {\n\t\t\t'id': id,\n\t\t\t'length': length,\n\t\t\t'data': stream.read(length)\n\t\t};\n\t}\n\t\n\tvar lastEventTypeByte;\n\t\n\tfunction readEvent(stream) {\n\t\tvar event = {};\n\t\tevent.deltaTime = stream.readVarInt();\n\t\tvar eventTypeByte = stream.readInt8();\n\t\tif ((eventTypeByte & 0xf0) == 0xf0) {\n\t\t\t/* system / meta event */\n\t\t\tif (eventTypeByte == 0xff) {\n\t\t\t\t/* meta event */\n\t\t\t\tevent.type = 'meta';\n\t\t\t\tvar subtypeByte = stream.readInt8();\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tswitch(subtypeByte) {\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\tevent.subtype = 'sequenceNumber';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n\t\t\t\t\t\tevent.number = stream.readInt16();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x01:\n\t\t\t\t\t\tevent.subtype = 'text';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x02:\n\t\t\t\t\t\tevent.subtype = 'copyrightNotice';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x03:\n\t\t\t\t\t\tevent.subtype = 'trackName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x04:\n\t\t\t\t\t\tevent.subtype = 'instrumentName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x05:\n\t\t\t\t\t\tevent.subtype = 'lyrics';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x06:\n\t\t\t\t\t\tevent.subtype = 'marker';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x07:\n\t\t\t\t\t\tevent.subtype = 'cuePoint';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x20:\n\t\t\t\t\t\tevent.subtype = 'midiChannelPrefix';\n\t\t\t\t\t\tif (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n\t\t\t\t\t\tevent.channel = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x2f:\n\t\t\t\t\t\tevent.subtype = 'endOfTrack';\n\t\t\t\t\t\tif (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x51:\n\t\t\t\t\t\tevent.subtype = 'setTempo';\n\t\t\t\t\t\tif (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n\t\t\t\t\t\tevent.microsecondsPerBeat = (\n\t\t\t\t\t\t\t(stream.readInt8() << 16)\n\t\t\t\t\t\t\t+ (stream.readInt8() << 8)\n\t\t\t\t\t\t\t+ stream.readInt8()\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x54:\n\t\t\t\t\t\tevent.subtype = 'smpteOffset';\n\t\t\t\t\t\tif (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n\t\t\t\t\t\tvar hourByte = stream.readInt8();\n\t\t\t\t\t\tevent.frameRate = {\n\t\t\t\t\t\t\t0x00: 24, 0x20: 25, 0x40: 29, 0x60: 30\n\t\t\t\t\t\t}[hourByte & 0x60];\n\t\t\t\t\t\tevent.hour = hourByte & 0x1f;\n\t\t\t\t\t\tevent.min = stream.readInt8();\n\t\t\t\t\t\tevent.sec = stream.readInt8();\n\t\t\t\t\t\tevent.frame = stream.readInt8();\n\t\t\t\t\t\tevent.subframe = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x58:\n\t\t\t\t\t\tevent.subtype = 'timeSignature';\n\t\t\t\t\t\tif (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n\t\t\t\t\t\tevent.numerator = stream.readInt8();\n\t\t\t\t\t\tevent.denominator = Math.pow(2, stream.readInt8());\n\t\t\t\t\t\tevent.metronome = stream.readInt8();\n\t\t\t\t\t\tevent.thirtyseconds = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x59:\n\t\t\t\t\t\tevent.subtype = 'keySignature';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n\t\t\t\t\t\tevent.key = stream.readInt8(true);\n\t\t\t\t\t\tevent.scale = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x7f:\n\t\t\t\t\t\tevent.subtype = 'sequencerSpecific';\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n\t\t\t\t\t\tevent.subtype = 'unknown'\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf0) {\n\t\t\t\tevent.type = 'sysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf7) {\n\t\t\t\tevent.type = 'dividedSysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else {\n\t\t\t\tthrow \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n\t\t\t}\n\t\t} else {\n\t\t\t/* channel event */\n\t\t\tvar param1;\n\t\t\tif ((eventTypeByte & 0x80) == 0) {\n\t\t\t\t/* running status - reuse lastEventTypeByte as the event type.\n\t\t\t\t\teventTypeByte is actually the first parameter\n\t\t\t\t*/\n\t\t\t\tparam1 = eventTypeByte;\n\t\t\t\teventTypeByte = lastEventTypeByte;\n\t\t\t} else {\n\t\t\t\tparam1 = stream.readInt8();\n\t\t\t\tlastEventTypeByte = eventTypeByte;\n\t\t\t}\n\t\t\tvar eventType = eventTypeByte >> 4;\n\t\t\tevent.channel = eventTypeByte & 0x0f;\n\t\t\tevent.type = 'channel';\n\t\t\tswitch (eventType) {\n\t\t\t\tcase 0x08:\n\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x09:\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\tif (event.velocity == 0) {\n\t\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevent.subtype = 'noteOn';\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0a:\n\t\t\t\t\tevent.subtype = 'noteAftertouch';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.amount = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0b:\n\t\t\t\t\tevent.subtype = 'controller';\n\t\t\t\t\tevent.controllerType = param1;\n\t\t\t\t\tevent.value = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0c:\n\t\t\t\t\tevent.subtype = 'programChange';\n\t\t\t\t\tevent.programNumber = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0d:\n\t\t\t\t\tevent.subtype = 'channelAftertouch';\n\t\t\t\t\tevent.amount = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0e:\n\t\t\t\t\tevent.subtype = 'pitchBend';\n\t\t\t\t\tevent.value = param1 + (stream.readInt8() << 7);\n\t\t\t\t\treturn event;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow \"Unrecognised MIDI event type: \" + eventType\n\t\t\t\t\t/* \n\t\t\t\t\tconsole.log(\"Unrecognised MIDI event type: \" + eventType);\n\t\t\t\t\tstream.readInt8();\n\t\t\t\t\tevent.subtype = 'unknown';\n\t\t\t\t\treturn event;\n\t\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t}\n\t\n\tstream = Stream(data);\n\tvar headerChunk = readChunk(stream);\n\tif (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n\t\tthrow \"Bad .mid file - header not found\";\n\t}\n\tvar headerStream = Stream(headerChunk.data);\n\tvar formatType = headerStream.readInt16();\n\tvar trackCount = headerStream.readInt16();\n\tvar timeDivision = headerStream.readInt16();\n\t\n\tif (timeDivision & 0x8000) {\n\t\tthrow \"Expressing time division in SMTPE frames is not supported yet\"\n\t} else {\n\t\tticksPerBeat = timeDivision;\n\t}\n\t\n\tvar header = {\n\t\t'formatType': formatType,\n\t\t'trackCount': trackCount,\n\t\t'ticksPerBeat': ticksPerBeat\n\t}\n\tvar tracks = [];\n\tfor (var i = 0; i < header.trackCount; i++) {\n\t\ttracks[i] = [];\n\t\tvar trackChunk = readChunk(stream);\n\t\tif (trackChunk.id != 'MTrk') {\n\t\t\tthrow \"Unexpected chunk - expected MTrk, got \"+ trackChunk.id;\n\t\t}\n\t\tvar trackStream = Stream(trackChunk.data);\n\t\twhile (!trackStream.eof()) {\n\t\t\tvar event = readEvent(trackStream);\n\t\t\ttracks[i].push(event);\n\t\t\t//console.log(event);\n\t\t}\n\t}\n\t\n\treturn {\n\t\t'header': header,\n\t\t'tracks': tracks\n\t}\n}", "function MidiFile(data) {\n\tfunction readChunk(stream) {\n\t\tvar id = stream.read(4);\n\t\tvar length = stream.readInt32();\n\t\treturn {\n\t\t\t'id': id,\n\t\t\t'length': length,\n\t\t\t'data': stream.read(length)\n\t\t};\n\t}\n\t\n\tvar lastEventTypeByte;\n\t\n\tfunction readEvent(stream) {\n\t\tvar event = {};\n\t\tevent.deltaTime = stream.readVarInt();\n\t\tvar eventTypeByte = stream.readInt8();\n\t\tif ((eventTypeByte & 0xf0) == 0xf0) {\n\t\t\t/* system / meta event */\n\t\t\tif (eventTypeByte == 0xff) {\n\t\t\t\t/* meta event */\n\t\t\t\tevent.type = 'meta';\n\t\t\t\tvar subtypeByte = stream.readInt8();\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tswitch(subtypeByte) {\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\tevent.subtype = 'sequenceNumber';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n\t\t\t\t\t\tevent.number = stream.readInt16();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x01:\n\t\t\t\t\t\tevent.subtype = 'text';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x02:\n\t\t\t\t\t\tevent.subtype = 'copyrightNotice';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x03:\n\t\t\t\t\t\tevent.subtype = 'trackName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x04:\n\t\t\t\t\t\tevent.subtype = 'instrumentName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x05:\n\t\t\t\t\t\tevent.subtype = 'lyrics';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x06:\n\t\t\t\t\t\tevent.subtype = 'marker';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x07:\n\t\t\t\t\t\tevent.subtype = 'cuePoint';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x20:\n\t\t\t\t\t\tevent.subtype = 'midiChannelPrefix';\n\t\t\t\t\t\tif (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n\t\t\t\t\t\tevent.channel = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x2f:\n\t\t\t\t\t\tevent.subtype = 'endOfTrack';\n\t\t\t\t\t\tif (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x51:\n\t\t\t\t\t\tevent.subtype = 'setTempo';\n\t\t\t\t\t\tif (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n\t\t\t\t\t\tevent.microsecondsPerBeat = (\n\t\t\t\t\t\t\t(stream.readInt8() << 16)\n\t\t\t\t\t\t\t+ (stream.readInt8() << 8)\n\t\t\t\t\t\t\t+ stream.readInt8()\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x54:\n\t\t\t\t\t\tevent.subtype = 'smpteOffset';\n\t\t\t\t\t\tif (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n\t\t\t\t\t\tvar hourByte = stream.readInt8();\n\t\t\t\t\t\tevent.frameRate = {\n\t\t\t\t\t\t\t0x00: 24, 0x20: 25, 0x40: 29, 0x60: 30\n\t\t\t\t\t\t}[hourByte & 0x60];\n\t\t\t\t\t\tevent.hour = hourByte & 0x1f;\n\t\t\t\t\t\tevent.min = stream.readInt8();\n\t\t\t\t\t\tevent.sec = stream.readInt8();\n\t\t\t\t\t\tevent.frame = stream.readInt8();\n\t\t\t\t\t\tevent.subframe = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x58:\n\t\t\t\t\t\tevent.subtype = 'timeSignature';\n\t\t\t\t\t\tif (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n\t\t\t\t\t\tevent.numerator = stream.readInt8();\n\t\t\t\t\t\tevent.denominator = Math.pow(2, stream.readInt8());\n\t\t\t\t\t\tevent.metronome = stream.readInt8();\n\t\t\t\t\t\tevent.thirtyseconds = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x59:\n\t\t\t\t\t\tevent.subtype = 'keySignature';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n\t\t\t\t\t\tevent.key = stream.readInt8(true);\n\t\t\t\t\t\tevent.scale = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x7f:\n\t\t\t\t\t\tevent.subtype = 'sequencerSpecific';\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n\t\t\t\t\t\tevent.subtype = 'unknown'\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf0) {\n\t\t\t\tevent.type = 'sysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf7) {\n\t\t\t\tevent.type = 'dividedSysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else {\n\t\t\t\tthrow \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n\t\t\t}\n\t\t} else {\n\t\t\t/* channel event */\n\t\t\tvar param1;\n\t\t\tif ((eventTypeByte & 0x80) == 0) {\n\t\t\t\t/* running status - reuse lastEventTypeByte as the event type.\n\t\t\t\t\teventTypeByte is actually the first parameter\n\t\t\t\t*/\n\t\t\t\tparam1 = eventTypeByte;\n\t\t\t\teventTypeByte = lastEventTypeByte;\n\t\t\t} else {\n\t\t\t\tparam1 = stream.readInt8();\n\t\t\t\tlastEventTypeByte = eventTypeByte;\n\t\t\t}\n\t\t\tvar eventType = eventTypeByte >> 4;\n\t\t\tevent.channel = eventTypeByte & 0x0f;\n\t\t\tevent.type = 'channel';\n\t\t\tswitch (eventType) {\n\t\t\t\tcase 0x08:\n\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x09:\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\tif (event.velocity == 0) {\n\t\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevent.subtype = 'noteOn';\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0a:\n\t\t\t\t\tevent.subtype = 'noteAftertouch';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.amount = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0b:\n\t\t\t\t\tevent.subtype = 'controller';\n\t\t\t\t\tevent.controllerType = param1;\n\t\t\t\t\tevent.value = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0c:\n\t\t\t\t\tevent.subtype = 'programChange';\n\t\t\t\t\tevent.programNumber = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0d:\n\t\t\t\t\tevent.subtype = 'channelAftertouch';\n\t\t\t\t\tevent.amount = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0e:\n\t\t\t\t\tevent.subtype = 'pitchBend';\n\t\t\t\t\tevent.value = param1 + (stream.readInt8() << 7);\n\t\t\t\t\treturn event;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow \"Unrecognised MIDI event type: \" + eventType\n\t\t\t\t\t/* \n\t\t\t\t\tconsole.log(\"Unrecognised MIDI event type: \" + eventType);\n\t\t\t\t\tstream.readInt8();\n\t\t\t\t\tevent.subtype = 'unknown';\n\t\t\t\t\treturn event;\n\t\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t}\n\t\n\tstream = Stream(data);\n\tvar headerChunk = readChunk(stream);\n\tif (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n\t\tthrow \"Bad .mid file - header not found\";\n\t}\n\tvar headerStream = Stream(headerChunk.data);\n\tvar formatType = headerStream.readInt16();\n\tvar trackCount = headerStream.readInt16();\n\tvar timeDivision = headerStream.readInt16();\n\t\n\tif (timeDivision & 0x8000) {\n\t\tthrow \"Expressing time division in SMTPE frames is not supported yet\"\n\t} else {\n\t\tticksPerBeat = timeDivision;\n\t}\n\t\n\tvar header = {\n\t\t'formatType': formatType,\n\t\t'trackCount': trackCount,\n\t\t'ticksPerBeat': ticksPerBeat\n\t}\n\tvar tracks = [];\n\tfor (var i = 0; i < header.trackCount; i++) {\n\t\ttracks[i] = [];\n\t\tvar trackChunk = readChunk(stream);\n\t\tif (trackChunk.id != 'MTrk') {\n\t\t\tthrow \"Unexpected chunk - expected MTrk, got \"+ trackChunk.id;\n\t\t}\n\t\tvar trackStream = Stream(trackChunk.data);\n\t\twhile (!trackStream.eof()) {\n\t\t\tvar event = readEvent(trackStream);\n\t\t\ttracks[i].push(event);\n\t\t\t//console.log(event);\n\t\t}\n\t}\n\t\n\treturn {\n\t\t'header': header,\n\t\t'tracks': tracks\n\t}\n}", "function handleMIDIMessageEvent(event)\n{\n\tswitch(event.data[0] & 0xF0)\n\t{\n\t\tcase 0x90: //when the key is pressed\n\t\t\tif(event.data[2] != 0)\n\t\t\t{\n\t\t\t\tnoteOn(event.data[1]);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\tcase 0x80: //when the key is released\n\t\t\tnoteOff(event.data[1]);\n\t\t\treturn;\n\n\t\tcase 0xB0: // when a knob is moved\n\t\t\tsetFilter(event.data[2] / 127);\n\t\t\treturn;\n\t}\n}", "function onMidi(status, data1, data2)\r\n{\r\n\t//printMidi(status, data1, data2)\r\n\tif (isChannelController(status)) //&& MIDIChannel(status) == alias_channel) //removing status check to include MasterFader\r\n\t{\r\n\t\tvar chMult = (status-177)*8;\r\n\t\t//post('CC: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tif(data1==10){\r\n\t\t\tCC_OBJECTS[chMult].receive(data2);\r\n\t\t\t//post(CC_OBJECTS[chMult]._name + ' ' + data2);\r\n\t\t}\r\n\t\telse if(data1==11){\r\n\t\t\tCC_OBJECTS[chMult+1].receive(data2);\r\n\t\t}\r\n\t\telse if(data1==12){\r\n\t\t\tCC_OBJECTS[chMult+2].receive(data2);\r\n\t\t}\r\n\t}\r\n\telse if (isNoteOn(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n\telse if (isNoteOff(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n}", "function on_midi_msg(event) {\n const cc = event.data[1];\n const val = event.data[2];\n\n console.log(event.data);\n\n switch (cc) {\n case 115:\n // The Command ID of a custom action that toggles the FX rack\n wwr_req('_dabc7267fcf7854e80a59865f2e6c261');\n break;\n case PLAY_CC:\n // The play button is a toggle button, so when it is\n // in active state pause the mix, otherwise play it\n if (last_transport_state & 1 > 0) {\n wwr_req(1008); // 1008 is pause, 1016 is stop if you prefer\n } else {\n wwr_req(1007);\n }\n break;\n case VOL_1_CC:\n send_trk_vol(1, val);\n break;\n case VOL_2_CC:\n send_trk_vol(2, val);\n break;\n case VOL_3_CC:\n send_trk_vol(3, val);\n break;\n case VOL_4_CC:\n send_trk_vol(4, val);\n break;\n case VOL_5_CC:\n send_trk_vol(5, val);\n break;\n case VOL_6_CC:\n send_trk_vol(6, val);\n break;\n case VOL_7_CC:\n send_trk_vol(7, val);\n break;\n case VOL_8_CC:\n send_trk_vol(8, val);\n break;\n case PREV_TRK_CC:\n wwr_req(40286);\n wwr_req('TRACK');\n break;\n case NEXT_TRK_CC:\n wwr_req(40285);\n wwr_req('TRACK');\n break;\n case MEDIA_EXPLR_CC:\n wwr_req(50124);\n break;\n case SEL_TRK_MUTE_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/MUTE/-1;TRACK/${sel_trk_idx}`);\n break;\n case SEL_TRK_SOLO_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/SOLO/-1;TRACK/${sel_trk_idx}`);\n break;\n default:\n break;\n }\n }", "work(midiEvent) {\n this.event.nd = {};\n this.event.nd.name = this.mapping[midiEvent.nd.note];\n\n // console.log(midiEvent.nd);\n\n document.body.dispatchEvent(this.event);\n }", "function onMessageArrived(message) {\n var data = message.payloadString.split(',');\n var today = new Date();\n var time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();\n console.log(\"onMessageArrived: \" + data[0] + \" and \" +data[1]);\n document.getElementById(\"messages\").innerHTML = '<h3>'+ data[0] +'</h3>';\n document.getElementById(\"messages1\").innerHTML = '<h3>'+ data[1] +'</h3>';\n document.getElementById(\"waktunow\").innerHTML = '<p>'+ date +' '+ time +'</p>';\n sendData(data[0], data[1]);\n addData(time, data[0]);\n addData1(time, data[1]);\n}", "function addNewMessage(list, type, text, startX, startY, fontSize) {\n var font = fontSize.toString() + \"px 'Orbitron'\";\n var colorRgb1;\n var colorRgb2 = CONSTANTS.FILL_YELLOW;\n var expireCount = CONSTANTS.MESSAGE_EXPIRE_COUNT;\n switch (type) {\n case Constants.MessageType.ADD_HEALTH:\n case Constants.MessageType.ADD_MISSILE:\n colorRgb1 = CONSTANTS.FILL_GREEN;\n colorRgb2 = CONSTANTS.FILL_RED;\n break;\n case Constants.MessageType.HIGH_SCORE:\n colorRgb1 = CONSTANTS.FILL_RED;\n break;\n case Constants.MessageType.NEW_BOSS:\n colorRgb1 = CONSTANTS.FILL_ORANGE;\n colorRgb2 = CONSTANTS.FILL_WHITE;\n break;\n case Constants.MessageType.QUOTE:\n colorRgb1 = CONSTANTS.FILL_YELLOW;\n colorRgb2 = CONSTANTS.FILL_WHITE;\n expireCount = 0; //show entire screen\n break;\n default:\n colorRgb1 = CONSTANTS.FILL_WHITE;\n break;\n }\n //add message\n list.push(new GameObjects.Message(type, text, font, colorRgb1, colorRgb2, startX, startY, expireCount));\n }", "function inputListener(midimessageEvent){\n var port, portId,\n data = midimessageEvent.data,\n type = data[0],\n noten = data[1],\n velocity = data[2];\n var delay = 0; // play one note every quarter second\n //var note = 50; // the MIDI note\n //var velocity = 127; // how hard the note hits\n // play the note\n var note = {\n velocity:velocity,\n note:noten,\n delay:delay\n };\n notes.push(playNote(note));\n }", "function getMIDIMessage(midiMessage) {\n console.log(midiMessage);\n\n if (midiMessage.data[0] == 0xF2) {\n var type = (midiMessage.data[1] & 0xF0) >> 4;\n if (requestNo < 9) {\n document.getElementById(\"gType\" + requestNo).value = type;\n document.getElementById(\"gChannel\" + requestNo).value = (midiMessage.data[1] & 0xF) + 1;\n document.getElementById(\"gNote\" + requestNo).value = midiMessage.data[2];\n\n updateDisplay(controlEnum.gate, requestNo);\n } else {\n document.getElementById(\"cType\" + (requestNo - 8)).value = type;\n document.getElementById(\"cChannel\" + (requestNo - 8)).value = (midiMessage.data[1] & 0xF) + 1;\n document.getElementById(\"cController\" + (requestNo - 8)).value = midiMessage.data[2];\n\n updateDisplay(controlEnum.cv, requestNo - 8);\n }\n\n if (requestNo < 12) {\n requestNo++;\n getOutputConfig(requestNo);\n\n }\n recCount++;\n } else if (midiMessage.data[0] == 0xF0) {\n\t\t var response = document.getElementById(\"testResponse\"); \n response.innerHTML = \"Received: \" + midiMessage.data[1];\n\t }\n\n}", "function registerForMessages() {\r\n\t$W().Push.registerEventHandler( 'END_CONVERSATION_NOTIFICATION', endConversationReceived);\r\n $W().Push.registerEventHandler( 'END_CONVERSATION_BY_SUPERVISOR_NOTIFICATION', overrideConversation);\r\n $W().Push.registerEventHandler( 'START_CONVERSATION_NOTIFICATION', startConversation);\r\n $W().Push.registerEventHandler( 'START_CONVERSATION_RECEIVED_NOTIFICATION', startConversationReceived);\r\n $W().Push.registerEventHandler( 'SEND_MESSAGE_NOTIFICATION', incomingMessage); \r\n $W().Push.registerEventHandler( 'CONTACT_PRESENCE_NOTIFICATION', setContactPresence);\r\n $W().Push.registerEventHandler( 'UPDATE_CONTACT_LIST_NOTIFICATION', updateContactList);\r\n $W().Push.registerEventHandler( 'CONNECTION_DOWN_NOTIFICATION', connectionDown);\r\n $W().Push.registerEventHandler( 'CONNECTION_UP_NOTIFICATION', connectionUp);\r\n}", "function onNewMessage(myId, msg, msgtype)\n{\n\tm.startComputation();\n\tthis.textHistory().push([myId, msg, msgtype]);\n\tm.endComputation();\n}", "function Messages()\n\t{\n\t\tthis.msgs = [];\n\t\tif( arguments[0] !== undefined )\n\t\t\tthis.update( arguments[0] );\n\t}", "function addMsgsMsg(msgsObj, msgObj){\n\tmsgsObj.root.msgs.push(msgObj);\n}", "_message (id, numbers, data) {\n const dataLength = data ? data.length : 0\n const buffer = Buffer.allocUnsafe(5 + (4 * numbers.length))\n\n buffer.writeUInt32BE(buffer.length + dataLength - 4, 0)\n buffer[4] = id\n for (let i = 0; i < numbers.length; i++) {\n buffer.writeUInt32BE(numbers[i], 5 + (4 * i))\n }\n\n this._push(buffer)\n if (data) this._push(data)\n }", "_message (id, numbers, data) {\n const dataLength = data ? data.length : 0\n const buffer = Buffer.allocUnsafe(5 + (4 * numbers.length))\n\n buffer.writeUInt32BE(buffer.length + dataLength - 4, 0)\n buffer[4] = id\n for (let i = 0; i < numbers.length; i++) {\n buffer.writeUInt32BE(numbers[i], 5 + (4 * i))\n }\n\n this._push(buffer)\n if (data) this._push(data)\n }", "receiveMessage() {\n\n index = this.currentChat;\n\n const cpuMessage = {\n message: 'ok',\n status: 'received',\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n }\n\n this.contacts[this.currentChat].messages.push(cpuMessage);\n }", "function pushMsj(data) {\n if (data.title || data.content) {\n var\n title = data.title || '',\n content = data.content || '',\n type = data.type || 'info',\n time = data.time || 4,\n remitente = data.from || '',\n sound = data.sound === true ? true : false,\n d = new Date();\n\n var idtime = d.getTime();\n idtime = idtime + parseInt(Math.random(1000) * 1000);\n\n var datos = { title: title, content: content, type: type, time: time, id: idtime, remitente: remitente };\n\n if (sound)\n msjsound.play();\n\n $(\".notificationcontent\").append(newMsj(datos));\n }\n }", "function onMessage(event) {\n var newMessage = event.data; // to newMessage tha parei to input opoy exw balei to event\n var chats = document.getElementById(\"content\");\n var newHtml = chats.innerHTML+newMessage; // to newHtml tha parei oti eixe to content + to neo input\n document.getElementById(\"content\").innerHTML=newHtml; // to synoliko mhnyma tha mpei sto content\n}", "onSend(messages=[]) {\n console.log(messages)\n let data = this.formatMessage(messages)\n this.socket.emit('msgadmin', data);\n this._storeMessages(messages);\n }", "function messagereceivedHandler(e) {\n var messageSize = e.detail.length;\n for (var i = 0; i < messageSize; i++) {\n for (var key in e.detail[i].data) {\n switch (key) {\n case Messages.ServerStarted:\n serverStarted = true;\n break;\n case Messages.MyMusicIsPlaying:\n isMusicPlaying = true;\n smtc.playbackStatus = MediaPlaybackStatus.playing;\n break;\n case Messages.CurrentSongName:\n\n document.getElementById(\"curr-song-name\").innerText = e.data.first().current.value;\n break;\n case Messages.CurrentSong:\n updateCurrentSong(e.detail[i].data[key]);\n break;\n }\n }\n }\n}", "function addTextFields(msg) {\n var i;\n msg.payload.talkerId_text = msg.payload.talkerId;\n for (i=0;i<talkerId_enum.length;i++) {\n if (talkerId_enum[i].id==msg.payload.talkerId) {\n msg.payload.talkerId_text = talkerId_enum[i].desc;\n break;\n }\n }\n msg.payload.sentenceId_text = msg.payload.sentenceId;\n for (i=0;i<sentenceId_enum.length;i++) {\n if (sentenceId_enum[i].id==msg.payload.sentenceId) {\n msg.payload.sentenceId_text = sentenceId_enum[i].desc;\n break;\n }\n }\n if (!isNaN(msg.payload.messageType)){\n msg.payload.messageType_text = textFor(messageType_enum,msg.payload.messageType);\n }\n if (!isNaN(msg.payload.navigationStatus)){\n msg.payload.navigationStatus_text = textFor(navigationStatus_enum,msg.payload.navigationStatus);\n }\n if (!isNaN(msg.payload.turningDirection)){\n msg.payload.turningDirection_text = textFor(turningDirection_enum,msg.payload.turningDirection+1);\n }\n if (!isNaN(msg.payload.positioningSystemStatus)){\n msg.payload.positioningSystemStatus_text = textFor(positioningSystemStatus_enum,msg.payload.positioningSystemStatus);\n }\n if (!isNaN(msg.payload.manoeuvre)){\n msg.payload.manoeuvre_text = textFor(manoeuvre_enum,msg.payload.manoeuvre);\n }\n if (!isNaN(msg.payload.shipType)){\n msg.payload.shipType_text = textFor(shipType_enum,msg.payload.shipType);\n }\n if (!isNaN(msg.payload.fixType)){\n msg.payload.fixType_text = textFor(fixType_enum,msg.payload.fixType);\n }\n if (!isNaN(msg.payload.navAid)){\n msg.payload.navAid_text = textFor(navAid_enum,msg.payload.navAid);\n }\n if (!isNaN(msg.payload.txrxMode)){\n msg.payload.txrxMode_text = textFor(txrxMode_enum,msg.payload.txrxMode);\n }\n if (!isNaN(msg.payload.airPressureTrend)){\n msg.payload.airPressureTrend_text = textFor(airPressureTrend_enum,msg.payload.airPressureTrend);\n }\n if (!isNaN(msg.payload.waterLevelTrend)){\n msg.payload.waterLevelTrend_text = textFor(waterLevelTrend_enum,msg.payload.waterLevelTrend);\n }\n if (!isNaN(msg.payload.precipitationType)){\n msg.payload.precipitationType_text = textFor(precipitationType_enum,msg.payload.precipitationType);\n }\n if (!isNaN(msg.payload.seaState)) {\n msg.payload.seaState_text = textFor(seaState_enum,msg.payload.seaState);\n }\n if (!isNaN(msg.payload.inlandVesselType)) {\n msg.payload.inlandVesselType_text = unexpected;\n for (i=0;i<inlandVesselType_enum.length;i++) {\n if (inlandVesselType_enum[i].id==msg.payload.inlandVesselType) {\n msg.payload.inlandVesselType_text = inlandVesselType_enum[i].desc;\n break;\n }\n }\n }\n}", "sendNewMessages () {\n if (this.socket) {\n const serializeJobs = this.messages.map(message => message.toTransferObject())\n Promise.all(serializeJobs)\n .then(serializedMessages => {\n this.socket.emit('messages', {\n hasMessages: this.hasMessages(),\n messages: serializedMessages\n })\n })\n .catch(e => console.error('Failed to send new messages: ', e))\n }\n }", "_newMessage(message) {\n this.messages.push(message);\n this.emitChange();\n }", "function mapOscToMidi (oscMessage) {\n //let midiNote = oscMap[oscMessage.address];\n let midiNote = oscMessageMap[oscMessage.address];\n midiNote.value = (midiNote) ? getMidiValue(oscMessage.args[0]) : 0;\n console.log('midi note', midiNote);\n return midiNote;\n}", "handleMessage(e){\n\n console.log(\"received message with id: \", e.data.id, \"; message was: \", e);\n\n switch (e.data.id) {\n\n case \"quantization\":\n this._quantOpt = e.data.quantOpt;\n this._quantBits = e.data.quantBits;\n break;\n\n case \"reverseK\":\n this._reverseKOpt = e.data.reverseKOpt;\n break;\n\n case \"perfectSynth\":\n this._perfectSynthOpt = e.data.perfectSynthOpt;\n break;\n\n case \"resampling\":\n this._resamplingFactor = e.data.resampFactor;\n this._resampler.update(this._resamplingFactor);\n break;\n\n case \"voicedThreshold\":\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n break;\n\n case \"pitchFactor\":\n this._pitchFactor = e.data.pitchFactor;\n break;\n\n case \"voiceMap\":\n // Voiced / Unvoiced Synthesis\n this._unvoicedMix = e.data.unvoicedMix;\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n // Resampling (vocal tract length)\n if (e.data.vocalTractFactor != this._resamplingFactor){\n this._resamplingFactor = e.data.vocalTractFactor;\n this._resampler.update(this._resamplingFactor);\n }\n // Pitch modifier\n this._pitchFactor = e.data.pitchFactor;\n // Vibrato\n //e.data.vibratoEffect;\n break;\n\n case \"options\":\n // Receive all options\n this._perfectSynthOpt = e.data.perfectSynthOpt;\n this._quantOpt = e.data.quantOpt;\n this._quantBits = e.data.quantBits;\n this._reverseKOpt = e.data.reverseKOpt;\n if (e.data.vocalTractFactor != this._resamplingFactor){\n this._resamplingFactor = e.data.vocalTractFactor;\n this._resampler.update(this._resamplingFactor);\n }\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n this._pitchFactor = e.data.pitchFactor;\n break;\n\n\n default: // any unknown ID: log the message ID\n console.log(\"unknown message received:\")\n console.log(e.data)\n }\n }", "function onMessageArrived(message) {\r\n console.log(\"onMessageArrived:\"+message.payloadString);\r\n \r\n var Mensaje=message.payloadString;//Se guarda el mensaje en una variable\r\n var Registro=Mensaje.split('_')\r\n\r\n if (Registro[0]==(\"R1\")){//Cuando se conecta por primera vez a la tarjeta\r\n document.getElementById(\"Historial\").innerHTML=Registro[1];//Muestra un mensaje de recibido en la web\r\n }\r\n if (Registro[0]==(\"R2\")){//Cuando se conecta por primera vez a la tarjeta\r\n document.getElementById(\"Historial\").innerHTML=Registro[1];//Muestra un mensaje de recibido en la web\r\n }\r\n\r\n var Sensores=Mensaje.split(',');//Divide el formato en que llegan los valores a razón del espacio en blanco\r\n document.getElementById(\"sensor1\").innerHTML=Sensores[0];//Muestra el primer valor en la etiqueta\r\n document.getElementById(\"sensor2\").innerHTML=Sensores[1];//Muestra el segundo valor en la etiqueta\r\n }", "function init() {\n //Request midi accsess\n navigator.requestMIDIAccess().then(function (midi_access) {\n console.log('MIDI ready!');\n const inputs = midi_access.inputs.values();\n\n outputs = midi_access.outputs.values();\n\n for (let input = inputs.next(); input && !input.done; input = inputs.next()) {\n input.value.onmidimessage = on_midi_msg;\n console.log('input:', input.value.name);\n }\n\n for (let output = outputs.next(); output && !output.done; output = outputs.next()) {\n outputs_by_name[output.value.name] = output.value;\n console.log('output:', output.value.name);\n }\n }, function (msg) {\n console.log('Failed to get MIDI access - ', msg);\n });\n\n // Respond to MIDI messages\n function on_midi_msg(event) {\n const cc = event.data[1];\n const val = event.data[2];\n\n console.log(event.data);\n\n switch (cc) {\n case 115:\n // The Command ID of a custom action that toggles the FX rack\n wwr_req('_dabc7267fcf7854e80a59865f2e6c261');\n break;\n case PLAY_CC:\n // The play button is a toggle button, so when it is\n // in active state pause the mix, otherwise play it\n if (last_transport_state & 1 > 0) {\n wwr_req(1008); // 1008 is pause, 1016 is stop if you prefer\n } else {\n wwr_req(1007);\n }\n break;\n case VOL_1_CC:\n send_trk_vol(1, val);\n break;\n case VOL_2_CC:\n send_trk_vol(2, val);\n break;\n case VOL_3_CC:\n send_trk_vol(3, val);\n break;\n case VOL_4_CC:\n send_trk_vol(4, val);\n break;\n case VOL_5_CC:\n send_trk_vol(5, val);\n break;\n case VOL_6_CC:\n send_trk_vol(6, val);\n break;\n case VOL_7_CC:\n send_trk_vol(7, val);\n break;\n case VOL_8_CC:\n send_trk_vol(8, val);\n break;\n case PREV_TRK_CC:\n wwr_req(40286);\n wwr_req('TRACK');\n break;\n case NEXT_TRK_CC:\n wwr_req(40285);\n wwr_req('TRACK');\n break;\n case MEDIA_EXPLR_CC:\n wwr_req(50124);\n break;\n case SEL_TRK_MUTE_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/MUTE/-1;TRACK/${sel_trk_idx}`);\n break;\n case SEL_TRK_SOLO_CC:\n wwr_req(`SET/TRACK/${sel_trk_idx}/SOLO/-1;TRACK/${sel_trk_idx}`);\n break;\n default:\n break;\n }\n }\n\n function send_trk_vol(trackIndex, encoderValue) {\n // My controller sends values from 0 to 127 which should map to (-inf, +12dB] in REAPER.\n // Read 'main.js' for more information. The formula is also dealing with the fact that\n // There are more numbers from -inf to 0 than from 0 to +12. It makes the encoder less jumpy.\n wwr_req(`SET/TRACK/${trackIndex}/VOL/${(encoderValue / 127) * 4 ** (encoderValue / 127)}`);\n }\n}", "function agregarAQueue(queue) {\r\n marcoListaReproduccion.innerHTML = \"\";\r\n for (let msg of queue) {\r\n let newID = msg.title.replace(regex, \"-\");\r\n let contenedorLink = document.createElement(\"div\");\r\n contenedorLink.setAttribute(\"class\", \"linkReproduccion\");\r\n contenedorLink.setAttribute(\"id\", `cont${newID}`);\r\n let parrafo = document.createElement(\"p\");\r\n parrafo.setAttribute(\"id\", newID);\r\n parrafo.innerHTML = `${msg.user} <br> ${msg.title}`;\r\n parrafo.addEventListener(\"click\", () => {\r\n getAndPostVideo(msg.url);\r\n let toDelete = document.getElementById(`cont${newID}`);\r\n toDelete.remove();\r\n let msgDel = {\r\n secc: \"reaccion\",\r\n type: \"deleteUrl\",\r\n channel: channel,\r\n title: msg.title,\r\n isOpen: isOpenQueue,\r\n };\r\n socket.emit(\"newOrder\", msgDel);\r\n });\r\n //arrayQueue.push(msg.url);\r\n contenedorLink.appendChild(parrafo);\r\n let equisIMG = document.createElement(\"img\");\r\n equisIMG.setAttribute(\"src\", \"./assets/equis.png\");\r\n equisIMG.setAttribute(\"alt\", \"cruz\");\r\n equisIMG.setAttribute(\"id\", \"boton-link-cruz\");\r\n equisIMG.setAttribute(\"class\", \"cruz\");\r\n equisIMG.addEventListener(\"click\", () => {\r\n let toDelete = document.getElementById(`cont${newID}`);\r\n toDelete.remove();\r\n let msgDel = {\r\n secc: \"reaccion\",\r\n type: \"deleteUrl\",\r\n channel: channel,\r\n title: msg.title,\r\n isOpen: isOpenQueue,\r\n };\r\n socket.emit(\"newOrder\", msgDel);\r\n });\r\n contenedorLink.appendChild(equisIMG);\r\n /*\r\n let alertIMG = document.createElement('img');\r\n alertIMG.setAttribute('src', './alert.png');\r\n alertIMG.setAttribute('alt', 'alert');\r\n alertIMG.setAttribute('id', 'boton-link-alerta');\r\n alertIMG.setAttribute('class', 'alert');\r\n contenedorLink.appendChild(alertIMG);\r\n */\r\n marcoListaReproduccion.appendChild(contenedorLink);\r\n }\r\n}", "messageHandler(self, e) {\n let msg = ( (e.data).match(/^[0-9]+(\\[.+)$/) || [] )[1];\n if( msg != null ) {\n let msg_parsed = JSON.parse(msg);\n let [r, data] = msg_parsed;\n self.socketEventList.forEach(e=>e.run(self, msg_parsed))\n }\n }", "function addMsg(room, msg, username)\n{\n //get the room\n var $room = $(\"#\"+room);\n\n //if no window is open, make a new one\n if($room.length == 0){\n $room = createChatWindow(username, room); //ouvre la fenetre adéquat //TODO => verifier le nb max\n }\n\n // append the message to the window\n $room.find(\".msg_container_base\") \n .append('<div class=\"row msg_container base_receive\"> \\\n <div class=\"col-md-12 col-xs-12\"> \\\n <div class=\"messages msg_receive\"> \\\n <p>'+msg+'</p> \\\n <time datetime=\"'+now+'\">'+username+' • '+now+'</time> \\\n </div> \\\n </div>\\\n </div>');\n $(\".msg_container_base\").scrollTo(90000)\n \n emojify.setConfig({\n img_dir :'https://github.global.ssl.fastly.net/images/icons/emoji/'\n });\n emojify.run();\n}", "function addMessages(message) {\n\n const newname = document.createElement('h6');\n const newmessage = document.createElement('p');\n messageContainer.appendChild(newname).append(message.name);\n messageContainer.appendChild(newmessage).append(message.message);\n}", "function addMessage(text, from, type, date) {\n date = new Date(date);\n text = SmileysSystem.parse(text);\n let hours = (\"0\" + date.getHours()).slice(-2);\n let minutes = (\"0\" + date.getMinutes()).slice(-2);\n let secondes = (\"0\" + date.getSeconds()).slice(-2);\n let msg = elt(\n \"p\",\n { class: type },\n elt(\n \"span\",\n {\n \"data-author\": from === pseudo ? \"Vous\" : from,\n \"data-hours\": `${hours}:${minutes}:${secondes}`,\n },\n text\n )\n );\n chatMain.appendChild(msg);\n msg.scrollIntoView();\n if (from === pseudo) {\n speak(`Vous venez d'envoyer le message : ${text}`);\n } else if (type === \"system\") {\n speak(text);\n } else {\n speak(`Message de ${from} : ${text}`);\n }\n }", "constructor() {\n super();\n /**\n * Object containing system-wide default values that can be changed to customize how the library\n * works.\n *\n * @type {object}\n *\n * @property {object} defaults.note - Default values relating to note\n * @property {number} defaults.note.attack - A number between 0 and 127 representing the\n * default attack velocity of notes. Initial value is 64.\n * @property {number} defaults.note.release - A number between 0 and 127 representing the\n * default release velocity of notes. Initial value is 64.\n * @property {number} defaults.note.duration - A number representing the default duration of\n * notes (in seconds). Initial value is Infinity.\n */\n\n this.defaults = {\n note: {\n attack: Utilities.from7bitToFloat(64),\n release: Utilities.from7bitToFloat(64),\n duration: Infinity\n }\n };\n /**\n * The [`MIDIAccess`](https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess)\n * instance used to talk to the lower-level Web MIDI API. This should not be used directly\n * unless you know what you are doing.\n *\n * @type {MIDIAccess}\n * @readonly\n */\n\n this.interface = null;\n /**\n * Indicates whether argument validation and backwards-compatibility checks are performed\n * throughout the WebMidi.js library for object methods and property setters.\n *\n * This is an advanced setting that should be used carefully. Setting `validation` to `false`\n * improves performance but should only be done once the project has been thoroughly tested with\n * `validation` turned on.\n *\n * @type {boolean}\n */\n\n this.validation = true;\n /**\n * Array of all (Input) objects\n * @type {Input[]}\n * @private\n */\n\n this._inputs = [];\n /**\n * Array of disconnected [`Input`](Input) objects. This is used when inputs are plugged back in\n * to retain their previous state.\n * @type {Input[]}\n * @private\n */\n\n this._disconnectedInputs = [];\n /**\n * Array of all [`Output`](Output) objects\n * @type {Output[]}\n * @private\n */\n\n this._outputs = [];\n /**\n * Array of disconnected [`Output`](Output) objects. This is used when outputs are plugged back\n * in to retain their previous state.\n * @type {Output[]}\n * @private\n */\n\n this._disconnectedOutputs = [];\n /**\n * Array of statechange events to process. These events must be parsed synchronously so they do\n * not override each other.\n *\n * @type {string[]}\n * @private\n */\n\n this._stateChangeQueue = [];\n /**\n * @type {number}\n * @private\n */\n\n this._octaveOffset = 0;\n }", "_ackConnectHandler(messages){\n\t // Add stored messages\n\t if ((messages !== \"\") && (this.messages.length === 0)){\n\t\t for (var x in messages){\n\t\t\t var message = messages[x];\n\t\t\t this.push('messages', {\"user\": message.user, \"message\": message.textMessage, \"time\": message.time});\n\t\t }\n\t } \n }", "onChildMsg(msg){\n \n console.log('> Vino de un children:',msg);\n\n }", "function addTextToChat (array,obj) {\n\tvar claseBocadillo=(obj.nombre=='tú')?'chatMsg1':'chatMsg2';\n\tvar d = new Date();\n\tvar h = d.getHours();\n\tvar m = d.getMinutes();\n\tif (m<10)m='0'+m;\n\tvar mensaje='<div class=\"'+claseBocadillo+' chatMsg\"><div class=\"chatMsgTxt\">'+obj.msg+'</div><div class=\"chatMsgTics\">'+h+':'+m+'</div></div>'\n\t$('.contentText').append(mensaje);\n\t$('.content_active').animate({scrollTop: ( $(document).height())+'px'},200);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString+\" DestName=\"+message.destinationName);\n if (message.payloadString == \"red\") {\n\t console.log(\"red\");\n draw_red()\n }\n if (message.payloadString == \"green\") {\n\t console.log(\"green\");\n draw_green()\n }\n\n if (message.destinationName == \"pressure\") {\n console.log(message.payloadString);\n $(\"#gauge1\").gauge(Number(message.payloadString), {min: 0, max: 1100, color: \"#8BC34A\", unit: \" HPa\", font: \"80px verdana\"});\n }\n\n if (message.destinationName == \"power\") {\n console.log(message.payloadString);\n draw_text(message.payloadString);\n $(\"#gauge2\").gauge(Number(message.payloadString), {min: 0, max: 700, color: \"#C38B4A\", unit: \" WHr\", font: \"80px verdana\"});\n }\n\n if (message.destinationName == \"temp_desktop\") {\n console.log(message.payloadString);\n $(\"#gauge3\").gauge(Number(message.payloadString), {min: 0, max: 45, color: \"#8BC34A\", unit: \" C\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n if (message.destinationName == \"temp_window\") {\n console.log(message.payloadString);\n $(\"#gauge4\").gauge(Number(message.payloadString), {min: 0, max: 45, color: \"#8BC34A\", unit: \" C\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n if (message.destinationName == \"temp_floor\") {\n console.log(message.payloadString);\n $(\"#gauge5\").gauge(Number(message.payloadString), {min: 0, max: 45, color: \"#8BC34A\", unit: \" C\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n\n if (message.destinationName == \"humi_desktop\") {\n console.log(message.payloadString);\n $(\"#gauge6\").gauge(Number(message.payloadString), {min: 0, max: 100, color: \"#8080AA\", unit: \" %\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n if (message.destinationName == \"humi_window\") {\n console.log(message.payloadString);\n $(\"#gauge7\").gauge(Number(message.payloadString), {min: 0, max: 100, color: \"#8080AA\", unit: \" %\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n if (message.destinationName == \"humi_floor\") {\n console.log(message.payloadString);\n $(\"#gauge8\").gauge(Number(message.payloadString), {min: 0, max: 100, color: \"#8080AA\", unit: \" %\", font: \"80px verdana\" ,type: \"halfcircle\"});\n }\n\n}", "function createMsgs(){\n\tvar msgsObj = {\n\t\t'root' : {\n\t\t\t'msgs': []\n\t\t}\n\t};\n\n\treturn msgsObj;\n}", "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n if(quickReply || messageText){\n var name = talkEnquery.findById(messageText);\n var ind_cou = 0; \n }\n \n if (isEcho) {\n // Just logging message echoes to console\n console.log(\"Received echo for message %s and app %d with metadata %s\", messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",messageId,quickReplyPayload);\n\n if(name){ \n //if(messageText){ \n //sendTextMessage(senderID, messageText);\n for(ind_cou in name){\n if(name[ind_cou].functions){ \n switch (name[ind_cou].functions) {\n case 'sendTextMessage': sendTextMessage(senderID,name[ind_cou].randomtext);\n break;\n\n case 'sendButton_Message': sendButton_Message(senderID,name[ind_cou].buttonType,name[ind_cou].title,name[ind_cou].info,name[ind_cou].randomtext);\n break;\n\n case 'sendQuickReply': sendQuickReply(senderID,name[ind_cou].titleArray,name[ind_cou].randomtext,name[ind_cou].payload);\n break;\n\n case 'sendListTemplate': sendListTemplate(senderID,name[ind_cou].title_arry,name[ind_cou].image_url_arry,name[ind_cou].subtitle_arry,name[ind_cou].url_arry,name[ind_cou].title_button);\n break;\n\n case 'sendGenericMessage': sendGenericMessage(senderID,name[ind_cou].title_arry,name[ind_cou].subtitle_arry,name[ind_cou].item_url_arry,name[ind_cou].img_url_arry,name[ind_cou].web_url_arry,name[ind_cou].title_urls_arry,name[ind_cou].payload_urls_arry);\n break;\n\n case 'sendGenericwithoutImage': sendGenericwithoutImage(senderID,name[ind_cou].title_arry,name[ind_cou].subtitle_arry,name[ind_cou].item_url_arry,name[ind_cou].web_url_arry,name[ind_cou].title_urls_arry,name[ind_cou].title_postback_arry,name[ind_cou].payload_urls_arry);\n break;\n\n case 'sendImageMessage' : sendImageMessage(senderID,name[ind_cou].image_url);\n break;\n }\n }\n else sendQuickReply(senderID,[\"เปิดบัญชี\",\"สัมมนาบัวหลวง\",\"ราคาหลักทรัพย์\",\"โอนเงิน\"],\"ไม่แน่ใจว่าคุณกำลังถามเรื่องนี้หรือไม่\",\"NOANSWER_TakingEnqury_QuickReply\");\n }\n }\n else sendQuickReply(senderID,[\"เปิดบัญชี\",\"สัมมนาบัวหลวง\",\"ราคาหลักทรัพย์\",\"โอนเงิน\"],\"ไม่แน่ใจว่าคุณกำลังถามเรื่องนี้หรือไม่\",\"NOANSWER_TakingEnqury_QuickReply\");\n\n return;\n }\n\n if (messageText) {\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n if(name){ \n \n for(ind_cou in name){\n if(name[ind_cou].functions){ \n switch (name[ind_cou].functions) {\n case 'sendTextMessage': sendTextMessage(senderID,name[ind_cou].randomtext);\n break;\n\n case 'sendButton_Message': sendButton_Message(senderID,name[ind_cou].buttonType,name[ind_cou].title,name[ind_cou].info,name[ind_cou].randomtext);\n break;\n\n case 'sendQuickReply': sendQuickReply(senderID,name[ind_cou].titleArray,name[ind_cou].randomtext,name[ind_cou].payload);\n break;\n\n case 'sendListTemplate': sendListTemplate(senderID,name[ind_cou].title_arry,name[ind_cou].image_url_arry,name[ind_cou].subtitle_arry,name[ind_cou].url_arry,name[ind_cou].title_button);\n break;\n\n case 'sendGenericMessage': sendGenericMessage(senderID,name[ind_cou].title_arry,name[ind_cou].subtitle_arry,name[ind_cou].item_url_arry,name[ind_cou].img_url_arry,name[ind_cou].web_url_arry,name[ind_cou].title_urls_arry,name[ind_cou].payload_urls_arry);\n break;\n\n case 'sendGenericwithoutImage': sendGenericwithoutImage(senderID,name[ind_cou].title_arry,name[ind_cou].subtitle_arry,name[ind_cou].item_url_arry,name[ind_cou].web_url_arry,name[ind_cou].title_urls_arry,name[ind_cou].title_postback_arry,name[ind_cou].payload_urls_arry);\n break;\n\n case 'sendImageMessage' : sendImageMessage(senderID,name[ind_cou].image_url);\n break;\n }\n }else{\n sendQuickReply(senderID,[\"เปิดบัญชี\",\"สัมมนาบัวหลวง\",\"ราคาหลักทรัพย์\",\"โอนเงิน\"],\"ไม่แน่ใจว่าคุณกำลังถามเรื่องนี้หรือไม่\",\"NOANSWER_TakingEnqury_QuickReply\");\n } \n }\n \n }else{\n var titleArray = [\"เปิดบัญชี\",\"สัมมนาบัวหลวง\",\"โอนเงิน\"];\n var text = [\"ไม่แน่ใจว่าคุณกำลังถามเรื่องนี้หรือไม่\",\"คุณอยากรู้เรื่องใด\",\"ขอโทษค่ะ ฉันไม่แน่ใจว่าคุณต้องการถามเรื่องนี้หรือไม่\"];\n var randomtext = text[Math.floor(Math.random()*text.length)];\n var payload = \"NO_TEXTANSWER_TAKINGENQURY\";\n sendQuickReply(senderID,titleArray,randomtext,payload); \n }\n \n }\n\n if (messageAttachments) {\n sendTextMessage(senderID, \"=)\");\n }\n\n SendeAction(senderID,'typing_off','Turning typing indicator off');\n SendeAction(senderID,'mark_seen','recipient_read_chatwithbot_already');\n}", "_registerMessageListener() {\n this._mav.on('message', (message) => {\n let type = this._mav.getMessageName(message.id);\n\n // Wait for specific message event to get the all the fields.\n this._mav.once(type, (_, fields) => {\n // Emit both events.\n this.emit('message', type, fields);\n let listened = this.emit(type, fields);\n\n // Emit another event if the message was not listened for.\n if (!listened) {\n this.emit('ignored', type, fields);\n }\n });\n });\n }", "function appReady() {\n\n MIDI.Player.addListener(function(e) {\n NOTE.last = Date.now();\n\n var eMap = SONG.effectMapping.channels;\n if(e.hasOwnProperty('channel') && eMap[e.channel]) {\n if(e.message == 144 && eMap[e.channel].hasOwnProperty('spawn')) {\n eMap[e.channel].spawn(e);\n } else if(e.message == 128 && eMap[e.channel].hasOwnProperty('despawn')) {\n eMap[e.channel].despawn(e);\n }\n }\n\n for(var i = 0; i < SONG.effectMapping.globals.length; i++) {\n if(e.message == 144 && SONG.effectMapping.globals[i].hasOwnProperty('spawn')) {\n SONG.effectMapping.globals[i].spawn(e);\n } else if(e.message == 128 && SONG.effectMapping.globals[i].hasOwnProperty('despawn')) {\n SONG.effectMapping.globals[i].despawn(e);\n }\n }\n });\n\n function inputEvent(e) {\n INPUT.x = ((e.clientX / window.innerWidth) - 0.5) * window.innerWidth;\n INPUT.y = ((e.clientY / window.innerHeight) - 0.5) * -window.innerHeight;\n INPUT.cursor.position.x = INPUT.x;\n INPUT.cursor.position.y = INPUT.y;\n INPUT.e = e;\n INPUT.last = Date.now();\n\n\n if(!MIDI.Player.playing) {\n MIDI.Player.resume();\n }\n\n for(var i in SONG.effectMapping.channels) {\n if(SONG.effectMapping.channels[i] && SONG.effectMapping.channels[i].hasOwnProperty('input')) {\n SONG.effectMapping.channels[i].input();\n }\n }\n\n for(var i = 0; i < SONG.effectMapping.globals.length; i++) {\n if(SONG.effectMapping.globals[i] && SONG.effectMapping.globals[i].hasOwnProperty('input')) {\n SONG.effectMapping.globals[i].input();\n }\n }\n }\n\n window.onmousemove = inputEvent;\n\n window.onmousedown = function(e) {\n INPUT.mousedown = true;\n inputEvent(e);\n }\n\n window.onmouseup = function(e) {\n INPUT.mousedown = false;\n }\n\n window.ontouchmove = function(e) {\n e.clientX = e.touches[0].clientX;\n e.clientY = e.touches[0].clientY;\n inputEvent(e);\n }\n\n window.onkeypress = function(e) {\n e.clientX = Math.floor(Math.random() * window.innerWidth);\n e.clientY = Math.floor(Math.random() * window.innerHeight);\n inputEvent(e);\n\n if(e.which == 32) {\n //change theme\n THEME = THEMES[THEMEPTR++ % THEMES.length];\n \n //dispatch randomize events\n for(var i in SONG.effectMapping.channels) {\n if(SONG.effectMapping.channels[i] && SONG.effectMapping.channels[i].hasOwnProperty('randomize')) {\n SONG.effectMapping.channels[i].randomize();\n }\n }\n\n for(var i = 0; i < SONG.effectMapping.globals.length; i++) {\n if(SONG.effectMapping.globals[i] && SONG.effectMapping.globals[i].hasOwnProperty('randomize')) {\n SONG.effectMapping.globals[i].randomize();\n }\n }\n }\n\n //return false;\n\n }\n\n loop();\n\n }", "function onMessageArrived(message) {\r\n\r\n \r\n console.log(\"onMessageArrived: \" + message.payloadString);\r\n\r\n if(message.destinationName == \"IC.embedded/jhat/sensors/readings\"){\r\n var split_data = message.payloadString.split(\",\");\r\n\r\n \r\n var d = new Date();\r\n var h = 0;\r\n var m = 0;\r\n if(d.getHours() < 10){\r\n h = '0'+d.getHours();\r\n }\r\n else{\r\n h = d.getHours();\r\n }\r\n if(d.getMinutes() < 10){\r\n m = '0'+d.getMinutes();\r\n }\r\n else{\r\n m = d.getMinutes();\r\n }\r\n time = h + ':' + m;\r\n time_all = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();\r\n addData(LineChart0, time, parseInt(split_data[0]));\r\n addData(LineChart1, time, parseInt(split_data[1]));\r\n addData(LineChart2, time, parseInt(split_data[2]));\r\n addData(LineChart3, time, parseInt(split_data[3]));\r\n \r\n $('.circle .bar').circleProgress('value', parseFloat(split_data[5])/100);\r\n \r\n // document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + ' | ' + message.payloadString + '</span><br/>';\r\n document.getElementById(\"live-temp\").innerHTML = split_data[0] + '°';\r\n document.getElementById(\"live-hum\").innerHTML = split_data[1] + '%';\r\n document.getElementById(\"live-air\").innerHTML = split_data[3] + ' ppb';\r\n\r\n\r\n \r\n message_board(split_data[4], time, split_data[5])\r\n } \r\n else if(message.destinationName == \"IC.embedded/jhat/sensors/connect_ack\"){\r\n var split_data = message.payloadString.split(\",\");\r\n\r\n for(i=0; i<split_data.length; i=i+7){\r\n time = split_data[i+6]\r\n addData(LineChart0, time, parseInt(split_data[i]));\r\n addData(LineChart1, time, parseInt(split_data[i+1]));\r\n addData(LineChart2, time, parseInt(split_data[i+2]));\r\n addData(LineChart3, time, parseInt(split_data[i+3]));\r\n message_board(split_data[i+4], time, split_data[i+5])\r\n }\r\n\r\n $('.circle .bar').circleProgress('value', parseFloat(split_data[split_data.length-2])/100)\r\n\r\n document.getElementById(\"live-temp\").innerHTML = split_data[split_data.length-7] + '°';\r\n document.getElementById(\"live-hum\").innerHTML = split_data[split_data.length-6] + '%';\r\n document.getElementById(\"live-air\").innerHTML = split_data[split_data.length-4] + ' ppb';\r\n }\r\n}", "function handleSend(newMessage = []) {\n setMessages(GiftedChat.append(messages, newMessage));\n }", "add( data_uri, caption_text ) {\n\n // Create message\n let message = {\n photo: data_uri,\n caption: caption_text\n }\n \n // Add to existing array\n this.messages.unshift(message);\n\n // Emit message\n this.socket.emit('new_message', message);\n\n // Return to app\n return message;\n }", "processNewME( ME ){\n \n //Calc beat & measure time\n ME.setTimes( this.getMusicTimes( ME.globalMsec ) );\n //console.log('new ME: ', ME,' times: ', ME.times);\n\n if( this.log.dumpNewME ){\n //console.log('')\n //console.log('Sequencer: new MusicalEvent: ')\n console.log('Seq new ME: ', ME)\n console.log(' perfBeatQ: ', ME.times.perfBeatQ, ' msr: ', ME.times.measure, ' beat: ', ME.times.beatNum, ' beatDiv: ', ME.times.beatDiv ); \n }\n\n //Send to musical analysis.\n //ME gets added to list of notes in MA obj, and generates\n // a MX that gets added to list in MA obj\n this.musicAnalysis.processME( ME );\n\n }", "function onMessageArrived(message) {\n try{\n let topic = message.destinationName;\n const data = JSON.parse(message.payloadString);\n addData(charts[topic], lists[topic], data.Id, { x: Date.now(), y: data.Value });\n }catch(e){\n // nothing\n }\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "addMessage(msg){\n this.messages.set(this.id, msg);\n this.id++\n return this;\n }", "static tempoAsMetaEvent(midiEvents) {\n\t\treturn midiEvents.map(mev => {\n\t\t\tif (mev.type !== 'tempo') return mev;\n\t\t\tlet value = new RecordBuffer(3);\n\t\t\tvalue.write(RecordType.int.u24be, mev.tempo.usPerQuarterNote);\n\t\t\treturn {\n\t\t\t\ttype: 'meta',\n\t\t\t\tmetaType: 0x51,\n\t\t\t\tdata: value.getU8(),\n\t\t\t\t/*Uint8Array.from([\n\t\t\t\t\t// UINT24BE\n\t\t\t\t\t(value >> 16) & 0xFF,\n\t\t\t\t\t(value >> 8) & 0xFF,\n\t\t\t\t\tvalue & 0xFF,\n\t\t\t\t]),\n\t\t\t\t*/\n\t\t\t};\n\t\t});\n\t}", "onMessage(event) {\n const buffer = event.data;\n this.buffredBytes += buffer.byteLength;\n this.messageQueue.push(new Uint8Array(buffer));\n this.processEvents();\n }", "onMessageStart() { }", "onReceivedMessage(messages) {\n this._storeMessages(messages);\n }", "function onmessage(e) {\n if (e.data.robot !== undefined) {\n update(e.data.robot);\n }\n if (e.data.sensors !== undefined) {\n updateSensors(e.data.sensors);\n }\n if (e.data.mode !== undefined) {\n mode = e.data.mode;\n if (mode === \"auto\") {\n runAutoTimer();\n }\n }\n if (e.data.log !== undefined) {\n let text = e.data.log;\n log(text);\n }\n if (e.data.objs !== undefined) {\n drawObjs(e.data.objs, e.data.type);\n }\n}", "function msgsArr() {\n\tMessage = msg = function (messageText) {\n\t\treturn $div().k('msg').c('x', 'z').font(20)\n\t\t\t\t.T(messageText || 'messageText goes here').M(10).P(10).B(0)\n\t}\n\tadd = function rc(messagesArray, a) {\n\t\tvar args = G(arguments)\n\t\tif (args.n) {\n\t\t\tmessagesArray.E()\n\t\t}\n\t\tif (A(a)) {\n\t\t\t_.e(a,\n\t\t\t\t\tfunction (v) {\n\t\t\t\t\t\trc(O(v) ? v.n : v)\n\t\t\t\t\t})\n\t\t}\n\t\telse {\n\t\t\t_.e(\n\t\t\t\t\targs,\n\t\t\t\t\tfunction (v) {\n\t\t\t\t\t\tmessagesArray($br(),\n\t\t\t\t\t\t\t\tmsg(v))\n\t\t\t\t\t}\n\t\t\t)\n\t\t}\n\t}\n}", "function xqserver_msgadd_normal(){\r\n\tsetup(g_qwUserId);\r\n\tengine.TickleListen(true,g_wPort);\r\n\tengine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),1,g_dw0QType,g_bstr0QTypeData,g_dw0QTypeDataSize);\r\n\tWaitForTickle(engine);\r\n\tif (1!=engine.GetTickleElement(\"QLength\")) FAIL();\r\n}//endmethod", "function handleMessage(message_event) {\n appendToEventLog('nexe sez: ' + message_event.data);\n}", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "addMessage(message) {\n // this.newMessages.next(message);\n // HACK: REPLACE this SERVICE IT IS DEFUNCT... FOR NOW just bypass\n this.chat.sendMsg(message);\n }", "function addMessageHandler(event) {\n var user, type;\n var messageInput = document.getElementById('message-input');\n var messageContainerEl = document.getElementById('message-container');\n\n //determine message type and set message variables accordingly.\n switch (event.target.id) {\n case 'parent-button':\n user = 'Parent';\n type = messageType.out;\n break;\n case 'babysitter-button':\n user = 'Babysitter';\n type = messageType.in;\n break;\n default:\n user = 'unknown';\n type = messageType.unknown;\n break;\n }\n\n //create new msg\n if (messageInput.value) {\n //construct a message and add it to array\n var message = new Message(type, user, messageInput.value);\n messages.push(message);\n\n //create a message element\n var el = createMessageElement(message);\n\n //add the message element to the DOM\n messageContainerEl.appendChild(el);\n\n // reset input\n messageInput.value = '';\n }\n}", "function processReceivedMessages(messages) {\n let message_list = chat_messages.get(initiated_chat_id);\n let message_type = chat_messages_type.get(initiated_chat_id);\n\n if (!is_page_in_view && messages.length > 0) {\n // play message notification sound\n sound.play();\n }\n\n // add messages to list\n for (let i = 0; i < messages.length; i++) {\n message_list.push(messages[i]);\n message_type.push(CLIENT_MSG);\n }\n\n // check to add message to chat window\n if (current_chat_id == initiated_chat_id) {\n let prev_sent_msg_time = 0;\n let curr_sent_msg_time;\n\n for (let i = 0; i < messages.length; i++) {\n curr_sent_msg_time = messages[i].time;\n\n // check to create header or tail message\n if ((curr_sent_msg_time - prev_sent_msg_time) > 60) { // create header message\n chat_window_msg_list_elem.appendChild(createClientHeaderMessageBox(messages[i]));\n\n } else { // create tail message\n chat_window_msg_list_elem.appendChild(createClientTailMessageBox(messages[i]));\n }\n\n prev_sent_msg_time = curr_sent_msg_time;\n }\n }\n }", "function addmessagestoarray(data) {\n if (filteredmessages.length !== 0) {\n messagestore = filteredmessages\n }\n messagestore.push(data)\n setchats([messagestore])\n scrollmessages();\n }", "inviaMessaggio(){\n if(this.messaggioInputUtente != ''){\n this.contacts[this.contattoAttivo].messages.push({\n date: dayjs().format('YYYY/MM/DD HH:MM:SS'),\n text: this.messaggioInputUtente,\n status: 'sent',\n stileMessaggio: 'message-sent'});\n this.messaggioInputUtente = '';\n setTimeout(()=>{\n this.contacts[this.contattoAttivo].messages.push({\n date: dayjs().format('YYYY/MM/DD HH:MM:SS'),\n text: 'ok',\n status: 'received',\n stileMessaggio: 'message-received'});\n }, 1000);\n }\n }", "function QwerToMidi() {\n this.duration = function () {\n var len = 1;\n while (this.tune.length > this.ix) {\n ch = this.tune.charAt(this.ix);\n if (ch == '/') {\n len++;\n } else if (ch == '\\\\') {\n len/=2;\n } else {\n break;\n }\n ++this.ix;\n }\n return len;\n };\n\n this.convert = function (tune) {\n this.tune = tune;\n this.ix = 0;\n var beat = this.duration();\n var oct = 0;\n trax = [ [ /* meta */ ] ];\n voice = [];\n while (this.ix < this.tune.length) {\n var ch = this.tune.charAt(this.ix++);\n var semitones = \"qasedrfgyhujikSEDRFGYHUJIKLP:\".indexOf(ch);\n if (semitones >= 0) {\n var midi = semitones + oct * 12 + 60; // = MIDI.pianoKeyOffset;\n var t = this.duration() * beat * 64;\n voice.push({deltaTime: 0, type: \"channel\", subtype: 'noteOn', channel: trax.length, noteNumber: midi, velocity:127});\n voice.push({deltaTime: t, type: \"channel\", subtype: 'noteOff', channel: trax.length, noteNumber: midi, velocity:0});\n }\n else {\n var tpos = \"-*+\".indexOf(ch) - 1;\n if (tpos == 0) {\n trax.push(voice);\n voice = [];\n oct = 0;\n }\n if (tpos >= -1) {\n oct += tpos;\n }\n }\n }\n trax.push(voice);\n return {\n header: {\n formatType: 1,\n trackCount: trax.length,\n ticksPerBeat: 64 // per crotchet\n },\n tracks: trax\n };\n };\n}", "function ini() {\n let messlist = document.getElementById(\"messages\");\n JSON.parse(messages).messages.forEach((message) => {\n\tmesslist.appendChild(create(message));\n\tmesslist.appendChild(document.createElement(\"BR\"));\n });\n}", "function onMessageArrived(message) {\n // if (message.destinationName == SubSuhu) {\n // // document.getElementById(\"suhu\").innerHTML = message.payloadString;\n // console.log(\"Suhu: \" + message.payloadString);\n // suhu1 = parseInt(message.payloadString);\n // // document.getElementById(\"suhu1\").innerHTML = suhu1;\n // }\n // if (message.destinationName == SubRh) {\n // // document.getElementById(\"rh\").innerHTML = message.payloadString;\n // console.log(\"Kelembaban: \" + message.payloadString);\n // rh1 = parseInt(message.payloadString);\n // // document.getElementById(\"rh1\").innerHTML = rh1;\n // }\n // if (message.destinationName == SubSuhu2) {\n // // document.getElementById(\"suhu\").innerHTML = message.payloadString;\n // console.log(\"Suhu2: \" + message.payloadString);\n // suhu2 = parseInt(message.payloadString);\n // // document.getElementById(\"suhu2\").innerHTML = suhu2;\n // }\n // if (message.destinationName == SubRh2) {\n // // document.getElementById(\"rh\").innerHTML = message.payloadString;\n // console.log(\"Kelembaban2: \" + message.payloadString);\n // rh2 = parseInt(message.payloadString);\n // // document.getElementById(\"rh2\").innerHTML = rh2;\n // }\n if (message.destinationName == lampu) {\n // document.getElementById(\"rh\").innerHTML = message.payloadString;\n console.log(\"Lampu: \" + message.payloadString);\n // rh2 = parseInt(message.payloadString);\n outlampu = parseInt(message.payloadString);\n }\n if (message.destinationName == fan) {\n // document.getElementById(\"rh\").innerHTML = message.payloadString;\n console.log(\"Fan: \" + message.payloadString);\n outfan = message.payloadString;\n }\n // // Publish suhu & rh\n // suhuTot = (suhu1 + suhu2) / 2;\n // rhTot = (rh1 + rh2) / 2;\n // console.log(\"onMessageArrived: \" + message.payloadString);\n // document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + '</span><br/>';\n // document.getElementById(\"pesan\").innerHTML = message.payloadString;\n // updateScroll(); // Scroll to bottom of window\n}", "add(section, messages) {\n for (const key in messages) {\n const path = `${section}.${key}`;\n const value = messages[key];\n if (value instanceof Object) {\n this.allMessages[path] = this.unwrapMessages(path, value);\n }\n else {\n this.allMessages[path] = `${value}`;\n }\n }\n }", "function appendNewMessage(msg) {\n // take the incoming message and push it into the Vue instance\n // into the messages array\n console.log(msg)\n vm.list.push(msg);\n }", "function AddnewMessages(message)\n{\n\t\t\tconsole.log(message)\n\t\t\t\n\t\t\tif(message.channel.sid == generalChannel.sid)\n\t\t\t{\n\t\t\t\tgeneralChannel.getMessages(1).then(function(messagesPaginator){\n\t\t\t\t\t\t\n\t\t\t\t\tconst ImageURL = messagesPaginator.items[0];\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(message.state.attributes.StaffuserName == \"admin\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//==============image print \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><img src=\"'+url+'\" height=\"100px\" width=\"100px\"/></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><img src='\"+url+\"' /> <div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//= ==========Any file print hre admin side ======\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><a src=\"'+url+'\"/></a></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><a href='\"+url+\"' >file</a><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// -------------simple text print ================\n\t\t\t\t\t\t\t\t\t\t\tif(message.state.attributes.note == \"note\")\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper owner_note\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft note'>\"+message.state.body+\"<img src='note.png'/><div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'>\"+message.state.body+\"<div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t console.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"'+url+'\" height=\"100px\" width=\"100px\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><img src='\"+url+\"' /> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a href=\"'+url+'\" >file</a>' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><a href='\"+url+\"' >file</a> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(document).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'>\"+message.state.body+\"</li>\");\n\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}\n\t\t\t\t\t})\n\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 1000);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t//$(\"#listOfChannel\").html(\"\");\n\t\t\t\t\tfor(var j=0;j<StoreChannel.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log(\"message.channel.sid\",message.channel.sid);\n\t\t\t\t\t\t\t//console.log(\"StoreChannel[i].state.sid\",StoreChannel[j].sid)\n\t\t\t\t\t\t\tif(message.channel.sid == StoreChannel[j].sid)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(\"Messagerboxy\",message.channel.body)\n\t\t\t\t\t\t\t\t\t\tvar countId=$(\"#count_\"+j).val();\n\t\t\t\t\t\t\t\t\t\tcountId=parseInt(countId)+1;\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"countIdcountId\",countId);\n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).text(countId);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).addClass(\"m-widget4__number\")\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).removeClass(\"bg-gray\");\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).addClass(\"bg-success\");\n\t\t\t\t\t\t\t\t\t\t$(\"#count_\"+j).val(parseInt(countId));\n\t\t\t\t\t\t\t\t\t\t$(\"#lastMessage_\"+j).text(message.state.body)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t}\n\t\n\t \n\t \n\t\n\t//$(\"#listOfChannel\").prepend(\"<li id='\"+StoreChannel[j].state.uniqueName+\"'onclick='customergetChannel(this.id)' style='color:green;'>\"+StoreChannel[j].state.friendlyName+\"<span class='count_\"+j+\"' style='color:red;'>\"+txtval+\"<span><input type='hidden' id='count_\"+j+\"' value='\"+txtval+\"'/></li>\");\n\t\n\t\n\t\t\t\t\t}\n\n\t\t}\n\t\t\n\n}", "addMsg(msg){\n this.socket.send(JSON.stringify(msg));\n }", "function onMessageArrived(message) {\n\n obj = JSON.parse(message.payloadString);\n //console.log(obj);\n\n\n if (!(obj.id in data)) {\n data[obj.id] = [obj.latitude, obj.longitude];\n locations.push(data[obj.id]);\n showMarkers(markers, locations[locations.length - 1],obj, mymap);\n }\n \n else {\n locations = locations.filter(function (value, index, arr) { return value != data[obj.id] });\n mymap.removeLayer(markersId[obj.id]);\n data[obj.id] = [obj.latitude, obj.longitude];\n locations.push(data[obj.id]);\n showMarkers(markers, locations[locations.length - 1],obj, mymap);\n }\n\n}", "function MessageMap(parentDivId, msgIdBase) {\n\t/**\n\t * The <code>messageMap</code> is the map of messages. Each type of message is held in its own array.\n\t */\n\tthis.messageMap = {};\n\n\t/**\n\t * The <code>uniqueMessageStyles</code> contains all of the unique CSS styles.\n\t */\n\tthis.uniqueMessageStyles = new Array();\n\n\t/**\n\t * The <code>alertDivParentId</code> is the parent node id to which all append and remove operations\n\t * are targeted.\n\t */\n\tthis.alertDivParentId = parentDivId;\n\n\t/**\n\t * The <code>msgIdBase</code> is the sequence of characters making up the id base or prefix. Each instance\n\t * needs a unique message id basis.\n\t */\n\tthis.msgIdBase = msgIdBase;\n\n\t/** \n\t * The <code>msgTimeout</code> is the minimum duration that a message will be left in the message map.\n\t * The message will be retained until the first time clear() is executed after the timeout is reached.\n\t */\n\tthis.msgTimeout = 10000;\n\n\t/**\n\t *\tAdds a message.\n\t *\t@param message is the message to end.\n\t */\n\tthis.addMessage = function (message) {\n\t\tvar msgArray = this.messageMap[message.getType()];\n\t\tif (msgArray === undefined) {\n\t\t\tmsgArray = new Array();\n\t\t\tthis.messageMap[message.getType()] = msgArray;\n\t\t}\n\t\tmsgArray.push(message);\n\t\tmessage.resetTimeout(this.msgTimeout);\n\t\tvar cssStyleAlreadyRegister = false;\n\t\tvar searchCSSStyle = message.getCSSStyleClass();\n\t\tfor (var ix = 0; ix < this.uniqueMessageStyles.length && cssStyleAlreadyRegister == false; ix++) {\n\t\t\tif (this.uniqueMessageStyles[ix] == searchCSSStyle)\n\t\t\t\tcssStyleAlreadyRegister = true;\n\t\t}\n\t\tif (!cssStyleAlreadyRegister)\n\t\t\tthis.uniqueMessageStyles.push(searchCSSStyle);\n\t};\n\n\t/**\n\t *\tDetermines if the incoming parameter is an Array object or not.\n\t */\n\tfunction isArray(arrayCandidate) {\n\t\treturn typeof arrayCandidate == 'object' && arrayCandidate.constructor == Array;\n\n\t}\n\n\n\t/**\n\t *\tClears all messages of all types from the current message map collection.\n\t */\n\tthis.clear = function () {\n\t\tvar currentTime = (new Date()).valueOf();\n\t\tfor (var msgArrayKey in this.messageMap) {\n\t\t\tvar msgArray = this.messageMap[msgArrayKey];\n\t\t\tif (isArray(msgArray)) {\n\t\t\t\tfor (var i = 0; i < msgArray.length;) {\n\t\t\t\t\tvar msg = msgArray[i];\n\t\t\t\t\tif (currentTime > msg.timeout) {\n\t\t\t\t\t\tmsgArray.splice(i, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t* Generates an alert div element based upon the type of messages contained in the msg array.\n\t* @param msgArray is an array of messages assumed to contain messages each with the same type.\n\t*/\n\tthis.generateAlertDiv = function(msgArray){\n\t\tif ( msgArray.length == 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\t\t\n\t\tvar message = msgArray[0];\n\t\tvar alertDiv = $(\"<div>\", {\n\t\t\tid: this.msgIdBase + message.getCSSStyleClass()\n\t\t});\n\t\talertDiv.addClass('alert');\n\t\talertDiv.addClass(message.getCSSStyleClass());\n\n\t\tvar headingText = message.getHeadingText();\n\t\tif ( headingText.length > 0 ) {\n\t\t\t$(\"<h4>\", {\n\t\t\t\ttext: headingText\n\t\t\t}).attr('class', message.getCSSStyleClass()).appendTo(alertDiv);\n\t\t\t\n\t\t\t$(\"<i class='fa' />\").appendTo(alertDiv);\n\t\t}\n\t\tfor (var ix = 0; ix < msgArray.length; ix++) {\n\t\t\tmessage = msgArray[ix];\n\t\t\t$(\"<p>\", {\n\t\t\t\ttext: message.getMessageText()\n\t\t\t}).appendTo(alertDiv);\n\t\t}\n\t\treturn alertDiv;\n\t};\n\n\t/**\n\t * Removes an alert div using is style class to access the node.\n\t * @param cssStyle is the CSS style of the alert node.\n\t */\n\tthis.removeAlert = function (cssStyle) {\n\t\t$(\"#\" + this.msgIdBase + cssStyle).remove();\n\t};\n\t/**\n\t * Removes all of the alerts currently present on the page and removes\n\t * all of the messages in the internal message map.\n\t */\n\tthis.removeAlerts = function () {\n\t\tfor (var ix = 0; ix < this.uniqueMessageStyles.length; ix++) {\n\t\t\tthis.removeAlert(this.uniqueMessageStyles[ix]);\n\t\t}\n\t\tthis.clear();\n\t};\n\n\t/**\n\t * Transfers the messaging currently held in the message map to DOM elements and\n\t * inserts them into the proper parent div.\n\t */\n\tthis.render = function () {\n\t\tvar alertDiv;\n\t\tfor (var msgArrayKey in this.messageMap) {\n\t\t\tvar msgArray = this.messageMap[msgArrayKey];\n\t\t\tif (isArray(msgArray)) {\n\t\t\t\talertDiv = this.generateAlertDiv(msgArray);\n\t\t\t\tif (alertDiv != null) {\n\t\t\t\t\t$('#' + this.alertDivParentId).append(alertDiv).fadeIn();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}", "function process_event(event){\n // Capturamos los datos del que genera el evento y el mensaje\n var senderID = event.sender.id;\n var message = event.message;\n \n // Si en el evento existe un mensaje de tipo texto\n if(message.text){\n console.log('=========MENSAJE DE ============')\n console.log('Mensaje de ' + senderID);\n console.log('mensaje: ' + message.text);\n\n if(message.text === 'Integrantes'){\n enviar_texto(senderID, {\n \"text\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\n })\n }\n if(message.text === 'integrantes'){\n enviar_texto(senderID, {\n \"text\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\n })\n }\n}\n \n // Enviamos el mensaje mediante SendAPI\n //enviar_texto(senderID, response);\n }", "[NEW_MESSAGE] (state, msg) {\n state.items.push(msg)\n }", "function onmessage(evt) {\n //add text to text area for message log from peer\n if(evt.data.msgcontent!=null ){\n console.log(evt.data.msgcontent);\n addMessageLog('Other',evt.data.msgcontent);\n //$('#MessageHistoryBox').text( $('#MessageHistoryBox').text() +'\\n'+ 'other : '+ evt.data.msgcontent );\n //texttospeech(evt.data.msgcontent);\n //call translator \n //append the rsult in messahelanghistory box\n translator(evt.data.msgcontent,mylang,peerlang); \n \n }else if(evt.data.lang!=null ){\n // set the peer langugae parameter\n peerlang=evt.data.lang;\n console.log(\" language received from peer \"+ peerlang);\n }\n}", "function send(midiMessage,callback){\r\n if(output){\r\n output.sendMIDIMessage(midiMessage);\r\n logMessage(JMB.getNoteName(midiMessage.data1) + \" notenumber:\" + midiMessage.data1 + \" velocity:\" + midiMessage.data2);\r\n }\r\n callback();\r\n }", "function addNewMessage(data){\n\t\t$chat.append(createMessage(data));\n\t\t$chat.scrollTop($chat[0].scrollHeight);\n\t}", "function HandleMIDI(event)\n{\n\n //Here we filter incoming note messages\n if (event instanceof NoteOn) { \n\n if(voiceCounter === GetParameter(\"Voice Index\") - 1){\n heldNotes[event.pitch] = true;\n event.send();\n }\n voiceCounter++;\n voiceCounter %= GetParameter(\"Group Polyphony\");\n }\n \n //If we get a 'note off' message that this voice is holding, turn it off. \n else if(event instanceof NoteOff) {\n\n //Listen for MIDI Note 0 to reset the voiceCounter if needed\n if(event.pitch === 0){\n voiceCounter = 0;\n }\n\n if(event.pitch in heldNotes) {\n event.send();\n delete heldNotes[event.pitch];\n }\n }\n \n //pass all other MIDI through\n else {\n event.send();\n } \n \n}", "function toMIDI(channels) {\n var channelsToAdd = channels.filter(function (c) { return !!c.events.length; }),\n numCh = channelsToAdd.length,\n multiCh = numCh > 1;\n return new Uint8Array(getHeader(multiCh ? numCh + 1 : numCh).concat(multiCh ? getTrackChunk([], true) : [], // Time info only\n channelsToAdd.reduce(function (chunks, channel) {\n var engine = channel.engine;\n return chunks.concat(getTrackChunk(channel.events, !multiCh, engine.midiTrackName, engine.midiInstrument));\n }, [])));\n }", "function appendMessage( arr ) {\n debug.log( arguments.callee.name );\n // Map array of arguments (from app) into something more useful.\n \n var args = {},\n arg_map = [ 'type', 'id', 'nick', 'description', 'time', 'nick_color',\n 'extra', 'current', 'highlight', 'starred', 'embed', 'direction',\n 'nick_image', 'context', 'nick_userhost', 'unencrypted' ];\n \n $.each( arg_map, function(i,v){\n args[ v ] = arr[ i ];\n });\n \n // msgTopicReply and msgTopicChange are both used to set the topic, but for\n // some reason, msgTopicReply seems to get spammed on style redraw, so use\n // the \"topic\" msgRaw in its place for chat messages.\n \n if ( args.type === 'msgTopicChange' ) {\n setTopic( args.description );\n \n } else if ( args.type === 'msgTopicReply' ) {\n setTopic( args.description );\n return;\n \n } else if ( args.type === 'msgRaw' && /^Topic is/.test( args.description ) ) {\n args.description = args.description.replace( /^Topic is \"(.*)\"$/, '$1' );\n setTopic( args.description );\n args.type = 'msgTopicReply';\n }\n \n message.append( args );\n}", "function xcoffee_handle_msg(msg)\r\n{\r\n console.log('xcoffee msg',msg);\r\n\r\n events_div.insertBefore(xcoffee_format_msg(msg),events_div.firstChild);\r\n\r\n switch (msg[\"event_code\"])\r\n {\r\n case \"COFFEE_REMOVED\":\r\n set_state_removed(msg);\r\n break;\r\n\r\n case \"COFFEE_GRINDING\":\r\n case \"COFFEE_BREWING\":\r\n set_state_brewing(msg);\r\n break;\r\n\r\n case \"COFFEE_POURED\":\r\n case \"COFFEE_NEW\":\r\n case \"COFFEE_REPLACED\":\r\n set_state_running(msg);\r\n break;\r\n\r\n case \"COFFEE_STATUS\":\r\n handle_status(msg);\r\n default:\r\n break;\r\n }\r\n}", "function message (msg){\n \n console.log(msg)\n \n for(var i=0;i<msg.length;i++){\n \n if(process.pid == msg[i]['pid']){\n \n if(msg[i]['trabajo'] == Config.valoresWorkers.trabajoAnalizar){\n\t\t\t\t\n\t\t\t\tvar Hawk = require(Utils.dirs().core + 'hawk.js')\n\t\t\t\tnew Hawk()\n\t\t\t\t\n // TODO Cambiar por trabajo Analizar\n console.log('Con este trabajo: ' + msg[i]['trabajo'] + ' tendre que ' + Config.valoresWorkers.trabajoAnalizar)\n \n }else{\n \n\t\t\t\t//var web = require(Utils.dirs().web + 'web.js')\n // TODO Cambiar por el trabajo Web\n console.log('Con este trabajo: ' + msg[i]['trabajo'] + ' tendre que ' + Config.valoresWorkers.trabajoWeb)\n\n\n }\n \n }\n }\n}", "function msg_int(v){\n if(v>=128 && v<=239){ \n counter = 0;\n midichunk = new Array();\n\t}\n if(v>=128 && v<=143) miditype = 7; //notes off <noteID&ch,note#,vel>\n if(v>=144 && v<=159) miditype = 1; //notes <noteID&ch,note#,vel>\n if(v>=160 && v<=175) miditype = 2; //after(poly)touch <polyID&ch,note#,val>\n if(v>=176 && v<=191) miditype = 3; //ctlr <ctlID&ch, cc#, val>\n if(v>=192 && v<=207) miditype = 4; //pgm ch <pgmID&ch,val>\n if(v>=208 && v<=223) miditype = 5; //ch. pressure <chprID&ch, val>\n if(v>=224 && v<=239) miditype = 6; //pitch bend <pbID&ch, msb, lsb>\n\n switch(miditype){\n case 1: //note ON\n midichunk[counter] = v;\n\t\t\tif (counter==2) {\n\t\t\t\tlog(\"noteon:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\tif (playingNote > 0 && this.patcher.getnamed('forceMono').getvalueof() > 0)\n\t\t\t\t{\t//if its in force mono mode and a note was already playing then kill it\n\t\t\t\t\toutlet(0,midichunk[0]-16); outlet(0,playingNote); outlet(0,64);\n\t\t\t\t\tlog(\"force note off:\",midichunk[0]-16,midichunk[1]);\n\t\t\t\t}\n\t\t\t\tplayingNote = midichunk[1];\n\t\t\t\tif (holdingNote == 0) \n\t\t\t\t{ //if a note isn't already being held\n\t\t\t\t\tif (pedalHeld > 0) \n\t\t\t\t\t{//if the pedal is already down and this is the next note, then hold it\n\t\t\t\t\t\tholdingNote = midichunk[1];\n\t\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,holdingNote ); outlet(0,midichunk[2]);\n\t\t\t\t\t\t//this.patcher.getnamed('holdingText').hidden = false;\n\t\t\t\t\t\tlog(\"holding note:\",midichunk[0],holdingNote);\n\t\t\t\t\t} else {//the pedal isn't down\n\t\t\t\t\t\tif (this.patcher.getnamed('toggleUnheldNotes').getvalueof() == 0 ) \n\t\t\t\t\t\t{ //if its set to play notes inbetween holders then output the note\n\t\t\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\t\t\tlog(\"playing note:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog(\"ignore\");\n\t\t\t\t\t//a note is being held. ignore this note\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n \n case 2: //after(poly)touch\n midichunk[counter] = v;\n //if (counter==2) printlet(\"aftertouch\",midichunk[1],midichunk[2]);\n counter++;\n break;\n \n case 3: //cc\n midichunk[counter] = v;\n if (counter==2) {\n //printlet(\"cc\",midichunk[1],midichunk[2]);\n }\n counter++;\n break;\n \n case 4: //pgm changes\n midichunk[counter] = v;\n if (counter==1) {\n\t\t\t\tlog(\"pgm\")\n\t\t\t\tif (0 <= midichunk[1] <= (arrMasterList.length/2 -1)) {\n\t\t\t\t\tfor (var midiByte in midichunk) outlet(0,midiByte);\n\t\t\t\t\t//currentPatch = midichunk[1]; //can cause infinte loop\n\t\t\t\t\t//Refresh();\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n \n case 5: //ch. pressure\n midichunk[counter] = v;\n //if (counter==1) printlet(\"ch. pressure\",midichunk[1]);\n counter++;\n break;\n \n case 6://pitch bend\n midichunk[counter] = v;\n //if (counter==2) printlet(\"bend\",midichunk[0]-223,midichunk[1]);\n counter++;\n break;\n \n case 7: //note OFF \n midichunk[counter] = v;\n if (counter==2) {\n\t\t\t\tlog(\"noteoff:\",midichunk[0],midichunk[1],midichunk[2]);\n\t\t\t\tmidichunk[2] = 64; //hack:ableton only responds to nonzero but it receives as 0\n\t\t\t\tif (holdingNote == 0 && this.patcher.getnamed('toggleUnheldNotes').getvalueof() == 0)\n\t\t\t\t{ //if no note is being held then send the note off\n\t\t\t\t\toutlet(0,midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\tlog(\"note off:\",midichunk[0],midichunk[1]);\n\t\t\t\t}\n\t\t\t\tif (playingNote == midichunk[1])\n\t\t\t\t{ //if the most recently played note released then mark nothing as recent\n\t\t\t\t\toutlet(0,127+midichunk[0]); outlet(0,midichunk[1]); outlet(0,midichunk[2]);\n\t\t\t\t\tplayingNote = 0;\n\t\t\t\t}\n\t\t\t}\n counter++;\n break;\n }\n}", "message(type, message) {\n this.array.push({\n type,\n message\n })\n // add element to array\n this.array[this.messageCount].dom = this.createAlert(type, message);\n // cumulative message execution function\n this.messageCount++;\n }", "async convertAndDownloadTracksAsMIDI({ tempo, shapeNoteEventsList }) {\n const zip = ZipFile('Shape Your Music Project');\n\n // create MIDI track for each shape\n shapeNoteEventsList.forEach((noteEvents, i) => {\n const track = new MidiWriter.Track();\n\n // TODO: confirm what the MIDI tempo should be\n track.setTempo(60);\n track.addEvent(new MidiWriter.ProgramChangeEvent({ instrument: 1 }));\n track.addTrackName(`Shape ${i + 1}`);\n\n // TODO: confirm Tick duration calculation\n noteEvents.forEach(({ note, duration }) => {\n const midiNoteEvent = {\n pitch: [note],\n duration: `T${duration * 60 * (100 / tempo)}`,\n };\n const midiNote = new MidiWriter.NoteEvent(midiNoteEvent);\n track.addEvent(midiNote);\n });\n\n const write = new MidiWriter.Writer([track]);\n zip.add(`shape-${i + 1}.mid`, write.buildFile());\n });\n\n await zip.download();\n }", "function onMessage(event) {\n var str = event.data.split(\"\\r\");\n var pos\n for (pos = 0; pos < str.length - 1; pos++) {\n if (logMessages.length >= maxLogs) {\n logMessages.shift();\n }\n logMessages.push(str[pos]);\n }\n}", "function onSocketMessage(event) {\r\n\tappendContent(\"theMessages\", \"Received: \" + event.data + \"<br/>\");\r\n}", "receive(message) {\n this.log(\"Received: \"+message);\n var obj = JSON.parse(message);\n if (\"object\" in obj){\n this.processEvent(obj.object,obj.changes);\n } else if (\"Add\" in obj ) {\n for ( i=0; i< obj.Add.objects.length; i++ ) {\n // this.log(\"adding \"+i+\":\"+obj);\n this.addObject(obj.Add.objects[i]);\n }\n this.log(\"added \"+obj.Add.objects.length+\" scene size \"+this.scene.size);\n } else if (\"Remove\" in obj) {\n for ( var i=0; i< obj.Remove.objects.length; i++ ) {\n this.removeObject(obj.Remove.objects[i]);\n }\n } else if (\"ERROR\" in obj){\n // TODO: error listener(s)\n this.log(obj.ERROR);\n this.errorListeners.forEach((listener)=>listener(obj.ERROR));\n } else if ( \"Welcome\" in obj) {\n var welcome = obj.Welcome;\n if ( ! this.me ) {\n // FIXME: Uncaught TypeError: Cannot assign to read only property of function class\n let client = new User();\n this.me = Object.assign(client,welcome.client.User);\n }\n this.welcomeListeners.forEach((listener)=>listener(welcome));\n if ( welcome.permanents ) {\n welcome.permanents.forEach( o => this.addObject(o));\n }\n } else if ( \"response\" in obj) {\n this.log(\"Response to command\");\n if ( typeof this.responseListener === 'function') {\n var callback = this.responseListener;\n this.responseListener = null;\n callback(obj);\n }\n } else {\n this.log(\"ERROR: unknown message type\");\n }\n }" ]
[ "0.70966196", "0.66593134", "0.6629907", "0.6185917", "0.59809494", "0.5954331", "0.5907878", "0.5839515", "0.582315", "0.5774265", "0.57725745", "0.5757983", "0.5757983", "0.5702442", "0.56684333", "0.5656926", "0.5638134", "0.56332827", "0.5630291", "0.56143975", "0.56037414", "0.55834687", "0.5554443", "0.5552752", "0.5549258", "0.5511092", "0.5511092", "0.55097324", "0.55036354", "0.54964817", "0.54543585", "0.54205775", "0.5416872", "0.5408633", "0.5398997", "0.5392402", "0.5353631", "0.53440297", "0.53399265", "0.5313932", "0.53107876", "0.53052753", "0.5302859", "0.53027374", "0.529521", "0.52904665", "0.52892786", "0.52822345", "0.5271404", "0.5268872", "0.5264102", "0.52553445", "0.5248462", "0.5244237", "0.5237087", "0.52289826", "0.52273846", "0.522592", "0.5224264", "0.5223987", "0.5222326", "0.52194935", "0.5214465", "0.5213255", "0.5208919", "0.51951736", "0.5190994", "0.5189515", "0.5189515", "0.5189515", "0.51878554", "0.51852685", "0.5180224", "0.5169865", "0.51647544", "0.515574", "0.5153544", "0.51520276", "0.5146341", "0.5141042", "0.5136804", "0.5136424", "0.5127256", "0.5124994", "0.51204246", "0.5114107", "0.51058376", "0.51053226", "0.51045406", "0.51023126", "0.51005995", "0.5096606", "0.50947267", "0.50919724", "0.5089475", "0.50766844", "0.5066848", "0.5057459", "0.50558597", "0.5052841" ]
0.5825209
8
functions for transforming opinion(s) to Html code
function opinion2html(opinion) { //in the case of Mustache, we must prepare data beforehand: opinion.createdDate = new Date(opinion.created).toDateString(); //get the template: const template = document.getElementById("mTmplOneOpinion").innerHTML; //use the Mustache: //const htmlWOp = Mustache.render(template,opinion); const htmlWOp = render(template, opinion); //delete the createdDate item as we created it only for the template rendering: delete opinion.createdDate; //return the rendered HTML: return htmlWOp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verse1() {\n let output = ''\n output = '<p>In the heart of Holy See</p>' +\n '<p>In the home of Christianity</p>' +\n '<p>The Seat of power is in danger</p>'\n\n return output\n}", "toHTML ( theMode, sigDigs , params) {}", "function OLover2HTMLshow(quo){\r\r\n var so=OLoverHTML,s2=(OLover2HTML||'null').toString(),q=(quo||0);\r\r\n overlib(OLhtmlspecialchars(s2,q), CAPTION,'<div align=\"center\">OLover2HTML</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,\r\r\n BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,\r\r\n CGCOLOR,'#aaaaaa', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',\r\r\n TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,\r\r\n (OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);\r\r\n OLoverHTML=so;\r\r\n}", "function gen_pet_tips_html(equipid, big_img_root, equip_face_img, pet_skill_url, pet_desc, pet_name){\nvar pet_attrs = get_pet_attrs_info(pet_desc);\nvar template = get_tips_template($(\"pet_tips_template\").innerHTML); \n\nvar result = template.format(equipid, big_img_root,equip_face_img, pet_name, pet_attrs.pet_grade, pet_attrs.attack_aptitude, \n\npet_attrs.defence_aptitude, pet_attrs.physical_aptitude, pet_attrs.magic_aptitude, pet_attrs.speed_aptitude, pet_attrs.avoid_aptitude, pet_attrs.lifetime, pet_attrs.growth, equipid, equipid, pet_attrs.blood,pet_attrs.max_blood, \n\npet_attrs.soma, pet_attrs.magic, pet_attrs.max_magic, pet_attrs.magic_powner, pet_attrs.attack, pet_attrs.strength, pet_attrs.defence, pet_attrs.endurance, pet_attrs.speed, pet_attrs.smartness, pet_attrs.wakan, pet_attrs.potential, equipid, equipid, \n\npet_attrs.five_aptitude, equipid, equipid,equipid, pet_attrs.all_skill, pet_attrs.sp_skill, pet_skill_url, equipid);\n\nreturn result;\n}", "splits_phrase_html() {\n switch (this.splits.length) {\n case 2: return `<strong>${this.splits[0].cook_rating_name}</strong> and <strong>${this.splits[1].cook_rating_name}</strong>`\n case 3: return `<strong>${this.splits[0].cook_rating_name}</strong>, <strong>${this.splits[1].cook_rating_name}</strong> and <strong>${this.splits[2].cook_rating_name}</strong>`\n default: throw new Error(`Wrong number of splits in ${this.state_name}: ${this.splits.length}`)\n }\n }", "function encodeRating(rating){\r\n let encode = \"<p style='display:none'>\" +rating+ \"</p>\";\r\n return encode;\r\n}", "function other_quiz_modes_html() {\n var html = `<span style=\"display:block;margin-bottom:15px;\"/>`\n const other_quiz_modes = Object.keys(quiz_modes).filter(mode => !current_quiz_modes(url_parameters).contains(mode))\n if (other_quiz_modes.length > 0) {\n html += `<div style=\"font-family:Helvetica\">\n <p id='other-quiz-modes'>You can also try these quiz modes!</p>\n <ul>`\n other_quiz_modes.forEach(function(mode) {\n const description = on_mobile_device() ? quiz_modes[mode].description.split(\"'\")[0] : quiz_modes[mode].description\n html += `<li>\n <a target='_self' href='?${mode}'>${quiz_modes[mode].anthem}</a>&nbsp;(${description}.)\n </li>`})\n html += `</ul>\n </div>`\n }\n return html\n}", "function renderHTML(data) {\n var htmlString = \"\";\n //for loop to concatinate each object info into a sentence\n for (var i = 0; i < data.length; i++) {\n htmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \";\n\n for (var ii = 0; ii < data[i].foods.likes.length; ii++) {\n if (ii == 0) {\n htmlString += data[i].foods.likes[ii]\n\n }\n else {\n htmlString += \" and \" + data[i].foods.likes[ii]\n }\n }\n\n htmlString += \" and dislikes \";\n\n for (var ii = 0; ii < data[i].foods.dislikes.length; ii++) {\n if (ii == 0) {\n htmlString += data[i].foods.dislikes[ii]\n\n }\n else {\n htmlString += \" and \" + data[i].foods.dislikes[ii]\n }\n }\n\n htmlString += \".</p>\"\n }\n animals.insertAdjacentHTML('beforeend', htmlString);\n}", "generateHtmlOutput() {\n let html = \"\";\n const stateSections = this.state.assignment.sections;\n const outSections = stateSections.custom.concat(stateSections.compulsory);\n\n for (let i = 0; i < outSections.length; i++) {\n if (outSections[i].value != \"\") {\n html += \"<h1>\" + outSections[i].title + \"</h1>\";\n html += outSections[i].value;\n }\n }\n\n return html;\n }", "function verse1() {\n let output = '<p>I have a mansion but forget the price\\<br>\\\n Ain\\'t never been there, they tell me it\\'s nice\\<br>\\\n I live in hotels, tear out the walls\\<br>\\\n I have accountants, pay for it all</p>'\n return output\n}", "function countResultHTML(tal1, tal2, ope) {\n let output\n const result = document.getElementById('result')\n\n if(ope === '+') {\n output = tal1 + tal2\n } else if(ope === '-') {\n output = tal1 - tal2\n } else if(ope === '*') {\n output = tal1 * tal2\n } else if(ope === '/') {\n output = tal1 / tal2\n } else {\n output = 'känner inte igen operatorn'\n }\n \n result.innerHTML = output\n}", "function explodeT() {\n setEx(true);\n return <p>hihihihihihihi</p>\n }", "function rederHtml(data){\n\t\n\t// create a variable that will hold the html code\n\tvar htmlString = \"\";\n\t//loop though the data and show it using html\n\tfor(i=0; i< data.length; i++){\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \";\n\t\t\n\t\t// loop though the list favorites food likes\n\t\tfor(a =0; a< data[i].foods.likes.length; a++){\n\t\t\t// if it is the first element\n\t\t\tif(a == 0){\n\t\t\t\t\n\t\t\t\thtmlString +=\tdata[i].foods.likes[a];\n\t\t\t} else { // otherwise\n\t\t\t\thtmlString +=\t\" and \" + data[i].foods.likes[a];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\thtmlString += ' and dislikes ';\n\t\t\t\n\t\t\t// loop though the list dislikes food\n\t\t\tfor(a =0; a< data[i].foods.dislikes.length; a++){\n\t\t\t\t// if it is the first element\n\t\t\t\tif(a == 0){\n\t\t\t\t\t\n\t\t\t\t\thtmlString +=\tdata[i].foods.dislikes[a];\n\t\t\t\t} else { // otherwise\n\t\t\t\t\thtmlString +=\t\" and \" + data[i].foods.dislikes[a];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t}\n\t\thtmlString += \"</p> <hr />\";\n\t\t\n\t}\n\t\n\t// append html to the page\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "render_explanation () {}", "function generateTeamHTML(answers) {\n return ` `;\n}", "function gen_equip_tips_html(equipid, equip_name, equip_desc, equip_type_desc, big_img_root, equip_face_img, pet_skill_url){\t\n\tvar template = get_tips_template($(\"equip_tips_template\").innerHTML);\n\tvar result = template.format(equipid, big_img_root, equip_face_img, equip_name, equip_type_desc, equip_desc);\n\treturn result;\n}", "function info_html(alist){\n\n var output = '';\n// output = output + '<div class=\"block\">';\n// output = output + '<h2>Intersection Information</h2>';\n output = output + group_info_html(alist); \n output = output + term_info_html(alist); \n output = output + gp_info_html(alist);\n// output = output + '</div>';\n return output;\n}", "function renderHTML(data){ //Sikter til funksjon som tidelere er blitt tildelt ourdata, parameter kan være samme\r\n var htmlString = \"\"; // tom string som vi skal fylle\r\n\r\n for(i = 0; i < data.length; i++){ // kjører gjennom listen\r\n htmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \" // bruker dot notation for å få tilgang til elementer\r\n\r\n for (ii = 0; ii < data[i].foods.likes.length; ii++){ //sikter oss dypere inn i underliggende arrays, så for loops inne i en for loop\r\n if (ii <= 0){\r\n htmlString += data[i].foods.likes[ii];\r\n } else{\r\n htmlString += \" and \" + data[i].foods.likes[ii];\r\n }\r\n }\r\n\r\n htmlString += \" and dislikes \";\r\n\r\n for(iii = 0; iii < data[i].foods.dislikes.length; iii++){\r\n if(iii <= 0){\r\n htmlString += data[i].foods.dislikes[iii];\r\n } else {\r\n htmlString += \" and \" + data[i].foods.dislikes[iii];\r\n }\r\n }\r\n\r\nhtmlString += \". </p>\"\r\n\r\n }\r\n\r\n animalContainer.insertAdjacentHTML('beforeend', htmlString);\r\n}", "function opFormat(itok,tokArray) {\n\t//alert('opFormat '+ tokArray[itok][0]);\n\tvar tmp;\n\tvar token = tokArray[itok][0];\n\t//single operators handled: -+*/_^\n\t//how to handle !?.|/@\"()[]\n\tswitch(tokArray[itok][0]) {\n\t case '-':\n\t\tmmlString = mmlString + \"<mo>-</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t case '+':\n\t\tmmlString = mmlString + \"<mo>+</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t case '*':\n\t\tmmlString = mmlString + \"<mo>*</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t case '/': // this has rank 1 so itok = 1 and we use itok = 0 and itok = 2\n\t\tmmlString = mmlString + \"<mfrac>\";\n\t\ttokEx(tokArray.slice(0,1));\n\t\ttokEx(tokArray.slice(2,3));\n\t\tmmlString = mmlString + \"</mfrac>\";\n\t\treturn tokArray.slice(3);\n\t\tbreak;\n\t case '_': // look ahead to see if a ^ follows, i.e. tok0 _ tok2 ^ tok4\n\t\tif (tokArray.length > 4 && tokArray[itok+2][0] == '^') {\n\t\t // look back to see if the base if sum, int, prod to use <munderover> \n\t\t // instead of <msubsup>\n\t\t if ( (tokArray[itok-1][0] == 'sum' || tokArray[itok-1][0] == 'prod' || tokArray[itok-1][0] == 'int') && tokArray[itok-1][1] == 'backWord') {\n\t\t\tvar begin = '<munderover>';\n\t\t\tvar end = '</munderover>';\n\t\t }\n\t\t else {\n\t\t\tvar begin = '<msubsup>';\n\t\t\tvar end = '</msubsup>';\n\t\t }\n\t\t mmlString = mmlString + begin;\n\t\t tokEx(tokArray.slice(0,1));\n\t\t tokEx(tokArray.slice(2,3));\n\t\t tokEx(tokArray.slice(4,5));\n\t\t mmlString = mmlString + end;\n\t\t return tokArray.slice(5);\n\t\t}\n\t\telse { // tok0 _ tok2\n\t\t // look back to see if the base if sum, int, prod to use <munder> \n\t\t // instead of <msub>\n\t\t if ( (tokArray[itok-1][0] == 'sum' || tokArray[itok-1][0] == 'prod' || tokArray[itok-1][0] == 'int') && tokArray[itok-1][1] == 'backWord') {\n\t\t\tvar begin = '<munder>';\n\t\t\tvar end = '</munder>';\n\t\t }\n\t\t else {\n\t\t\tvar begin = '<msub>';\n\t\t\tvar end = '</msub>';\n\t\t }\n\t\t mmlString = mmlString + begin;\n\t\t tokEx(tokArray.slice(0,1));\n\t\t tokEx(tokArray.slice(2,3));\n\t\t mmlString = mmlString + end;\n\t\t return tokArray.slice(3);\n\t\t}\n\t\tbreak;\n\t case '^':\n // look ahead to see if a _ follows, i.e. tok0 ^ tok2 _ tok4\n\t\tif (tokArray.length > 4 && tokArray[itok+2][0] == '_') {\n\t\t // look back to see if the base is sum, int, prod to use <munderover> \n\t\t // instead of <msubsup>\n\t\t if ( (tokArray[itok-1][0] == 'sum' || tokArray[itok-1][0] == 'prod' || tokArray[itok-1][0] == 'int') && tokArray[itok-1][1] == 'backWord') {\n\t\t\tvar begin = '<munderover>';\n\t\t\tvar end = '</munderover>';\n\t\t }\n\t\t else {\n\t\t\tvar begin = '<msubsup>';\n\t\t\tvar end = '</msubsup>';\n\t\t }\n\t\t mmlString = mmlString + begin;\n\t\t tokEx(tokArray.slice(0,1));\n\t\t tokEx(tokArray.slice(4,5));\n\t\t tokEx(tokArray.slice(2,3));\n\t\t mmlString = mmlString + end;\n\t\t return tokArray.slice(5);\n\t\t}\n\t\telse { // tok0 ^ tok2\n\t\t // look back to see if the base if sum, int, prod to use <mover> \n\t\t // instead of <msup>\n\t\t if ( (tokArray[itok-1][0] == 'sum' || tokArray[itok-1][0] == 'prod' || tokArray[itok-1][0] == 'int') && tokArray[itok-1][1] == 'backWord') {\n\t\t\tvar begin = '<mover>';\n\t\t\tvar end = '</mover>';\n\t\t }\n\t\t else {\n\t\t\tvar begin = '<msup>';\n\t\t\tvar end = '</msup>';\n\t\t }\n\t\t mmlString = mmlString + begin;\n\t\t tokEx(tokArray.slice(0,1));\n\t\t tokEx(tokArray.slice(2,3));\n\t\t mmlString = mmlString + end;\n\t\t return tokArray.slice(3);\n\t\t}\n\t\tbreak;\n\t case '(':\n\t\tmmlString = mmlString + \"<mo>(</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t case ')':\n\t\tmmlString = mmlString + \"<mo>)</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t case '=':\n\t\tmmlString = mmlString + \"<mo>=</mo>\";\n\t\treturn tokArray.slice(1);\n\t\tbreak;\n\t}\n\treturn;\n }", "function mutateHtmlTextsOpacity() {\n // rawArticle += 'STRONG WORDS SENTENCES (filter by common words dictionary)' + ' : \\n\\n';\n // rawArticle += '------------- \\n\\n';\n\n let outputText = ''\n let elms = Array.from(document.querySelectorAll('a,b,blockquote,button,dd,del,dt,em,h1,h2,h3,h4,h5,h6,i,ins,label,li,mark,p,small,span,strong,sub,sup,td,th'))\n elms.forEach(elm => {\n let words = elm.innerText.split(/\\s/g)\n .map(x => {\n if (commonWordsDictionnary.includes(x.toLowerCase()) == true) {\n return '<span data-trigger=\"orasyo-low\" style=\"opacity:0.44;\">' + x.trim() + '</span>'\n } else {\n return '<span data-trigger=\"orasyo-high\">' + x + '</span>'\n }\n })\n\n elm.innerHTML = words.join(' ')\n\n // write in \"pre\"\n // outputText += Array.from(elm.children)\n // .filter(x => x.dataset.trigger == 'orasyo-high')\n // .map(x => x.innerText)\n // .reduce((acc, val) => {\n // if (acc.includes(val))\n // acc.push(val)\n // return acc\n // }, [])\n // .join(' ') + '\\n';\n })\n\n // rawArticle += outputText\n\n // // always display results in console\n // rawArticle += '\\n\\n' + separator + '\\n\\n';\n}", "function format_html_output() {\r\n var text = String(this);\r\n text = text.tidy_xhtml();\r\n\r\n if (Prototype.Browser.WebKit) {\r\n text = text.replace(/(<div>)+/g, \"\\n\");\r\n text = text.replace(/(<\\/div>)+/g, \"\");\r\n\r\n text = text.replace(/<p>\\s*<\\/p>/g, \"\");\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"\\n\");\r\n } else if (Prototype.Browser.Gecko) {\r\n text = text.replace(/<p>/g, \"\");\r\n text = text.replace(/<\\/p>(\\n)?/g, \"\\n\");\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"\\n\");\r\n } else if (Prototype.Browser.IE || Prototype.Browser.Opera) {\r\n text = text.replace(/<p>(&nbsp;|&#160;|\\s)<\\/p>/g, \"<p></p>\");\r\n\r\n text = text.replace(/<br \\/>/g, \"\");\r\n\r\n text = text.replace(/<p>/g, '');\r\n\r\n text = text.replace(/&nbsp;/g, '');\r\n\r\n text = text.replace(/<\\/p>(\\n)?/g, \"\\n\");\r\n\r\n text = text.gsub(/^<p>/, '');\r\n text = text.gsub(/<\\/p>$/, '');\r\n }\r\n\r\n text = text.gsub(/<b>/, \"<strong>\");\r\n text = text.gsub(/<\\/b>/, \"</strong>\");\r\n\r\n text = text.gsub(/<i>/, \"<em>\");\r\n text = text.gsub(/<\\/i>/, \"</em>\");\r\n\r\n text = text.replace(/\\n\\n+/g, \"</p>\\n\\n<p>\");\r\n\r\n text = text.gsub(/(([^\\n])(\\n))(?=([^\\n]))/, \"#{2}<br />\\n\");\r\n\r\n text = '<p>' + text + '</p>';\r\n\r\n text = text.replace(/<p>\\s*/g, \"<p>\");\r\n text = text.replace(/\\s*<\\/p>/g, \"</p>\");\r\n\r\n var element = Element(\"body\");\r\n element.innerHTML = text;\r\n\r\n if (Prototype.Browser.WebKit || Prototype.Browser.Gecko) {\r\n var replaced;\r\n do {\r\n replaced = false;\r\n element.select('span').each(function(span) {\r\n if (span.hasClassName('Apple-style-span')) {\r\n span.removeClassName('Apple-style-span');\r\n if (span.className == '')\r\n span.removeAttribute('class');\r\n replaced = true;\r\n } else if (span.getStyle('fontWeight') == 'bold') {\r\n span.setStyle({fontWeight: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<strong>' + span.innerHTML + '</strong>');\r\n replaced = true;\r\n } else if (span.getStyle('fontStyle') == 'italic') {\r\n span.setStyle({fontStyle: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<em>' + span.innerHTML + '</em>');\r\n replaced = true;\r\n } else if (span.getStyle('textDecoration') == 'underline') {\r\n span.setStyle({textDecoration: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<u>' + span.innerHTML + '</u>');\r\n replaced = true;\r\n } else if (span.attributes.length == 0) {\r\n span.replace(span.innerHTML);\r\n replaced = true;\r\n }\r\n });\r\n } while (replaced);\r\n\r\n }\r\n\r\n for (var i = 0; i < element.descendants().length; i++) {\r\n var node = element.descendants()[i];\r\n if (node.innerHTML.blank() && node.nodeName != 'BR' && node.id != 'bookmark')\r\n node.remove();\r\n }\r\n\r\n text = element.innerHTML;\r\n text = text.tidy_xhtml();\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"<br />\\n\");\r\n text = text.replace(/<\\/p>\\n<p>/g, \"</p>\\n\\n<p>\");\r\n\r\n text = text.replace(/<p>\\s*<\\/p>/g, \"\");\r\n\r\n text = text.replace(/\\s*$/g, \"\");\r\n\r\n return text;\r\n }", "function OLoverHTMLshow(quo){\r\r\n var so=OLoverHTML,s=(so||'null').toString(),q=(quo||0);\r\r\n overlib(OLhtmlspecialchars(s,q), CAPTION,'<div align=\"center\">OLoverHTML</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,\r\r\n BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,\r\r\n CGCOLOR,'#999999', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',\r\r\n TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,\r\r\n (OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);\r\r\n OLoverHTML=so;\r\r\n}", "function createSimplifiedTextHTML(originalText, simplifications) {\n Array.prototype.keySort = function(key, desc){\n this.sort(function(a, b) {\n var result = desc ? (a[key] < b[key]) : (a[key] > b[key]);\n return result ? 1 : -1;\n });\n return this;\n }\n simplifications.keySort('start');\n if (simplifications.length == 0)\n {\n var result = emptyText;//'No hay palabras que necesiten ser simplificadas';\n }else{\n var result = originalText;\n var item = '';\n // for each simplified word add an element containing it\n for (var i = simplifications.length -1; i >= 0; i--) {\n item = simplifications[i];\n console.log(item);\n result = result.substring(0, item.start) + \n createSimplifiedWordLabel(item) + \n result.substring(item.end, result.length);\n }\n }\n return result;\n }", "function GenerateAnswerHTML(options, answer) {\r\n \r\n var content = '';\r\n if(options['votes'] == 'true')\r\n content += '<div class=\"hr\" /><a href=\"' + answer['link'] + '\" target=\"_blank\" class=\"heading answer-count\">' +\r\n answer['score'] + ' votes' + (answer['is_accepted']?' - <span class=\"accepted\">Accepted</span>':'') + '</a>';\r\n \r\n content += GenerateProfileHTML(answer['owner']) + answer['body'];\r\n return content;\r\n \r\n }", "function outputModifiers() {\n let modifiersHtml = {\n 'piloted_ship': [], 'fleet': [], 'fighters': [], 'governed_colony': [], 'hull_mod': [], 'ability': [], 'other': []\n };\n for (let i in skills) {\n for (let pId in skills[i].perks) {\n let perkObj = skills[i].perks[pId];\n if (perkObj.level > 0) {\n for (let lId in perkObj.levels) {\n if (perkObj.levels[lId].level <= perkObj.level) {\n let levelObj = perkObj.levels[lId];\n let perkType = levelObj.type !== '' ? levelObj.type.replace(' ', '_') : 'other';\n modifiersHtml[perkType].push(levelObj.description + ' <span>(' + perkObj.name + ' <span>level ' + levelObj.level + '</span>)</span>');\n }\n }\n }\n }\n }\n\n let showModifiers = false;\n let modifiersSelector = $('#modifiers');\n for (var type in modifiersHtml) {\n modifiersSelector.find('#' + type).hide().find('ul').html('');\n for (let i in modifiersHtml[type]) {\n if (modifiersSelector.find('#' + type).is(':hidden')) {\n modifiersSelector.find('#' + type).show();\n }\n modifiersSelector.find('#' + type + ' ul').append('<li>' + modifiersHtml[type][i] + '</span></li>');\n }\n showModifiers = true;\n }\n\n if (showModifiers && modifiersSelector.is(':hidden')) {\n modifiersSelector.slideDown();\n }\n\n if (!showModifiers && modifiersSelector.is(':visible')) {\n modifiersSelector.hide();\n }\n\n}", "function renderHTML(data) {\r\n\t// create empty string\r\n\tvar htmlString = \"\";\r\n\r\n\t// loop through array\r\n\tfor (i = 0; i < data.length; i++){\r\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \"\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\r\n\t\thtmlString += \" and dislikes \";\r\n\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\thtmlString += '.</p>'\r\n\t}\r\n\r\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString)\r\n}", "function renderHTML(data) {\n\n let htmlStr = '';\n\n // loops through data and we get all obj from array\n for (let i = 0; i < data.length; i++) {\n htmlStr += \"<p>\" + data[i].name + ' ' + data[i].species + \"that likes to eat \";\n\n // loops obj and search keys\n for (let x = 0; x < data[i].foods.likes.length; x++) {\n if (x == 0) {\n htmlStr += data[i].foods.likes[x];\n } else {\n htmlStr += \" and \" + data[i].foods.likes[x];\n }\n }\n\n htmlStr += ' and dislikes ';\n\n // loops obj and search keys\n for (let x = 0; x < data[i].foods.dislikes.length; x++) {\n if (x == 0) {\n htmlStr += data[i].foods.dislikes[x];\n } else {\n htmlStr += \" and \" + data[i].foods.dislikes[x];\n }\n }\n\n htmlStr += '</p>';\n }\n // The insertAdjacentHTML method allows us to insert random HTML anywhere in the document, including between nodes!\n // The first argument tells were we want to put a text, second what content we add\n dataContainer.insertAdjacentHTML('beforeend', htmlStr);\n\n}", "function generateResultHtml(result)\n\t{\n\n\t\tlet Html = \"\"\n\t\tresult.forEach(function(element) {\n\t\t\tlet difficulty = ''\n\t\t\tswitch(element.LevelOfDifficulty){\n\t\t\t\tcase 1:\n\t\t\t\t\tdifficulty = 'Green'\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tdifficulty = 'Red'\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tdifficulty = 'Black'\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tHtml += `<div>\n <p>${element.Destination1} To ${element.Destination2}</p>\n <p>Length: ${element.Lenght/1000} Km</p>\n <p>Difficulty: ${difficulty}</p>\n <a href=\"${element.GPXLink}\">GpxLink</a>\n <hr>\n </div>`\n\t\t})\n\n\t\treturn Html\n\t}", "get displayHtml PS_displayHtml() {\n var {escapeHtml} = Utils;\n var sentence = ('<span class=\"verb\">' +\n escapeHtml(this._verb.matchedName) +\n '</span>');\n var args = this._verb._arguments;\n for (let x in args) {\n let obj = x === \"direct_object\";\n let {summary} = this._argSuggs[x] || 0;\n if (summary) {\n let label = obj ? \"\" : escapeHtml(args[x].flag) + \" \";\n sentence += (\n \" \" + (obj ? \"\" : '<span class=\"delimiter\">' + label + '</span>') +\n '<span class=\"' + (obj ? \"object\" : \"argument\") + '\">' +\n summary + \"</span>\");\n }\n else {\n let label = (obj ? \"\" : args[x].flag + \" \") + args[x].label;\n sentence += ' <span class=\"needarg\">' + escapeHtml(label) + \"</span>\";\n }\n }\n return sentence;\n }", "toHtml()\n\t{\n //to finish \n var answer = '<div class=\"student-project-panel\"><div class=\"personal-row\"> <h3>' \n\t\t+ this.name + '</h3><span class=\"'+ map_dot[this.status]+'\"></span></div></div>'\n\t\treturn answer;\n\t}", "function choicesL(choices) {\n\n let result = ''; //providing string to display result\n\n for (let i = 0; i < choices.length; i++) { //looping over choice values\n result += `<p class=\"userChoice\" data-answer= \"${choices[i]}\">${choices[i]}</p>`; //setting data vaule and displaying them onto the page\n }\n\n return result; //returning result to display this function in questionL ()\n}", "function OLshowMarkup(str,quo){\r\r\n var so=OLoverHTML,s=(str||'null').toString(),q=(quo||0);\r\r\n overlib(OLhtmlspecialchars(s,q), CAPTION,'<div align=\"center\">Markup</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,\r\r\n BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,\r\r\n CGCOLOR,'#999999', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',\r\r\n TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,\r\r\n (OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);\r\r\n OLoverHTML=so;\r\r\n}", "function format_html_input() {\r\n var text = String(this);\r\n\r\n var element = Element(\"body\");\r\n element.innerHTML = text;\r\n\r\n if (Prototype.Browser.Gecko || Prototype.Browser.WebKit) {\r\n element.select('strong').each(function(element) {\r\n element.replace('<span style=\"font-weight: bold;\">' + element.innerHTML + '</span>');\r\n });\r\n element.select('em').each(function(element) {\r\n element.replace('<span style=\"font-style: italic;\">' + element.innerHTML + '</span>');\r\n });\r\n element.select('u').each(function(element) {\r\n element.replace('<span style=\"text-decoration: underline;\">' + element.innerHTML + '</span>');\r\n });\r\n }\r\n\r\n if (Prototype.Browser.WebKit)\r\n element.select('span').each(function(span) {\r\n if (span.getStyle('fontWeight') == 'bold')\r\n span.addClassName('Apple-style-span');\r\n\r\n if (span.getStyle('fontStyle') == 'italic')\r\n span.addClassName('Apple-style-span');\r\n\r\n if (span.getStyle('textDecoration') == 'underline')\r\n span.addClassName('Apple-style-span');\r\n });\r\n\r\n text = element.innerHTML;\r\n text = text.tidy_xhtml();\r\n\r\n text = text.replace(/<\\/p>(\\n)*<p>/g, \"\\n\\n\");\r\n\r\n text = text.replace(/(\\n)?<br( \\/)?>(\\n)?/g, \"\\n\");\r\n\r\n text = text.replace(/^<p>/g, '');\r\n text = text.replace(/<\\/p>$/g, '');\r\n\r\n if (Prototype.Browser.Gecko) {\r\n text = text.replace(/\\n/g, \"<br>\");\r\n text = text + '<br>';\r\n } else if (Prototype.Browser.WebKit) {\r\n text = text.replace(/\\n/g, \"</div><div>\");\r\n text = '<div>' + text + '</div>';\r\n text = text.replace(/<div><\\/div>/g, \"<div><br></div>\");\r\n } else if (Prototype.Browser.IE || Prototype.Browser.Opera) {\r\n text = text.replace(/\\n/g, \"</p>\\n<p>\");\r\n text = '<p>' + text + '</p>';\r\n text = text.replace(/<p><\\/p>/g, \"<p>&nbsp;</p>\");\r\n text = text.replace(/(<p>&nbsp;<\\/p>)+$/g, \"\");\r\n }\r\n\r\n return text;\r\n }", "function outputPosition(rating, position, textposition){\n if(rating != \"SS\"){\n outputstr += \"<b> \" + textposition + \" was rated: \" + rating + \"</b></br>\";\n outputstr += \"Alternatives: \"\n newlist = getBetterChars(rating, position);\n for (var i = 0; i<newlist.length-1; i++){\n outputstr+= newlist[i] + \", \";\n }\n outputstr+= newlist[i] + \"</br>\";\n } else {\n outputstr += \"<b> \" + textposition + \" was rated: SS</b></br>\"\n outputstr += \"No alternatives for improvement</br>\";\n }\n outputstr += \"</br>\";\n}", "function generateOutput() {\n str = '';\n AreaOutput.childNodes[0].childNodes.forEach( node => {\n if(node.nodeName == \"SPAN\"){\n str += node.innerText;\n } else {\n str += node.options[node.selectedIndex].text;\n }\n });\n return str;\n}", "render() {\n let output =\n this.getHelperWordsBefore() +\n \" \" +\n this.renderForms()\n .map((i) => `<b>${i}</b>`)\n .join(\" / \") +\n this.getHelperWordsAfter();\n output = output.trim();\n\n // const highlight = options?.highlight\n // if (highlight && this.is(highlight)) {\n // output = `<span class=\"highlight\">${output}</span>`\n // }\n\n return output;\n }", "function moreButtonsHtml() {\n\tres = \"<img src='gif/x.gif' style='position: absolute; top:2px; right: 2px;' onclick='closeMoreButtonsMenu()'></img>\" +\n\t\"<table style='margin-left:auto; margin-right:auto'><tr><td><p class='moreButton' onclick='moreButtonsFunc(1);'>one word [Sh. o]</p>\" +\n\t\"<p class='moreButton' onclick='moreButtonsFunc(2);'>unanalyzable [Sh. u]</p>\" +\n\t\"<p class='moreButton' onclick='moreButtonsFunc(3);''>uncertain [Sh. v]</p></td><td>\" +\n\t\"<p class='moreButton' onclick='moreButtonsFunc(4);'>edit unit [e]</p>\"+\n\t\"<p class='moreButton' onclick='moreButtonsFunc(5);'>deselect [d]</p>\" +\n\t\"<p class='moreButton' onclick='moreButtonsFunc(6);'>jump [j]</p>\" +\n\t\"</td></tr></table>\";\n\treturn res;\n}", "function convert() {\n let text = input.value;\n let converted = markConvert.makeHtml(text);\n myOutput.innerHTML = converted;\n}", "htmlForSpeed() {\nvar html;\n//-----------\nreturn html = `<!--========================================================-->\n<span class=\"spanSpeed av${this.ix}\" >\nSpeed (log<sub>2</sub> scale):\n${this.htmlForSpeedCtrl()}\n</span> <!--class=\"spanSpeed av${this.ix}\"-->`;\n}", "function formatRoboconfSnippets() {\n\n $( '.language-roboconf' ).each( function( index ) {\n var text = $( this ).text().trim();\n\n var result = '';\n text.split( '\\n' ).forEach( function( line, index, arr ) {\n var pos = line.indexOf( '#' );\n var before, after;\n\n // Split the line\n if( pos >= 0 ) {\n before = line.substring( 0, pos );\n after = line.substring( pos );\n } else {\n before = line;\n after = '';\n }\n\n // Make replacements\n // <span class=\"comment\"># a comment</span>\n after = after.replace( /(#[^\\n]*)/ig, '<span class=\"comment\">$1</span>' );\n\n // = <span class=\"value\">something</span>\n //before = before.replace( /=(\\s*)([^,;]+)/ig, '=$1<span class=\"value\">$2</span>' );\n\n // <span class=\"property\">instance of</span>\n before = before.replace( /\\b(instance of)\\b/ig, '<span class=\"property\">$1</span>' );\n\n // <span class=\"property\">facet</span>\n before = before.replace( /\\b(facet)\\b/ig, '<span class=\"property\">$1</span>' );\n\n // <span class=\"property\">import</span>\n before = before.replace( /\\b(import)\\b/ig, '<span class=\"property\">$1</span>' );\n\n // <span class=\"property\">name:</span>\n before = before.replace( /\\b([^:\\n]+:)/ig, '<span class=\"property\">$1</span>' );\n\n // <span class=\"value\">(optional)</span>\n before = before.replace( /\\(([^)]*)\\)/ig, '(<span class=\"value\">$1</span>)' );\n\n // <span class=\"value\">external</span>\n before = before.replace( /\\b(external)\\b/ig, '<span class=\"value\">$1</span>' );\n\n // <span class=\"value\">random[port]</span>\n before = before.replace( /\\b(random\\[port\\]) /ig, '<span class=\"value\">$1</span> ' );\n\n // Update the result\n result += before + after + '\\n';\n });\n\n $( this ).html( result.trim());\n });\n}", "function outPutDATAtoHTML() {\n let displayResult = STATE.searchResult.map(singleRest => {\n return `<div class=\"col-12\">\n <div class=\"col text-color\">\n <p>Name: ${singleRest.name} </p>\n <p>Address: ${singleRest.address}</p>\n <p> Price Range <img class=\"raiting-size\" src=\"images/dollar.png\" alt=\"Price rating\"> ${\n singleRest.priceRange\n } </p>\n <p>Rating <img class=\"raiting-size\" src=\"images/star.png\" alt=\"Restaurant rating\"> ${\n singleRest.ratings\n }</p>\n </div>\n <hr>\n </div>`;\n });\n \n $(\"#show-search-result\").html(displayResult);\n }", "function buildDesc()\n {\n var description = \"\";\n var shortDescription = \"\";\n\n if ($(SELECTOR_M2M).is(':checked')) {\n description += \"M2M \";\n shortDescription += \"M2M \";\n }\n\n if ($(SELECTOR_ISEDGE).is(':checked')) {\n\n description += \"Edge \";\n shortDescription += \"EDG \";\n\n // category goes after term\n description += $(SELECTOR_BUCKETCAT + ' option:selected').text() + \" \";\n shortDescription += $(SELECTOR_BUCKETCAT + ' option:selected').val() + \" \";\n\n // activation type\n description += $('#edit-acttypeid option:selected').text();\n\n } else if ($(SELECTOR_TERM).val() > 0) {\n // insert term if > 0\n description += $(SELECTOR_TERM).val() + \" Month \";\n shortDescription += $(SELECTOR_TERM).val() + \"M \";\n\n // category goes after term\n description += $(SELECTOR_BUCKETCAT + ' option:selected').text() + \" \";\n shortDescription += $(SELECTOR_BUCKETCAT + ' option:selected').val() + \" \";\n\n // activation type\n description += $('#edit-acttypeid option:selected').text();\n\n } else if($('#edit-acttypeid option:selected').text() == \"Prepaid\") {\n // Term is PREPAY\n description += \"Prepaid \";\n shortDescription += \"PREPAY \";\n\n // Category\n description += $(SELECTOR_BUCKETCAT + ' option:selected').text() + \" \";\n shortDescription += $(SELECTOR_BUCKETCAT + ' option:selected').val() + \" \";\n\n // no activation (PREPAY)\n } else {\n // category goes after term\n description += $(SELECTOR_BUCKETCAT + ' option:selected').text() + \" \";\n shortDescription += $(SELECTOR_BUCKETCAT + ' option:selected').val() + \" \";\n\n // activation type\n description += $('#edit-acttypeid option:selected').text();\n }\n\n description += $(SELECTOR_ISNE2).is(':checked') ? ' NE2' : '';\n if ($(SELECTOR_ISNE2).is(':checked')) {\n shortDescription += \"NE2U\";\n\n } else if($('#edit-acttypeid option:selected').text() != \"Prepaid\") {\n shortDescription += $('#edit-acttypeid option:selected').text().substr(0,3).toUpperCase();\n }\n\n $(SELECTOR_DESC).val(description);\n $(SELECTOR_SHORTDESC).val(shortDescription);\n }", "function processCode(content) { \n var slide = '\\n' \n slide += '\\t<textarea class=\"textareaCode\" onfocus=\"selectEdit(this.id)\" onBlur=\"deselectEdit(this.id)\">'\n for(var line of content)\n slide += line.replace('<', '&lt;').replace('>', '&gt;') +'\\n'\n slide += '\\t</textarea>'\n slide += '\\t<div class=\"iframewrapper\"></div>'\n slide += '\\t</div>'\n return slide\n }", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "function createMarkup() {\n if (episode.summary) {\n let newSummary = episode.summary; //Convert response for summary to Markup.\n let newLength = episode.summary.length;\n let regex = /[.,]/g;\n if (newLength > 100) {\n newSummary = newSummary.slice(3, newSummary.search(regex)).concat('...'); // WIll cut the string for summary if it's longer than 100 without removing the markup tag\n }\n return { __html: newSummary }; // (Dangerously) going to set html.\n }\n }", "function addCodeToHtml(){ \n let bSortCodeBlock = document.getElementById(\"bubble-sort-code-block\");\n let mSortCodeBlock = document.getElementById(\"merge-sort-code-block\");\n let qSortCodeBlock = document.getElementById(\"quick-sort-code-block\");\n let bSortInfoBlock = document.getElementById(\"bubble-sort-info-block\");\n let mSortInfoBlock = document.getElementById(\"merge-sort-info-block\");\n let qSortInfoBlock = document.getElementById(\"quick-sort-info-block\");\n bSortCodeBlock.innerHTML = `${getBubbleSortCodeString()}`;\n mSortCodeBlock.innerHTML = `${getMergeSortCodeString()}`;\n qSortCodeBlock.innerHTML = `${getQuickSortCodeString()}`;\n bSortInfoBlock.innerHTML = `${getBubbleSortInfoString()}`;\n mSortInfoBlock.innerHTML = `${getMergeSortInfoString()}`;\n qSortInfoBlock.innerHTML = `${getQuickSortInfoString()}`;\n}", "function formatStats(attack, defense) {\n return \"(<span class='attack'>\" + attack + \"</span>\" + \"/\" + \"<span class='defense'>\" + defense + \"</span>\" + \")\";\n}", "function getPredictionHtmlPrettyPrint() {\n\n // Loop through all element in predictions and round to 4 places.\n let response = [];\n let classVal, classLabel = \"\", confidence = \"\", color = \"\";\n for (let i = 0; i < predictions.length; i++) {\n\n // Set the class label as per Class Map if user entered a matching vakue\n classVal = parseInt(predictions[i][0]);\n\n // Prediction confidence as human readable %\n confidence = `${Math.round(predictions[i][1] * 10000) / 100} %`;\n\n // Get the prediction color to be dicplayed for this label\n color = colorArray[classVal];\n\n // Get the class label.\n classLabel = getPredictionLabel(classVal);\n\n // Now append to response\n response.push(`<p style=\"color: ${color}\">${i + 1} - ${classLabel} - Confidence: ${confidence}</p>`);\n\n }\n\n return response.join(\"\");\n}", "function renderInsightText(insight) {\n var priorityClass = (insight.p > 50\n ? 'highPriority'\n : 'lowPriority');\n return {text:insight.m,sp_class:priorityClass};\n }", "function generateAnswers(data) {\n data.badge = badges[data.license];\n return `\n# ${data.title}\n\n${data.badge}\n\n## Description\n${data.description}\n\n## Table of Contents\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [Tests](#tests)\n- [License](#license)\n- [Questions](#questions)\n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.tests}\n\n## License\nThis project is licensed under ${data.license}.\n\n## Questions\n\nIf you have any questions, please contact me at [${data.email}](mailto:${data.email}).\\n\nCheck out my GitHub [profile!](https://github.com/${data.username})\\n\n©${year} ${data.fullname}`\n}", "function displayChoices(choices) {\n let result = \"\";\n for (let i = 0; i < choices.length; i++) {\n result += `<p class=choice data-answer=\"${choices[i]}\">${choices[i]}</p>`\n }\n return result;\n}", "function correctAnswerHtml() {\n let correctAnswerText = `<h2>Correct!</h2><br>\n <p>Well done globetrotter.</p>\n <button type=\"button\" class=\"nextButton button\">Continue</button>\n <button class=\"startoverButton\">Start Over</button>`;\n\n return correctAnswerText;\n}", "html (showCurrency = true, signMode = 1) {\n let str = '<span class=\"major\">%j</span>'\n str += '<span class=\"separator\">%p</span>'\n str += '<span class=\"minor\">%n</span>'\n\n if (showCurrency) str = '<span class=\"currency\">%y</span>' + str\n\n const signModes = {\n 0: '',\n 1: '<span class=\"sign\">%s</span>',\n 2: '<span class=\"sign\">%+</span>',\n 3: '<span class=\"sign\">%-</span>'\n }\n\n str = signModes[signMode] + str\n str = this.format(str)\n\n const el = document.createElement('span')\n el.classList.add('amount')\n el.classList.add(this.positive ? 'positive' : 'negative')\n el.innerHTML = str\n\n return el.outerHTML\n }", "function show_emoticons() {\n\n // YOUR CODE GOES HERE\n var result = \"\";\n var para_arr_node = document.querySelectorAll(\"#book_chapter ul li p\");\n for(each_para_node of para_arr_node){\n var para_arr = each_para_node.innerText.split(\"\\n\");\n each_para_node.innerHTML = \"\";\n for(each_para of para_arr){\n var word_arr = each_para.split(\" \");\n for(each_word of word_arr){\n //checking if there is a comma, ? or ! in the word\n if(each_word.indexOf(\",\") > -1){\n result += each_word.replace(\",\", String.fromCodePoint(0x2B50));\n }\n else if(each_word.indexOf(\"?\") > -1){\n result += each_word.replace(\"?\", String.fromCodePoint(0x2753));\n }\n else if(each_word.indexOf(\"!\") > -1){\n result += each_word.replace(\"!\", String.fromCodePoint(0x2757));\n }\n else{\n result += each_word + \" \";\n }\n }\n }\n\n each_para_node.innerHTML += result;\n result = \"\";\n }\n\n}", "function makeHtml(data) {\n storage.get(['mathjax', 'html'], function(items) {\n // Convert MarkDown to HTML without MathJax typesetting.\n // This is done to make page responsiveness. The HTML body\n // is replaced after MathJax typesetting.\n if (items.html) {\n config.markedOptions.sanitize = false;\n }\n marked.setOptions(config.markedOptions);\n var html = marked(data);\n $(document.body).html(html);\n\n $('img').on(\"error\", function() {\n resolveImg(this);\n });\n\n // Apply MathJax typesetting\n if (items.mathjax) {\n runMathjax(data);\n }\n });\n }", "function experiences() {\n\tvar experiencesArray = ['>Experiences:',\n\t\t'<span class=\"blue\"><h3>Internship mobile developpement Xamarint</h3></span>',\n\t\t'Alliance Reseau',\n\t\t'Xamarin app development with asp.net backend.',\n\t\t'<i>C#, Asp.net</i>',\n\t\t'<span class=\"blue\"><h3>Internship embedded software developmentt</h3></span>',\n\t\t'Squadrone system',\n\t\t'Integrated software development, making a drone flight simulator',\n\t\t'<i>C++, embeded software</i>',\n\t\t'<span class=\"blue\"><h3>Video game developper & web developpmentt</h3></span>',\n\t\t'Moovlab',\n\t\t'Creating animation for video games and also a web interface to choose trainings',\n\t\t'<i>cocos2dX, html, css</i>',\n\t\t'<span class=\"blue\"><h3>Mobie video game developper</h3></span>',\n\t\t'Graaly',\n\t\t'Mobile video game, using unity to create aumented reality experiences in most places.',\n\t\t'<i>Unity3D, c#</i>',\n\t];\n\tseperator();\n\tfor (var i = 0; i < experiencesArray.length; i++) {\n\t\tvar out = '<span>' + experiencesArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function itemToHTML(item,type) {\n\n // console.log(item);\n // console.log(type);\n\n var theString = \"<p style=\\\"color: black;\\\">\"\n switch (type) {\n case 1:\n var date = new Date(item[\"date\"]);\n theString += \"<u>Crime</u>\" + \"<br/>\" +\n item[\"description\"] + \"<br/>\" +\n item[\"location_description\"] + \"<br/>\" +\n dateToString(date) +\n \"</p>\";\n break;\n case 2:\n var date = new Date(item[\"violation_date\"]);\n theString += \"<u>Building Violation</u>\" + \"<br/>\" +\n item[\"address\"] + \"<br/>\" +\n item[\"inspection_category\"] + \" (\" + item[\"inspection_status\"] + \")<br/>\" +\n dateToString(date) + \"<br/>\" +\n item[\"violation_ordinance\"] +\n \"</p>\"\n break;\n case 3:\n theString += \"<u>Library</u>\" + \"<br/>\" +\n item[\"name_\"] + \"<br/>\" +\n item[\"address\"] + \"<br/>\" +\n \"Open: \" + item[\"hours_of_operation\"] + \"<br/>\" +\n \"<a target=\\\"_blank\\\" href=\\\"\" + item[\"website\"] + \"\\\">Website</a>\" + \"<br/>\" +\n \"Phone: \" + item[\"phone\"] +\n \"</p>\"\n break;\n case 4:\n theString += \"<u>Christmas Tree Recycling Location</u>\" + \"<br/>\" +\n item[\"address\"] + \"<br/>\" +\n \"Free mulch: \" + item[\"free_mulch\"] + \"<br/>\" +\n \"</p>\";\n break;\n case 5:\n var creationDate = new Date(item[\"creation_date\"]);\n var completionDate = new Date(item[\"completion_date\"]);\n theString += \"<u>311 Service Request - Tree Trim</u>\" + \"<br/>\" +\n item[\"location_of_trees\"] + \"<br/>\" +\n item[\"status\"] + \"<br/>\" +\n \"Creation date: \" + dateToString(creationDate) + \"<br/>\" +\n \"Completion date: \" + dateToString(completionDate) + \"<br/>\" +\n \"</p>\";\n break;\n case 6:\n var creationDate = new Date(item[\"creation_date\"]);\n var completionDate = new Date(item[\"completion_date\"]);\n theString += \"<u>311 Service Request - Tree Debris</u>\" + \"<br/>\" +\n item[\"type_of_service_request\"] + \"<br/>\" +\n item[\"most_recent_action\"] + \"<br/>\" +\n item[\"status\"] + \"<br/>\" +\n \"Creation date: \" + dateToString(creationDate) + \"<br/>\" +\n \"Completion date: \" + dateToString(completionDate) + \"<br/>\" +\n \"</p>\";\n break;\n case 7:\n theString += \"<u>Police Station</u>\" + \"<br/>\" +\n item[\"address\"] + \"<br/>\" +\n item[\"phone\"] + \"<br/>\" +\n \"District: \" + item[\"district_name\"] + \"<br/>\" +\n \"<a target=\\\"_blank\\\" href=\\\"\" + item[\"website\"] + \"\\\">Website</a>\" + \"<br/>\" +\n \"</p>\";\n break;\n case 8:\n theString += \"<u>Park</u>\" + \"<br/>\" +\n item[\"park_name\"] + \"<br/>\" +\n item[\"street_address\"] + \"<br/>\" +\n \"Acres: \" + item[\"acres\"] + \"<br/>\" +\n \"Tennis Courts: \" + item[\"tennis_courts\"] +\n \"</p>\";\n break;\n case 9:\n var creationDate = new Date(item[\"creation_date\"]);\n var completionDate = new Date(item[\"completion_date\"]);\n theString += \"<u>311 Service Request - Pot Holes</u>\" + \"<br/>\" +\n item[\"type_of_service_request\"] + \"<br/>\" +\n \"Potholes Filled on Block: \" + item[\"number_of_potholes_filled_on_block\"] + \"<br/>\" +\n item[\"status\"] + \"<br/>\" +\n \"Creation date: \" + dateToString(creationDate) + \"<br/>\" +\n \"Completion date: \" + dateToString(completionDate) + \"<br/>\" +\n \"</p>\";\n break;\n case 10:\n theString += \"<u>L Stop</u>\" + \"<br/>\" +\n item[\"station_descriptive_name\"] + \"<br/>\" +\n \"Direction: \" + item[\"direction_id\"] + \"<br/>\" +\n \"</p>\";\n break;\n default:\n theString += \"Sorry, no information available.\" + \"</p>\";\n break;\n }\n\n return theString;\n}", "toHtml()\n\t{\n\t\t// 1. dynamic list of action buttons each one with it's design from the class \n\t\t// 2. \n\n\t\tvar answer = '<div class=\"academic-papers-panel\"><div class=\"personal-row-col col-reverse-mobile w-100 align-space-between\"><h3>' \n\t\t+ this.title + '</h3>'\n\t\tif (this.fileLinks[1][\"link\"] != \"\")\n\t\t{\n\t\t\tanswer += '<a class=\"cite-btn\" onclick=\"copy_cite(\\'' + this.title.replaceAll(\"'\", \"\").replaceAll(\" \", \"_\") + '\\');\">' + CITE_SYMBOL + 'Cite</a></div>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tanswer += \"</div>\";\n\t\t}\n\n\t\tanswer += '<h4>' + this.authors + \"<br>\" + this.publisher + '</h4>';\n\t\tanswer += descriptionTrim(this.description) + '<div class=\"personal-row space-between align-items-center mobile-row-breaker\">';\n\t\tif(window.screen.width > 400)\n\t\t{\n\t\t\tanswer += '<div class=\"publication-details\"><span>'\n\t\t\t\t+ this.publicationStatus + '</span><span>'\n\t\t\t\t+ this.year + '</span><span>'\n\t\t\t\t+ this.type + '</span></div>';\n\t\t}\n\t\tif (this.fileLinks[0][\"link\"] != \"\" && this.isFileFormat(this.fileLinks[0][\"link\"]))\n\t\t{\n\t\t\tanswer+='<div class=\"inner-publication-card-div\">';\n\t\t\tanswer+='<a href=\"' + this.fileLinks[0][\"link\"] + '\" class=\"download-btn acadmic-card-margin-fix acadmic-download-btn\">Download</a>'\n\t\t\tanswer+='<a href=\"' + this.fileLinks[0][\"link\"] + '\" class=\"read-online-btn acadmic-card-margin-fix\">Read Online</a></div>'\t\t// added the Read online button and put both bottums inside the condition\n\t\t\tanswer+='</div>';\n\t\t}\n\n\t\tanswer+='</div></div><input type=\"text\" style=\"display: none;\" id=\"' + this.title.replaceAll(\"'\", \"\").replaceAll(\" \", \"_\") + '\" value=\"' + this.fileLinks[1][\"link\"] + '\"></div></div>';\n\t\treturn answer;\n\t}", "function verse1() {\n let output = 'Would you climb a hill? Anything.<br>Wear a dafodill? Anything.<br>Leave me all your will? Anything.<br>Even fight my bill? What fisticuffs?'\n\n return output\n}", "function htmlWriteResults(cases) {\r\n var myHTML = '';\r\n myHTML +=\r\n `<article><div class=\"col-md-4\">\r\n <div class=\"well text-center\">`;\r\n if (filterMovies(cases.imdbID)) {\r\n myHTML +=\r\n `<div class=\"alert alert-success\" id=\"${cases.imdbID}inCollection\"><p><i class=\"fa fa-cloud-download\"></i> In Collection</p></div>`;\r\n } else {\r\n myHTML +=\r\n `<div class=\"alert alert-danger\" id=\"${cases.imdbID}notInCollection\"><p><i class=\"fa fa-exclamation-triangle\"></i> Not in Collection</p></div>`;\r\n }\r\n myHTML +=\r\n `<figure><img src=\"${posterError(cases.Poster)}\" alt=\"${cases.Title}\"></figure>\r\n <h5 class=\"whiteheader\">${cases.Title} (${cases.Year.substring(0, 4)})</h5>\r\n <div class=\"btn-group\">\r\n <a onclick=\"movieSelected('${cases.imdbID}')\" class=\"btn btn-primary btn-rounded\" href=\"#\"><i class=\"fa fa-info-circle\"></i> ${upperFirst(cases.Type)} Details</a>\r\n </div>\r\n </div>\r\n </div></article>\r\n `;\r\n return myHTML;\r\n}", "function choiceSwitchHTML(arr, arrObj) {\n // for (let i = 0; i < arr.length; i++) {\n // if (i !== 1) {\n // if (i === 0 || i === 2) {\n // for (let j = 0; j < arrObj.length; j++) {\n // for (let key in arrObj[j]) {\n // if (key !== 'label') {\n // if (key === 'id') {\n // if (arrObj[j][key].includes('-') && arr[i].attributes[0].value.includes('-')) {\n // arr[i].setAttribute(key, arrObj[j][key]); \n // } else if (!arrObj[j][key].includes('-') && !arr[i].attributes[0].value.includes('-')) {\n // arr[i].setAttribute(key, arrObj[j][key]); \n // };\n // } else {\n // if (typeof arrObj[j][key] === 'string') {\n // if (arrObj[j][key].toLowerCase().includes('count') && arr[i].attributes[0].value.includes('count')) {\n // arr[i].innerHTML = arrObj[j][key]; \n // } else if (!arrObj[j][key].toLowerCase().includes('count') && !arr[i].attributes[0].value.includes('count')) {\n // arr[i].innerHTML = arrObj[j][key]; \n // };\n // } else {\n // if (arrObj[j][key] === 12 && !arr[i].attributes[0].value.includes('-')) {\n // arr[i].innerHTML = arrObj[j][key]; \n // } else if (arrObj[j][key] !== 12 && arr[i].attributes[0].value.includes('-')) {\n // arr[i].innerHTML = arrObj[j][key]; \n // };\n // };\n // };\n // };\n // };\n // }; \n // } else {\n // for (let j = 0; j < arrObj.length; j++) {\n // for (let key in arrObj[j]) {\n // if (key === 'label') {\n // arr[i].innerHTML = arrObj[j][key]; \n // };\n // };\n // }; \n // };\n // };\n // };\n}", "_generateMarkup() {\n // console.log(this._data); // data is in the form of an array. We want to return one of the below html elements for each of the elements in that array\n\n return this._data.map(this._generateMarkupPreview).join('');\n }", "function build_question_html(question){\n /**\n * question structure - [qid,question,question_type,additional-options]\n */\n\n let html_str=''\n \n if(question[2]==1){\n html_str+=`\n \n <div class=\"mySlides\"> \n <div class=\"card\" >\n <div class=\"card-header\">\n `+question[1]+`\n </div>\n <div class=\"card-body\">\n `;\n question[3].split(\";\").forEach((option)=>{\n html_str+=`\n \n <div class=\"input-group mb-3\">\n <div class=\"input-group-prepend\">\n <div class=\"input-group-text\">\n <input class=\"radioBtn\" type=\"radio\" name=\"`+question[0]+`\" aria-label=\"Checkbox for following text input\" value=\"`+option+`\" >\n </div>\n </div>\n <input type=\"text\" class=\"form-control\" readonly aria-label=\"Text input with checkbox\" value=\"`+option+`\">\n </div>\n \n `\n })\n html_str+='</div></div></div></br>'\n }\n else{\n\n html_str=`\n <div class=\"mySlides\" type=\"2\"> \n <div class=\"card border-dark mb-3\" >\n <div class=\"card-body\">`+question[1]+`\n </div>\n <input id=\"`+question[0]+`\" value=\"\" style=\"display:none\"/>\n </div>\n </div>\n </br>`;\n }\n \n return html_str;\n \n}", "function TML2HTML() {\n \n /* Constants */\n var startww = \"(^|\\\\s|\\\\()\";\n var endww = \"($|(?=[\\\\s\\\\,\\\\.\\\\;\\\\:\\\\!\\\\?\\\\)]))\";\n var PLINGWW =\n new RegExp(startww+\"!([\\\\w*=])\", \"gm\");\n var TWIKIVAR =\n new RegExp(\"^%(<nop(?:result| *\\\\/)?>)?([A-Z0-9_:]+)({.*})?$\", \"\");\n var MARKER =\n new RegExp(\"\\u0001([0-9]+)\\u0001\", \"\");\n var protocol = \"(file|ftp|gopher|https|http|irc|news|nntp|telnet|mailto)\";\n var ISLINK =\n new RegExp(\"^\"+protocol+\":|/\");\n var HEADINGDA =\n new RegExp('^---+(\\\\++|#+)(.*)$', \"m\");\n var HEADINGHT =\n new RegExp('^<h([1-6])>(.+?)</h\\\\1>', \"i\");\n var HEADINGNOTOC =\n new RegExp('(!!+|%NOTOC%)');\n var wikiword = \"[A-Z]+[a-z0-9]+[A-Z]+[a-zA-Z0-9]*\";\n var WIKIWORD =\n new RegExp(wikiword);\n var webname = \"[A-Z]+[A-Za-z0-9_]*(?:(?:[\\\\./][A-Z]+[A-Za-z0-9_]*)+)*\";\n var WEBNAME =\n new RegExp(webname);\n var anchor = \"#[A-Za-z_]+\";\n var ANCHOR =\n new RegExp(anchor);\n var abbrev = \"[A-Z]{3,}s?\\\\b\";\n var ABBREV =\n new RegExp(abbrev);\n var ISWIKILINK =\n new RegExp( \"^(?:(\"+webname+\")\\\\.)?(\"+wikiword+\")(\"+anchor+\")?\");\n var WW =\n new RegExp(startww+\"((?:(\"+webname+\")\\\\.)?(\"+wikiword+\"))\", \"gm\");\n var ITALICODE =\n new RegExp(startww+\"==(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)==\"+endww, \"gm\");\n var BOLDI =\n new RegExp(startww+\"__(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)__\"+endww, \"gm\");\n var CODE =\n new RegExp(startww+\"\\\\=(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\=\"+endww, \"gm\");\n var ITALIC =\n new RegExp(startww+\"\\\\_(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\_\"+endww, \"gm\");\n var BOLD =\n new RegExp(startww+\"\\\\*(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\*\"+endww, \"gm\");\n var NOPWW =\n new RegExp(\"<nop(?: *\\/)?>(\"+wikiword+\"|\"+abbrev+\")\", \"g\");\n var URI =\n new RegExp(\"(^|[-*\\\\s(])(\"+protocol+\":([^\\\\s<>\\\"]+[^\\s*.,!?;:)<]))\");\n\n /*\n * Main entry point, and only external function. 'options' is an object\n * that must provide the following method:\n * getViewUrl(web,topic) -> url (where topic may include an anchor)\n * and may optionally provide\n * expandVarsInURL(url, options) -> url\n * getViewUrl must generate a URL for the given web and topic.\n * expandVarsinURL gives an opportunity for a caller to expand selected\n * Macros embedded in URLs\n */\n this.convert = function(content, options) {\n this.opts = options;\n\n content = content.replace(/\\\\\\n/g, \" \");\n \n content = content.replace(/\\u0000/g, \"!\");\t\n content = content.replace(/\\u0001/g, \"!\");\t\n content = content.replace(/\\u0002/g, \"!\");\t\n \n this.refs = new Array();\n\n // Render TML constructs to tagged HTML\n return this._getRenderedVersion(content);\n };\n \n this._liftOut = function(text) {\n index = '\\u0001' + this.refs.length + '\\u0001';\n this.refs.push(text);\n return index;\n }\n \n this._dropBack = function(text) {\n var match;\n \n while (match = MARKER.exec(text)) {\n var newtext = this.refs[match[1]];\n if (newtext != match[0]) {\n var i = match.index;\n var l = match[0].length;\n text = text.substr(0, match.index) +\n newtext +\n text.substr(match.index + match[0].length);\n }\n MARKER.lastIndex = 0;\n }\n return text;\n };\n \n // Parse twiki variables.\n //for InlineEdit, would like to not nest them, and to surround entire html entities where needed\n this._processTags = function(text) {\n \n var queue = text.split(/%/);\n var stack = new Array();\n var stackTop = '';\n var prev = '';\n \n while (queue.length) {\n var token = queue.shift();\n if (stackTop.substring(-1) == '}') {\n while (stack.length && !TWIKIVAR.match(stackTop)) {\n stackTop = stack.pop() + stackTop;\n }\n }\n \n var match = TWIKIVAR.exec(stackTop);\n if (match) {\n var nop = match[1];\n var args = match[3];\n if (!args)\n args = '';\n // You can always replace the %'s here with a construct e.g.\n // html spans; however be very careful of variables that are\n // used in the context of parameters to HTML tags e.g.\n // <img src=\"%ATTACHURL%...\">\n var tag = '%' + match[2] + args + '%';\n if (nop) {\n nop = nop.replace(/[<>]/g, '');\n tag = \"<span class='TML'\"+nop+\">\"+tag+\"</span>\";\n }\n stackTop = stack.pop() + this._liftOut(tag) + token;\n } else {\n stack.push(stackTop);\n stackTop = prev + token;\n }\n prev = '%';\n }\n // Run out of input. Gather up everything in the stack.\n while (stack.length) {\n stackTop = stack.pop(stack) + stackTop;\n }\n \n return stackTop;\n };\n \n this._makeLink = function(url, text) {\n if (!text || text == '')\n text = url;\n url = this._liftOut(url);\n return \"<a href='\"+url+\"'>\" + text + \"</a>\";\n };\n \n this._expandRef = function(ref) {\n if (this.opts['expandVarsInURL']) {\n var origtxt = this.refs[ref];\n var newtxt = this.opts['expandVarsInURL'](origtxt, this.opts);\n if (newTxt != origTxt)\n return newtxt;\n }\n return '\\u0001'+ref+'\\u0001';\n };\n \n this._expandURL = function(url) {\n if (this.opts['expandVarsInURL'])\n return this.opts['expandVarsInURL'](url, this.opts);\n return url;\n };\n \n this._makeSquab = function(url, text) {\n url = _sg(MARKER, url, function(match) {\n this._expandRef(match[1]);\n }, this);\n \n if (url.test(/[<>\\\"\\x00-\\x1f]/)) {\n // we didn't manage to expand some variables in the url\n // path. Give up.\n // If we can't completely expand the URL, then don't expand\n // *any* of it (hence save)\n return text ? \"[[save][text]]\" : \"[[save]]\";\n }\n \n if (!text) {\n // forced link [[Word]] or [[url]]\n text = url;\n if (url.test(ISLINK)) {\n var wurl = url;\n wurl.replace(/(^|)(.)/g,$2.toUpperCase());\n var match = wurl.exec(ISWEB);\n if (match) {\n url = this.opts['getViewUrl'](match[1], match[2] + match[3]);\n } else {\n url = this.opts['getViewUrl'](null, wurl);\n }\n }\n } else if (match = url.exec(ISWIKILINK)) {\n // Valid wikiword expression\n url = this.optsgetViewUrl(match[1], match[2]) + match[3];\n }\n \n text.replace(WW, \"$1<nop>$2\");\n \n return this._makeLink(url, text);\n };\n \n // Lifted straight out of DevelopBranch Render.pm\n this._getRenderedVersion = function(text, refs) {\n if (!text)\n return '';\n \n this.LIST = new Array();\n this.refs = new Array();\n \n // Initial cleanup\n text = text.replace(/\\r/g, \"\");\n text = text.replace(/^\\n+/, \"\");\n text = text.replace(/\\n+$/, \"\");\n\n var removed = new BlockSafe();\n \n text = removed.takeOut(text, 'verbatim', true);\n\n // Remove PRE to prevent TML interpretation of text inside it\n text = removed.takeOut(text, 'pre', false);\n \n // change !%XXX to %<nop>XXX\n text = text.replace(/!%([A-Za-z_]+(\\{|%))/g, \"%<nop>$1\");\n\n // change <nop>%XXX to %<nopresult>XXX. A nop before th % indicates\n // that the result of the tag expansion is to be nopped\n text = text.replace(/<nop>%(?=[A-Z]+(\\{|%))/g, \"%<nopresult>\");\n \n // Pull comments\n text = _sg(/(<!--.*?-->)/, text,\n function(match) {\n this._liftOut(match[1]);\n }, this);\n \n // Remove TML pseudo-tags so they don't get protected like HTML tags\n text = text.replace(/<(.?(noautolink|nop|nopresult).*?)>/gi,\n \"\\u0001($1)\\u0001\");\n \n // Expand selected TWiki variables in IMG tags so that images appear in the\n // editor as images\n text = _sg(/(<img [^>]*src=)([\\\"\\'])(.*?)\\2/i, text,\n function(match) {\n return match[1]+match[2]+this._expandURL(match[3])+match[2];\n }, this);\n \n // protect HTML tags by pulling them out\n text = _sg(/(<\\/?[a-z]+(\\s[^>]*)?>)/i, text,\n function(match) {\n return this._liftOut(match[1]);\n }, this);\n \n var pseud = new RegExp(\"\\u0001\\((.*?)\\)\\u0001\", \"g\");\n // Replace TML pseudo-tags\n text = text.replace(pseud, \"<$1>\");\n \n // Convert TWiki tags to spans outside parameters\n text = this._processTags(text);\n \n // Change ' !AnyWord' to ' <nop>AnyWord',\n text = text.replace(PLINGWW, \"$1<nop>$2\");\n \n text = text.replace(/\\\\\\n/g, \"\"); // Join lines ending in '\\'\n \n // Blockquoted email (indented with '> ')\n text = text.replace(/^>(.*?)/gm,\n '&gt;<cite class=TMLcite>$1<br /></cite>');\n \n // locate isolated < and > and translate to entities\n // Protect isolated <!-- and -->\n text = text.replace(/<!--/g, \"\\u0000{!--\");\n text = text.replace(/-->/g, \"--}\\u0000\");\n // SMELL: this next fragment is a frightful hack, to handle the\n // case where simple HTML tags (i.e. without values) are embedded\n // in the values provided to other tags. The only way to do this\n // correctly (i.e. handle HTML tags with values as well) is to\n // parse the HTML (bleagh!)\n text = text.replace(/<(\\/[A-Za-z]+)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<([A-Za-z]+(\\s+\\/)?)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<(\\S.*?)>/g, \"{\\u0000$1}\\u0000\");\n // entitify lone < and >, praying that we haven't screwed up :-(\n text = text.replace(/</g, \"&lt;\");\n text = text.replace(/>/g, \"&gt;\");\n text = text.replace(/{\\u0000/g, \"<\");\n text = text.replace(/}\\u0000/g, \">\");\n \n // standard URI\n text = _sg(URI, text,\n function(match) {\n return match[1] + this._makeLink(match[2],match[2]);\n }, this);\n \n // Headings\n // '----+++++++' rule\n text = _sg(HEADINGDA, text, function(match) {\n return this._makeHeading(match[2],match[1].length);\n }, this);\n \n // Horizontal rule\n var hr = \"<hr class='TMLhr' />\";\n text = text.replace(/^---+/gm, hr);\n \n // Now we really _do_ need a line loop, to process TML\n // line-oriented stuff.\n var isList = false;\t\t// True when within a list\n var insideTABLE = false;\n this.result = new Array();\n\n var lines = text.split(/\\n/);\n for (var i in lines) {\n var line = lines[i];\n // Table: | cell | cell |\n // allow trailing white space after the last |\n if (line.match(/^(\\s*\\|.*\\|\\s*)/)) {\n if (!insideTABLE) {\n result.push(\"<table border=1 cellpadding=0 cellspacing=1>\");\n }\n result.push(this._emitTR(match[1]));\n insideTABLE = true;\n continue;\n } else if (insideTABLE) {\n result.push(\"</table>\");\n insideTABLE = false;\n }\n // Lists and paragraphs\n if (line.match(/^\\s*$/)) {\n isList = false;\n line = \"<p />\";\n }\n else if (line.match(/^\\S+?/)) {\n isList = false;\n }\n else if (line.match(/^(\\t| )+\\S/)) {\n var match;\n if (match = line.match(/^((\\t| )+)\\$\\s(([^:]+|:[^\\s]+)+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[5];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)(\\S+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[4];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)\\* (.*)$/)) {\n // Unnumbered list\n line = \"<li> \"+match[3];\n this._addListItem('ul', 'li', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/)) {\n // Numbered list\n var ot = $3;\n ot = ot.replace(/^(.).*/, \"$1\");\n if (!ot.match(/^\\d/)) {\n ot = ' type=\"'+ot+'\"';\n } else {\n ot = '';\n }\n line.replace(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/,\n \"<li\"+ot+\"> \");\n this._addListItem('ol', 'li', match[1]);\n isList = true;\n }\n } else {\n isList = false;\n }\n \n // Finish the list\n if (!isList) {\n this._addListItem('', '', '');\n }\n \n this.result.push(line);\n }\n \n if (insideTABLE) {\n this.result.push('</table>');\n }\n this._addListItem('', '', '');\n \n text = this.result.join(\"\\n\");\n text = text.replace(ITALICODE, \"$1<b><code>$2</code></b>\")\n text = text.replace(BOLDI, \"$1<b><i>$2</i></b>\");\n text = text.replace(BOLD, \"$1<b>$2</b>\")\n text = text.replace(ITALIC, \"$1<i>$2</i>\")\n text = text.replace(CODE, \"$1<code>$2</code>\");\n \n // Handle [[][] and [[]] links\n text = text.replace(/(^|\\s)\\!\\[\\[/gm, \"$1[<nop>[\");\n \n // We _not_ support [[http://link text]] syntax\n \n // detect and escape nopped [[][]]\n text = text.replace(/\\[<nop(?: *\\/)?>(\\[.*?\\](?:\\[.*?\\])?)\\]/g,\n '[<span class=\"TMLnop\">$1</span>]');\n text.replace(/!\\[(\\[.*?\\])(\\[.*?\\])?\\]/g,\n '[<span class=\"TMLnop\">$1$2</span>]');\n \n // Spaced-out Wiki words with alternative link text\n // i.e. [[1][3]]\n\n text = _sg(/\\[\\[([^\\]]*)\\](?:\\[([^\\]]+)\\])?\\]/, text,\n function(match) {\n return this._makeSquab(match[1],match[2]);\n }, this);\n \n // Handle WikiWords\n text = removed.takeOut(text, 'noautolink', true);\n \n text = text.replace(NOPWW, '<span class=\"TMLnop\">$1</span>');\n \n text = _sg(WW, text,\n function(match) {\n var url = this.opts['getViewUrl'](match[3], match[4]);\n if (match[5])\n url += match[5];\n return match[1]+this._makeLink(url, match[2]);\n }, this);\n\n text = removed.putBack(text, 'noautolink', 'div');\n \n text = removed.putBack(text, 'pre');\n \n // replace verbatim with pre in the final output\n text = removed.putBack(text, 'verbatim', 'pre',\n function(text) {\n // use escape to URL encode, then JS encode\n return HTMLEncode(text);\n });\n \n // There shouldn't be any lingering <nopresult>s, but just\n // in case there are, convert them to <nop>s so they get removed.\n text = text.replace(/<nopresult>/g, \"<nop>\");\n \n return this._dropBack(text);\n }\n \n // Make the html for a heading\n this._makeHeading = function(heading, level) {\n var notoc = '';\n if (heading.match(HEADINGNOTOC)) {\n heading = heading.substring(0, match.index) +\n heading.substring(match.index + match[0].length);\n notoc = ' notoc';\n }\n return \"<h\"+level+\" class='TML\"+notoc+\"'>\"+heading+\"</h\"+level+\">\";\n };\n\n\n this._addListItem = function(type, tag, indent) {\n indent = indent.replace(/\\t/g, \" \");\n var depth = indent.length / 3;\n var size = this.LIST.length;\n\n if (size < depth) {\n var firstTime = true;\n while (size < depth) {\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n if (!firstTime)\n this.result.push(\"<\"+tag+\">\");\n this.result.push(\"<\"+type+\">\");\n firstTime = false;\n size++;\n }\n } else {\n while (size > depth) {\n var types = this.LIST.pop();\n this.result.push(\"</\"+types['tag']+\">\");\n this.result.push(\"</\"+types['type']+\">\");\n size--;\n }\n if (size) {\n this.result.push(\"</this.{LIST}.[size-1].{element}>\");\n }\n }\n \n if (size) {\n var oldt = this.LIST[size-1];\n if (oldt['type'] != type) {\n this.result.push(\"</\"+oldt['type']+\">\\n<type>\");\n this.LIST.pop();\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n }\n }\n }\n \n this._emitTR = function(row) {\n \n row.replace(/^(\\s*)\\|/, \"\");\n var pre = 1;\n \n var tr = new Array();\n \n while (match = row.match(/^(.*?)\\|/)) {\n row = row.substring(match[0].length);\n var cell = 1;\n \n if (cell == '') {\n cell = '%SPAN%';\n }\n \n var attr = new Attrs();\n \n my (left, right) = (0, 0);\n if (cell.match(/^(\\s*).*?(\\s*)/)) {\n left = length (1);\n right = length (2);\n }\n \n if (left > right) {\n attr.set('class', 'align-right');\n attr.set('style', 'text-align: right');\n } else if (left < right) {\n attr.set('class', 'align-left');\n attr.set('style', 'text-align: left');\n } else if (left > 1) {\n attr.set('class', 'align-center');\n attr.set('style', 'text-align: center');\n }\n \n // make sure there's something there in empty cells. Otherwise\n // the editor will compress it to (visual) nothing.\n cell.replace(/^\\s*/g, \"&nbsp;\");\n \n // Removed TH to avoid problems with handling table headers. TWiki\n // allows TH anywhere, but Kupu assumes top row only, mostly.\n // See Item1185\n tr.push(\"<td \"+attr+\"> \"+cell+\" </td>\");\n }\n return pre+\"<tr>\" + tr.join('')+\"</tr>\";\n }\n}", "function codigohtml (dato) {\n\tvar html=\"<article>\";\n\t\thtml=\"<div>\"+dato+\"</div>\";\n\thtml+=\"</article>\";\n\treturn html;\n}", "function addHtmlStep(say, vmode) {\n var tag; //will be appended to document\n \n // vmode controls how simple the HTML output\n switch (vmode) {\n case 0: // simple html for each step\n var txt = document.createTextNode(say);\n tag = document.createElement(\"h3\");\n if(say.length > 5) {\n // add umph\n var moremph = document.createElement(\"i\");\n moremph.appendChild(txt);\n tag.appendChild(moremph);\n }\n else {\n tag.appendChild(txt);\n }\n break;\n default:\n // mode not implemented; add nothing\n }\n \n // append to the designated <div>\n document.getElementById(\"result\").appendChild(tag);\n \n return tag;\n}", "function arrayToHtml() {\n let fullString = '';\n let tipsList = '';\n const startDiv = '<div>';\n const endDiv = '</div>';\n \n const lb = '<br>';\n let newTip = 0;\n let endTip = 2;\n const auth ='Submited By: ';\n const ti = 'Title: '\n \n for (i = 0; i < tips.length; i++)\n {\n if (i == newTip)\n { // start of new Tip add Div and author string\n fullString += startDiv + ti + tips[i] + lb;\n \n newTip += 3;\n } else if (i == endTip)\n { // end of Tip add text and close Div\n fullString += tips[i] + endDiv;\n endTip +=3;\n } else \n { // add Author data\n fullString += '<em>' + auth + tips[i] + '</em>' + lb + lb;\n }\n \n }\n \n document.getElementById(\"tipData\").innerHTML = fullString;\n // console.log(fullString);\n\n}", "function createHtml(o){\n var b = '',\n attr,\n val,\n key,\n cn;\n\n if(typeof o == \"string\"){\n b = o;\n } else if (Ambow.isArray(o)) {\n for (var i=0; i < o.length; i++) {\n if(o[i]) {\n b += createHtml(o[i]);\n }\n };\n } else {\n b += '<' + (o.tag = o.tag || 'div');\n for (attr in o) {\n val = o[attr];\n if(!confRe.test(attr)){\n if (typeof val == \"object\") {\n b += ' ' + attr + '=\"';\n for (key in val) {\n b += key + ':' + val[key] + ';';\n };\n b += '\"';\n }else{\n b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '=\"' + val + '\"';\n }\n }\n };\n // Now either just close the tag or try to add children and close the tag.\n if (emptyTags.test(o.tag)) {\n b += '/>';\n } else {\n b += '>';\n if ((cn = o.children || o.cn)) {\n b += createHtml(cn);\n } else if(o.html){\n b += o.html;\n }\n b += '</' + o.tag + '>';\n }\n }\n return b;\n }", "function buildHTML(tree, options) {\n // Strip off outer tag wrapper for processing below.\n var tag = null;\n\n if (tree.length === 1 && tree[0].type === \"tag\") {\n tag = tree[0].tag;\n tree = tree[0].body;\n } // Build the expression contained in the tree\n\n\n var expression = buildHTML_buildExpression(tree, options, true);\n var children = []; // Create one base node for each chunk between potential line breaks.\n // The TeXBook [p.173] says \"A formula will be broken only after a\n // relation symbol like $=$ or $<$ or $\\rightarrow$, or after a binary\n // operation symbol like $+$ or $-$ or $\\times$, where the relation or\n // binary operation is on the ``outer level'' of the formula (i.e., not\n // enclosed in {...} and not part of an \\over construction).\"\n\n var parts = [];\n\n for (var i = 0; i < expression.length; i++) {\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"mbin\") || expression[i].hasClass(\"mrel\") || expression[i].hasClass(\"allowbreak\")) {\n // Put any post-operator glue on same line as operator.\n // Watch for \\nobreak along the way.\n var nobreak = false;\n\n while (i < expression.length - 1 && expression[i + 1].hasClass(\"mspace\")) {\n i++;\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"nobreak\")) {\n nobreak = true;\n }\n } // Don't allow break if \\nobreak among the post-operator glue.\n\n\n if (!nobreak) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n }\n } else if (expression[i].hasClass(\"newline\")) {\n // Write the line except the newline\n parts.pop();\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n } // Put the newline at the top level\n\n\n children.push(expression[i]);\n }\n }\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n } // Now, if there was a tag, build it too and append it as a final child.\n\n\n var tagChild;\n\n if (tag) {\n tagChild = buildHTMLUnbreakable(buildHTML_buildExpression(tag, options, true));\n tagChild.classes = [\"tag\"];\n children.push(tagChild);\n }\n\n var htmlNode = buildHTML_makeSpan([\"katex-html\"], children);\n htmlNode.setAttribute(\"aria-hidden\", \"true\"); // Adjust the strut of the tag to be the maximum height of all children\n // (the height of the enclosing htmlNode) for proper vertical alignment.\n\n if (tagChild) {\n var strut = tagChild.children[0];\n strut.style.height = htmlNode.height + htmlNode.depth + \"em\";\n strut.style.verticalAlign = -htmlNode.depth + \"em\";\n }\n\n return htmlNode;\n}", "function generateHtml() {\n $(\"#instruction\").html('Select the right answers and click Submit');\n $(\"#score\").html(\"\");\n for (i = 0; i < triviaDatabase.length; i++) {\n var newQuestion = $(\"<h2>\").append(triviaDatabase[i].question);\n $(\"#allQuestions\").append(newQuestion);\n var newAnswer = $('<div class=answerOption id=question' + i + '>');\n\n for (j = 0; j < triviaDatabase[i].answers.length; j++) {\n newAnswer.append('<input type=radio name=answer' + i + ' value=' + j + '>' + triviaDatabase[i].answers[j]);\n $(\"#allQuestions\").append(newAnswer);\n }\n }\n }", "function getAnswerHtml (arrAns) {\n\n let ansHtml = arrAns.map( function (item, ind) {\n return `\n <div class='qna_text answer'>\n <label class='custom_radio' for='${ind}'>\n <input type='radio' id='${ind}' name='answer' value='${ind}' required> \n ${item.text}\n </label>\n </div>`;\n });\n\n return `\n <form class='js-submit'>\n <fieldset name='AnswerOption'>\n ${ansHtml.join(\"\")}\n </fieldset>\n </form>`;\n \n}", "function correctAnswer() {\n return `<div class=\"css-rightAnswer\">\n <img src=\"${questionsAnswers[questionNumber].correctImg}\" alt=\"${questionsAnswers[questionNumber].correctAlt}\" class=\"answerGifs\">\n <h3>YUP!</h3>\n <p>${questionsAnswers[questionNumber].correctFeedback}</p>\n <button role=\"button\" class=\"nextButton\">NEXT QUESTION</button>\n </div>`;\n}", "function incorrectAnswerHtml() {\n let incorrectAnswerText = `<h2 class=\"wrong\">That's the wrong city...</h2><br>\n <p>It's actually <span class=\"wrong\">${STORE[questionNumber].correctAnswer}</span>. Don't worry, you'll get it next time.</p>\n <button type=\"button\" class=\"nextButton button\">Continue</button><button class=\"startoverButton\">Start Over</button>`;\n\n return incorrectAnswerText;\n}", "function plInfToHTML(senPlayerInf, gotPlayerInf){\n document.getElementById(\"senteInfoBoxNm\").innerHTML = '<p class = \"playerInfFnt\">'+senPlayerInf[\"name\"]+'</p>'\n document.getElementById(\"goteInfoBoxNm\").innerHTML = '<p class = \"playerInfFnt\">'+gotPlayerInf[\"name\"]+'</p>'\n document.getElementById(\"senteInfoBoxNm2\").innerHTML = '<p class = \"playerInfFnt\">'+'<img src='+senPlayerInf[\"flag\"]+' class=\"plFlgs\">'+'('+senPlayerInf[\"rating\"]+')</p>'\n document.getElementById(\"goteInfoBoxNm2\").innerHTML = '<p class = \"playerInfFnt\">'+'<img src='+gotPlayerInf[\"flag\"]+' class=\"plFlgs\">'+'('+gotPlayerInf[\"rating\"]+')</p>'\n document.getElementById(\"senteInfoBoxPc\").innerHTML = '<img src='+senPlayerInf[\"picture\"]+' class=\"disPcSz\">'\n document.getElementById(\"goteInfoBoxPc\").innerHTML = '<img src='+gotPlayerInf[\"picture\"]+' class=\"disPcSz\">'\n}", "function getPopupText(output){\n\t\tvar result = \"\";\n\t\tfor(var attr in output){\n\t\t\tif(attr == 'operator_id'){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(output.hasOwnProperty(attr)){\n\t\t\t\tvar splitString = attr.split(\"_\");\n\t\t\t\tfor(var splitPart in splitString){\n\t\t\t\t\tresult += ' ' + splitString[splitPart].charAt(0).toUpperCase() + splitString[splitPart].slice(1);\n\t\t\t\t}\n\t\t\t\tresult += \": \";\n\t\t\t\tresult += '<b>' + output[attr] + '</b>' + '<br />';\n\t\t\t}\n\t\t}\n\t\tresult += '<br />';\n\t\treturn result;\n\t}", "function displayCode(tab) {\n var text = \"\";\n for (let i = 0; i < tab.length; i++) {\n if (tab[i] == '<') {\n text = text + '&lt;';\n } else if (tab[i] == '>') {\n text = text + '&gt;';\n } else {\n text = text + tab[i];\n }\n }\n $('#code main').html(text);\n}", "function htmlDescript(k) {\n \n //html start tag paragraph\n document.writeln(\"<p>\");\n \n //loop through the length of each description\n //k is the current description and j is the current line in that description\n document.writeln(\"<div class= intro>\");\n for (let j = 0; j < gameInfo[k].length; j++) {\n document.writeln(gameInfo[k][j]);\n }\n document.writeln(\"</div>\");\n \n //html end tag paragraph\n document.writeln(\"</p>\");\n }", "linktip_render(linktip_data) {\n let text = \"<p class =\" +'linktip-' + linktip_data['aff_name'] + \" >\" + linktip_data['aff1_geo'].aff_name + \"</p>\";\n text += \"<p class =\" +'linktip-' + linktip_data['aff_name'] + \" >\" + linktip_data['aff2_geo'].aff_name + \"</p>\";\n text += \"<p class =\" +'linktip-' + linktip_data['aff_name'] + \" >\" +'Co-publication:' + linktip_data['area_cnt']['total'] + \"</p>\";\n return text;\n }", "function buildHTML(tree, options) {\n // Strip off outer tag wrapper for processing below.\n var tag = null;\n\n if (tree.length === 1 && tree[0].type === \"tag\") {\n tag = tree[0].tag;\n tree = tree[0].body;\n } // Build the expression contained in the tree\n\n\n var expression = buildHTML_buildExpression(tree, options, true);\n var children = []; // Create one base node for each chunk between potential line breaks.\n // The TeXBook [p.173] says \"A formula will be broken only after a\n // relation symbol like $=$ or $<$ or $\\rightarrow$, or after a binary\n // operation symbol like $+$ or $-$ or $\\times$, where the relation or\n // binary operation is on the ``outer level'' of the formula (i.e., not\n // enclosed in {...} and not part of an \\over construction).\"\n\n var parts = [];\n\n for (var i = 0; i < expression.length; i++) {\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"mbin\") || expression[i].hasClass(\"mrel\") || expression[i].hasClass(\"allowbreak\")) {\n // Put any post-operator glue on same line as operator.\n // Watch for \\nobreak along the way, and stop at \\newline.\n var nobreak = false;\n\n while (i < expression.length - 1 && expression[i + 1].hasClass(\"mspace\") && !expression[i + 1].hasClass(\"newline\")) {\n i++;\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"nobreak\")) {\n nobreak = true;\n }\n } // Don't allow break if \\nobreak among the post-operator glue.\n\n\n if (!nobreak) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n }\n } else if (expression[i].hasClass(\"newline\")) {\n // Write the line except the newline\n parts.pop();\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n } // Put the newline at the top level\n\n\n children.push(expression[i]);\n }\n }\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n } // Now, if there was a tag, build it too and append it as a final child.\n\n\n var tagChild;\n\n if (tag) {\n tagChild = buildHTMLUnbreakable(buildHTML_buildExpression(tag, options, true));\n tagChild.classes = [\"tag\"];\n children.push(tagChild);\n }\n\n var htmlNode = buildHTML_makeSpan([\"katex-html\"], children);\n htmlNode.setAttribute(\"aria-hidden\", \"true\"); // Adjust the strut of the tag to be the maximum height of all children\n // (the height of the enclosing htmlNode) for proper vertical alignment.\n\n if (tagChild) {\n var strut = tagChild.children[0];\n strut.style.height = htmlNode.height + htmlNode.depth + \"em\";\n strut.style.verticalAlign = -htmlNode.depth + \"em\";\n }\n\n return htmlNode;\n}", "function buildHTML(tree, options) {\n // Strip off outer tag wrapper for processing below.\n var tag = null;\n\n if (tree.length === 1 && tree[0].type === \"tag\") {\n tag = tree[0].tag;\n tree = tree[0].body;\n } // Build the expression contained in the tree\n\n\n var expression = buildHTML_buildExpression(tree, options, true);\n var children = []; // Create one base node for each chunk between potential line breaks.\n // The TeXBook [p.173] says \"A formula will be broken only after a\n // relation symbol like $=$ or $<$ or $\\rightarrow$, or after a binary\n // operation symbol like $+$ or $-$ or $\\times$, where the relation or\n // binary operation is on the ``outer level'' of the formula (i.e., not\n // enclosed in {...} and not part of an \\over construction).\"\n\n var parts = [];\n\n for (var i = 0; i < expression.length; i++) {\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"mbin\") || expression[i].hasClass(\"mrel\") || expression[i].hasClass(\"allowbreak\")) {\n // Put any post-operator glue on same line as operator.\n // Watch for \\nobreak along the way, and stop at \\newline.\n var nobreak = false;\n\n while (i < expression.length - 1 && expression[i + 1].hasClass(\"mspace\") && !expression[i + 1].hasClass(\"newline\")) {\n i++;\n parts.push(expression[i]);\n\n if (expression[i].hasClass(\"nobreak\")) {\n nobreak = true;\n }\n } // Don't allow break if \\nobreak among the post-operator glue.\n\n\n if (!nobreak) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n }\n } else if (expression[i].hasClass(\"newline\")) {\n // Write the line except the newline\n parts.pop();\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n } // Put the newline at the top level\n\n\n children.push(expression[i]);\n }\n }\n\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n } // Now, if there was a tag, build it too and append it as a final child.\n\n\n var tagChild;\n\n if (tag) {\n tagChild = buildHTMLUnbreakable(buildHTML_buildExpression(tag, options, true));\n tagChild.classes = [\"tag\"];\n children.push(tagChild);\n }\n\n var htmlNode = buildHTML_makeSpan([\"katex-html\"], children);\n htmlNode.setAttribute(\"aria-hidden\", \"true\"); // Adjust the strut of the tag to be the maximum height of all children\n // (the height of the enclosing htmlNode) for proper vertical alignment.\n\n if (tagChild) {\n var strut = tagChild.children[0];\n strut.style.height = htmlNode.height + htmlNode.depth + \"em\";\n strut.style.verticalAlign = -htmlNode.depth + \"em\";\n }\n\n return htmlNode;\n}", "function formatCode(code)\r\n{\r\n\tmetaTag = /((<br\\/?>)?\\s?&lt;(meta))/gi;\r\n\thtmlTag = /(&lt;(html)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\r\n\thtml2Tag = /((<br\\/?>)?\\s?&lt;(\\/html)([\\s\\S]*?)&gt;)/gi;\r\n\ttitleTag = /(&lt;(\\/title)&gt;\\s?(<br\\/?>)?)/gi;\r\n\ttitle2Tag = /((<br\\/?>)?\\s?&lt;(title)&gt;)/gi;\r\n\ttableTag = /(&lt;(tbody|th|tr|td|\\/tbody|\\/th|\\/tr|\\/td)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\ttableBeginTag = /((<br\\/?>)?\\s?&lt;(table)([\\s\\S]*?)&gt;)/gi;\r\n\ttableEndTag = /(&lt;(\\/table)&gt;\\s?(<br\\/?>)?)/gi;\r\n\theadTag = /(&lt;(head)&gt;\\s?(<br\\/?>)?)/gi;\r\n\thead2Tag = /(&lt;(\\/head)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\r\n\tbodyTag = /(&lt;(body)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\tbody2Tag = /((<br\\/?>)?\\s?&lt;(\\/body)([\\s\\S]*?)&gt;)/gi;\r\n\tscriptTag = /(&lt;(script|\\/script)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\r\n\tcode = code.replace(metaTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(tableEndTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(tableBeginTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(htmlTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(html2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(title2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/<br\\/?>/gi,\"\");});\r\n\tcode = code.replace(titleTag,function(s1,s2){return s2.replace(/<br\\/?>/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(tableTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(headTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(head2Tag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(bodyTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(body2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(scriptTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\treturn code;\r\n}", "htmlForStatus() {\nvar html;\n//----------\nreturn html = `<!--========================================================-->\n<span class=\"spanInfo av${this.ix}\" >\nStatus:\n<input type=\"text\" class=\"statusExtra av${this.ix}\" />\n</span> <!--class=\"spanInfo av${this.ix}\"-->`;\n}", "function scorify (score) {\n var path = score.leaf.path;\n var html = '';\n var beforelet = '<b>';\n var afterlet = '</b>';\n var index = 0;\n for (var i = score.indexes.length - 1; i >= 0; i--) {\n html += htmlEscape(path.slice(index, score.indexes[i])) + beforelet\n + htmlEscape(path[score.indexes[i]]) + afterlet;\n index = score.indexes[i] + 1; \n }\n html += htmlEscape(path.slice(index));\n return html;\n}", "function makeHTML([title, rating, index]) {\n return `\n <li id=\"${index}\">\n ${title}: ${rating} \n <button class=\"remove\">\n REMOVE\n </button>\n </li>\n `\n}", "function getWebDiceDisplay(input)\r\n{\r\n\tvar res = input+\"\"\r\n\tres = res.replace(/d/g, \"<i style=\\\"opacity: 0.7;\\\">d</i>\")\r\n\tres = res.replace(/\\+/g, \"<i style=\\\"opacity: 0.7;\\\">+</i>\")\r\n\treturn res\r\n}", "function _lprAdminQuestionHTML($dom, type) {\r\n\tswitch (type) {\r\n\t\tcase 'true_or_false':\r\n\t\t\t$dom.lprTrueOrFalseQuestion();\r\n\t\t\tbreak;\r\n\t\tcase 'multi_choice':\r\n\t\t\t$dom.lprMultiChoiceQuestion();\r\n\t\t\tbreak;\r\n\t\tcase 'single_choice':\r\n\t\t\t$dom.lprSingleChoiceQuestion();\r\n\t\t\tbreak;\r\n\t}\r\n}", "function getHtml() {\n let htmlContent = '';\n randomizeArray();\n dinosaurs.forEach(dino => {\n (dino.species.toLowerCase() != \"human\") ? dino.addToFacts() : '';\n htmlContent += dino.buildTile();\n });\n return htmlContent;\n}", "function showWords(){\n return profanities;\n }", "function overallScore() {\r\n return `\r\n <div class=\"current-score\">\r\n <p id=\"score\">\r\n Current Score: ${store.score} out of ${store.questions.length}\r\n </p>\r\n </div>\r\n `; \r\n}", "function OLcontentSimple(text){\r\nvar txt=\r\n'<table'+(o3_wrap?'':' width=\"'+o3_width+'\"')+o3_height+' border=\"0\" cellpadding=\"'+o3_border\r\n+'\" cellspacing=\"0\"'+(o3_bgclass?' class=\"'+o3_bgclass+'\"':o3_bgcolor+o3_bgbackground)\r\n+'><tr><td><table width=\"100%\"'+o3_height+' border=\"0\" cellpadding=\"'+o3_textpadding\r\n+'\" cellspacing=\"0\"'+(o3_fgclass?' class=\"'+o3_fgclass+'\"':o3_fgcolor+o3_fgbackground)\r\n+'><tr><td valign=\"top\"'+(o3_fgclass?' class=\"'+o3_fgclass+'\"':'')+'>'\r\n+OLlgfUtil(0,o3_textfontclass,'div',o3_textcolor,o3_textfont,o3_textsize)+text\r\n+OLlgfUtil(1,'','div')+'</td></tr></table>'+((o3_base>0&&!o3_wrap)?\r\n('<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"'+o3_base\r\n+'\"></td></tr></table>'):'')+'</td></tr></table>';\r\nOLsetBackground('');\r\nreturn txt;\r\n}", "function createMoreinfoHtml(x,i){\n let coinInfo = '';\n coinInfo += `<div class='row'>`;\n coinInfo += `<div class='col-md-6'>`;\n coinInfo += `<img src=\"${x.image.small}\">`;\n coinInfo += `</div>`;\n coinInfo += `<div class='col-md-6'>`;\n coinInfo += `<div>${x.market_data.current_price.usd}$</div>`;\n coinInfo += `<div>${x.market_data.current_price.eur}€</div>`;\n coinInfo += `<div>${x.market_data.current_price.ils}&#8362</div>`;\n coinInfo += `</div>`;\n coinInfo += `</div>`;\n $(`#collapse${i}`).html(coinInfo);\n}", "function textTransformToHtml(text)\n{\n var html = text;\n //html = html.replace(/&/gi, \"&amp;\");\n //html = html.replace(/</gi, \"&lt;\").replace(/>/gi, \"&gt;\");\n html = html.replace(/\\r\\n/gi, \"<br/>\").replace(/\\n/gi, \"<br/>\");\n html = html.replace(/\\[h(\\d)\\](.+?)\\[\\/h\\d\\]/gi, \"<h$1>$2</h$1>\");\n\n html = html.replace(/\\[q\\](.+?)\\[q\\]/g, '<i class=\"ttQuoted\">$1</i>');\n html = html.replace(/\\[f\\](.+?)\\[f\\]/g, '<b class=\"ttFilename\">$1</b>');\n html = html.replace(/\\[space=(.+?)\\]/g, '<span style=\"margin-right: $1\">&nbsp;</span>');\n html = html.replace(/\\[mdash\\]/g, '&mdash;');\n\n html = html.replace(/\\[img(.*?)\\](.+?)\\[\\/img\\]/g, '<img $1 src=\"$2\" />');\n html = html.replace(/\\[a(.*?)\\](.+?)\\[\\/a\\]/g, '<a $1 target=\"_blank\">$2</a>');\n\n html = html.replace(/<br\\/>(\\d)\\. /g, '<br/><b class=\"numlist\">$1.</b> ');\n\n // word-highliter\n var words = new Array();\n var rx = /\\[wh=([abcdefABCDEF0-9]+?)\\](.+?)\\[wh\\]/g;\n var match;\n while (match = rx.exec(html))\n {\n var color = match[1];\n var word = match[2];\n words[word] = color;\n }\n html = html.replace(/\\[wh=[abcdefABCDEF0-9]+?\\].+?\\[wh\\]/gi, \"\");\n for (word in words)\n {\n color = words[word];\n html = replaceTextNotBetween(html, \"[code\", \"[/code]\", word, '<span style=\"color: #' + color + '\">' + word + '</span>');\n }\n\n\n // prepare code for syntax highlighting\n html = html.replace(/\\[code (class=\"brush\\: .+?\")\\](.+?)\\[\\/code\\]/gi, \"<pre $1>$2</pre>\");\n html = replaceTextBetween(html, '<pre class=\"brush', \"</pre>\", \"<br/>\", \"\\n\");\n\n return html;\n}", "render() {\n let _this = this;\n let genderPronounPossessive = getGenderPronoun(_this.state.traits.gender).possessive;\n let genderPronounPersonal = getGenderPronoun(_this.state.traits.gender).personal;\n\n function getGenderPronoun(gender) {\n let pronoun = \"\";\n let possessive = \"\";\n\n gender = gender || \"\";\n\n switch (gender.toLowerCase()) {\n case \"male\" : \n return {\n personal : \"He\",\n possessive : \"His\"\n }\n case \"female\" : \n return {\n personal : \"She\",\n possessive : \"Her\"\n }\n default : \n return {\n personal : \"This character\",\n possessive : \"Their\"\n }\n }\n }\n\n function renderDescription(traitName,useProperCase,prefix) {\n let traitValue = _this.state.traits[traitName].toLowerCase();\n let traitDescription = traitValue;\n let vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n\n prefix = traitDescription && prefix ? prefix : \"\";\n\n if (npcTraits.descriptions[traitName] && npcTraits.descriptions[traitName][traitValue]) {\n traitDescription = npcTraits.descriptions[traitName][traitValue].toLowerCase();\n }\n\n if (prefix === \"a \") {\n vowels.map(function(num){\n if (traitDescription.split('')[0].toLowerCase() === \"\"+num) {\n prefix = \"an \";\n }\n });\n }\n\n if (useProperCase) {\n traitDescription = traitDescription.toProperCase()\n }\n\n return <span className=\"keyword\">{prefix+traitDescription}</span>\n }\n \n return <div className=\"container generator\">\n <div className=\"row\">\n <div className=\"col-sm-12\">\n <h2>NPC Generator</h2>\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col-sm-6 description-container\">\n <p>You see {renderDescription(\"physique\",false,\"a \")} {renderDescription(\"gender\")} {renderDescription(\"race\",true)} with {renderDescription(\"distinguishing_marks\")} wearing the clothes of {renderDescription(\"occupation\",false,\"a \")}. {genderPronounPersonal} looks to be in {genderPronounPossessive.toLowerCase()} {renderDescription(\"age_group\")}, has {renderDescription(\"hair_color\")} hair, and is {renderDescription(\"height\")} for a {renderDescription(\"gender\")} {renderDescription(\"race\", true)}. You can see {renderDescription(\"emotion\")} in {genderPronounPossessive.toLowerCase()} {renderDescription(\"eye_color\")}, {renderDescription(\"eye_shape\")} eyes.</p>\n\n <p>{renderDescription(\"name\",true)}{renderDescription(\"surname\",true,\" \")} has a {renderDescription(\"alignment_lawful\")}-{renderDescription(\"alignment_moral\")} alignment and is {renderDescription(\"high_ability\")} yet {renderDescription(\"low_ability\")}. Impressively, {genderPronounPersonal.toLowerCase()} is {renderDescription(\"talents\")}. {renderDescription(\"name\",true)} often {renderDescription(\"mannerisms\")} and has a {renderDescription(\"interaction_traits\")} way of speaking. {genderPronounPersonal} is always {renderDescription(\"bonds\")} and values {renderDescription(\"ideals\")} more than anything, but is troubled by {genderPronounPossessive.toLowerCase()} {renderDescription(\"flaws\")}.</p>\n\n <p>{renderDescription(\"name\",true)} has a {renderDescription(\"family_relationship\")} relationship with {genderPronounPossessive.toLowerCase()} family. {genderPronounPersonal} is {renderDescription(\"maritial_status\")} with {renderDescription(\"children\")}. The rest of {genderPronounPossessive.toLowerCase()} family consists of {renderDescription(\"siblings\")}, {renderDescription(\"cousins\")}, {renderDescription(\"aunts\")}, {renderDescription(\"uncles\")}, and {renderDescription(\"parents\")}.</p>\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col-sm-6\">\n <br />\n <SubmitButton \n type=\"text\" \n label=\"Randomize All\" \n name=\"randomize_all\" \n onUpdate={this.updateAll}\n />\n\n {this.renderMultipleInputs(\n {\n names : [\n \"gender\",\n \"race\",\n \"name\",\n \"surname\",\n \"alignment_lawful\",\n \"alignment_moral\",\n \"distinguishing_marks\",\n \"high_ability\",\n \"low_ability\",\n \"talents\",\n \"mannerisms\",\n \"interaction_traits\",\n \"bonds\",\n \"flaws\",\n \"ideals\",\n \"emotion\",\n \"social_class\",\n \"occupation\",\n \"useful_knowledge\"\n ]\n }\n )}\n\n </div>\n <div className=\"col-sm-6\">\n\n <h3>Physical</h3>\n {this.renderMultipleInputs(\n {\n names : [\n \"eye_color\",\n \"eye_shape\",\n \"hair_color\",\n \"age_group\",\n \"physique\",\n \"height\"\n ]\n }\n )}\n \n\n <h3>Family</h3>\n {this.renderMultipleInputs(\n {\n names : [\n \"parents\",\n \"siblings\",\n \"cousins\",\n \"aunts\",\n \"uncles\",\n \"children\",\n \"family_relationship\",\n \"maritial_status\"\n ]\n }\n )}\n \n </div>\n </div>\n </div>;\n\t}", "function opSetString(op){\n if(o === 1){\n display.innerHTML = num1 + \" + \" + num2\n }\n else if(op === 2){\n display.innerHTML = num1 + \" - \" + num2\n }\n else if(op === 3){\n display.innerHTML = num1 + \" * \" + num2\n }\n else{\n display.innerHTML = num1 + \" / \" + num2\n }\n}", "function p(e){var t,a,n,o,c,u=f(e);r(u)||(O.useBR?(t=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),t.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):t=e,c=t.textContent,n=u?l(u,c,!0):d(c),a=i(t),a.length&&(o=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),o.innerHTML=n.value,n.value=s(a,i(o),c)),n.value=_(n.value),e.innerHTML=n.value,e.className=m(e.className,u,n.language),e.result={language:n.language,re:n.relevance},n.second_best&&(e.second_best={language:n.second_best.language,re:n.second_best.relevance}))}", "function html(literals, ...substs) {\n return literals.raw.reduce((acc, lit, i) => {\n let subst = substs[i - 1];\n if (Array.isArray(subst)) {\n subst = subst.join('');\n }\n return acc + subst + lit;\n });\n}", "function testFunctions(str) {\n const shoutedStr = shout(str);\n const yelledStr = yell(shoutedStr);\n const htmlStr = html(yelledStr);\n console.log(htmlStr);\n }", "interpretHTML(a) {\n // CUT OUT IMGS TO ACCOUNT FOR MORE THAN 1 & STYLE ACCORDINGLY\n let _complete;\n let _imgs = a.match(/<img.*>/g, '');\n let _text = a.replace(/<img.*>/g, '');\n let _temp = [\"<div class='markedWrapper'>\"];\n\n if(_imgs === null){\n _temp.push(_text);\n }else if(_imgs.length > 1){\n _temp.push(_text.concat(this.handleImgs(_imgs)));\n }else{\n _temp.push(this.handleImgs(_imgs).concat(_text));\n }\n _temp.push(\"</div>\")\n _complete = _temp.join('');\n return {__html: _complete};\n }", "function ol_content_simple(text) {\r\n\tvar cpIsMultiple = /,/.test(o3_cellpad);\r\n\tvar txt = '<table width=\"'+o3_width+ '\" border=\"0\" cellpadding=\"'+o3_border+'\" cellspacing=\"0\" '+(o3_bgclass ? 'class=\"'+o3_bgclass+'\"' : o3_bgcolor+' '+o3_height)+'><tr><td><table width=\"100%\" border=\"0\" '+((olNs4||!cpIsMultiple) ? 'cellpadding=\"'+o3_cellpad+'\" ' : '')+'cellspacing=\"0\" '+(o3_fgclass ? 'class=\"'+o3_fgclass+'\"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign=\"TOP\"'+(o3_textfontclass ? ' class=\"'+o3_textfontclass+'\">' : ((!olNs4&&cpIsMultiple) ? ' style=\"'+setCellPadStr(o3_cellpad)+'\">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td></tr></table></td></tr></table>';\r\n\r\n\tset_background(\"\");\r\n\treturn txt;\r\n}", "function create_cont_Likert(sentence,name_label)\n\t\t{ //console.log(\"it's getting here\")\n\t\t\tvar likert = '<tr><td style=\"text-align: left; height: 40px\"> <b>' + sentence + '</b></td>'+\n\t\t\t'<td><input type=\"radio\" name=\"' + name_label+ \n\t\t\t'\" value=\"1\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"2\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"3\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"4\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"5\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"6\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"7\" /></td></tr>';\n\n\t\t\treturn likert;\n\t\t}" ]
[ "0.6306691", "0.6161154", "0.59423804", "0.59075797", "0.58257955", "0.5784069", "0.5768201", "0.57210326", "0.57195795", "0.56941193", "0.56693196", "0.5649801", "0.561515", "0.5606914", "0.5604092", "0.5603173", "0.5572509", "0.5561534", "0.5554751", "0.5542017", "0.5518682", "0.5516912", "0.5511231", "0.54983056", "0.54929376", "0.54868084", "0.5466631", "0.54626065", "0.54518056", "0.54445654", "0.5441024", "0.54260325", "0.5407819", "0.53948456", "0.538138", "0.53787124", "0.53666776", "0.53583616", "0.5353306", "0.53492814", "0.5331783", "0.5321162", "0.5313503", "0.5309632", "0.5305005", "0.53018045", "0.5299073", "0.52904177", "0.5283176", "0.5265496", "0.5258271", "0.52569485", "0.5249058", "0.5246305", "0.52434987", "0.52303463", "0.5227286", "0.5226265", "0.52185243", "0.5207598", "0.5204671", "0.5203188", "0.5202825", "0.52013505", "0.5198929", "0.51955855", "0.51937485", "0.51935935", "0.5183177", "0.5181385", "0.51810473", "0.5180783", "0.51766646", "0.5175626", "0.5168371", "0.5168047", "0.51658297", "0.5158885", "0.51550484", "0.51550484", "0.5152471", "0.5152469", "0.51523894", "0.5151029", "0.5148633", "0.5148171", "0.5141758", "0.5140831", "0.5139331", "0.513894", "0.51271915", "0.512657", "0.511978", "0.5118924", "0.5114608", "0.5110832", "0.5110238", "0.5110075", "0.5108686", "0.51076436" ]
0.63442564
0
swagger_pointname: the endpoint of swagger (for specifying the schema within the swagger2 file) Uses Swagger v2 swagger_pointname example: '/businesscurrentaccounts',
function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) { let swaggerjson = swagger_filecontent; // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname); // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses', '200', 'schema']); // let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].schema; let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].content['application/json'].schema; return schema; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this.name = 'serverless-plugin-swagger-endpoints';\n }", "function hello(req, res) {\n // variables defined in the Swagger document can be referenced using req.swagger.params.{parameter_name}\n //var name = req.swagger.params.name.value || 'stranger';\n\n}", "onSwaggerButtonClicked() {\n this.context.editor.showSwaggerViewForService(this.props.model);\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('back_office_availabilities', { format: 'json' }) + '?' + querystring;\n }", "function generateEndpointURL () {\n var querystring = $.param({\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('sliced_back_office_advisor_profile_availabilities', {\n advisor_profile_id: this[options.advisorIdAttribute],\n format: 'json'\n }) + '?' + querystring;\n }", "static getName() {\n return 'net.kfalck.' + ServerlessPluginSwaggerExport.name;\n }", "function buildSpecUrl() {\n let {protocol, host} = window.location\n let url = window.PRELOAD.swagger_url || '/docs?format=openapi'\n return `${protocol}//${host}${url}`\n}", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return API_ENDPOINT + '?' + querystring;\n }", "function configureEndpoint() {\n\tif(!o().isEndpoint()) {\n\t\to().config({\n\t\t\tendpoint:'http://services.odata.org/V4/%28S%28wptr35qf3bz4kb5oatn432ul%29%29/TripPinServiceRW/',\n\t\t\tversion:4,\n\t\t\tstrictMode:true\n\t\t});\n\t}\n}", "function convertSwagger(source){\n var apiInfo = clone(source,false);\n apiInfo.resources = {};\n\n\tif (apiInfo.servers && apiInfo.servers.length) {\n\t\tvar u = url.parse(apiInfo.servers[0].url);\n\t\tapiInfo.host = u.host;\n\t\tapiInfo.basePath = u.path;\n\t\tapiInfo.schemes = [];\n\t\tapiInfo.schemes.push(u.protocol.replace(':',''));\n\t}\n\n for (var p in apiInfo.paths) {\n for (var m in apiInfo.paths[p]) {\n if ('.get.post.put.delete.head.patch.options.trace.'.indexOf(m)>=0) {\n var sMethod = apiInfo.paths[p][m];\n var ioMethod = {};\n ioMethod.httpMethod = m.toUpperCase();\n var sMethodUniqueName = sMethod.operationId ? sMethod.operationId : m+'_'+p.split('/').join('_');\n sMethodUniqueName = sMethodUniqueName.split(' ').join('_'); // TODO {, } and : ?\n ioMethod.name = sMethodUniqueName;\n ioMethod.summary = sMethod.summary;\n ioMethod.description = sMethod.description;\n ioMethod.parameters = {};\n var sParams = sMethod.parameters ? sMethod.parameters : [];\n if (apiInfo.paths[p].parameters) {\n sParams = sParams.concat(apiInfo.paths[p].parameters);\n }\n for (var p2 in sParams) {\n var param = sParams[p2];\n var ptr = param[\"$ref\"];\n if (ptr && ptr.startsWith('#/parameters/')) {\n ptr = ptr.replace('#/parameters/','');\n param = clone(apiInfo.parameters[ptr],false);\n }\n if (ptr && ptr.startsWith('#/components/parameters/')) {\n ptr = ptr.replace('#/components/parameters/','');\n param = clone(apiInfo.components.parameters[ptr],false);\n }\n param.location = param[\"in\"];\n delete param[\"in\"];\n\t\t\t\t\tif (!param.type && param.schema && param.schema.type) {\n\t\t\t\t\t\tparam.type = param.schema.type;\n\t\t\t\t\t}\n ioMethod.parameters[param.name] = param;\n }\n ioMethod.path = p;\n ioMethod.responses = sMethod.responses;\n var tagName = 'Default';\n if (sMethod.tags && sMethod.tags.length>0) {\n tagName = sMethod.tags[0];\n }\n if (!apiInfo.resources[tagName]) {\n apiInfo.resources[tagName] = {};\n if (apiInfo.tags) {\n for (var t in apiInfo.tags) {\n var tag = apiInfo.tags[t];\n if (tag.name == tagName) {\n apiInfo.resources[tagName].description = tag.description;\n apiInfo.resources[tagName].externalDocs = tag.externalDocs;\n }\n }\n }\n }\n if (!apiInfo.resources[tagName].methods) apiInfo.resources[tagName].methods = {};\n apiInfo.resources[tagName].methods[sMethodUniqueName] = ioMethod;\n }\n }\n }\n delete apiInfo.paths; // to keep size down\n if (apiInfo.definitions) rename(apiInfo,'definitions','schemas');\n if (apiInfo.components && apiInfo.components.schemas) rename(apiInfo,'components.schemas','schemas');\n return apiInfo;\n}", "function extendSwagger2(baucisInstance, sw2Root) {\t\n\tconsole.log(\" plugin- extendSwagger2()\");\t\n}", "onRoute (info) {\n openApi.addRoute(info, {\n basePath: env.REST_API_PREFIX\n })\n }", "genPathByServiceAndActionName(configObj, serviceName, actionName) {\n\t\treturn `${configObj.versionEndpoint}.${serviceName}.${actionName}`;\n\t}", "constructor(baseURL = 'http://petstore.swagger.io:80/v2') {\n super(baseURL);\n }", "static bindDocs(api){\n\t\treturn (ctx,next)=>{\n\t\t\tctx.swaggerDocs = api;\n\t\t\tctx.define={\n\t\t\t\tmodel:{\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\tparams:{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next();\n\t\t}\n\t}", "api_name() {\n\n }", "function situationByName(req, res){\n\tqueryName(req.swagger.params.name.value, function(array){\n\t\tres.json(array);\n\t});\n}", "function exportIodocs(src){\n var obj = clone(src,false);\n obj.swagger = '2.0';\n obj.info = {};\n obj.info.version = obj.version || '1';\n obj.info.title = obj.name;\n obj.info.description = obj.description;\n obj.paths = {};\n\n var u = url.parse(obj.basePath+obj.publicPath);\n obj.schemes = [];\n obj.schemes.push(u.protocol.replace(':',''));\n obj.host = u.host;\n obj.basePath = u.path;\n\n delete obj.version;\n delete obj.title;\n delete obj.description;\n delete obj.publicPath;\n delete obj.privatePath; // for oauth etc\n delete obj.protocol;\n delete obj.name;\n delete obj.auth; // TODO\n delete obj.oauth; // TODO\n delete obj.headers; // TODO\n rename(obj,'schemas','definitions');\n if (obj.definitions) fixSchema(obj.definitions);\n\n for (var r in obj.resources) {\n var resource = obj.resources[r];\n // do tags\n for (var m in resource.methods) {\n var method = resource.methods[m];\n method.path = fixPathParameters(method.path);\n\n if (!obj.paths[method.path]) obj.paths[method.path] = {};\n var path = obj.paths[method.path];\n\n var httpMethod = method.httpMethod.toLowerCase();\n if (!path[httpMethod]) path[httpMethod] = {};\n\n var op = path[httpMethod];\n op.operationId = m;\n op.description = method.description;\n op.parameters = [];\n\n for (var p in method.parameters) {\n var param = method.parameters[p];\n param.name = p;\n if (param.title) rename(param,'title','name');\n if ((param.type == 'textarea') || (param.type == 'enumerated')) param.type = 'string';\n if (param.type == 'long') param.type = 'number';\n if (param.type == 'string[]') {\n param.type = 'array';\n param.items = {};\n param.items.type = 'string';\n }\n rename(param,'location','in');\n if (!param[\"in\"]) {\n if (method.path.indexOf('{'+param.name+'}')>=0) {\n param[\"in\"] = 'path';\n }\n else {\n param[\"in\"] = 'query';\n }\n }\n if ((param[\"in\"] == 'body') && (param.type != 'object')) {\n param[\"in\"] = 'formData'; // revalidate\n }\n if (param[\"in\"] == 'pathReplace') {\n param[\"in\"] = 'path';\n }\n if (param[\"in\"] == 'path') {\n param.required = true;\n }\n if (typeof param.required == 'string') {\n param.required = (param.required === 'true');\n }\n if (param.properties) {\n delete param.type;\n param.schema = {};\n param.schema.type = 'object';\n param.schema.properties = param.properties;\n delete param.properties;\n delete param[\"default\"];\n fixSchema(param.schema);\n }\n if (param.items) fixSchema(param.items);\n op.parameters.push(param);\n }\n op.tags = [];\n op.tags.push(r);\n\n op.responses = {};\n op.responses[\"200\"] = {};\n op.responses[\"200\"].description = 'Success';\n\n }\n }\n\n delete obj.resources;\n return obj;\n}", "static defaultEndpoint(req : $Request, res : $Response) {\n res.json({\n version: '1.0',\n });\n }", "registerActions() {\n S.addAction(this._exportSwaggerJSON.bind(this), {\n handler: 'exportSwaggerJSON',\n description: 'Exports a Swagger JSON API definition to standard output',\n context: 'swagger',\n contextAction: 'export',\n options: [{ \n option: 'basePath',\n shortcut: 'b',\n description: 'Supplied basePath will be used unless overridden in s-project.json'\n }],\n parameters: []\n });\n return BbPromise.resolve();\n }", "function modeToEndpoint (mode) {\n return mode==\"startup\"?\"/api/startup\":\"/api/signup\";\n }", "route() {\n return `/api/staff/v1/${this._api_route}`;\n }", "function swaggerUiInit(swaggerUrl) {\n var express = require(\"express\");\n var path = require(\"path\");\n var eApp = express();\n var exphbs = require(\"express-handlebars\");\n eApp.engine(\"handlebars\",\n exphbs({\n defaultLayout: \"main\"\n }));\n var distdir = path.join(__dirname, \"swagger-ui/dist\");\n eApp.set(\"views\", distdir);\n eApp.set(\"view engine\", \"handlebars\");\n // TODO: port should be a configuration option\n eApp.set(\"port\", 8000);\n eApp.use(express.static(distdir));\n eApp.get(\"/\", function(req, res) {\n res.render(\"index.handlebars\", {\n layout: false,\n swaggerSpecUrl: swaggerUrl,\n docExpansion: \"list\"\n }); // this is the important part\n });\n eApp.listen(eApp.get(\"port\"));\n console.log(\"Swagger UI running:\", swaggerUrl);\n}", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "endpoint() {\n //\n }", "async _getSwagger(name, token) {\n\t\treturn requestPromise({\n\t\t\t...this.requestSettings.getSwagger(name, token),\n\t\t\t...this.proxySettings\n\t\t})\n\t}", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "endpointsInfo() {\n\n let endpointNameString = '';\n if (this.apiName != null) {\n endpointNameString = ' for ' + this.apiName;\n }\n\n console.log('\\n==== ENDPOINTS BEGIN' + endpointNameString + ' >>>>');\n console.log(this.endpoints);\n console.log('<<<< ENDPOINTS END' + endpointNameString + ' ====\\n');\n\n }", "printServicesInfo() {\n let endPoints = listEndpoints(this.app);\n logger.debug(\"Endpoints are : \", endPoints);\n }", "function getComponentPathString(schemaName) {\n return `#/components/schema/${schemaName}`\n}", "function showEndpoint(response){\n}", "_bundle (schema){\n return SwaggerParser.bundle(schema);\n }", "function SwaggerParser () {\n $RefParser.apply(this, arguments);\n}", "getGraphqlEndPoint() {\n let endpoint = this.url;\n if(endpoint.length === 0)\n {\n let getUrl = window.location;\n endpoint = getUrl .protocol + \"//\" + getUrl.host + \"/\" + getUrl.pathname.split('/')[0];\n return endpoint + 'graphql';\n }\n return endpoint + '/graphql';\n }", "function getApiRoute(endpoint) {\n console.log(\"getApiRoute\", endpoint);\n return Meteor.settings[\"api\"] + endpoint + \"&access_token=\" +\n (Meteor.user().services ? Meteor.user().services.instagram.accessToken : null);\n }", "postProcessgetHaxJSONSchema(schema) {\n schema.properties[\"__editThis\"] = {\n type: \"string\",\n component: {\n name: \"a\",\n properties: {\n id: \"cmstokenidtolockonto\",\n href: \"\",\n target: \"_blank\"\n },\n slot: \"Edit this view\"\n }\n };\n return schema;\n }", "function getAPIEndpoint(endpoint, city) {\r\n var service = config.openweather.host + config.openweather[endpoint];\r\n var qs = $httpParamSerializer({\r\n appid: config.openweather.appid,\r\n units: config.openweather.units,\r\n q: city\r\n });\r\n\r\n return service + '?' + qs;\r\n }", "_exportSwaggerJSON(evt) {\n\n // This is the base Swagger JSON\n var project = S.getProject();\n\n let basePath = '/';\n if (evt.options.basePath) {\n basePath += evt.options.basePath;\n }\n\n var swagger = {\n \"swagger\": \"2.0\",\n \"info\": {\n \"version\": project.version,\n \"title\": project.title,\n \"description\": project.description\n },\n \"host\": \"localhost\",\n \"basePath\": basePath,\n \"schemes\": [\"http\"],\n \"tags\": [],\n \"securityDefinitions\": {},\n \"paths\": {},\n \"definitions\": {}\n };\n\n return BbPromise.resolve()\n .then(() => {\n // Add main project info from s-project.json\n return this._addSwaggerProjectInfo(project.swaggerExport, swagger);\n })\n .then(() => {\n // Add main project info from s-swagger.json (if exists)\n var content;\n try {\n content = fs.readFileSync(path.join(S.config.projectPath, 's-swagger.json'), 'utf-8');\n } catch (err) {\n // Ignore file not found\n }\n if (content) {\n return this._addSwaggerProjectInfo(JSON.parse(content), swagger);\n }\n })\n .then(() => {\n // Add functions and endpoints from s-function.json's\n return this._addSwaggerFunctions(project.functions, swagger);\n })\n .then(() => {\n // Add object type definitions from models\n return this._addSwaggerObjectDefinitions(swagger);\n })\n .then(() => {\n // Final cleanups\n delete swagger.definitions.$sequelizeImport;\n // Sort by URL path\n var paths = swagger.paths;\n var sortedPaths = Object.keys(swagger.paths);\n swagger.paths = {};\n sortedPaths.sort();\n sortedPaths.map(function (path) {\n swagger.paths[path] = paths[path];\n });\n // Output the final JSON\n console.log(JSON.stringify(swagger, null, 2));\n });\n }", "get endpoint() {\n return this.getStringAttribute('endpoint');\n }", "get endpoint() {\n return this.getStringAttribute('endpoint');\n }", "get endpoint() {\n return this.getStringAttribute('endpoint');\n }", "function getBaseApiEndpoint(dsn) {\n\t const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n\t const port = dsn.port ? `:${dsn.port}` : '';\n\t return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n\t}", "urlForPath(path = '/') {\n if (!path.startsWith('/')) {\n throw new Error(`Path must begin with \"/\": ${path}`);\n }\n return `https://${this.restApi.restApiId}.execute-api.${core_1.Stack.of(this).region}.${core_1.Stack.of(this).urlSuffix}/${this.stageName}${path}`;\n }", "function publishExternalAPI(appHelpers) {\n angular.extend(appHelpers, {\n 'per': per,\n 'generateLabelFromPeriod': generateLabelFromPeriod,\n 'generateFullLabelFromPeriod': generateFullLabelFromPeriod,\n 'getPeriodString': getPeriodString,\n 'getYearLabelFromPeriod': getYearLabelFromPeriod,\n 'getMonthFromPeriod': getMonthFromPeriod,\n 'getYearFromPeriod': getYearFromPeriod,\n 'getMonthIndexFromPeriod': getMonthIndexFromPeriod,\n 'getMonthFromNumber': getMonthFromNumber\n });\n }", "validate(input) {\r\n return new Promise((resolve, reject) => {\r\n SwaggerParser.validate(input+'.yaml').then((api) => {\r\n resolve(true);\r\n }).catch((err) => {\r\n \t\t console.log(err);\r\n resolve('You must provide an existing OpenAPI spec (yaml file in working directory) and the spec MUST be valid');\r\n });\r\n });\r\n }", "function Schema_from_swagger(schema_content) {\n 'use strict';\n // use new\n\n this.resolve = (input_json_obj) => {\n //const schema = getSwaggerV2Schema(schema_content, '/default_endpoint')\n const schema = schema_content;\n const ok = schemaValidator(schema, input_json_obj);\n if (ok) {\n return input_json_obj;\n } else {\n throw new Error('mismatch: The constraint aspect of template failed');\n }\n };\n\n this.generate = (obj) => this.resolve(obj);\n}", "static apiRoute() {\n return 'api'\n }", "function parseSchema(name, schema) {\n var name = name.replace('.json', '');\n\n if (name === 'manifest') {\n manifest = schema;\n return;\n }\n\n if (schema.hasOwnProperty('endpoint')) {\n var res = /\\.(post|put|delete|get)/g.exec(name);\n\n if (res && !schema.hasOwnProperty('http_method')) {\n schema.http_method = res[1].toUpperCase();\n }\n\n var root = /([a-z0-9\\-_]+)/i.exec(schema.endpoint);\n root = root[0];\n\n if (!endpoints.hasOwnProperty(root)) {\n endpoints[root] = {};\n }\n\n var uid_name = schema.http_method.toUpperCase()+' '+schema.endpoint;\n endpoints[root][uid_name] = schema;\n endpoint_map[uid_name] = schema;\n } else {\n \n }\n }", "function convertSwaggerTypeToExample (type, name) {\n switch (type) {\n case 'integer':\n return 0;\n case 'number':\n return 0;\n case 'boolean':\n return true;\n case 'string':\n return name || type;\n default:\n return type;\n }\n}", "function getServiceUrl(service, data) {\n var endPoint = service.endPoint;\n var serviceUrl = CONFIG.USE_MOCK_SERVICES ? ('mock-api/' + service.mockPath) : CONFIG.REST_SERVER;\n\n if (CONFIG.USE_MOCK_SERVICES) {\n if (endPoint === 'userConsole' && data) {\n endPoint += ('-' + data.consoleId);\n }\n endPoint += '.json';\n }\n\n return serviceUrl + endPoint;\n }", "function startServer(port){\n const expressSwagger = require('express-swagger-generator')(app);\n require('./routes')(app);\n \n let options = {\n swaggerDefinition: {\n info: {\n description: 'Test for Backend Developer role.',\n title: 'Lobby Wars',\n version: '0.0.1',\n },\n host: 'localhost:'+port,\n basePath: '/v1',\n produces: [\n \"application/json\",\n \"application/xml\"\n ],\n schemes: ['http'], \n },\n basedir: __dirname, //app absolute path\n files: ['./routes/**/*.js'] //Path to the API handle folder\n };\n expressSwagger(options)\n\n let server = app.listen(port); \n console.log(\"Listening on port: \"+port);\n return server;\n}", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n }", "function generateOAPIParameters() {\n\n return [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"description\": \"ID of the requested object in the database.\",\n \"required\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"format\": \"int32\"\n },\n \"style\": \"simple\"\n }\n ];\n\n}", "function resetEndpoint(endpoint) {\n return endpoint = \"https://localhost:44367/api/movie/\";\n }", "function GetApiPath() {\n return '/api/data/v9.0/';\n }", "function printEndpoint(method, name, payload, params){\n console.log(\"\\n========== ========== ==========\");\n console.log(method + \" \" + name);\n console.log(\"PAYLOAD: \", payload);\n console.log(\"PARAMS: \", params);\n console.log(\"========== ========== ==========\");\n}", "function fetchStargazers(fullName, nextPageUrl) {\n return {\n fullName,\n [CALL_API]: {\n types: [ STARGAZERS_REQUEST, STARGAZERS_SUCCESS, STARGAZERS_FAILURE ],\n endpoint: nextPageUrl,\n schema: Schemas.USER_ARRAY\n }\n }\n}", "function setRestfulApi(options) {\n if(options.apis && options.apis.restful) {\n var apis = self.settings().apis;\n for( var api in apis ) {\n apis[api].url = options.apis.restful.url;\n }\n }\n }", "function iodocsUpgrade(data){\n \tvar data = data['endpoints'];\n\tvar newResource = {};\n\tnewResource.resources = {};\n\tfor (var index2 = 0; index2 < data.length; index2++) {\n\t\tvar resource = data[index2];\n\t\tvar resourceName = resource.name;\n\t\tnewResource.resources[resourceName] = {};\n\t\tnewResource.resources[resourceName].methods = {};\n\t\tvar methods = resource.methods;\n\t\tfor (var index3 = 0; index3 < methods.length; index3++) {\n\t\t\tvar method = methods[index3];\n\t\t\tvar methodName = method['MethodName'];\n\t\t\tvar methodName = methodName.split(' ').join('_');\n\t\t\tnewResource.resources[resourceName].methods[methodName] = {};\n\t\t\tnewResource.resources[resourceName].methods[methodName].name = method['MethodName'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['httpMethod'] = method['HTTPMethod'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['path'] = method['URI'];\n\t\t\tnewResource.resources[resourceName].methods[methodName].parameters = {};\n\t\t\tif (!method.parameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar parameters = method.parameters;\n\t\t\tfor (var index4 = 0; index4 < parameters.length; index4++) {\n\t\t\t\tvar param = parameters[index4];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name] = {};\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['title'] = param.name;\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['required'] = (param['Required'] == 'Y');\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['default'] = param['Default'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['type'] = param['Type'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['description'] = param['Description'];\n\t\t\t}\n\t\t}\n\t}\n return newResource;\n}", "function draw_endpoint( data ) {\n\n draw_tools( data );\n draw_table( data );\n _resource.get_sheets_labels( draw_tabs );\n\n // deactivate menu button and hide the panel\n manage_top_panel( $('#top-menu').find('.active'), function () {\n hide_panel( data['type'] );\n });\n }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "getRestUrl(endPoint, type) {\n let url = '';\n if (endPoint === 'auth') {\n url = BASIC_URL + this.serviceUrls[endPoint];\n } else if (type === 'user') {\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n this.serviceUrls[endPoint];\n } \n else if(type === 'cart'){\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n '/carts/' +\n this.getCartGuid() +\n this.serviceUrls[endPoint];\n } else if (type === 'userid') {\n url = BASE_URL + '/' + this.siteId + '/users/';\n } else if (type === 'subscribe') {\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n '/carts/' +\n this.getSubscribtionCartId() +\n this.serviceUrls[endPoint];\n } else {\n url = BASE_URL + '/' + this.siteId + this.serviceUrls[endPoint];\n }\n if (!this.isMock && this.isMock !== 'true') {\n return url;\n }\n return this.getMockURL(url);\n }", "function convertLiveDocs(apiInfo){\n rename(apiInfo,'title','name');\n rename(apiInfo,'prefix','publicPath');\n rename(apiInfo,'server','basePath');\n apiInfo.resources = {};\n for (var e in apiInfo.endpoints) {\n var ep = apiInfo.endpoints[e];\n var eName = ep.name ? ep.name : 'Default';\n\n if (!apiInfo.resources[eName]) apiInfo.resources[eName] = {};\n apiInfo.resources[eName].description = ep.description;\n\n for (var m in ep.methods) {\n var lMethod = ep.methods[m];\n if (!apiInfo.resources[eName].methods) apiInfo.resources[eName].methods = {};\n var mName = lMethod.MethodName ? lMethod.MethodName : 'Default';\n if (mName.endsWith('.')) mName = mName.substr(0,mName.length-1);\n mName = mName.split(' ').join('_');\n rename(lMethod,'HTTPMethod','httpMethod');\n rename(lMethod,'URI','path');\n rename(lMethod,'Synopsis','description');\n rename(lMethod,'MethodName','name');\n\n lMethod.path = fixPathParameters(lMethod.path);\n\n var params = {};\n for (var p in lMethod.parameters) {\n var lParam = lMethod.parameters[p];\n if (!lParam.type) lParam.type = 'string';\n if (lParam.type == 'json') lParam.type = 'string';\n if (!lParam.location) {\n if (lMethod.path.indexOf(':'+lParam.name)>=0) {\n lParam.location = 'path';\n }\n else {\n lParam.location = 'query';\n }\n }\n if (lParam.location == 'boddy') lParam.location = 'body'; // ;)\n params[lParam.name] = lParam;\n delete lParam.name;\n delete lParam.input; // TODO checkbox to boolean?\n delete lParam.label;\n rename(lParam,'options','enum');\n }\n lMethod.parameters = params;\n if (Object.keys(params).length==0) delete lMethod.parameters;\n\n apiInfo.resources[eName].methods[mName] = lMethod;\n }\n\n }\n delete apiInfo.endpoints; // to keep size down\n return apiInfo;\n}", "function tagName(tag, options) {\n if (tag == null || tag === '') {\n tag = options.defaultTag || 'Api';\n }\n tag = toIdentifier(tag);\n return tag.charAt(0).toUpperCase() + (tag.length == 1 ? '' : tag.substr(1));\n}", "function defaultServiceHost() {\n return \"api.traceguide.io\";\n}", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}", "function nameToPath(name = '') {\n let routeName;\n if (name === '/' || name.trim().length === 0) return name\n name = removeSlash(name, 'lead');\n routeName = name.split(':')[0];\n routeName = removeSlash(routeName, 'trail');\n\n return routeName.toLowerCase()\n }", "function getAPIEndPoints(key) {\n const API_URL = \"https://5dc588200bbd050014fb8ae1.mockapi.io\";\n\n const API_ENDPONTS = {\n GETUSERS: \"/assessment\"\n };\n return API_URL + API_ENDPONTS[key];\n}", "updateSwagger() {\n const {\n selectedEnvironment, api, environments,\n } = this.state;\n let promiseSwagger;\n\n if (selectedEnvironment) {\n if (environments.includes(selectedEnvironment)) {\n promiseSwagger = this.apiClient.getSwaggerByAPIIdAndEnvironment(api.id, selectedEnvironment);\n } else {\n promiseSwagger = this.apiClient.getSwaggerByAPIIdAndLabel(api.id, selectedEnvironment);\n }\n } else {\n promiseSwagger = this.apiClient.getSwaggerByAPIId(api.id);\n }\n promiseSwagger.then((swaggerResponse) => {\n this.setState({ swagger: swaggerResponse.obj });\n });\n }", "updateSwagger() {\n const {\n selectedEnvironment, api, environments,\n } = this.state;\n let promiseSwagger;\n\n if (selectedEnvironment) {\n if (environments.includes(selectedEnvironment)) {\n promiseSwagger = this.apiClient.getSwaggerByAPIIdAndEnvironment(api.id, selectedEnvironment);\n } else {\n promiseSwagger = this.apiClient.getSwaggerByAPIIdAndLabel(api.id, selectedEnvironment);\n }\n } else {\n promiseSwagger = this.apiClient.getSwaggerByAPIId(api.id);\n }\n promiseSwagger.then((swaggerResponse) => {\n this.setState({ swagger: swaggerResponse.obj });\n });\n }", "get kibanaEndpoint() {\n return this.getStringAttribute('kibana_endpoint');\n }", "function routeToAPI(route, modelName) {\n var returnDesc = route.returns && route.returns[0];\n var model = returnDesc\n ? ((returnDesc.type == 'object' || returnDesc.type == 'any')\n ? modelName || 'any'\n : prepareDataType(returnDesc.type))\n : 'void';\n\n return {\n path: convertPathFragments(route.path),\n operations: [{\n httpMethod: convertVerb(route.verb),\n nickname: route.method.replace(/\\./g, '_'), // [rfeng] Swagger UI doesn't escape '.' for jQuery selector\n responseClass: model,\n parameters: route.accepts ? route.accepts.map(acceptToParameter(route)) : [],\n errorResponses: [], // TODO(schoon) - We don't have descriptions for this yet.\n summary: route.description, // TODO(schoon) - Excerpt?\n notes: '', // TODO(schoon) - `description` metadata?\n authorizations: {\n oauth2: [\n {\n description: 'Allow everything',\n scope: '*'\n }\n ]\n }\n }]\n };\n}", "function explorer(loopbackApplication, options) {\n options = _defaults({}, options, {\n basePath: loopbackApplication.get('restApiRoot') || '',\n name: 'swagger',\n resourcePath: 'resources',\n apiInfo: loopbackApplication.get('apiInfo') || {}\n });\n\n swagger(loopbackApplication.remotes(), options);\n\n var app = express();\n\n app.disable('x-powered-by');\n\n app.get('/config.json', function(req, res) {\n res.send({\n url: path.join(options.basePath || '/', options.name, options.resourcePath)\n });\n });\n // Allow specifying a static file root for swagger files. Any files in that folder\n // will override those in the swagger-ui distribution. In this way one could e.g. \n // make changes to index.html without having to worry about constantly pulling in\n // JS updates.\n if (options.swaggerDistRoot) {\n app.use(loopback.static(options.swaggerDistRoot));\n }\n // File in node_modules are overridden by a few customizations\n app.use(loopback.static(STATIC_ROOT));\n // Swagger UI distribution\n app.use(loopback.static(SWAGGER_UI_ROOT));\n return app;\n}", "constructor(apiName = null) {\n if (apiName != null) this.apiName = apiName;\n this.endpoints = [];\n }", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "registerActions() {\n\n S.addAction(this._swaggerDeploy.bind(this), {\n handler: 'swaggerDeploy',\n description: 'A custom action from a custom plugin',\n context: 'swagger',\n contextAction: 'deploy',\n options: [\n {\n option: 'stage',\n shortcut: 's',\n description: 'Optional if only one stage is defined in project'\n }, {\n option: 'region',\n shortcut: 'r',\n description: 'Optional - Target one region to deploy to'\n }, {\n option: 'all',\n shortcut: 'a',\n description: 'Optional - Deploy all Functions'\n }, {\n option: 'swaggerPath',\n shortcut: 'w',\n description: 'Swagger file path (relative to project root)'\n }, {\n option: 'mode',\n shortcut: 'm',\n description: 'Import Mode (\\'merge\\' or \\'overwrite\\')'\n }\n ],\n parameters: [\n {\n parameter: 'names',\n description: 'The names/ids of the endpoints you want to deploy in this format: user/create~GET',\n position: '0->'\n }\n ]\n });\n\n return BbPromise.resolve();\n }", "function userProfileUrl() { return \"{{conf.reqUrl}}/api/userprofile/\"; }", "static get WOPI_REQUEST_HEADER_APP_ENDPOINT() { return \"X-WOPI-AppEndpoint\"; }", "function convertToOpenAPI(info, data) {\n const builder = new openapi3_ts_1.OpenApiBuilder();\n builder.addInfo(Object.assign(Object.assign({}, info.base), { title: info.base.title || '[untitled]', version: info.base.version || '0.0.0' }));\n info.contact && builder.addContact(info.contact);\n const tags = [];\n const paths = {};\n let typeCount = 1;\n const schemas = {};\n data.forEach(item => {\n [].concat(item.url).forEach(url => {\n if (typeof url !== 'string') {\n // TODO\n return;\n }\n url = url\n .split('/')\n .map((item) => (item.startsWith(':') ? `{${item.substr(1)}}` : item))\n .join('/');\n if (!tags.find(t => t.name === item.typeGlobalName)) {\n const ctrlMeta = controller_1.getControllerMetadata(item.typeClass);\n tags.push({\n name: item.typeGlobalName,\n description: (ctrlMeta && [ctrlMeta.name, ctrlMeta.description].filter(s => s).join(' ')) ||\n undefined,\n });\n }\n if (!paths[url]) {\n paths[url] = {};\n }\n [].concat(item.method).forEach((method) => {\n method = method.toLowerCase();\n function paramFilter(p) {\n if (p.source === 'Any') {\n return ['post', 'put'].every(m => m !== method);\n }\n return p.source !== 'Body';\n }\n function convertValidateToSchema(validateType) {\n if (validateType === 'string') {\n return {\n type: 'string',\n };\n }\n if (validateType === 'int' || validateType === 'number') {\n return {\n type: 'number',\n };\n }\n if (validateType.type === 'object' && validateType.rule) {\n let properties = {};\n const required = [];\n Object.keys(validateType.rule).forEach(key => {\n const rule = validateType.rule[key];\n properties[key] = convertValidateToSchema(rule);\n if (rule.required !== false) {\n required.push(key);\n }\n });\n const typeName = `GenType_${typeCount++}`;\n builder.addSchema(typeName, {\n type: validateType.type,\n required: required,\n properties,\n });\n return {\n $ref: `#/components/schemas/${typeName}`,\n };\n }\n if (validateType.type === 'enum') {\n return {\n type: 'string',\n };\n }\n return {\n type: validateType.type,\n items: validateType.itemType\n ? validateType.itemType === 'object'\n ? convertValidateToSchema({ type: 'object', rule: validateType.rule })\n : { type: validateType.itemType }\n : undefined,\n enum: Array.isArray(validateType.values)\n ? validateType.values.map(v => convertValidateToSchema(v))\n : undefined,\n maximum: validateType.max,\n minimum: validateType.min,\n };\n }\n function getTypeSchema(p) {\n if (p.schema) {\n return p.schema;\n }\n else if (p.validateType && p.validateType.type) {\n return convertValidateToSchema(p.validateType);\n }\n else {\n const type = utils_1.getGlobalType(p.type);\n const isSimpleType = ['array', 'boolean', 'integer', 'number', 'object', 'string'].some(t => t === type.toLowerCase());\n // TODO complex type process\n return {\n type: isSimpleType ? type.toLowerCase() : 'object',\n items: type === 'Array'\n ? {\n type: 'object',\n }\n : undefined,\n };\n }\n }\n // add schema\n const components = item.schemas.components || {};\n Object.keys(components).forEach(typeName => {\n if (schemas[typeName] && schemas[typeName].hashCode !== components[typeName].hashCode) {\n console.warn(`[egg-controller] type: [${typeName}] has multi defined!`);\n return;\n }\n schemas[typeName] = components[typeName];\n });\n // param\n const inParam = item.paramTypes.filter(paramFilter);\n // req body\n const inBody = item.paramTypes.filter(p => !paramFilter(p));\n let requestBody;\n if (inBody.length) {\n const requestBodySchema = {\n type: 'object',\n properties: {},\n };\n inBody.forEach(p => {\n if (p.required || util_1.getValue(() => p.validateType.required)) {\n if (!requestBodySchema.required) {\n requestBodySchema.required = [];\n }\n requestBodySchema.required.push(p.paramName);\n }\n requestBodySchema.properties[p.paramName] = getTypeSchema(p);\n });\n const reqMediaType = 'application/json';\n requestBody = {\n content: {\n [reqMediaType]: {\n schema: requestBodySchema,\n },\n },\n };\n }\n // res\n let responseSchema = item.schemas.response || {};\n const refTypeName = responseSchema.$ref;\n if (refTypeName) {\n const definition = item.schemas.components[refTypeName.replace('#/components/schemas/', '')];\n if (definition) {\n responseSchema = { $ref: refTypeName };\n }\n else {\n console.warn(`[egg-controller] NotFound {${refTypeName}} in components.`);\n responseSchema = { type: 'any' };\n }\n }\n const responses = {\n default: {\n description: 'default',\n content: {\n 'application/json': {\n schema: responseSchema,\n },\n },\n },\n };\n paths[url][method] = {\n operationId: item.functionName,\n tags: [item.typeGlobalName],\n summary: item.name,\n description: item.description,\n parameters: inParam.length\n ? inParam.map(p => {\n const source = p.source === 'Header' ? 'header' : p.source === 'Param' ? 'path' : 'query';\n return {\n name: p.paramName,\n in: source,\n required: source === 'path' || p.required || util_1.getValue(() => p.validateType.required),\n schema: getTypeSchema(p),\n };\n })\n : undefined,\n requestBody,\n responses,\n };\n });\n });\n });\n // add schema\n Object.keys(schemas).forEach(key => {\n delete schemas[key].hashCode;\n builder.addSchema(key, schemas[key]);\n });\n tags.forEach(tag => builder.addTag(tag));\n Object.keys(paths).forEach(path => builder.addPath(path, paths[path]));\n return JSON.parse(builder.getSpecAsJson());\n}", "function getSensorByName(req, res) {\n\tqueryName(req.swagger.params.name.value, req.swagger.params.thing.value, function(array){\n\t\tif (array.length > 0) {\n\t\t\tres.json(array[0]);\n\t\t} else {\n\t\t\tres.statusCode = 404;\n\t\t\tres.json({message: \"Not Found\"})\n\t\t}\n\t});\n}", "function resolveRef(swagger, ref) {\n if (ref.indexOf('#/') != 0) {\n console.error('Resolved references must start with #/. Current: ' + ref);\n process.exit(1);\n }\n var parts = ref.substr(2).split('/');\n var result = swagger;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n result = result[part];\n }\n return result === swagger ? {} : result;\n}", "function Documentation(jsonDoc) {\n this.id = jsonDoc.id;\n this.serviceName = jsonDoc.serviceName;\n this.serviceDescription = jsonDoc.serviceDescription;\n this.serviceHost = jsonDoc.serviceHost;\n this.swaggerUiUrl = jsonDoc.swaggerUiUrl;\n this.swaggerSpecUrl = jsonDoc.swaggerSpecUrl;\n this.environment = jsonDoc.environment;\n this.category = jsonDoc.category;\n this.displayName = ko.computed(function() {\n return this.serviceName + \" (\" + this.environment + \")\";\n }, this);\n this.displayHost = ko.computed(function() {\n var displayHost = this.serviceHost;\n if(displayHost.indexOf(\"http://\") < 0) {\n displayHost = \"http://\" + displayHost;\n }\n return displayHost;\n }, this);\n this.displaySwaggerSpec = ko.computed(function() {\n return this.displayHost() + this.swaggerSpecUrl;\n }, this);\n this.displaySwaggerUi = ko.computed(function() {\n return this.displayHost() + this.swaggerUiUrl;\n }, this);\n this.iframeUrl = ko.computed(function() {\n var swaggerUI = this.displaySwaggerUi();\n if(swaggerUI.indexOf(\"?\") > -1) {\n swaggerUI = swaggerUI + \"&\";\n } else {\n swaggerUI = swaggerUI + \"?\"\n }\n return swaggerUI + \"hideHeader=true\";\n }, this);\n}", "function goToCollection() {\n var links = $scope.response.links || $scope.schema.links;\n links.forEach(function (link) {\n if (link.rel === 'schema/rel/collection') {\n $location.url('/view?res=' + normalizeUrl(link.href));\n }\n });\n }", "function setupEndpoint() {\n if (host.val().indexOf('/') != -1) {\n var hostArr = host.val().split('/');\n\n path = \"http://\" + hostArr[0] + \":\" + port.val();\n hostArr.shift(); // remove host\n\n if (hostArr.length > 0) { // anything left?\n path += \"/\" + hostArr.join('/');\n }\n } else {\n path = \"http://\" + host.val() + \":\" + port.val();\n }\n endpoint = path;\n }", "constructor(token) {\n this.token = token\n this.baseUrl = 'https://api-invest.tinkoff.ru/openapi/'\n }", "function loadSwaggerUi(apiUrl) {\n const ui = SwaggerUIBundle({\n url: apiUrl,\n dom_id: '#swagger-ui',\n presets: [\n SwaggerUIBundle.presets.apis,\n SwaggerUIStandalonePreset\n ],\n layout: \"StandaloneLayout\"\n })\n window.ui = ui\n}", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "createAPI(app) {\n\n // Add swagger validation and ui.\n swagger_helper.addValidation(router, teamsSwagger);\n swagger_helper.addUI(app, teamsSwagger, 'teams');\n\n router.get(\"/\", (req, res, next) => {\n \n this.teams_dao.getTeams()\n .then((teams) => {\n res.status(200).json(teams);\n })\n .catch((err) => {\n res.status(500).json({ err: err });\n }); \n });\n\n router.post(\"/\", (req, res, next) => {\n res.status(200).json({ msg: 'Post team successful' });\n });\n\n router.put('/', (req, res, next) => {\n\n this.teams_dao.updateTeam(req.body)\n .then(() => {\n res.status(200).json({ msg: 'Put team successful' });\n })\n .catch((err) => {\n res.status(500).json({ err: err });\n }); \n });\n\n router.delete('/', (req, res, next) => {\n res.status(200).json({ msg: 'Delete team successful' });\n }); \n\n return router;\n }", "get endpoint () {\n\t\treturn this._endpoint;\n\t}", "function baseUrl(obj) {\n var specIsOAS3 = Object(_helpers__WEBPACK_IMPORTED_MODULE_21__[\"isOAS3\"])(obj.spec);\n return specIsOAS3 ? oas3BaseUrl(obj) : swagger2BaseUrl(obj);\n}", "validate (){\n const that = this;\n return this\n ._validate(this.swaggerInput)\n .then((dereferencedSchema) => {\n that.swaggerObject = dereferencedSchema;\n return that;\n });\n }", "function Config(app) {\n morgan.token('time', (req, res) => new Date().toISOString());\n app.use(morgan('[:time] :remote-addr :method :url :status :res[content-length] :response-time ms'));\n\n app.use(bodyParser.urlencoded({ extended: true }));\n app.use(bodyParser.json());\n app.use(require('./api/v1'));\n\n app.use(function(req, res, next) {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'X-Requested-With');\n res.header('Access-Control-Allow-Headers', 'Content-Type');\n res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');\n next();\n });\n \n app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));\n}", "function generateResourceListing(options) {\n const controllers = options.controllers;\n const opts = options.options || {};\n\n const paths = buildPaths(controllers);\n const definitions = buildDefinitions(controllers);\n\n const listing = {\n swagger: '2.0',\n info: {\n description: 'Baucis generated API',\n version: options.version,\n title: 'api'\n // termsOfService: 'TOS: to be defined.',\n // contact: {\n // email: '[email protected]'\n // },\n // license: {\n // name: 'TBD',\n // url: 'http://license.com'\n // }\n },\n // host: null,\n basePath: options.basePath,\n tags: buildTags(options),\n schemes: ['http', 'https'],\n consumes: ['application/json'],\n produces: ['application/json', 'text/html'],\n paths,\n definitions,\n parameters: params.generateCommonParams()\n // responses: getReusableResponses(),\n // securityDefinitions: {},\n // security: [] // Must be added via extensions\n // externalDocs: null\n };\n\n if (opts.security) {\n listing.security = opts.security;\n }\n if (opts.securityDefinitions) {\n listing.securityDefinitions = opts.securityDefinitions;\n }\n\n return listing;\n}", "function baseUrl(obj) {\n var specIsOAS3 = (0,_helpers__WEBPACK_IMPORTED_MODULE_20__.isOAS3)(obj.spec);\n return specIsOAS3 ? oas3BaseUrl(obj) : swagger2BaseUrl(obj);\n}", "function getPointName(point) {\n var y = point.y;\n if(y < 10) {\n return \"helix\";\n }\n else {\n return \"beta\";\n }\n }", "makeEndpoint(schema) {\n return (options) => {\n const ep = new endpoint_1.Endpoint(options);\n ep.applySchema(ep, schema, schema, ep);\n return ep;\n };\n }", "static getFullPath() {\n return this.baseUrl() + this.apiRoute() + '/' + this.route() + '/'\n }", "function Swagger(remotes, options, models) {\n // Unfold options.\n var _options = options || {};\n var name = _options.name || 'swagger';\n var version = _options.version;\n var basePath = _options.basePath;\n\n // We need a temporary REST adapter to discover our available routes.\n var adapter = remotes.handler('rest').adapter;\n var routes = adapter.allRoutes();\n var classes = remotes.classes();\n\n var extension = {};\n var helper = Remoting.extend(extension);\n\n var apiDocs = {};\n var resourceDoc = {\n apiVersion: version,\n swaggerVersion: '1.2',\n basePath: basePath,\n apis: [\n {\n path: '/swagger/oauth'\n },\n {\n path: '/swagger/batch'\n }\n ],\n authorizations: {\n oauth2: {\n grantTypes: {\n implicit: {\n loginEndpoint: {\n url: '/oauth/authorize'\n },\n tokenName: 'access_token'\n }\n },\n scopes: [\n {\n description: 'Allow everything',\n scope: '*'\n },\n ],\n type: 'oauth2'\n }\n }\n };\n\n models = models || _(classes).map(modelFromClass).reduce(_.assign, {});\n models['token'] = {\n id: 'token',\n required: ['access_token', 'token_type'],\n properties: {\n access_token: {\n type: 'string',\n required: true\n },\n token_type: {\n type: 'string',\n required: true\n }\n }\n };\n models['tokeninfo'] = {\n id: 'tokeninfo',\n required: ['audience', 'user_id', 'scope'],\n properties: {\n audience: {\n type: 'string',\n required: true\n },\n user_id: {\n type: 'string',\n required: true\n },\n scope: {\n type: 'string',\n required: true\n },\n expires_in: {\n type: 'string'\n }\n }\n };\n\n var oauthDoc = {\n apiVersion: resourceDoc.apiVersion,\n swaggerVersion: resourceDoc.swaggerVersion,\n basePath: '',\n apis: [\n {\n path: convertPathFragments('/oauth/authorize'),\n operations: [{\n httpMethod: 'GET',\n nickname: 'oauth_authorize',\n responseClass: 'void',\n parameters: [\n {\n paramType: 'query',\n name: 'response_type',\n description: 'Response type',\n dataType: 'string',\n required: true,\n allowMultiple: false,\n enum: [\n 'code',\n 'token'\n ]\n },\n {\n paramType: 'query',\n name: 'client_id',\n description: 'Client ID',\n dataType: 'string',\n required: true,\n allowMultiple: false\n },\n {\n paramType: 'query',\n name: 'redirect_uri',\n description: 'Client redirect URI',\n dataType: 'string',\n required: true,\n allowMultiple: false\n }\n ],\n errorResponses: [],\n summary: 'OAuth 2.0 authorization endpoint',\n notes: '<p>OAuth 2.0 specifies a framework that allows users to grant client ' +\n 'applications limited access to their protected resources. It does ' +\n 'this through a process of the user granting access, and the client ' +\n 'exchanging the grant for an access token.</p>' +\n '<p>We support three grant types: <u>authorization codes</u>, ' +\n '<u>implicit</u> and <u>resource owner password credentials</u>.</p>' +\n '<p>For detailed description see <a href=\"http://tools.ietf.org/html/rfc6749#section-1.3\">Section 1.3 of OAuth spec</a></p>' +\n '<p>This endpoint is used for <u>authorization code</u> and <u>implicit</u> ' +\n 'grant types.</p>' +\n '<p>Once you receive your token, you can use it to send requests that ' +\n 'need authorization by adding received token to \\'Athorization\\' header:</p>' +\n '<pre>Authorization: Bearer your-token-goes-here</pre>'\n }]\n },\n {\n path: convertPathFragments('/oauth/token'),\n operations: [{\n httpMethod: 'POST',\n nickname: 'oauth_token',\n responseClass: 'token',\n parameters: [\n {\n paramType: \"form\",\n name: \"grant_type\",\n description: \"Token grant type\",\n dataType: \"string\",\n required: true,\n allowMultiple: false,\n enum: [\n \"authorization_code\",\n \"password\"\n ]\n },\n {\n \"paramType\": \"form\",\n \"name\": \"client_id\",\n \"description\": \"Client ID\",\n \"dataType\": \"string\",\n \"required\": true,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"client_secret\",\n \"description\": \"Client secret\",\n \"dataType\": \"string\",\n \"required\": true,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"redirect_uri\",\n \"description\": \"Client redirect URI\",\n \"dataType\": \"string\",\n \"required\": false,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"username\",\n \"description\": \"User login\",\n \"dataType\": \"string\",\n \"required\": false,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"password\",\n \"description\": \"User password\",\n \"dataType\": \"string\",\n \"required\": false,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"code\",\n \"description\": \"Authorization code\",\n \"dataType\": \"string\",\n \"required\": false,\n \"allowMultiple\": false\n },\n {\n \"paramType\": \"form\",\n \"name\": \"scope\",\n \"description\": \"Scope of access\",\n \"dataType\": \"string\",\n \"required\": false,\n \"allowMultiple\": false\n }\n ],\n errorResponses: [],\n summary: 'OAuth 2.0 token endpoint',\n notes: '<p>This endpoint is used for <u>authorization code</u> and <u>password</u> ' +\n 'grant types.</p>' +\n '<p>For <u>authorization code</u> grant type you can exchange authorization ' +\n 'code received from authorization endpoint for an access token</p>' +\n '<p>For <u>resource owner password credentials</u> grant type you exchange user credentials for an access token</p>' +\n '<p>Client credentials can be provided either via form arguments or via HTTP Basic authorization</p>'\n }]\n },\n {\n path: convertPathFragments('/oauth/token/info'),\n operations: [{\n httpMethod: 'GET',\n nickname: 'oauth_tokeninfo',\n responseClass: 'tokeninfo',\n parameters: [{\n paramType: 'query',\n name: 'access_token',\n description: 'Access token',\n dataType: 'string',\n required: true,\n allowMultiple: false\n }],\n errorResponses: [],\n summary: 'OAuth 2.0 token validation endpoint',\n notes: '<p>Tokens received on the fragment <u>MUST</u> be explicitly validated. ' +\n 'Failure to verify tokens acquired this way makes your application more ' +\n 'vulnerable to the <a href=\"http://en.wikipedia.org/wiki/Confused_deputy_problem\">confused deputy problem</a>.</p>' +\n '<p>When verifying a token, it is critical to ensure the audience field ' +\n 'in the response exactly matches your client ID. It is absolutely vital ' +\n 'to perform this step, because it is the mitigation for the confused deputy issue.</p>' +\n '<p>If the token has expired, has been tampered with, or the permissions ' +\n 'revoked, server will respond with an error. The error surfaces as a 400 ' +\n 'status code, and a JSON body as follows:</p>' +\n '<pre>{\\n \"error\": \"invalid_token\"\\n}</pre>' +\n '<p>By design, no additional information is given as to the reason for the failure.</p>'\n }]\n },\n ],\n models: models\n };\n\n var batchDoc = {\n apiVersion: resourceDoc.apiVersion,\n swaggerVersion: resourceDoc.swaggerVersion,\n basePath: '',\n apis: [\n {\n path: convertPathFragments('/batch'),\n operations: [{\n httpMethod: \"POST\",\n nickname: \"batch\",\n responseClass: 'object',\n authorizations: {\n oauth2: [\n {\n description: 'Allow everything',\n scope: '*'\n }\n ]\n },\n parameters: [\n {\n paramType: 'body',\n name: 'data',\n description: 'Batch request object',\n dataType: 'object',\n required: true,\n allowMultiple: false,\n },\n ],\n errorResponses: [],\n summary: 'Batch request',\n notes: '<p>Batch requests add the ability for a client to send a single request ' +\n 'that represents many, have them all run, then return a single response.</p>' +\n '<p>Basic batch request will look like this:</p>' +\n '<pre>{\\n' +\n ' \"myRequest\": {\\n' +\n ' \"method\": \"GET\"\\n' +\n ' \"uri\": \"/api/users\"\\n' +\n ' }\\n' +\n '}</pre>' +\n '<p>Server will perform a GET request to a local endpoint called ' +\n '/api/users/ and will return the result that looks like the following:</p>' +\n '<pre>{\\n' +\n ' \"myRequest\": {\\n' +\n ' \"statusCode\": 200,\\n' +\n ' \"body\": ...,\\n' +\n ' \"headers\": {\\n' +\n ' \"x-powered-by\": \"LoopBack\",\\n' +\n ' \"content-type\": \"application/json\",\\n' +\n ' \"date\": \"Wed, 06 Nov 2013 21:33:18 GMT\",\\n' +\n ' \"connection\": \"close\",\\n' +\n ' \"transfer-encoding\": \"chunked\"\\n' +\n ' },\\n' +\n ' }\\n' +\n '}</pre>' +\n '<p>To add more than one request, just add more keys to the root level ' +\n 'JSON object, one per additional request:</p>' +\n '<pre>{\\n' +\n ' \"myRequest1\": ...,\\n' +\n ' \"myRequest2\": ...,\\n' +\n ' \"myRequest3\": ...\\n' +\n '}</pre>' +\n '<p>To send a request using a particular method (GET, DELETE, PATCH, POST, PUT) specify it with a key of <u>method</u>.</p>' +\n '<p>In order to do a POST (or PUT or PATCH) you’ll need to send along the data.</p>' +\n '<p>This is as simple as adding a key of <u>body</u> whose value is the data you’d like to POST.</p>' +\n '<p>To specify headers to send with a particular request, simply add a key of <u>headers</u> and an object with any headers to send along.</p>'\n }]\n },\n ],\n };\n\n classes.forEach(function (item) {\n resourceDoc.apis.push({\n path: '/' + name + item.http.path,\n description: item.ctor.sharedCtor && item.ctor.sharedCtor.description\n });\n\n apiDocs[item.name] = {\n apiVersion: resourceDoc.apiVersion,\n swaggerVersion: resourceDoc.swaggerVersion,\n basePath: resourceDoc.basePath,\n apis: [],\n models: models\n };\n\n helper.method(api, {\n path: item.name,\n http: { path: item.http.path },\n returns: { type: 'object', root: true }\n });\n function api(callback) {\n callback(null, apiDocs[item.name]);\n }\n addDynamicBasePathGetter(remotes, name + '.' + item.name, apiDocs[item.name]);\n });\n\n routes.forEach(function (route) {\n var split = route.method.split('.');\n var doc = apiDocs[split[0]];\n var classDef;\n\n if (!doc) {\n console.error('Route exists with no class: %j', route);\n return;\n }\n\n classDef = classes.filter(function (item) {\n return item.name === split[0];\n })[0];\n\n if (classDef && classDef.sharedCtor && classDef.sharedCtor.accepts && split.length > 2 /* HACK */) {\n route.accepts = (route.accepts || []).concat(classDef.sharedCtor.accepts);\n }\n\n doc.apis.push(routeToAPI(route, classDef.ctor.definition.name));\n });\n\n /**\n * The topmost Swagger resource is a description of all (non-Swagger) resources\n * available on the system, and where to find more information about them.\n */\n helper.method(resources, {\n returns: [{ type: 'object', root: true }]\n });\n function resources(callback) {\n callback(null, resourceDoc);\n }\n\n addDynamicBasePathGetter(remotes, name + '.resources', resourceDoc);\n\n helper.method(oauth, {\n returns: { type: 'object', root: true }\n });\n function oauth(callback) {\n callback(null, oauthDoc);\n }\n\n addDynamicBasePathGetter(remotes, name + '.oauth', oauthDoc);\n\n helper.method(batch, {\n returns: { type: 'object', root: true }\n });\n function batch(callback) {\n callback(null, batchDoc);\n }\n\n addDynamicBasePathGetter(remotes, name + '.batch', batchDoc);\n\n remotes.exports[name] = extension;\n return extension;\n}", "get endpoint() {\n\t\treturn this.__endpoint;\n\t}" ]
[ "0.6110735", "0.5859485", "0.5848763", "0.56770724", "0.5558211", "0.55102384", "0.5417477", "0.52908945", "0.5237259", "0.52311194", "0.52173626", "0.517776", "0.5167958", "0.51644236", "0.5094158", "0.5092385", "0.5081248", "0.5066106", "0.498042", "0.49226943", "0.49119768", "0.49079728", "0.4895421", "0.48838916", "0.48825625", "0.48492295", "0.48430285", "0.47998184", "0.47975418", "0.47845232", "0.4782297", "0.4739959", "0.47101596", "0.46677527", "0.4611621", "0.4608848", "0.46088034", "0.46059793", "0.45940757", "0.45940757", "0.45940757", "0.45876533", "0.45816562", "0.45608854", "0.45572376", "0.4549589", "0.45261425", "0.4523952", "0.45205343", "0.451609", "0.45155504", "0.45033622", "0.44896984", "0.4482091", "0.44577613", "0.44525805", "0.4450548", "0.44492325", "0.44468325", "0.4445799", "0.44312754", "0.44242308", "0.4418279", "0.4392258", "0.43915614", "0.4390336", "0.4390336", "0.43782607", "0.43657866", "0.43424806", "0.43424806", "0.43272692", "0.4325735", "0.43236366", "0.4318377", "0.431539", "0.4308867", "0.43055132", "0.42964134", "0.42884177", "0.42871526", "0.42782623", "0.42734987", "0.42650455", "0.42644665", "0.42459965", "0.42185682", "0.42130125", "0.4207103", "0.4206084", "0.41993442", "0.41983587", "0.41964126", "0.41949904", "0.4182846", "0.41826698", "0.41814604", "0.4178763", "0.41651353", "0.41609165" ]
0.630345
0
old interface: Schema_from_swagger_yaml(require('./wellknown.swagger.yaml')); Schema_from_swagger_yaml(yaml_file_content)
function Schema_from_swagger(schema_content) { 'use strict'; // use new this.resolve = (input_json_obj) => { //const schema = getSwaggerV2Schema(schema_content, '/default_endpoint') const schema = schema_content; const ok = schemaValidator(schema, input_json_obj); if (ok) { return input_json_obj; } else { throw new Error('mismatch: The constraint aspect of template failed'); } }; this.generate = (obj) => this.resolve(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) {\n\n let swaggerjson = swagger_filecontent;\n // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname);\n // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses', '200', 'schema']);\n // let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].schema;\n let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].content['application/json'].schema;\n return schema;\n}", "validate(input) {\r\n return new Promise((resolve, reject) => {\r\n SwaggerParser.validate(input+'.yaml').then((api) => {\r\n resolve(true);\r\n }).catch((err) => {\r\n \t\t console.log(err);\r\n resolve('You must provide an existing OpenAPI spec (yaml file in working directory) and the spec MUST be valid');\r\n });\r\n });\r\n }", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "_bundle (schema){\n return SwaggerParser.bundle(schema);\n }", "function readYml(file, fn) {\n\n var m;\n var api = {};\n var resource = yaml.safeLoad(fs.readFileSync(file, 'utf8'));\n var paths = Object.keys(resource.paths);\n _.each(paths, function(path) {\n if (options.apiPrefix && path.indexOf(options.apiPrefix) === 0){\n path = path.replace(options.apiPrefix, \"\");\n }\n api.resourcePath = path;\n api.description = resource.description || \"\";\n descriptor.paths[path] = resource.paths[path];\n\n // append definitions\n if (descriptor.definitions && Object.keys(descriptor.definitions).length) {\n m = _.merge(descriptor.definitions, resource.definitions);\n descriptor.definitions = m;\n } else {\n descriptor.definitions = resource.definitions;\n }\n });\n\n fn();\n}", "function yamlParse(input) {\n return jsYaml.load(input, { schema: schema });\n}", "validate (){\n const that = this;\n return this\n ._validate(this.swaggerInput)\n .then((dereferencedSchema) => {\n that.swaggerObject = dereferencedSchema;\n return that;\n });\n }", "function exportIodocs(src){\n var obj = clone(src,false);\n obj.swagger = '2.0';\n obj.info = {};\n obj.info.version = obj.version || '1';\n obj.info.title = obj.name;\n obj.info.description = obj.description;\n obj.paths = {};\n\n var u = url.parse(obj.basePath+obj.publicPath);\n obj.schemes = [];\n obj.schemes.push(u.protocol.replace(':',''));\n obj.host = u.host;\n obj.basePath = u.path;\n\n delete obj.version;\n delete obj.title;\n delete obj.description;\n delete obj.publicPath;\n delete obj.privatePath; // for oauth etc\n delete obj.protocol;\n delete obj.name;\n delete obj.auth; // TODO\n delete obj.oauth; // TODO\n delete obj.headers; // TODO\n rename(obj,'schemas','definitions');\n if (obj.definitions) fixSchema(obj.definitions);\n\n for (var r in obj.resources) {\n var resource = obj.resources[r];\n // do tags\n for (var m in resource.methods) {\n var method = resource.methods[m];\n method.path = fixPathParameters(method.path);\n\n if (!obj.paths[method.path]) obj.paths[method.path] = {};\n var path = obj.paths[method.path];\n\n var httpMethod = method.httpMethod.toLowerCase();\n if (!path[httpMethod]) path[httpMethod] = {};\n\n var op = path[httpMethod];\n op.operationId = m;\n op.description = method.description;\n op.parameters = [];\n\n for (var p in method.parameters) {\n var param = method.parameters[p];\n param.name = p;\n if (param.title) rename(param,'title','name');\n if ((param.type == 'textarea') || (param.type == 'enumerated')) param.type = 'string';\n if (param.type == 'long') param.type = 'number';\n if (param.type == 'string[]') {\n param.type = 'array';\n param.items = {};\n param.items.type = 'string';\n }\n rename(param,'location','in');\n if (!param[\"in\"]) {\n if (method.path.indexOf('{'+param.name+'}')>=0) {\n param[\"in\"] = 'path';\n }\n else {\n param[\"in\"] = 'query';\n }\n }\n if ((param[\"in\"] == 'body') && (param.type != 'object')) {\n param[\"in\"] = 'formData'; // revalidate\n }\n if (param[\"in\"] == 'pathReplace') {\n param[\"in\"] = 'path';\n }\n if (param[\"in\"] == 'path') {\n param.required = true;\n }\n if (typeof param.required == 'string') {\n param.required = (param.required === 'true');\n }\n if (param.properties) {\n delete param.type;\n param.schema = {};\n param.schema.type = 'object';\n param.schema.properties = param.properties;\n delete param.properties;\n delete param[\"default\"];\n fixSchema(param.schema);\n }\n if (param.items) fixSchema(param.items);\n op.parameters.push(param);\n }\n op.tags = [];\n op.tags.push(r);\n\n op.responses = {};\n op.responses[\"200\"] = {};\n op.responses[\"200\"].description = 'Success';\n\n }\n }\n\n delete obj.resources;\n return obj;\n}", "function validateYaml(filename, content) {\n if (!content.hasOwnProperty('name')) {\n console.error(`Missing 'name' in ${filename}`)\n }\n if (!content.hasOwnProperty('blip')) {\n console.error(`Missing 'blip' in ${filename}`)\n }\n if (!Array.isArray(content.blip)) {\n console.error(`'blip' is not an array in ${filename}`)\n }\n for (var blip of content.blip) {\n if (!blip.hasOwnProperty('version')) {\n console.error(`Missing 'blip[*].version' in ${filename}`)\n }\n if (!blip.hasOwnProperty('ring')) {\n console.error(`Missing 'blip[*].ring' in ${filename}`)\n }\n }\n if (!content.hasOwnProperty('description')) {\n console.error(`Missing 'description' in ${filename}`)\n }\n}", "defineSchema() {\n\n }", "function yamlparser(filep, field) {\n try {\n var src = fs.readFileSync(filep,'utf8')\n var doc = yaml.safeLoad(src)\n if (!doc[field]) {\n console.log('Error in ',field,' data:',doc)\n return null\n } else {\n const keyn = slugify(doc[field]).toLowerCase()\n return {\n [keyn]: doc\n }\n }\n }\n catch (e) {\n console.log('Cannot read', filep, \"\\n\", e)\n return null\n }\n}", "function SwaggerParser () {\n $RefParser.apply(this, arguments);\n}", "bundle (){\n const that = this;\n return this\n ._bundle(this.swaggerInput)\n .then((referencedSchema) => {\n that.swaggerObject = referencedSchema;\n return that;\n });\n }", "function load_schema (dirname, filename, cb) {\nvar fields = []\n ,\tmodelname = require(dirname + '/' + filename)\n , thech = modelname;\n\n\tthech=thech.schema.tree;\n\tfilename = filename.substr(0, filename.indexOf('.'));\n\n\tfor (key in thech)\n\t\tfields.push(key);\n\n\t// falls thru, unless rejig is set to all\n\twipeAdFields(appname, filename, function() {\n\t\taddFields(appname, filename, fields, 0, cb);\n\t});\n}", "schema() { }", "function processYAML(yamlFile) {\n try {\n console.log('convert Yaml file', yamlFile);\n // Get document, or throw exception on error\n var yamlObject = yaml.safeLoad(fs.readFileSync(yamlFile, 'utf8'));\n //console.log('yaml json string', JSON.stringify(yamlObject));\n console.log('processYAML', yamlObject);\n yamlObject.application.java.tomcat.components.forEach(function(e) {\n downloadFile(e.artifact, false)\n });\n } catch (e) {\n console.log(e);\n }\n}", "static get schema() {\n return {\n name: { type: 'string' },\n version: { type: 'string' },\n description: { type: 'string' },\n authors: { type: 'array' },\n }\n }", "function loadTestSchema() {\n return urlGetObject(resolveUri(schemaUri, baseSchemaUri));\n}", "static loadDocs() {\n try {\n HelpGenerator.docs = yaml.load(fs.readFileSync('./help.yaml', 'utf8'));\n } catch (e) {\n console.error(`[HelpGenerator] ${e}`);\n }\n }", "function readJSONSchema(schamaFilePath){\n return JSON.parse(fs.readFileSync(schamaFilePath, 'utf8'));;\n }", "loadFromFile(filename) {\n try {\n /* load using require as it can process both js and json */\n const data = requireUncached(filename);\n this.loadFromObject(data, filename);\n }\n catch (err) {\n if (err instanceof SchemaValidationError) {\n throw err;\n }\n throw new UserError(`Failed to load element metadata from \"${filename}\"`, err);\n }\n }", "get convertedSchema() {\n let schema = {\n $schema: \"http://json-schema.org/schema#\",\n title: this.label,\n type: \"object\",\n required: [],\n properties: this.fieldsToSchema(this.fields),\n };\n return schema;\n }", "getConfig() {\n try {\n let contents = fs.readFileSync(this.getFilePath(), 'utf8');\n return yaml.load(contents);\n }\n catch (err) {\n console.log(err.stack || String(err));\n }\n }", "function parseJsonSchema(schema) {\n // we use the presence of the double quoted string to differentiate JSON from YAML\n if (schema.indexOf('\"$schema\"') !== -1) {\n return JSON.parse(schema)\n } else {\n return yaml.safeLoad(schema)\n }\n}", "function run() {\n const filename = __dirname + path.sep + \"schema.json\";\n\n const schema = JSON.parse(fs.readFileSync(filename, \"utf8\"));\n\n const descriptions = {};\n for (const d in schema.definitions) {\n const description = schema.definitions[d].description;\n if (d.endsWith(\"Conf\") && description === undefined) {\n console.log(\"Missing jsdoc description: \" + d);\n process.exit(1);\n } else if (description !== undefined) {\n descriptions[d] = description;\n }\n }\n\n const rules = schema.definitions.IConfig.properties.rules.properties;\n for (const rule in rules) {\n const name = rules[rule].anyOf[0][\"$ref\"].split(\"/\")[2];\n rules[rule].description = descriptions[name];\n }\n\n fs.writeFileSync(filename, JSON.stringify(schema, null, 2));\n}", "function openSchemaFile()\r\n{\r\n jsonFileOpener.showOpenDialog();\r\n\r\n let fileContentString = jsonFileOpener.getJsonFileContentString();\r\n if (fileContentString) jsonEditorHandler.setJsonEditorSchemaString(fileContentString);\r\n}", "function load_schema(typename) {\n var filename = SCHEMAS_DIR + '/' + typename + '.schema.json';\n return readJSONFile(filename).then(function (data) {\n return { filename: data.filename, schema: data.obj };\n });\n }", "function convertToOpenAPI(info, data) {\n const builder = new openapi3_ts_1.OpenApiBuilder();\n builder.addInfo(Object.assign(Object.assign({}, info.base), { title: info.base.title || '[untitled]', version: info.base.version || '0.0.0' }));\n info.contact && builder.addContact(info.contact);\n const tags = [];\n const paths = {};\n let typeCount = 1;\n const schemas = {};\n data.forEach(item => {\n [].concat(item.url).forEach(url => {\n if (typeof url !== 'string') {\n // TODO\n return;\n }\n url = url\n .split('/')\n .map((item) => (item.startsWith(':') ? `{${item.substr(1)}}` : item))\n .join('/');\n if (!tags.find(t => t.name === item.typeGlobalName)) {\n const ctrlMeta = controller_1.getControllerMetadata(item.typeClass);\n tags.push({\n name: item.typeGlobalName,\n description: (ctrlMeta && [ctrlMeta.name, ctrlMeta.description].filter(s => s).join(' ')) ||\n undefined,\n });\n }\n if (!paths[url]) {\n paths[url] = {};\n }\n [].concat(item.method).forEach((method) => {\n method = method.toLowerCase();\n function paramFilter(p) {\n if (p.source === 'Any') {\n return ['post', 'put'].every(m => m !== method);\n }\n return p.source !== 'Body';\n }\n function convertValidateToSchema(validateType) {\n if (validateType === 'string') {\n return {\n type: 'string',\n };\n }\n if (validateType === 'int' || validateType === 'number') {\n return {\n type: 'number',\n };\n }\n if (validateType.type === 'object' && validateType.rule) {\n let properties = {};\n const required = [];\n Object.keys(validateType.rule).forEach(key => {\n const rule = validateType.rule[key];\n properties[key] = convertValidateToSchema(rule);\n if (rule.required !== false) {\n required.push(key);\n }\n });\n const typeName = `GenType_${typeCount++}`;\n builder.addSchema(typeName, {\n type: validateType.type,\n required: required,\n properties,\n });\n return {\n $ref: `#/components/schemas/${typeName}`,\n };\n }\n if (validateType.type === 'enum') {\n return {\n type: 'string',\n };\n }\n return {\n type: validateType.type,\n items: validateType.itemType\n ? validateType.itemType === 'object'\n ? convertValidateToSchema({ type: 'object', rule: validateType.rule })\n : { type: validateType.itemType }\n : undefined,\n enum: Array.isArray(validateType.values)\n ? validateType.values.map(v => convertValidateToSchema(v))\n : undefined,\n maximum: validateType.max,\n minimum: validateType.min,\n };\n }\n function getTypeSchema(p) {\n if (p.schema) {\n return p.schema;\n }\n else if (p.validateType && p.validateType.type) {\n return convertValidateToSchema(p.validateType);\n }\n else {\n const type = utils_1.getGlobalType(p.type);\n const isSimpleType = ['array', 'boolean', 'integer', 'number', 'object', 'string'].some(t => t === type.toLowerCase());\n // TODO complex type process\n return {\n type: isSimpleType ? type.toLowerCase() : 'object',\n items: type === 'Array'\n ? {\n type: 'object',\n }\n : undefined,\n };\n }\n }\n // add schema\n const components = item.schemas.components || {};\n Object.keys(components).forEach(typeName => {\n if (schemas[typeName] && schemas[typeName].hashCode !== components[typeName].hashCode) {\n console.warn(`[egg-controller] type: [${typeName}] has multi defined!`);\n return;\n }\n schemas[typeName] = components[typeName];\n });\n // param\n const inParam = item.paramTypes.filter(paramFilter);\n // req body\n const inBody = item.paramTypes.filter(p => !paramFilter(p));\n let requestBody;\n if (inBody.length) {\n const requestBodySchema = {\n type: 'object',\n properties: {},\n };\n inBody.forEach(p => {\n if (p.required || util_1.getValue(() => p.validateType.required)) {\n if (!requestBodySchema.required) {\n requestBodySchema.required = [];\n }\n requestBodySchema.required.push(p.paramName);\n }\n requestBodySchema.properties[p.paramName] = getTypeSchema(p);\n });\n const reqMediaType = 'application/json';\n requestBody = {\n content: {\n [reqMediaType]: {\n schema: requestBodySchema,\n },\n },\n };\n }\n // res\n let responseSchema = item.schemas.response || {};\n const refTypeName = responseSchema.$ref;\n if (refTypeName) {\n const definition = item.schemas.components[refTypeName.replace('#/components/schemas/', '')];\n if (definition) {\n responseSchema = { $ref: refTypeName };\n }\n else {\n console.warn(`[egg-controller] NotFound {${refTypeName}} in components.`);\n responseSchema = { type: 'any' };\n }\n }\n const responses = {\n default: {\n description: 'default',\n content: {\n 'application/json': {\n schema: responseSchema,\n },\n },\n },\n };\n paths[url][method] = {\n operationId: item.functionName,\n tags: [item.typeGlobalName],\n summary: item.name,\n description: item.description,\n parameters: inParam.length\n ? inParam.map(p => {\n const source = p.source === 'Header' ? 'header' : p.source === 'Param' ? 'path' : 'query';\n return {\n name: p.paramName,\n in: source,\n required: source === 'path' || p.required || util_1.getValue(() => p.validateType.required),\n schema: getTypeSchema(p),\n };\n })\n : undefined,\n requestBody,\n responses,\n };\n });\n });\n });\n // add schema\n Object.keys(schemas).forEach(key => {\n delete schemas[key].hashCode;\n builder.addSchema(key, schemas[key]);\n });\n tags.forEach(tag => builder.addTag(tag));\n Object.keys(paths).forEach(path => builder.addPath(path, paths[path]));\n return JSON.parse(builder.getSpecAsJson());\n}", "loadConfig() {\n // TODO: Make Private\n const configPath = path.join(__dirname, '../config.yml');\n return yaml.safeLoad(fs.readFileSync(configPath));\n }", "parseJSONSchema(json) {\n let type = json[\"@type\"];\n let i = type.indexOf(\"://\");\n if (i > 0)\n type = type.substring(i + 3);\n i = type.indexOf(\"#\");\n if (i > 0)\n type = type.substring(0, i);\n switch (type) {\n case \"action-descriptor\":\n case \"https://\":\n return new ActionDescriptor(json);\n case \"realm-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n case \"controller-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n }\n throw new Error(\"unknown schema type: \" + type);\n }", "getReferenceDataSchemas() {\n let app = this.environment.app;\n var fileUrl = app.referenceDataJsonSchema;\n return new Promise((resolve, reject) => {\n fs.readFile(fileUrl, 'utf8', function (err, data) {\n if (err) {\n console.error(\"[JsonSchemasAppService] getReferenceDataSchemas - Error: \", err);\n return reject(err);\n }\n var contractJson = JSON.parse(data);\n let definitions = contractJson['definitions'];\n \n let allSchemas =[];\n let baseProperties = definitions['ReferenceDataMaintenanceDto']['properties'];\n for (let p in definitions) {\n if (p != \"ReferenceDataMaintenanceDto\") {\n let obj = definitions[p];\n let typeName = obj[\"x-discriminator-value\"];\n if (typeName) {\n //we only add items that can be loaded from the api\n let typeProperties = obj[\"allOf\"][1][\"properties\"];\n let jsonSchema = Object.assign({}, baseProperties);\n Object.assign(jsonSchema, typeProperties);\n allSchemas.push({\n name:typeName,\n schema:jsonSchema\n });\n }\n }\n }\n \n return resolve(allSchemas);\n });\n\n });\n }", "setSchema(version, options = {}) {\n if (typeof version === 'number')\n version = String(version);\n let opt;\n switch (version) {\n case '1.1':\n if (this.directives)\n this.directives.yaml.version = '1.1';\n else\n this.directives = new Directives({ version: '1.1' });\n opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };\n break;\n case '1.2':\n case 'next':\n if (this.directives)\n this.directives.yaml.version = version;\n else\n this.directives = new Directives({ version });\n opt = { merge: false, resolveKnownTags: true, schema: 'core' };\n break;\n case null:\n if (this.directives)\n delete this.directives;\n opt = null;\n break;\n default: {\n const sv = JSON.stringify(version);\n throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n }\n }\n // Not using `instanceof Schema` to allow for duck typing\n if (options.schema instanceof Object)\n this.schema = options.schema;\n else if (opt)\n this.schema = new Schema(Object.assign(opt, options));\n else\n throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n }", "function _initializeSwagger(callback) {\n var spec = fs.readFileSync('./src/api/config/swagger.yaml', 'utf8');\n var swaggerDoc = jsyaml.safeLoad(spec);\n\n swaggerDoc.host = config.api.host;\n\n // Initialize the Swagger middleware\n swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {\n\n // Enabling CORS\n app.use(function(req, res, next) {\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n res.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\n next();\n });\n\n // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain\n app.use(middleware.swaggerMetadata());\n\n // Validate Swagger requests\n app.use(middleware.swaggerValidator());\n\n // Route validated requests to appropriate controller\n app.use(middleware.swaggerRouter(options));\n\n // Serve the Swagger documents and Swagger UI\n app.use(middleware.swaggerUi());\n\n // Start the server\n server = http.createServer(app);\n server.listen(config.api.port, function () {\n console.log('Your server is listening on port %d (http://localhost:%d)', config.api.port, config.api.port);\n console.log('Swagger-ui is available on http://localhost:%d/docs', config.api.port);\n\n if (callback) {\n callback();\n }\n });\n });\n}", "static get schema() {\n return {};\n }", "function gatherSchemas() {\n LOGGER.info('loading command schemas..');\n\n const schemaMap = {};\n const schemaFiles = glob.sync(path.resolve(__dirname, '../resources/validationSchemas/**/*.json'));\n\n LOGGER.info(`got ${schemaFiles.length} schema files...`);\n\n schemaFiles.map(schemaFile => {\n const schemaFileContent = fs.readFileSync(schemaFile, 'utf-8');\n const schemaName = path.basename(schemaFile, '.json');\n schemaMap[schemaName] = parseSchemaFile(schemaFileContent, schemaFile);\n });\n\n // add the default command schema, which is referenced from all others ($ref)\n tv4.addSchema(schemaMap.command);\n\n return schemaMap;\n}", "function YAMLParser(data) {\n return yaml.safeLoad(data, 'utf8');\n}", "function parseSchema(name, schema) {\n var name = name.replace('.json', '');\n\n if (name === 'manifest') {\n manifest = schema;\n return;\n }\n\n if (schema.hasOwnProperty('endpoint')) {\n var res = /\\.(post|put|delete|get)/g.exec(name);\n\n if (res && !schema.hasOwnProperty('http_method')) {\n schema.http_method = res[1].toUpperCase();\n }\n\n var root = /([a-z0-9\\-_]+)/i.exec(schema.endpoint);\n root = root[0];\n\n if (!endpoints.hasOwnProperty(root)) {\n endpoints[root] = {};\n }\n\n var uid_name = schema.http_method.toUpperCase()+' '+schema.endpoint;\n endpoints[root][uid_name] = schema;\n endpoint_map[uid_name] = schema;\n } else {\n \n }\n }", "function loadTestSchema() {\n return eUtil.urlGetObject(eUtil.resolveUri(schemaUri, baseSchemaUri));\n}", "function convertSwagger(source){\n var apiInfo = clone(source,false);\n apiInfo.resources = {};\n\n\tif (apiInfo.servers && apiInfo.servers.length) {\n\t\tvar u = url.parse(apiInfo.servers[0].url);\n\t\tapiInfo.host = u.host;\n\t\tapiInfo.basePath = u.path;\n\t\tapiInfo.schemes = [];\n\t\tapiInfo.schemes.push(u.protocol.replace(':',''));\n\t}\n\n for (var p in apiInfo.paths) {\n for (var m in apiInfo.paths[p]) {\n if ('.get.post.put.delete.head.patch.options.trace.'.indexOf(m)>=0) {\n var sMethod = apiInfo.paths[p][m];\n var ioMethod = {};\n ioMethod.httpMethod = m.toUpperCase();\n var sMethodUniqueName = sMethod.operationId ? sMethod.operationId : m+'_'+p.split('/').join('_');\n sMethodUniqueName = sMethodUniqueName.split(' ').join('_'); // TODO {, } and : ?\n ioMethod.name = sMethodUniqueName;\n ioMethod.summary = sMethod.summary;\n ioMethod.description = sMethod.description;\n ioMethod.parameters = {};\n var sParams = sMethod.parameters ? sMethod.parameters : [];\n if (apiInfo.paths[p].parameters) {\n sParams = sParams.concat(apiInfo.paths[p].parameters);\n }\n for (var p2 in sParams) {\n var param = sParams[p2];\n var ptr = param[\"$ref\"];\n if (ptr && ptr.startsWith('#/parameters/')) {\n ptr = ptr.replace('#/parameters/','');\n param = clone(apiInfo.parameters[ptr],false);\n }\n if (ptr && ptr.startsWith('#/components/parameters/')) {\n ptr = ptr.replace('#/components/parameters/','');\n param = clone(apiInfo.components.parameters[ptr],false);\n }\n param.location = param[\"in\"];\n delete param[\"in\"];\n\t\t\t\t\tif (!param.type && param.schema && param.schema.type) {\n\t\t\t\t\t\tparam.type = param.schema.type;\n\t\t\t\t\t}\n ioMethod.parameters[param.name] = param;\n }\n ioMethod.path = p;\n ioMethod.responses = sMethod.responses;\n var tagName = 'Default';\n if (sMethod.tags && sMethod.tags.length>0) {\n tagName = sMethod.tags[0];\n }\n if (!apiInfo.resources[tagName]) {\n apiInfo.resources[tagName] = {};\n if (apiInfo.tags) {\n for (var t in apiInfo.tags) {\n var tag = apiInfo.tags[t];\n if (tag.name == tagName) {\n apiInfo.resources[tagName].description = tag.description;\n apiInfo.resources[tagName].externalDocs = tag.externalDocs;\n }\n }\n }\n }\n if (!apiInfo.resources[tagName].methods) apiInfo.resources[tagName].methods = {};\n apiInfo.resources[tagName].methods[sMethodUniqueName] = ioMethod;\n }\n }\n }\n delete apiInfo.paths; // to keep size down\n if (apiInfo.definitions) rename(apiInfo,'definitions','schemas');\n if (apiInfo.components && apiInfo.components.schemas) rename(apiInfo,'components.schemas','schemas');\n return apiInfo;\n}", "function connect(schema) {\n _opts.url = schema + '.json';\n let _schema = {};\n _modelsPath = schema.replace('/_schemas', '/db/');\n\n if (h.isValidPath(schema + '.json')) {\n _schema.url = schema + '.json';\n _schema.content = require(_schema.url);\n _self._schema = _schema;\n if (_schema.content) {\n _self = loadCollections(_schema.content, _self);\n }\n\n return _self;\n } else {\n throw new Error(`The schema url:\n [${_opts.url}]\ndoes not seem to be valid. Recheck the path and try again`);\n }\n}", "createSchema() {\n this.schema = this.extensionManager.schema;\n }", "compileSchema(fullPath, fileSchema, commonSchemas) {\n const file = path.join(fullPath, fileSchema);\n const schema = openFile(file, 'schema');\n const ajv = new Ajv(conf.ajvOptions);\n\n addSchemas(commonSchemas, ajv, 'schema');\n let validate;\n try {\n validate = ajv.compile(schema);\n /* istanbul ignore else */\n if (typeof validate === 'function') {\n debug('*compileSchema* - valid schema ' + file + ' :' + validate);\n msg.addValidSchema(fullPath, 'Schema ' + file + ' is valid');\n } else {\n debug('*compileSchema* - invalid schema ' + file + ' :' + validate);\n msg.addError(\n fullPath,\n 'Schema ' + file + ' failed to compile to a function'\n );\n if (conf.failErrors) {\n throw new Error(validate.errors);\n }\n }\n } catch (err) {\n msg.addError(\n fullPath,\n 'Schema ' +\n file +\n ' is invalid, ' +\n 'if one or more schemas cannot be retrieved, ' +\n 'try using remote validation (dmv:resolveRemoteSchemas=true), ' +\n 'check if \"dmv:loadModelCommonSchemas\" is enabled ' +\n ' (if missing schemas are FIWARE common schemas) ' +\n 'or store third party schemas in the \"externalSchema\" folder: ' +\n err.message\n );\n if (conf.failErrors) {\n throw new Error(err.message);\n }\n }\n return validate;\n }", "function readLocalSchema(schemaPath) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Fetch local schema\n\t\treadFile(schemaPath, 'utf8', (err, data) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// Resolve with schema built from file data\n\t\t\t\tresolve(buildSchema(data));\n\t\t\t}\n\t\t});\n\t});\n}", "function resetNoteSchema(){\n // this is a GET function; the file path should stay like this unless a different name is used\n fs.readFile('./storage/schema/notes.json', 'utf-8', (err, jsonString) => {\n noteSchemaTest = JSON.parse(jsonString);\n });\n}", "getElementsSchema(filename) {\n const config = this.getConfigFor(filename !== null && filename !== void 0 ? filename : \"inline\");\n const metaTable = config.getMetaTable();\n return metaTable.getJSONSchema();\n }", "function initialize() {\n let configFile = 'contentful-settings.yaml';\n // check if configFile exist and throw error if it doesn't\n if (fs.existsSync(configFile)) {\n console.log(\n `\\n-------------------------------------\\n Pulling Data from Contentful...\\n-------------------------------------\\n`\n );\n try {\n let config = yaml.safeLoad(\n fs.readFileSync('contentful-settings.yaml')\n );\n // loop through repeatable content types\n let types = config.repeatableTypes;\n if (types) {\n totalContentTypes += types.length;\n for (let i = 0; i < types.length; i++) {\n // object to pass settings into the function\n let contentSettings = {\n typeId: types[i].id,\n directory: types[i].directory,\n isHeadless: types[i].isHeadless,\n fileExtension: types[i].fileExtension,\n titleField: types[i].title,\n dateField: types[i].dateField,\n mainContent: types[i].mainContent,\n type: types[i].type\n };\n // check file extension settings\n switch (contentSettings.fileExtension) {\n case 'md':\n case 'yaml':\n case 'yml':\n case undefined:\n case null:\n getContentType(1000, 0, contentSettings);\n break;\n default:\n console.log(\n `ERROR: file extension \"${contentSettings.fileExtension}\" not supported`\n );\n break;\n }\n }\n }\n // loop through single content types\n let singles = config.singleTypes;\n if (singles) {\n totalContentTypes += singles.length;\n for (let i = 0; i < singles.length; i++) {\n let single = singles[i];\n let contentSettings = {\n typeId: single.id,\n directory: single.directory,\n fileExtension: single.fileExtension,\n fileName: single.fileName,\n titleField: single.title,\n dateField: single.dateField,\n mainContent: single.mainContent,\n isSingle: true,\n type: single.type\n };\n switch (contentSettings.fileExtension) {\n case 'md':\n case 'yaml':\n case 'yml':\n case null:\n case undefined:\n getContentType(1, 0, contentSettings);\n break;\n default:\n console.log(\n `ERROR: file extension \"${contentSettings.fileExtension}\" not supported`\n );\n break;\n }\n }\n }\n } catch (e) {\n console.log(e);\n }\n } else {\n console.log(\n `\\nConfiguration file not found. Create a file called \"contentful-settings.yaml\" to get started.\\nVisit https://github.com/ModiiMedia/contentful-hugo for configuration instructions\\n`\n );\n }\n}", "setupSchema() {\n\t\tfor (const type in this.Definition) {\n\t\t\tif (this.Definition.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.Definition[type];\n\t\t\t\tthis.Schema[type] = oas.compile(typeDef);\n\t\t\t}\n\t\t}\n\t\tfor (const type in this.precompiled) {\n\t\t\tif (this.precompiled.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.precompiled[type];\n\t\t\t\tthis.Schema[type] = typeDef;\n\t\t\t}\n\t\t}\n\t}", "function gatherSchemas() {\n LOGGER.info('loading command schemas..');\n\n var schemaMap = {};\n var schemaFiles = _glob2.default.sync(_path2.default.resolve(__dirname, '../resources/validationSchemas/**/*.json'));\n\n LOGGER.info('got ' + schemaFiles.length + ' schema files...');\n\n schemaFiles.map(function (schemaFile) {\n var schemaFileContent = _fs2.default.readFileSync(schemaFile, 'utf-8');\n var schemaName = _path2.default.basename(schemaFile, '.json');\n schemaMap[schemaName] = parseSchemaFile(schemaFileContent, schemaFile);\n });\n\n // add the default command schema, which is referenced from all others ($ref)\n _tv2.default.addSchema(schemaMap.command);\n\n return schemaMap;\n}", "setSchema(version, options = {}) {\n if (typeof version === 'number')\n version = String(version);\n let opt;\n switch (version) {\n case '1.1':\n if (this.directives)\n this.directives.yaml.version = '1.1';\n else\n this.directives = new directives.Directives({ version: '1.1' });\n opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };\n break;\n case '1.2':\n case 'next':\n if (this.directives)\n this.directives.yaml.version = version;\n else\n this.directives = new directives.Directives({ version });\n opt = { merge: false, resolveKnownTags: true, schema: 'core' };\n break;\n case null:\n if (this.directives)\n delete this.directives;\n opt = null;\n break;\n default: {\n const sv = JSON.stringify(version);\n throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n }\n }\n // Not using `instanceof Schema` to allow for duck typing\n if (options.schema instanceof Object)\n this.schema = options.schema;\n else if (opt)\n this.schema = new Schema.Schema(Object.assign(opt, options));\n else\n throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n }", "function read(str) {\n var schema;\n if (typeof str == 'string' && ~str.indexOf(path.sep) && files.existsSync(str)) {\n // Try interpreting `str` as path to a file contain a JSON schema or an IDL\n // protocol. Note that we add the second check to skip primitive references\n // (e.g. `\"int\"`, the most common use-case for `avro.parse`).\n var contents = files.readFileSync(str, {encoding: 'utf8'});\n try {\n return JSON.parse(contents);\n } catch (err) {\n var opts = {importHook: files.createSyncImportHook()};\n assembleProtocol(str, opts, function (err, protocolSchema) {\n schema = err ? contents : protocolSchema;\n });\n }\n } else {\n schema = str;\n }\n if (typeof schema != 'string' || schema === 'null') {\n // This last predicate is to allow `read('null')` to work similarly to\n // `read('int')` and other primitives (null needs to be handled separately\n // since it is also a valid JSON identifier).\n return schema;\n }\n try {\n return JSON.parse(schema);\n } catch (err) {\n try {\n return Reader.readProtocol(schema);\n } catch (err) {\n try {\n return Reader.readSchema(schema);\n } catch (err) {\n return schema;\n }\n }\n }\n}", "async function createOrUpdateSchema() {\n const subscriptionId =\n process.env[\"LOGIC_SUBSCRIPTION_ID\"] || \"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345\";\n const resourceGroupName = process.env[\"LOGIC_RESOURCE_GROUP\"] || \"testResourceGroup\";\n const integrationAccountName = \"testIntegrationAccount\";\n const schemaName = \"testSchema\";\n const schema = {\n content:\n '<?xml version=\"1.0\" encoding=\"utf-16\"?>\\r\\n<xs:schema xmlns:b=\"http://schemas.microsoft.com/BizTalk/2003\" xmlns=\"http://Inbound_EDI.OrderFile\" targetNamespace=\"http://Inbound_EDI.OrderFile\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:schemaInfo default_pad_char=\" \" count_positions_by_byte=\"false\" parser_optimization=\"speed\" lookahead_depth=\"3\" suppress_empty_nodes=\"false\" generate_empty_nodes=\"true\" allow_early_termination=\"false\" early_terminate_optional_fields=\"false\" allow_message_breakup_of_infix_root=\"false\" compile_parse_tables=\"false\" standard=\"Flat File\" root_reference=\"OrderFile\" />\\r\\n <schemaEditorExtension:schemaInfo namespaceAlias=\"b\" extensionClass=\"Microsoft.BizTalk.FlatFileExtension.FlatFileExtension\" standardName=\"Flat File\" xmlns:schemaEditorExtension=\"http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:element name=\"OrderFile\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:recordInfo structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" sequence_number=\"1\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:complexType>\\r\\n <xs:sequence>\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:groupInfo sequence_number=\"0\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:element name=\"Order\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:recordInfo sequence_number=\"1\" structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" child_delimiter_type=\"hex\" child_delimiter=\"0x0D 0x0A\" child_order=\"infix\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:complexType>\\r\\n <xs:sequence>\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:groupInfo sequence_number=\"0\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:element name=\"Header\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:recordInfo sequence_number=\"1\" structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" child_delimiter_type=\"char\" child_delimiter=\"|\" child_order=\"infix\" tag_name=\"HDR|\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:complexType>\\r\\n <xs:sequence>\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:groupInfo sequence_number=\"0\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:element name=\"PODate\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"1\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"PONumber\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo justification=\"left\" sequence_number=\"2\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"CustomerID\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"3\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"CustomerContactName\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"4\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"CustomerContactPhone\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"5\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n </xs:sequence>\\r\\n </xs:complexType>\\r\\n </xs:element>\\r\\n <xs:element minOccurs=\"1\" maxOccurs=\"unbounded\" name=\"LineItems\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:recordInfo sequence_number=\"2\" structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" child_delimiter_type=\"char\" child_delimiter=\"|\" child_order=\"infix\" tag_name=\"DTL|\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:complexType>\\r\\n <xs:sequence>\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:groupInfo sequence_number=\"0\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n <xs:element name=\"PONumber\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"1\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"ItemOrdered\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"2\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"Quantity\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"3\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"UOM\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"4\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"Price\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"5\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"ExtendedPrice\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"6\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n <xs:element name=\"Description\" type=\"xs:string\">\\r\\n <xs:annotation>\\r\\n <xs:appinfo>\\r\\n <b:fieldInfo sequence_number=\"7\" justification=\"left\" />\\r\\n </xs:appinfo>\\r\\n </xs:annotation>\\r\\n </xs:element>\\r\\n </xs:sequence>\\r\\n </xs:complexType>\\r\\n </xs:element>\\r\\n </xs:sequence>\\r\\n </xs:complexType>\\r\\n </xs:element>\\r\\n </xs:sequence>\\r\\n </xs:complexType>\\r\\n </xs:element>\\r\\n</xs:schema>',\n contentType: \"application/xml\",\n location: \"westus\",\n metadata: {},\n schemaType: \"Xml\",\n tags: { integrationAccountSchemaName: \"IntegrationAccountSchema8120\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new LogicManagementClient(credential, subscriptionId);\n const result = await client.integrationAccountSchemas.createOrUpdate(\n resourceGroupName,\n integrationAccountName,\n schemaName,\n schema\n );\n console.log(result);\n}", "function readInputConfigFileReturnJSON(file) {\n 'use strict';\n let yamlConfig = fs.readFileSync(file).toString();\n return yaml.safeLoad(yamlConfig);\n}", "function yamllistparser(filep, field) {\n try {\n var src = fs.readFileSync(filep,'utf8')\n var doc = yaml.safeLoad(src)\n var keyn\n var items = {}\n doc.forEach( n => {\n if (!n[field]) {\n console.log('Error in ',field,' data:',n)\n } else {\n keyn = slugify(n[field]).toLowerCase()\n items[keyn] = n\n }\n })\n return items\n }\n catch (e) {\n console.log('Cannot read', filep, \"\\n\", e)\n return null\n }\n}", "function yamlConfig() {\n var Parser = this.Parser\n var Compiler = this.Compiler\n var parser = Parser && Parser.prototype.blockTokenizers\n var compiler = Compiler && Compiler.prototype.visitors\n\n if (parser && parser.yamlFrontMatter) {\n parser.yamlFrontMatter = factory(parser.yamlFrontMatter)\n }\n\n if (compiler && compiler.yaml) {\n compiler.yaml = factory(compiler.yaml)\n }\n}", "function loadYaml (filename) {\n const file = findFile(`${filename}.yml`)\n return file ? YAML.parse(fs.readFileSync(file, 'utf8')) : {}\n }", "function resetShowSchema(){\n // this is a GET function; the file path should stay like this unless a different name is used\n fs.readFile('./storage/schema/show.json', 'utf-8', (err, jsonString) => {\n jsonSchemaTest = jsonString;\n });\n}", "function GetSchema()\r\n {\r\n try \r\n {\r\n var SchemaFile=FileSystem.OpenTextFile(GetCurrentFolder()+'Schema.json');\n var Schema=SchemaFile.ReadAll().replace(/export default /,'');\n SchemaFile.Close();\n return this.JSON.parse(Schema);\n }\r\n catch (e)\r\n {\r\n Log('GetSchema failed: '+e.name);\r\n }\r\n return;\r\n }", "_parseFrom(schema) {\n const parsed = {};\n Object.entries(schema.properties).forEach(([pName, prop]) => {\n let p = prop;\n let name = pName;\n if (typeof p === 'string') {\n p = {\n type: p\n };\n }\n if (name === 'id')\n name = '_id';\n parsed[name] = p;\n if (p.type instanceof Array) {\n parsed[name].type = mongoose_1.default.Schema.Types.Mixed;\n }\n else {\n switch (p.type) {\n case 'email':\n parsed[name].type = String;\n break;\n case 'uuid':\n parsed[name].type = String;\n parsed[name].default = () => v4_1.default();\n break;\n }\n }\n if (p.unique) {\n parsed[name].index = {\n unique: true\n };\n }\n });\n parsed.createdAt = { type: Date, required: true, default: Date.now };\n parsed.updatedAt = Date;\n parsed.deletedAt = Date;\n return parsed;\n }", "function loadDocumentSync(file) {\n return YAML.load(file);\n}", "addValidationSchema(schema) {\n const validationMetadatas = new _validation_schema_ValidationSchemaToMetadataTransformer__WEBPACK_IMPORTED_MODULE_0__[\"ValidationSchemaToMetadataTransformer\"]().transform(schema);\n validationMetadatas.forEach(validationMetadata => this.addValidationMetadata(validationMetadata));\n }", "cleanYaml(yaml, mode = 'edit') {\n try {\n const obj = jsyaml.load(yaml);\n\n if (mode !== 'edit') {\n this.$dispatch(`cleanForNew`, obj);\n }\n\n if (obj._type) {\n obj.type = obj._type;\n delete obj._type;\n }\n const out = jsyaml.dump(obj, { skipInvalid: true });\n\n return out;\n } catch (e) {\n return null;\n }\n }", "function buildSchema(source, options) {\n var document = Object(_language_parser_mjs__WEBPACK_IMPORTED_MODULE_2__[\"parse\"])(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}", "function buildSchema(source, options) {\n var document = Object(_language_parser_mjs__WEBPACK_IMPORTED_MODULE_2__[\"parse\"])(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}", "function parseSchema(subschema, out, fullPath) {\r\n subschema.eachPath(function (pathString, pathO) {\r\n\r\n var include = excludedPaths.indexOf(pathString) === -1;\r\n if (include && opt.includes != '*')\r\n include = includedPaths.indexOf(pathString) !== -1;\r\n\r\n if (include) {\r\n var type = getType(pathString, pathO.constructor.name);\r\n var defaultValue = false;\r\n //if( self.isInit(pathString) )\r\n defaultValue = self.get(pathString);\r\n\r\n function iterate(path, obj) {\r\n if (matches = path.match(/([^.]+)\\.(.*)/)) {\r\n var key = matches[1];\r\n if (!obj[key]) {\r\n // Humanize object title\r\n var sentenceCased = changeCase.sentenceCase(key);\r\n var titleCased = changeCase.titleCase(sentenceCased);\r\n obj[key] = {type: 'object', title: titleCased, properties: {}}\r\n }\r\n iterate(matches[2], obj[key].properties);\r\n } else {\r\n if (['string', 'date', 'boolean', 'number', 'object', 'image', 'gallery', 'geojson'].indexOf(type.type) >= 0) {\r\n obj[path] = {};\r\n if (_.isFunction(pathO.options.default)) {\r\n type.default = pathO.options.default();\r\n }\r\n if (defaultValue && opt.setDefaults) {\r\n pathO.options.default = defaultValue;\r\n if (type.type == 'date') {\r\n pathO.options.default = pathO.options.default.toISOString();\r\n }\r\n }\r\n // TODO: Check if fullpath is undefined. If it is, attach it to options\r\n if (fullPath) {\r\n pathO.arraypath = fullPath + '.' + pathString;\r\n }\r\n addCustomOptions(pathO);\r\n _.extend(obj[path], convertTypeOptions(type.type, pathO.options), type);\r\n } else if (type.type == 'array') {\r\n obj[path] = type;\r\n // Humanize array title\r\n var sentenceCased = changeCase.sentenceCase(path);\r\n var titleCased = changeCase.titleCase(sentenceCased);\r\n obj[path].title = titleCased;\r\n if (type.items.type == 'object') {\r\n // TODO: Pass to the the parseSchema the current path\r\n parseSchema(pathO.schema, obj[path].items.properties, pathO.path);\r\n } else {\r\n type = getType(pathString, pathO.caster.instance);\r\n\r\n if (_.isFunction(pathO.options.default)) {\r\n type.default = pathO.options.default();\r\n }\r\n if (defaultValue && opt.setDefaults) {\r\n pathO.options.default = defaultValue;\r\n if (type.type == 'date') {\r\n pathO.options.default = pathO.options.default.toISOString();\r\n }\r\n }\r\n _.extend(obj[path].items, convertTypeOptions(type.type, pathO.options.type[0]), type);\r\n\r\n }\r\n } else {\r\n console.log('unsupported type: ' + type.type);\r\n }\r\n }\r\n }\r\n\r\n iterate(pathString, out);\r\n }\r\n });\r\n }", "static readFromPath(filePath, base, encoding='utf8') {\n return new DocumentationFile({\n path: filePath,\n base,\n encoding,\n stat: fs.lstatSync(filePath),\n contents: fs.readFileSync(filePath),\n });\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "static _getRawSchema () {\n let schema = this.schema\n return schema\n }", "static boot ({ schema }) {\n\n }", "function readSchema() {\n let schemaJson;\n let schemaXSD;\n let contFiles = 0;\n return new Promise((res, rej) => {\n fs.readdir(URLjxschema, (errReadFolder, filesNames) => {\n if (!errReadFolder)\n filesNames.forEach((fileName) => {\n fs.readFile(\n path.join(URLjxschema, fileName),\n \"utf8\",\n (errReadFile, file) => {\n if (!errReadFile) {\n if (path.extname(fileName) == \".json\") {\n schemaJson = JSON.parse(file);\n }\n if (path.extname(fileName) == \".xsd\") {\n schemaXSD = path.join(URLjxschema, fileName);\n }\n }\n contFiles++; //else console.log(errReadFile);\n if (filesNames.length == contFiles) {\n //console.log([schemaJson, schemaXSD]);\n res([schemaJson, schemaXSD]);\n }\n }\n );\n });\n });\n });\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor){this.rules=null;this._messages=__WEBPACK_IMPORTED_MODULE_4__messages__[\"a\"/* messages */];this.define(descriptor);}", "function extendSchema(schema, documentAST, options) {\n Object(_type_schema__WEBPACK_IMPORTED_MODULE_8__[\"assertSchema\"])(schema);\n !(documentAST && documentAST.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].DOCUMENT) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n Object(_validation_validate__WEBPACK_IMPORTED_MODULE_7__[\"assertValidSDLExtension\"])(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefs = [];\n var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefs = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExts = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var def = _step.value;\n\n if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].SCHEMA_EXTENSION) {\n schemaExts.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[\"isTypeDefinitionNode\"])(def)) {\n typeDefs.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[\"isTypeExtensionNode\"])(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExts = typeExtsMap[extendedTypeName];\n typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def];\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) {\n return schema;\n }\n\n var schemaConfig = schema.toConfig();\n var astBuilder = new _buildASTSchema__WEBPACK_IMPORTED_MODULE_6__[\"ASTDefinitionBuilder\"](options, function (typeName) {\n var type = typeMap[typeName];\n !type ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, \"Unknown type: \\\"\".concat(typeName, \"\\\".\")) : void 0;\n return type;\n });\n var typeMap = Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(typeDefs, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildType(node);\n });\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = schemaConfig.types[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var existingType = _step2.value;\n typeMap[existingType.name] = extendNamedType(existingType);\n } // Get the extended root operation types.\n\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var operationTypes = {\n query: schemaConfig.query && schemaConfig.query.name,\n mutation: schemaConfig.mutation && schemaConfig.mutation.name,\n subscription: schemaConfig.subscription && schemaConfig.subscription.name\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = schemaDef.operationTypes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _ref2 = _step3.value;\n var operation = _ref2.operation;\n var type = _ref2.type;\n operationTypes[operation] = type.name.value;\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n var _arr = schemaExts;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var schemaExt = _arr[_i];\n\n if (schemaExt.operationTypes) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = schemaExt.operationTypes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var _ref4 = _step4.value;\n var _operation = _ref4.operation;\n var _type = _ref4.type;\n operationTypes[_operation] = _type.name.value;\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n } // Support both original legacy names and extended legacy names.\n\n\n var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n return new _type_schema__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLSchema\"]({\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n query: getMaybeTypeByName(operationTypes.query),\n mutation: getMaybeTypeByName(operationTypes.mutation),\n subscription: getMaybeTypeByName(operationTypes.subscription),\n types: Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeMap),\n directives: getMergedDirectives(),\n astNode: schemaDef || schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts),\n allowedLegacyNames: allowedLegacyNames\n }); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isListType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLList\"](replaceType(type.ofType));\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isNonNullType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n return typeMap[type.name];\n }\n\n function getMaybeTypeByName(typeName) {\n return typeName ? typeMap[typeName] : null;\n }\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefs.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendNamedType(type) {\n if (Object(_type_introspection__WEBPACK_IMPORTED_MODULE_9__[\"isIntrospectionType\"])(type) || Object(_type_scalars__WEBPACK_IMPORTED_MODULE_10__[\"isSpecifiedScalarType\"])(type)) {\n // Builtin types are not extended.\n return type;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isScalarType\"])(type)) {\n return extendScalarType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isObjectType\"])(type)) {\n return extendObjectType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(type)) {\n return extendInterfaceType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isUnionType\"])(type)) {\n return extendUnionType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isEnumType\"])(type)) {\n return extendEnumType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isInputObjectType\"])(type)) {\n return extendInputObjectType(type);\n } // Not reachable. All possible types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n }\n\n function extendDirective(directive) {\n var config = directive.toConfig();\n return new _type_directives__WEBPACK_IMPORTED_MODULE_12__[\"GraphQLDirective\"](_objectSpread({}, config, {\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.args, extendArg)\n }));\n }\n\n function extendInputObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLInputObjectType\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, function (field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type)\n });\n }), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (field) {\n return field.name.value;\n }, function (field) {\n return astBuilder.buildInputField(field);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendEnumType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[type.name] || [];\n var valueNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.values || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLEnumType\"](_objectSpread({}, config, {\n values: _objectSpread({}, config.values, Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(valueNodes, function (value) {\n return value.name.value;\n }, function (value) {\n return astBuilder.buildEnumValue(value);\n })),\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendScalarType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLScalarType\"](_objectSpread({}, config, {\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var interfaceNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.interfaces || [];\n });\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLObjectType\"](_objectSpread({}, config, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendInterfaceType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLInterfaceType\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendUnionType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var typeNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.types || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLUnionType\"](_objectSpread({}, config, {\n types: function types() {\n return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendField(field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type),\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(field.args, extendArg)\n });\n }\n\n function extendArg(arg) {\n return _objectSpread({}, arg, {\n type: replaceType(arg.type)\n });\n }\n}", "function buildSchema(source, options) {\n return buildASTSchema(Object(_language_parser__WEBPACK_IMPORTED_MODULE_9__[\"parse\"])(source, options), options);\n}", "function loadSchema(resource, method, schemaUrl) {\n //$resourceInput.prop('disabled', true);\n\n // Read schema using GET\n $.ajax({\n timeout: xhrTimeout,\n type: 'GET',\n url: schemaUrl,\n })\n .done(function(data) {\n\t\t\tconst schema = cachedData[\"template\"];\n renderForm(schema, resource, method);\n\n // Fill the form with current data if applicable, i.e. when\n // modifying an existing record\n if (cachedData) {\n loadFormData(data);\n }\n })\n .fail(handleAjaxError)\n }", "function parse(any, opts) {\n let schemaOrProtocol = specs.read(any);\n return schemaOrProtocol.protocol ?\n services.Service.forProtocol(schemaOrProtocol, opts) :\n types.Type.forSchema(schemaOrProtocol, opts);\n}", "constructor({ fieldpath, schema, deserializedDefault = [], serializedDefault = [] }) {\n super({ fieldpath, deserializedDefault, serializedDefault });\n this.schema = schema;\n this.schemaKeys = Object.keys(this.schema);\n }", "function yaml(hljs) {\n var LITERALS = 'true false yes no null';\n\n // Define keys as starting with a word character\n // ...containing word chars, spaces, colons, forward-slashes, hyphens and periods\n // ...and ending with a colon followed immediately by a space, tab or newline.\n // The YAML spec allows for much more than this, but this covers most use-cases.\n var KEY = {\n className: 'attr',\n variants: [\n { begin: '\\\\w[\\\\w :\\\\/.-]*:(?=[ \\t]|$)' },\n { begin: '\"\\\\w[\\\\w :\\\\/.-]*\":(?=[ \\t]|$)' }, //double quoted keys\n { begin: '\\'\\\\w[\\\\w :\\\\/.-]*\\':(?=[ \\t]|$)' } //single quoted keys\n ]\n };\n\n var TEMPLATE_VARIABLES = {\n className: 'template-variable',\n variants: [\n { begin: '\\{\\{', end: '\\}\\}' }, // jinja templates Ansible\n { begin: '%\\{', end: '\\}' } // Ruby i18n\n ]\n };\n var STRING = {\n className: 'string',\n relevance: 0,\n variants: [\n {begin: /'/, end: /'/},\n {begin: /\"/, end: /\"/},\n {begin: /\\S+/}\n ],\n contains: [\n hljs.BACKSLASH_ESCAPE,\n TEMPLATE_VARIABLES\n ]\n };\n\n var DATE_RE = '[0-9]{4}(-[0-9][0-9]){0,2}';\n var TIME_RE = '([Tt \\\\t][0-9][0-9]?(:[0-9][0-9]){2})?';\n var FRACTION_RE = '(\\\\.[0-9]*)?';\n var ZONE_RE = '([ \\\\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?';\n var TIMESTAMP = {\n className: 'number',\n begin: '\\\\b' + DATE_RE + TIME_RE + FRACTION_RE + ZONE_RE + '\\\\b',\n };\n\n return {\n name: 'YAML',\n case_insensitive: true,\n aliases: ['yml', 'YAML'],\n contains: [\n KEY,\n {\n className: 'meta',\n begin: '^---\\s*$',\n relevance: 10\n },\n { // multi line string\n // Blocks start with a | or > followed by a newline\n //\n // Indentation of subsequent lines must be the same to\n // be considered part of the block\n className: 'string',\n begin: '[\\\\|>]([0-9]?[+-])?[ ]*\\\\n( *)[\\\\S ]+\\\\n(\\\\2[\\\\S ]+\\\\n?)*',\n },\n { // Ruby/Rails erb\n begin: '<%[%=-]?', end: '[%-]?%>',\n subLanguage: 'ruby',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n { // local tags\n className: 'type',\n begin: '!' + hljs.UNDERSCORE_IDENT_RE,\n },\n { // data type\n className: 'type',\n begin: '!!' + hljs.UNDERSCORE_IDENT_RE,\n },\n { // fragment id &ref\n className: 'meta',\n begin: '&' + hljs.UNDERSCORE_IDENT_RE + '$',\n },\n { // fragment reference *ref\n className: 'meta',\n begin: '\\\\*' + hljs.UNDERSCORE_IDENT_RE + '$'\n },\n { // array listing\n className: 'bullet',\n // TODO: remove |$ hack when we have proper look-ahead support\n begin: '\\\\-(?=[ ]|$)',\n relevance: 0\n },\n hljs.HASH_COMMENT_MODE,\n {\n beginKeywords: LITERALS,\n keywords: {literal: LITERALS}\n },\n TIMESTAMP,\n // numbers are any valid C-style number that\n // sit isolated from other words\n {\n className: 'number',\n begin: hljs.C_NUMBER_RE + '\\\\b'\n },\n STRING\n ]\n };\n}", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "function iodocsUpgrade(data){\n \tvar data = data['endpoints'];\n\tvar newResource = {};\n\tnewResource.resources = {};\n\tfor (var index2 = 0; index2 < data.length; index2++) {\n\t\tvar resource = data[index2];\n\t\tvar resourceName = resource.name;\n\t\tnewResource.resources[resourceName] = {};\n\t\tnewResource.resources[resourceName].methods = {};\n\t\tvar methods = resource.methods;\n\t\tfor (var index3 = 0; index3 < methods.length; index3++) {\n\t\t\tvar method = methods[index3];\n\t\t\tvar methodName = method['MethodName'];\n\t\t\tvar methodName = methodName.split(' ').join('_');\n\t\t\tnewResource.resources[resourceName].methods[methodName] = {};\n\t\t\tnewResource.resources[resourceName].methods[methodName].name = method['MethodName'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['httpMethod'] = method['HTTPMethod'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['path'] = method['URI'];\n\t\t\tnewResource.resources[resourceName].methods[methodName].parameters = {};\n\t\t\tif (!method.parameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar parameters = method.parameters;\n\t\t\tfor (var index4 = 0; index4 < parameters.length; index4++) {\n\t\t\t\tvar param = parameters[index4];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name] = {};\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['title'] = param.name;\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['required'] = (param['Required'] == 'Y');\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['default'] = param['Default'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['type'] = param['Type'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['description'] = param['Description'];\n\t\t\t}\n\t\t}\n\t}\n return newResource;\n}", "function runSemanticValidator(swagger) {\n return oav.validateSpec(swagger, {consoleLogLevel: 'off'}).then(function (validationResult) {\n //console.dir(validationResult, { depth: null, colors: true });\n return validationResult.validateSpec.errors;\n }).catch(function (err) {\n console.dir(err, { depth: null, colors: true });\n });\n}", "function yamlDump(input) {\n return jsYaml.dump(input, { schema: schema });\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function buildSchema(source, options) {\n var document = (0, _parser.parse)(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}", "function buildSchema(source, options) {\n var document = (0, _parser.parse)(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}", "function fetchRemoteSchema(uri) {\n return new Promise((resolve, reject) => {\n fetch(uri.toString(), {\n headers: {\n 'Accept': 'application/schema+json, application/json'\n }\n })\n .then((response) => {\n response.json()\n .then((data) => {\n // console.log(`loaded:\\n${JSON.stringify(data, null, 2)}`)\n resolve(data)\n })\n .catch((error) => reject(`failed to process ${uri}: ${error}`))\n })\n .catch((error) => reject(`failed to fetch ${uri}: ${error}`))\n })\n}", "handleConfigSchema(aapPacket) {\n // ignored, since they are currently hardcoded based on the specs\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}" ]
[ "0.6788131", "0.6291001", "0.627871", "0.6187575", "0.6134092", "0.5878334", "0.5633782", "0.5613062", "0.5537598", "0.5500399", "0.54908156", "0.5447068", "0.5434033", "0.5412732", "0.5399147", "0.5391997", "0.5381167", "0.53721017", "0.5370661", "0.53672606", "0.5301931", "0.5300159", "0.52908236", "0.52752334", "0.5220822", "0.5199537", "0.5184024", "0.5155637", "0.512967", "0.50980973", "0.50978106", "0.50966895", "0.50814766", "0.50699556", "0.5069422", "0.5064647", "0.5064534", "0.5052981", "0.50517327", "0.5045046", "0.5028566", "0.50059974", "0.50004506", "0.49982798", "0.49691847", "0.49638405", "0.49567723", "0.49443734", "0.49328208", "0.49310586", "0.49282888", "0.49206626", "0.49161318", "0.49124664", "0.4905523", "0.48986432", "0.48737806", "0.4851844", "0.48446134", "0.48420066", "0.4836996", "0.4830156", "0.4830156", "0.4815679", "0.4803353", "0.47951102", "0.47951102", "0.47951102", "0.47951102", "0.47858787", "0.4785755", "0.477803", "0.47766617", "0.47738332", "0.47723138", "0.4762871", "0.4757144", "0.47538343", "0.4745477", "0.47338128", "0.47332284", "0.47332284", "0.47224158", "0.47220975", "0.47024903", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.46976215", "0.4697029", "0.4697029", "0.46866107", "0.46798533", "0.46773398" ]
0.7307377
0
grafana will call this function and pass a callback function. execute the callback with your dashboard once it's ready
function asyncGraph(callback) { var dashboard = {}; window.setTimeout(function() { callback(dashboard); }, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback(){\n console.log(\"Charts Data Executed\");\n}", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function onWidgetInitialized(dashboard, args) {\n //\tHooking to ready/destroyed events\n args.widget.on(\"destroyed\", onWidgetDestroyed);\n\t\t\n //\tOnly run for specific charts that have this setting enabled\n var typeOk = checkChartType(args.widget.type);\n var settingOk = checkChartSetting(args.widget.style);\t\t\n\n //\tAdd hook for when the widget is ready\n if (typeOk && settingOk) {\n args.widget.on(\"render\", modifyPieChart);\n args.widget.on(\"ready\", hideGrey);\n }\n }", "function renderDashboardUX(){\n DATA_METRICS_ARR = metrics_arr;\n if(from_date == 'None'){\n $('#date-subtitle').html('Duration: 3 months | monthly');\n }else{\n $('#date-subtitle').html('From: '+ from_date.split(' ')[0] + ' | To: ' + to_date.split(' ')[0] + ' | Filtered: '+ aggreg_typ);\n }\n $('#dashboard-container').empty();\n $('#dashboard-container').dashboard({\n configSrc : DASHBOARD_CONFIG,\n utilsObj : $engine,\n templateObj : $('#graphtemplate'),\n metricsArr : DATA_METRICS_ARR\n });\n $engine.log('DASHBOARD > setupDashboardUX: Config: ' + DASHBOARD_CONFIG);\n }", "function watchDashboardPageLoad() {\n displayName();\n}", "function callback(){}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function getNewDashboardData() {\n $.ajax({\n url: '/dashboard/json/',\n dataType: 'json',\n success: refreshDashboard_cb\n });\n}", "function onTimerCallBack() {\n populateResults();\n }", "getDashboardConfig(callback) {\n RestClient.get(Constants.DASHBOARD_CONFIG_PATH, callback, exception => {\n logger.error(\"Error during application initialization, details:\", exception);\n });\n }", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "function gDone() {\nconsole.log(\"page done!\");\n\n//The below loads google charting package and calls back gvizloaded\n\ngoogle.load(\"visualization\", \"1\", {\npackages : [\"corechart\"],\n\"callback\" : gVizloaded\n});\n}", "function showAdminDashboard() {\n $.dashboard.setWidth('95%');\n $.dashboard.setHeight('93%');\n $.dashboard.setTop('5%');\n $.dashboard.setBottom('5%');\n $.dashboard.setRight('3%');\n $.dashboard.setLeft(20);\n $.dashboard.setOpacity('1.0');\n $.dashboard_container.setHeight(Ti.UI.FILL);\n $.dashboard_container.setWidth(Ti.UI.FILL);\n handlePageSelection({\n page : 'configurations'\n });\n}", "function finalCb( err, result ) {\n Y.log( 'Added show information: ' + JSON.stringify( result ), 'debug', NAME );\n callback( err, result );\n }", "function main() {\n //your widget code goes here\n jQueryBeacon(document).ready(function () {\n console.log('Realgraph Beacon Loaded');\n var currentURL = window.location.href; // Returns full URL\n pingListener(currentURL);\n getAndRenderEntitiesData(currentURL);\n\n //example load css\n //loadCss(\"http://example.com/widget.css\");\n\n //example script load\n //loadScript(\"http://example.com/anotherscript.js\", function() { /* loaded */ });\n });\n }", "function runOnline(dims)\n{\n $(\"#funcSelector\").change(function () {\n query(\"cfg\",\n $(\"#funcSelector option:selected\").text(),\n function (json) {\n if (!isEmpty(json)) {\n $(\"#uiFuncName\").text(function (_, _) {\n return $(\"#funcSelector option:selected\").text();\n });\n drawCFG(dims, json);\n registerRefreshEvents(dims, json);\n }\n });\n });\n query(\"functions\", \"\", drawFunctions);\n query(\"bininfo\", \"\", drawBinInfo);\n}", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var contents = JSON.stringify(healthCheckResults);\n res.writeHead(200, {\n 'Content-Type': \"application/json\"\n });\n res.end(contents);\n }", "function getDashboard(){\n \tdataUriCall = dataUri + \"fnc=getDashboard\" + \"&rand=\" + Math.random();\n\tloadAsyncData(encodeURI(dataUriCall), \"GET\", function() {\n if (xmlhttpRequest.readyState == 4 && xmlhttpRequest.status == 200){\n\t\tcbGetDashboard();\n }\n\t}, true, null);\n}", "function initDetailDashboard(){\n $('#dashboard-container').find('div[data-role=panel-container]').remove();\n $engine.toggleViewLoader(false);\n $engine.toggleViewLoader(true, 'Loading.. Please wait.', $('#dashboard-loader'));\n var _options = {\n startDate: moment(new Date(2014, 5, 12)),\n minDate: moment().subtract('months', 6),\n rangeToggleButtons: ['3 Months', 'Current Month'],\n rangeSelectLabel : 'Custom',\n customShortcuts: ['Monthly', 'Weekly', 'Daily']\n };\n dateCompoment = new DateFilterComponent($('#datefilter_container'), _options);\n loadCount = 0;\n objloadedArr.length = null;\n if(!sessionObject) sessionObject = new SessionObject();\n sessionObject.getSessionObject();\n }", "function elasticDefaultSuccess(data) {\n successCallback(data, false);\n }", "connectedCallback(){\n\t\t\t\n\t\t\tlet GoogleSRC = \"https://www.gstatic.com/charts/loader.js\";\n\t\t\t$.ajax({\n\t\t\t\turl: GoogleSRC,\n\t\t\t\tdataType: \"script\",\n\t\t\t\tasync: true\n\t\t\t\t}\n\t\t\t).done( ()=>{\n\t\t\t\t\n\t\t\t\t\t\t\tthis._firstConnection = false;\n\t\t\t\t\t\t\tgoogle.charts.load('current', {'packages':['corechart','gauge']}).then( ()=>{\n\t\t\t\t\t\t\t//google.charts.setOnLoadCallback(()=>{alert(google.visualization);});\n\t\t\t\t\t\t\t\tgoogle.charts.setOnLoadCallback(this.redraw());\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t);\n\t\t\n\t\t\n \n }", "function onLoad()\n{\n \n\t$.get(publicPort+'Results',function(data,status){\n console.log(data);\n\t\tdrawBarChart(data,'chart');\n\t\t\n\t});\n\n\tgetSuitibleCourses();\n\n\t\n}", "function callLogs() {\n console.log('HAI SAYA ADALAH CALLBACK');\n}", "function main() {\n $(function() {\n // When document has loaded we attach FastClick to\n // eliminate the 300 ms delay on click events.\n FastClick.attach(document.body)\n\n // Event listener for Back button.\n $('.app-back').on('click', function() {\n history.back()\n })\n })\n\n // Event handler called when Cordova plugins have loaded.\n document.addEventListener(\n 'deviceready',\n onDeviceReady,\n false)\n window.onbeforeunload = function(e) {\n rfduinoble.close();\n };\n google.charts.load('current', {\n 'packages': ['corechart', 'controls', 'charteditor']\n });\n //google.setOnLoadCallback(drawChart);\n // google.setOnLoadCallback(function() {\n // genSampleData(generateSamples)\n // });\n }", "onSuccess() {}", "function setgriddisplaycallback(callback) {\n\n setgriddisplay = callback;\n\n }", "static publish() {\r\n ViewportService.subscribers.forEach(el => {el.callback();});\r\n }", "function init() {\n logger.info('init called');\n showAdminDashboard();\n $.app_config_window.init();\n}", "function updateMonitoringData () {\n // Get HTML elements where results are displayed\n // ...\n}", "function populateDashboard(data){\n\tconsole.log('populateDashboard ran');\n\tgetAndGatherArtistInfo();\n\tretrieveLocalStorage();\n\tgetAndRenderUsername();\n\t//if the user has artwork in their profile, render the artwork thumb\n\tgetAndRenderArtworkThumb();\n}", "function checkGraphStatus() {\n $.get(\"graphStatus\", function (graphStatus) {\n if(graphStatus){\n switchView();\n }else{\n subscribeToGraphStatus();\n }\n })\n}", "callback () {\n \n // Loop through the standark callbacks\n for (var i = 0; i < this.callbacks.length; i++) {\n this.callbacks[i]();\n }\n\n // delay and then loop through the delayed callbacks\n if(!this.timeoutID) this.timeoutID = setTimeout(\n window.sambar_ho_delayed_callback,\n 1000\n );\n\n }", "function updateDashboard() {\n request\n .get(\"https://dsrealtimefeed.herokuapp.com/\")\n .end(function(res) {\n console.log(\"Pinged Dashboard, \" + res.status)\n if(res.status != 200) {\n stathat.trackEZCount(config.STATHAT, 'dsrealtime-feed-cant_ping', 1, function(status, response){});\n }\n });\n}", "function initialDashboard() {\n\n // Dropdown menu\n var selector = d3.select(\"#selDataset\");\n\n // Use the D3 library to read in samples.json\n d3.json(\"./data/samples.json\").then(data => {\n\n // Verify data has been read in\n // console.log(data);\n\n // Declare variable to store sample IDs\n var sampleNames = data.names;\n\n // Populate dropdown menu with sample IDs\n sampleNames.forEach(sampleID => {\n selector.append(\"option\")\n .text(sampleID)\n .property(\"value\", sampleID);\n\n });\n\n // Declare variable to store data from object array\n var id = sampleNames[0];\n\n // Call each function onto dashboard\n drawBarGraph(id);\n drawBubbleChart(id);\n updateDemographicInfo(id)\n drawGaugeChart(id);\n\n });\n}", "function stepOne(){\n//Console log to make sure it is working\nconsole.log(\"My document must be ready\");\n\n//Load Google Visualization library\ngoogle.load(\"visualization\", \"1\", {packages:[\"corechart\"], callback:\"stepTwo\"});\n}", "function reflowDashboard() {\n loadDashboard(true);\n adjustHeight();\n }", "function performer(cb) {\n cb();\n }", "function readyCallBack() {\n}", "function initialize(){\n $('#loading').hide();\n\t\n\tasync.series([\n\t\tgetAllTweets(),\n\t\tsetMap()\n\t]);\t\n\t//event listener for submission of word to map (bindData called)- triggers movement of control panel to side and disappearing of welcome text\t\n }", "function callback() {\n console.log(\"Callback\");\n }", "function drawDashboard() {\n\n // Create our data table.\n var data = google.visualization.arrayToDataTable([\n ['typeQuestion', 'Nombre de questions'],\n ['Choix Multiples', getQuestionsMultiples(question)],\n ['Choix Simple', getQuestionsSimples(question)],\n ['Reponse Texte', getQuestionsTexte(question)],\n ]);\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Nombre de questions'\n }\n });\n\n // Create a pie chart, passing some options\n var pieChart = new google.visualization.ChartWrapper({\n 'chartType': 'PieChart',\n 'containerId': 'chart_div',\n 'options': {\n 'width': 475,\n 'height': 350,\n 'pieSliceText': 'value',\n 'legend': 'bottom'\n }\n });\n\n // Establish dependencies, declaring that 'filter' drives 'pieChart',\n // so that the pie chart will only display entries that are let through\n // given the chosen slider range.\n dashboard.bind(donutRangeSlider, pieChart);\n\n // Draw the dashboard.\n dashboard.draw(data);\n}", "function callback() {\n\n}", "function cb () {\n\t\tcallback();\n\t}", "function get_dashboard_info()\n{\n //fade_in_loader_and_fade_out_form(\"loader\", \"stats_info\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"access_token\"); \n send_restapi_request_to_server_from_form(\"get\", api_get_dashboard_stats_url, bearer, \"\", \"json\", get_dashboard_info_success_response_function, get_dashboard_info_error_response_function);\n}", "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}", "function loadDashboard(data){\n //set global database\n database = data;\n //hide the login\n screen.remove(login);\n //append the dashboard object to the main screen\n screen.append(dashboard);\n //populate the tables list\n mysqlAssistant.listTables(function(callback){\n //add tables to dashboard list\n \tdashTables.setItems(callback);\n \t//render the dashboard\n screen.render();\n });\n}", "function the_start_callback(){\n\t\t\t\tif(typeof start_callback == 'function'){\n\t\t\t\t\tvar id = $container.attr('id');\n\t\t\t\t\tif(id==undefined || !id){\n\t\t\t\t\t\tid = '[no id]';\n\t\t\t\t\t}\n\t\t\t\t\tstart_callback(id);\n\t\t\t\t}\n\t\t\t}", "function initLocalDashboardPage(){\r\n\treportsSection = \"dashboard\";\r\n\treportsObject = getDashboardReports(sid);\r\n\tvar list = $(\"#dashboard\");\r\n\tlist.empty();\r\n\tvar predefinedReports = reportsObject.predefined;\r\n\tif(predefinedReports.length > 0){\r\n\t\t\r\n\t\t$.each(predefinedReports, function(k, vObj){\r\n\t\t\tvar raport = prepareDashboardReport(vObj.code);\r\n\t\t\treportObjectToExecute = loadDashboardReport(raport);\r\n\t\t\tlist.append(\r\n\t\t\t\t\t$(\"<div>\",{class:\"dashboard-item-\"+reportObjectToExecute.class+\" uss\",id:reportObjectToExecute.id})\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"title\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"form\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"graph\",id:\"graph-\"+reportObjectToExecute.id}).append($(\"<div>\",{class:\"loading-span\"}).text(\"Loading ...\")))\r\n\t\t\t);\r\n\t\t\trenderDashboardReport(reportObjectToExecute);\r\n\t\t});\r\n\t}\r\n}", "function callback() {\n console.log('yo soy un callback')\n}", "function renderCallback(renderConfig) {\n\n\t\tvar chart = renderConfig.moonbeamInstance;\n\t\tvar props = renderConfig.properties;\n\n\t\tchart.legend.visible = false;\n\n\t\tprops.width = renderConfig.width;\n\t\tprops.height = renderConfig.height;\n\t\t//props.data = renderConfig.data;\n\n\t\tprops.data = (renderConfig.data || []).map(function(datum){\n\t\t\tvar datumCpy = jsonCpy(datum);\n\t\t\tdatumCpy.elClassName = chart.buildClassName('riser', datum._s, datum._g, 'bar');\n\t\t\treturn datumCpy;\n\t\t});\n\n\t\tprops.buckets = renderConfig.dataBuckets.buckets;\n\t\tprops.formatNumber = renderConfig.moonbeamInstance.formatNumber;\n\n\t\tprops.isInteractionDisabled = renderConfig.disableInteraction;\n\n\t\tvar container = d3.select(renderConfig.container)\n\t\t\t.attr('class', 'tdg_marker_chart');\n\n\t\tprops.onRenderComplete = function() {\n console.log(container);\n renderConfig.modules.tooltip.updateToolTips();\n renderConfig.renderComplete();\n }\n\t\tvar marker_chart = tdg_marker(props);\n\n\n\t\tmarker_chart(container);\n\n\t}", "ServerCallback() {\n\n }", "onShowThumbnails(callback) {\n this.transport.on(Protocol.SHOW_THUMBNAILS, () => callback());\n }", "function initDashboard() {\n console.log(\"Initializing Screen\");\n \n // The Initialize function needs to do the following:\n // Populate the dropdown box with all the IDs - create variable to select the dropdown\n var selector = d3.select(\"#selDataset\");\n\n // Read json file with data, then populate the dropdown using the key from the data (names in this case)\n d3.json(\"samples.json\").then((data) => {\n var sampleNames = data.names;\n\n // For each sample, use the value from the key to populate the contents of the dropdown box -\n // append an option to it, set text to it and assign a property\n sampleNames.forEach((sampleID) => { \n selector\n .append(\"option\") \n .text(sampleID)\n .property(\"value\", sampleID); \n });\n \n var sampleID = sampleNames[0];\n\n // Populate Demographic Information\n showDemographicInfo(sampleID);\n // Draw bargraph\n drawBarGraph(sampleID);\n // // Draw bubble chart\n drawBubbleChart(sampleID);\n\n });\n\n }", "function mPageLoaded(){\n\t\t\n\t\tconsole.log(\"got to page Loaded\");\n\t\t\n\t\t//load the google visualization library \n\t\t//added the callback - want the name of the callback function to be gLoaded\n\t\t\n\t\tgoogle.load(\"visualization\", \"1\", {packages:[\"corechart\"], callback: \"gLoaded\"});\n\n\t\t\n\t}", "async function updateDashboardPlots() {\r\n\tawait createDashboardPlot();\r\n}", "startServer(callback) {\n this._server.listen(this._port, () => {\n this._logger.debug(`Prometheus exporter started on port ${this._port} at endpoint ${this._endpoint}`);\n if (callback) {\n callback();\n }\n });\n }", "static subscribe(callback) {\r\n ViewportService.subscribers.push({callback});\r\n }", "function main() {\n // main widget code\n\n jQuery(document).ready(function ($) {\n var rule_id = scriptTag.src.split(\"?id=\")[1];\n var site_path = scriptTag.src.split(\"?id=\")[0];\n var hostname = $('<a>').prop('href', site_path).prop('protocol') + '//' + $('<a>').prop('href', site_path).prop('host');\n var baseURI = window.location.pathname+location.search;\n\n var api_url = hostname+\"/api/check-rule-conditions/\"+rule_id;\n jQuery.getJSON(api_url, {url: baseURI}, function(result) {\n console.log(result);\n if(result.show) {\n alert(result.text)\n }\n });\n\n\n });\n }", "function searchSummonerStatsSummary(){\n\t// This is an example of a callback function where it calls the function getSummonerID and \n\t// // uses the function getSummonerStats as parameter.\n\t\n}", "function successCallbackPer() {\n\t// Start the human activity sensors\n\t// start the heart rate\n\ttizen.humanactivitymonitor.start('HRM');\n\t// start the sleep monitor\n\ttizen.humanactivitymonitor.start('SLEEP_MONITOR');\n\tconsole.log('succes Permision');\n\t// call sensorFunction with a time interval\n\tsetInterval(sensorFunc, 1000 * 6);\n}", "function callbackSelf() {\n\t\tsetTimeout( regenFn(scrollFriendsAsync, args), 1000 );\n\t}", "[types.REQUEST_METRICS_DASHBOARD](state) {\n state.emptyState = dashboardEmptyStates.LOADING;\n }", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var newSource = sfp.readFile('test-output/temp.js');\n // healthCheckResults.source = sfp.readFile(tempFilePath);\n healthCheckResults.source = realSource;\n healthCheckResults.processedSource = newSource;\n runJsDoc(projectPath + '/test-output', healthCheckResults);\n }", "function getClusterHealth() {\n\t\tvar options = {callbackParameter: 'callback'};\n\t\treqManager.sendMultiGetJsonP(\"clusterHealth\", urls, null, HealthinfoHandler, errorHandler, options);\n\t\tsetTimeout(function(){ \n\t\t\tgetClusterHealth();\n\t\t}, pollInterval);\n\t}", "function onReady(tileConfig,tileOptions,viewer,container) {\n console.log('onReady',tileConfig,tileOptions,viewer,container);\n\n if ( typeof tileConfig !== 'object' ) {\n tileConfig = JSON.parse(unescape(tileConfig) || {} );\n } // end if\n\n $('.nav-item').click(handleNavClick);\n\n /*** FETCH LIST OF AVAILABLE DERBIES ***/\n osapi.http.get({\n 'href' : HOST + \"/api/derby/\"+tileConfig[\"derby\"][\"id\"]+\"/snapshot\",\n 'format' : 'json',\n 'authz' : 'signed',\n 'headers' : { 'Content-Type' : ['application/json'] }\n }).execute(\n function (response) {\n if (!response[\"error\"] && response[\"content\"]) {\n initRaceData(response[\"content\"]);\n\n $('#loading-wrapper').hide();\n $('#stats-wrapper').slideDown('fast',function() {\n app.resize();\n /*** CLICK THE FIRST VISIBLE ELEMENT ***/\n $('.nav-item:visible:first').click();\n });\n } else {\n console.log('****','error',response[\"error\"]);\n $('#loading-wrapper').hide();\n $('#no-data-wrapper').show();\n } // end if\n } // end function\n );\n} // end function", "function DashboardManager(showAlert)\n{\n this.workpoolSetupAlert = (showAlert);\n}", "function updateDashboard() {\n setGraph1();\n setGraph2();\n setGraph3();\n}", "function initializeGa(results, callback) {\n googleDataEntireFunction(results, callback);\n }", "function bindDashboardEvents(){\n configureNavigation();\n \n }", "function callback(){\n console.log('Popup done!'); // logged after notification popup is displayed\n}", "function init() {\n charts(\"940\");\n}", "function mycallback() {}", "function runCallback( callback, data ){\n if(typeof callback === 'function') callback();\n }", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var newSource = sfp.readFile('test-output/temp.js');\n // healthCheckResults.source = sfp.readFile(tempFilePath);\n healthCheckResults.source = realSource;\n healthCheckResults.processedSource = newSource;\n runJsDoc('test-output', healthCheckResults);\n }", "function _success_callback(resp, man){\n\t// The response is a generic bbop.rest.response.json.\n\t// Peel out the graph and render it.\n\tif( resp.okay() ){\n\t add_to_graph(resp.raw());\n\t}else{\n\t ll('the response was not okay');\t \n\t}\n\t_spin_hide();\n }", "_chartistLoaded() {\n this.__chartistLoaded = true;\n this._renderChart();\n }", "init () {\n this.renderPieCharts(40,100,300,300);\n }", "_init() {\n this.add(this.callback);\n }", "function display_results() {\n}", "function my_js_callback(data) {\n\t//send data to be turned into interpretable data\n\t$(\".Alerts\").hide(\"slow\");\n\t$(\".Alerts\").replaceWith('<div class=\"Alerts\">Message</div>');\n\tDisplayDrawingResultPage(data)\n}", "function create_report() {\n // send ajax request to server\n var callback = function(responseText) {\n // tmp\n //myT = responseText;\n // end tmp\n // process response from server\n var tests = JSON.parse(responseText);\n google.charts.setOnLoadCallback( function () {\n drawAnnotations(tests);\n });\n }\n httpAsync(\"GET\", window.location.origin + '/star_tests.json' + window.location.search, callback);\n\n}", "function theCallbackFunction() {\n console.log(\"callback is being called!\");\n}", "onSuccess() {\n\n }", "function chartDrawFloor() {\n\n\n\n sendRequest(\n floorUrl,\n password,\n 'GET',\n null,\n function (data) {\n google.charts.setOnLoadCallback(function () {\n drawChartTotalUsers(data);\n });\n }\n );\n}", "function callBack(){\n console.log(\"Hello there\")\n}", "async function node(api_alerts, auth) {\n log(\"Start\")\n\n let alerts = await get_alerts_node(api_alerts, auth)\n let statistics = analyze(alerts)\n info(\"Statistics: \" + JSON.stringify(statistics))\n\n log(\"Finished\")\n}", "function drawDashboard() {\n // Create our data table.\n _data = new google.visualization.DataTable(_jsonIn);\n //data = _jsonIn;\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var scoreRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_score_div',\n 'options': {\n 'filterColumnLabel': 'Score'\n }\n });\n // Create a range slider, passing some options\n var exDateRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'DateRangeFilter',\n 'containerId': 'filter_exdate_div',\n 'options': {\n 'filterColumnLabel': 'ExDate'\n }\n });\n // Create a range slider, passing some options\n /*\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Donuts eaten'\n }\n });\n */\n // \n var linkedTable = new google.visualization.ChartWrapper({\n 'chartType': 'Table',\n 'containerId': 'table_div',\n 'options': {\n //'width': \n //'height': 400\n }\n });\n //dashboard.bind(scoreRangeSlider, linkedTable);\n dashboard.bind(exDateRangeSlider, linkedTable);\n // Draw the dashboard.\n dashboard.draw(_data);\n}", "create(id, callback, htmlTemplate) {\n let html = $('<div/>').prepend(htmlTemplate);\n\n //create the id to be set in html\n let htmlId = \"iotdbWidget\" + id;\n let htmlIdSelector = `#${htmlId}`;\n\n //When html of widget is loaded, set up barGraph in canvas\n $(\"#templateWidgetCanvas\").ready(() => {\n\n //Replace dummy ids with real ones\n $(\"#templateWidget\").attr(\"id\", htmlId);\n $(\"#templateWidgetLastUpdate\").attr(\"id\", htmlId + \"-lastUpdate\");\n $(\"#templateWidgetCanvas\").attr(\"id\", `${htmlId}-canvas`);\n\n //Resize inner canvas after resizing\n $(\"#\" + `${htmlId}`).parent().resize(function() {\n _barGraphWidgetFactory._resizeCanvas(htmlId);\n });\n\n // Set correct language for title\n $(htmlIdSelector).find(\".widget-title\").text(window.iotlg.widgetBarGraphTitle);\n\n // Set remove callback\n $(htmlIdSelector).find(\"#removeWidgetButton\").click(function(e) {\n e.preventDefault();\n _userEvents.removeWidget(htmlId);\n });\n\n // Set config callback\n $(htmlIdSelector).find(\"#configureWidgetButton\").click(function(e) {\n e.preventDefault();\n _userEvents.configureWidget(htmlId);\n });\n\n // Define variables\n let timeRelative;\n let barData = [\n []\n ];\n let delta;\n let timeIntervalUnit;\n let realBarData = [];\n let barGraph;\n let min;\n let max;\n let color;\n let configurableOptions;\n let minAndMax = [];\n let groupInterval = 3;\n let labelTicks = {\n label: \"\"\n };\n\n //the DOM-Element to display the time of the last Update\n let lastUpdate = $(`#${htmlId}-lastUpdate`)[0];\n\n //Function to be called when new data arrives\n let dataUpdate = (data) => {\n\n // check if data is actually something\n if (data[0] != undefined && data[0].Observations != undefined) {\n\n // Set time for last upadate\n let date = new Date();\n lastUpdate.innerText = window.iotlg.widgetLastUpdate + \": \" + _widgetFactory.getCurrentTimePretty();\n\n // update barData\n realBarData = this._convertedDataToBarData(data);\n\n // Set min max values\n if (timeRelative) {\n let relMinMax = this._getRelativMinAndMax(realBarData, delta);\n configurableOptions.xmin = relMinMax.min.toUTCString();\n configurableOptions.xmax = relMinMax.max.toUTCString();\n } else {\n // min max have not changed, since they are absolute\n }\n\n // trim Data according to new min and max values\n realBarData = this._trimData(new Date(configurableOptions.xmin), new Date(configurableOptions.xmax), realBarData);\n\n //calculate labels of barGraph\n labelTicks = this._calcLabelTicks(new Date(configurableOptions.xmin), new Date(configurableOptions.xmax), groupInterval);\n barData = this._groupData(realBarData, groupInterval, labelTicks);\n // console.log(labelTicks, groupInterval);\n\n // set X-Axis label correctly\n configurableOptions.labels = labelTicks.label;\n\n // Redraw barGraph rgraph\n RGraph.reset(document.getElementById(`${htmlId}-canvas`));\n barGraph = new RGraph.Bar({id: `${htmlId}-canvas`, data: barData, options: configurableOptions}).draw();\n }\n //id not important but needed in tests\n let _view = new View(\"id\");\n if (_view.getLoadingWidgets().indexOf(htmlId) >= 0) {\n _view.popLoading(htmlId);\n }\n };\n\n //Function to be called when new configuration arrives\n let configUpdate = (config) => {\n\n // format config properly\n config = this._formatConfigurableData(config);\n html.find(\".widget-title\")[0].innerText = config.title.data;\n\n //Check for absolute or rellativ and chose min max right\n timeRelative = config.timeIntervalRelative.data;\n timeIntervalUnit = config.timeIntervalUnit.data;\n max = config.endTime.data.toUTCString();\n min = config.startTime.data.toUTCString();\n delta = this._getMilliseconds(config.timeInterval.data, timeIntervalUnit);\n\n // check if scatterGraph exists\n if (realBarData.length >= 1) {\n // set min max\n if (timeRelative) {\n let relMinMax = this._getRelativMinAndMax(realBarData, delta);\n min = relMinMax.min.toUTCString();\n max = relMinMax.max.toUTCString();\n } else {\n // Do nothing, since min, max is set\n }\n // set X-Axis label correctly\n labelTicks = this._calcLabelTicks(new Date(min), new Date(max), config.timeGroups.data);\n // console.log(labelTicks, config.timeGroups.data);\n }\n\n // View configuration\n // set title by config settings title:\n groupInterval = config.timeGroups.data;\n\n configurableOptions = {\n xmin: min,\n xmax: max,\n gutterLeft: 50,\n colors: config.colors.data,\n backgroundBarcolor1: config.backgroundBarcolor1.data,\n backgroundBarcolor2: config.backgroundBarcolor2.data,\n backgroundGrid: config.backgroundGrid.data,\n gutterBottom: 120,\n labels: labelTicks.label,\n titleXaxis: \"Time intervals\",\n titleXaxisPos: -0.1,\n titleYaxis: config.titleY.data,\n titleYaxisPos: 0.15\n };\n\n RGraph.reset(document.getElementById(`${htmlId}-canvas`));\n barGraph = new RGraph.Bar({id: `${htmlId}-canvas`, data: barData, options: configurableOptions}).draw();\n };\n\n callback(htmlId, dataUpdate, configUpdate);\n _barGraphWidgetFactory._resizeCanvas(htmlId);\n });\n return html;\n }", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to schedule the alert job\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tif (gvMethod === \"Create\" || gvMethod === \"CREATE\") {\n\t\t\t\t\tDeleteJob();\n\t\t\t\t\tScheduleJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule created\"\n\t\t\t\t\t}));\n\t\t\t\t} else if (gvMethod === \"DELETE\" || gvMethod === \"Delete\") {\n\t\t\t\t\tDeleteJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule deleted\"\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, but no action taken, method was not supplied\"\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\n\t\t}\n\t}", "createdCallback() {}", "function createDashboardEca(data, data2) {\n\n /*\n * Loading all Units os Assessment and use this for populating\n * select box which will control the whole layout and all the visualizations\n * on this page\n */\n // Load all Unit of Assessment options\n var uoas = dataManager.loadAllUoAs(data);\n\n // Populate the select box with the options\n (0, _populateSelections2.default)(uoas);\n\n // Get the current selection from the select box\n var selectBox = document.getElementById('selector');\n selectBox.selectedIndex = 6;\n var selectedUoa = 'Business and Management Studies';\n var selectedUni = 'Anglia Ruskin University';\n\n /*\n * Creating the first visualization, which is a map of the UK,\n * with all the locations of the universities in a selected field (Unit\n * of Assessment) which is passed on as an argument from the selectbox\n */\n var mapMarkers = dataManager.getLocationByUoA(data, selectedUoa);\n var hierarchical = new _hierarchical2.default(data2, data, selectedUoa, selectedUni, 'ShowUniversity', false);\n var barChart = new _hBarChart2.default(data, dataManager.getLocationByUoA(data, selectedUoa), selectedUoa, '', 'ShowUniversity');\n\n // Create the map\n var map = new _map2.default(mapMarkers, '4*');\n map.createMap();\n map.render();\n\n // Create a horizontal stacked bar chart\n barChart.createChart();\n\n // Create the hierarchical sunburst chart\n hierarchical.createChart();\n\n // Listen for changes on the selectbox and get the selected value\n selectBox.addEventListener('change', function (event) {\n selectedUoa = selectBox.options[selectBox.selectedIndex].value;\n console.log(selectedUoa);\n\n // Reload the map with the new dataset\n map.reload(dataManager.getLocationByUoA(data, selectedUoa));\n barChart.reload('', selectedUoa, data, dataManager.getLocationByUoA(data, selectedUoa), 'ShowUniversity');\n });\n}", "function callback(err) {\n if (err) {\n console.log(err);\n } else {\n //console.log(\"successo\");\n }\n }", "publish() {\n _callbacks.forEach(callback => callback());\n }", "function main()\n{\n\t// Fetch all stats that exist already\n\tvar fetchAllUrl = baseUrl + \"/apps/fetchstats/\" + appId;\n\tconsole.log(\"Fetching all stats...\");\n\tAppsAjaxRequest(fetchAllUrl, {}, function(results){\n\t\tconsole.log(\"Retrieved results!\");\n\t\texistingStats = results;\n\t\tParseExistingStats();\n\t});\n}", "function callbackDriver() {\n cb();\n }", "function displayCallback(data) {\n document.getElementById(\"callback\").innerHTML = data;\n}" ]
[ "0.66811186", "0.58476686", "0.5845754", "0.5784398", "0.567192", "0.5643497", "0.5628917", "0.5628917", "0.5628917", "0.5628917", "0.5628917", "0.55949146", "0.5519947", "0.5493057", "0.54734033", "0.5454622", "0.5405336", "0.53836596", "0.53830934", "0.53577733", "0.5350956", "0.5345569", "0.53378886", "0.533403", "0.53332424", "0.5302774", "0.52994174", "0.5294205", "0.5280011", "0.527574", "0.52650017", "0.52612174", "0.52578765", "0.5244645", "0.52425873", "0.5237515", "0.5228545", "0.52246714", "0.5204931", "0.5189592", "0.5189117", "0.51787287", "0.517572", "0.5170879", "0.5160883", "0.5159871", "0.51529056", "0.5148487", "0.5146095", "0.5137467", "0.5135772", "0.51319045", "0.51203483", "0.5114858", "0.5109", "0.51057833", "0.50868714", "0.5086098", "0.50837004", "0.5082249", "0.5074555", "0.50699645", "0.5065792", "0.50603914", "0.50552565", "0.50526", "0.50503635", "0.504863", "0.50439113", "0.50395066", "0.50357133", "0.50353503", "0.5034666", "0.5030953", "0.5019431", "0.5017604", "0.5009371", "0.500921", "0.5008738", "0.5002162", "0.4998577", "0.49971187", "0.4988108", "0.49869028", "0.49854606", "0.49837288", "0.49703294", "0.4965616", "0.49595785", "0.49581647", "0.49578187", "0.495399", "0.49434665", "0.49424157", "0.49411336", "0.49404556", "0.49386477", "0.49335113", "0.4933369", "0.49319476" ]
0.6254712
1
this function to display question and options
function DisplayQues(quesarr, optarr, index) { document.querySelector(".questionNoBox").innerHTML = "Question no " + count; document.querySelector(".questionBox").innerHTML = quesarr[index]; document.querySelector("#opt1").innerHTML = optarr[index][0]; document.querySelector("#opt2").innerHTML = optarr[index][1]; document.querySelector("#opt3").innerHTML = optarr[index][2]; document.querySelector("#opt4").innerHTML = optarr[index][3]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayQuestion() {\n\t\t\tstartTime30();\t\n\t\t\t$(\"#question\").html(eachone[count].question);\n\t\t\t$(\"#option1\").html(eachone[count].option1.answer);\n\t\t\t$(\"#option2\").html(eachone[count].option2.answer);\n\t\t\t$(\"#option3\").html(eachone[count].option3.answer);\n\t\t\t$(\"#option4\").html(eachone[count].option4.answer);\n\t\t\t$(\"#okButton\").html(\"\");\n\t\t}", "function showQuestions() {\n $(questionText).text(quizObject[index].question);\n $(optionA).text(quizObject[index].answerA);\n $(optionB).text(quizObject[index].answerB);\n $(optionC).text(quizObject[index].answerC);\n $(optionD).text(quizObject[index].answerD);\n }", "display(options, answer) {\n\t\t// this.element.innerHTML = \"\";\n\t\tlet header = document.createElement(\"h1\");\n\t\theader.textContent = this.question;\n\t\tthis.element.appendChild(header);\n\t\tfor(let index in this.options) {\n\t\t\tthis.element.appendChild(Questions.createElementOption(index, this.options[index]));\n\t\t}\n\t}", "function displayQuestion() {\n\tvar question='', choice='', choices='', i=0;\n\tquestion = questions[questionCounter].question;\n\tchoiceArray = questions[questionCounter].choices;\n\t \n\tfor (var i in choiceArray){\n\t\t choice = questions[questionCounter].choices[i];\n\t\t choices += \"<p class='choices'>\" + choice + \"</p>\";\n\t}\n $(\"#QuizArea\").append(\"<p><strong>\" + question + \"</strong></p>\" + choices );\n}", "display() {\n document.querySelector(\"#question\").innerHTML = this.question;\n for (let i = 0; i < 4; i++)\n showAnswer = selectValue(showAnswer, 4);\n answer1.innerHTML = this.answers[showAnswer[0]];\n answer2.innerHTML = this.answers[showAnswer[1]];\n answer3.innerHTML = this.answers[showAnswer[2]];\n answer4.innerHTML = this.answers[showAnswer[3]];\n }", "function displayQuestion() {\n hideResults();\n $(\"#answer\").hide();\n $(\"#time\").show();\n showDiv();\n $(\"#question\").html(question[questionCount]);\n $(\"#choice1\").html(firstChoice[questionCount]);\n $(\"#choice2\").html(secondChoice[questionCount]);\n $(\"#choice3\").html(thirdChoice[questionCount]);\n $(\"#choice4\").html(fourthChoice[questionCount]);\n }", "function displayQuestion() {\n const questionElement = document.getElementById('question');\n const optionsElement = document.getElementById('options');\n \n // Clear previous question and options\n questionElement.textContent = '';\n optionsElement.textContent = '';\n \n // Display current question\n questionElement.textContent = quiz[currentQuestion].question;\n \n // Display options\n quiz[currentQuestion].options.forEach((option, index) => {\n const button = document.createElement('button');\n button.textContent = option;\n button.addEventListener('click', () => {\n checkAnswer(option);\n });\n optionsElement.appendChild(button);\n });\n }", "function displayQ(object){\n \n answers.style.display = \"inline-block\";\n\n question.textContent = object[0][0].Question;\n option1El.textContent = object[0][0].option1;\n option2El.textContent = object[0][0].option2;\n option3El.textContent = object[0][0].option3;\n option4El.textContent = object[0][0].option4;\n\n}", "function answersQuestionPrint() {\n questionChooser();\n answerChooser(currentQuestion);\n }", "function displayQuestion() {\n let question = STORE.questions[STORE.currentQuestion];\n updateScoreAndQuestionCounter();\n\n $(\"main\").html(generateQuestionTemplate(question.question));\n showOptions();\n $(\"#next\").hide();\n}", "function questionOptions() {\n\tvar questionType = document.querySelector('input[name=\"question\"]:checked').value;\n\tdocument.getElementById(\"questionTypeDiv\").style.display='none';\n\tif (questionType === \"Question-Answer Pair\") {\n\t\tdocument.getElementById(\"textQuestion\").style.display='';\n\t} else if (questionType === \"Filler\") {\n\t\tdocument.getElementById(\"filler\").style.display='';\n\t} else if (questionType === \"No Answer\") {\n\t\tdocument.getElementById(\"noAnswer\").style.display='';\n\t}\n}", "function displayQuestionAnswer(question){\n\t\t$(\"#questionResponse\").text(question);\n\t\tcurrentAnswer = currentTopicChoice[currentQuestion][0];\n\t\tcurrentOptions = currentTopicChoice[currentQuestion][1];\n\t\tcurrentAnswerImage = currentTopicChoice[currentQuestion][2];\n\n\t\t//Build the button for all options proposed\n\t\tBuildOptionButtons(currentOptions);\n\n\t}", "function showQuestion() {\n // quiz questions along with possible answers\n questionEl.innerHTML = questions[currentQuesIndex].question;\n answerA.innerHTML = questions[currentQuesIndex].choiceA;\n answerB.innerHTML = questions[currentQuesIndex].choiceB;\n answerC.innerHTML = questions[currentQuesIndex].choiceC;\n\n}", "function displayQuestion() {\n $(\".questions\").text(currentQuestionData.question);\n $(\".answer-1\").text(currentQuestionData.otherAnswers[0]);\n $(\".answer-2\").text(currentQuestionData.otherAnswers[1]);\n $(\".answer-3\").text(currentQuestionData.otherAnswers[2]);\n $(\".answer-4\").text(currentQuestionData.otherAnswers[3]);\n }", "function renderQuestion() {\n var question = questions[questionIndex];\n var answers = questions[answerIndex];\n questionText.textContent = question.question;\n optionA.textContent = answers.answers.a;\n optionB.textContent = answers.answers.b;\n optionC.textContent = answers.answers.c;\n optionD.textContent = answers.answers.d;\n}", "function showQuestion() {\n clearSection();\n currentQuestion = questions[questionNum];\n var loc = questionNum + 1;\n questionStat.textContent = \"Question: \" + loc + \"/\" + questionLength;\n var question = document.createElement(\"h2\");\n question.textContent = currentQuestion.questionPrompt;\n quizEl.appendChild(question);\n showQuestionOptions();\n}", "function displayQuestion(arg) {\n setTimer();\n $(\"#alerts\").hide();\n $(\"#questionDisplay\").html(arg.question);\n $(\"#choice1\").html(arg.choices[0]);\n $(\"#choice2\").html(arg.choices[1]);\n $(\"#choice3\").html(arg.choices[2]);\n $(\"#choice4\").html(arg.choices[3]); \n }", "function displayQuestion() {\n\n questionsEl.textContent = quizQuestions[currentQuestionIndex].title\n answer1El.textContent = quizQuestions[currentQuestionIndex].choices[0];\n answer2El.textContent = quizQuestions[currentQuestionIndex].choices[1];\n answer3El.textContent = quizQuestions[currentQuestionIndex].choices[2];\n answer4El.textContent = quizQuestions[currentQuestionIndex].choices[3];\n}", "function displayQuestion() {\n questionText.textContent = currentQuestionObject.question;\n for (i=0; i<4; i++) {\n answerButtons[i].textContent = currentQuestionObject.choices[i]\n }\n}", "function showQuestion(e) {\n //show question\n var questionElement = document.getElementById(\"questionElement\")\n questionElement.innerHTML = questionarry[e].question;\n\n //show options\n var optionElement = document.getElementsByClassName(\"card-text\")\n for (var i = 0; i < optionElement.length; i++) {\n optionElement[i].innerHTML = questionarry[e].options[i]\n\n }\n\n}", "function showQuiz() {\n // Display the question\n question.textContent = shuffledQuizArr[currentQuestion].question;\n // Display the answers\n optionA.textContent = shuffledQuizArr[currentQuestion].answerList.a;\n optionB.textContent = shuffledQuizArr[currentQuestion].answerList.b;\n optionC.textContent = shuffledQuizArr[currentQuestion].answerList.c;\n optionD.textContent = shuffledQuizArr[currentQuestion].answerList.d;\n}", "function showQuestion() {\n if (questionCount === questionsObj.length) {\n stop();\n }\n else {\n $(\"#question\").html(questionsObj[questionCount].question);\n $(\"#answer1\").html(questionsObj[questionCount].choices[0]);\n $(\"#answer2\").html(questionsObj[questionCount].choices[1]);\n $(\"#answer3\").html(questionsObj[questionCount].choices[2]);\n $(\"#answer4\").html(questionsObj[questionCount].choices[3]);\n questionTime = 5;\n }\n }", "function questionDisplay() {\n // 1 - update the question text to the current question (questionsArray.[currentQuestionNumber])\n $('#question').text(questionsArray[currentQuestionNumber].questionText);\n\n console.log(\"The current question is \" + questionsArray[currentQuestionNumber].questionText);\n\n\n // 2 - display the choices for the current question:\n // empty the current choices;\n $('#choices').empty();\n\n // get the total number of choices for the current question; loop through all the choices...;\n var totalNumberOfChoices = questionsArray[currentQuestionNumber].questionChoices.length\n for (var i = 0; i < totalNumberOfChoices; i++) {\n\n //...and append the choices to the choices container, each on their own line and with their own radio button.\n\n var buildEachChoiceHTML = \"<input class='option' type='radio' name='option' value=\" + i + \">\" + questionsArray[currentQuestionNumber].questionChoices[i] + \"<br>\";\n $('#choices').append(buildEachChoiceHTML);\n }\n\n\n // 3 - displays the number of the current question\n $('#questionNumberDisplay').text(\"Question \" + (currentQuestionNumber + 1) + \" of \" + totalNumberOfQuestion);\n\n}", "function displayQuestions() {\n // Show questions starting with question one\n var displayedQuestion = gameQuestionEl.innerHTML = questions[currentQuestion].question;\n // Console log displayed question\n console.log(\"Displayed question: \", displayedQuestion);\n // Display each answer choice for user to select from\n choiceA.innerHTML = questions[currentQuestion].choices[0];\n choiceB.innerHTML = questions[currentQuestion].choices[1];\n choiceC.innerHTML = questions[currentQuestion].choices[2];\n choiceD.innerHTML = questions[currentQuestion].choices[3];\n}", "function showQuestions() {\n DOMSelectors.quizQuestion.innerHTML = questions[index].question;\n DOMSelectors.choice1.innerHTML = questions[index].choices[0];\n DOMSelectors.choice2.innerHTML = questions[index].choices[1];\n DOMSelectors.choice3.innerHTML = questions[index].choices[2];\n DOMSelectors.choice4.innerHTML = questions[index].choices[3];\n}", "function renderQuestion() {\n if (currentQuestionIndex < totalQuestions) {\n questionDisplay. textContent = quizQuestions[currentQuestionIndex].question;\n\n for (var i = 0; i < quizQuestions[currentQuestionIndex].options.length; i++) {\n var optionText = quizQuestions[currentQuestionIndex].options[i];\n allOptions[i].textContent = optionText;\n } \n\n }\n\n}", "function showQuestion() { // funcao para mostar as questoes\n if (questions[currentQuestion]) {\n\n let q = questions[currentQuestion]; //armazenado a questao na variavel q\n let pct = Math.floor((currentQuestion / questions.length) * 100); // conta da barra de porcentagem \n\n document.querySelector('.progress--bar').style.width = `${pct}%` // barra de progresso css\n\n document.querySelector('.scoreArea').style.display = 'none'; // sem nada\n document.querySelector('.questionArea').style.display = 'block';\n\n document.querySelector('.question').innerHTML = q.question; //inserindo a questao no html\n\n let optionsHtml = ''; // zerando \n for (let i in q.options) {\n optionsHtml += `<div data-op=\"${i}\"class=\"option\"><span>${parseInt(i)+1}</span>${q.options[i]}</div>`; // pasando as opcao das questoes\n }\n document.querySelector('.options').innerHTML = optionsHtml; // atribuido \n\n document.querySelectorAll('.options .option').forEach(item => {\n item.addEventListener('click', optionClickEvent);\n })\n\n } else {\n //acabaram as questoes\n finishQuiz();\n\n }\n}", "function showQuestions(question, options, answerIndex){\n\t//sets question\n\t$(\".question-title\").html(question);\n\n\t//sets question image\n\tvar questionImageSrc = questions[nextQuestionIndex].questionImage;\n\t$(\".question-image\").attr(\"src\", questionImageSrc);\n\n\t//sets question options\n\t$(\".question-answers\").empty();\n\tfor(var i = 0; i < options.length; i++){\n\t\tvar correctAnswer = false;\n\t\tif(i == answerIndex){\n\t\t\tcorrectAnswer = true;\n\t\t}\n\t\t$(\".question-answers\").append('<li class=\"option-list\" data-correct-answer=\"' + correctAnswer + '\">' + options[i] + '</li>');\n\t}\n}", "function showQuestions(passQuestion) {\n questionEl.innerText = passQuestion.question;\n answerBtn1.innerText = passQuestion.answers[0].text;\n answerBtn2.innerText = passQuestion.answers[1].text;\n answerBtn3.innerText = passQuestion.answers[2].text;\n answerBtn4.innerText = passQuestion.answers[3].text;\n}", "function displayQuestion() {\n formQuestion.textContent = questions[currentQuestion].question;\n answer1.textContent = \" 1. \" + questions[currentQuestion].answers[1];\n answer2.textContent = \" 2. \" + questions[currentQuestion].answers[2];\n answer3.textContent = \" 3. \" + questions[currentQuestion].answers[3];\n answer4.textContent = \" 4. \" + questions[currentQuestion].answers[4];\n}", "function displayQuestion() {\n\n if (questionList.length > 0) {\n currentQuestion = questionList.pop();\n answerPos = currentQuestion.getAnswerPos();\n questionChoices = currentQuestion.getChoices();\n questionQuote = currentQuestion.getQuotedPerson().getQuote();\n quoteCount++;\n\n //reset page items used to display\n $('select option').remove();\n $(\".quote\").empty();\n $(\".quoteCounter\").empty();\n\n //show new page text and update counter\n $(\".quoteCounter\").text(\"Quote: \" + quoteCount);\n $(\".quote\").append(questionQuote);\n\n //add new people to select\n for(var i=0; i<questionChoices.length; i++)\n {\n $(\"select\").append(\"<option data-img-label=\" +\"'\" + questionChoices[i].getName() +\"'\" + \"data-img-src=\"+\"'\" + questionChoices[i].getPhoto()+\"'\" + \"value=\" +\"'\" + i +\"'\" +\n \">\" + questionChoices[i].getName() + \"</option>\");\n }\n\n //reinitialize picker\n initPicker();\n\n }\n else\n displayGameResults();\n }", "function showQuestion() {\n let q = myQuestions[runningQuestion];\n question.innerHTML = q.question;\n choiceA.innerHTML = q.choiceA;\n choiceB.innerHTML = q.choiceB;\n choiceC.innerHTML = q.choiceC;\n}", "function showQuestions(questions, questionContainer) {\n\n//storing output and answer choices\n var output = [];\n var answers;\n\n//looping through questions and setting a variable to hold answers\n for (var i = 0; i < questions.length; i++) {\n answers = [];\n for (letter in questions[i].answers) {\n answers.push('<label>' + '<input id=\"inputData\" type=\"radio\" name=\"question' + i + '\" value=\"' + letter + '\">'\n + questions[i].answers[letter] + '</label>'\n );\n }\n//adding questions and answers to output\n output.push(\n '<div class=\"question\">' + questions[i].question + '</div>'\n + '<div class=\"answers\">' + answers.join() + '</div>'\n );\n }\n//adding output list into string to display\n questionContainer.innerHTML = output.join('');\n }", "function getChoices (question){\n\t$(\"#radioA\").html(question.a.caption);\n\t$(\"#radioB\").html(question.b.caption);\n\t$(\"#radioC\").html(question.c.caption);\n\t$(\"#radioD\").html(question.d.caption); \n\n\tconsole.log(\"a :\" + question.a.caption);\n\tconsole.log(\"b :\" + question.b.caption);\n\tconsole.log(\"c :\" + question.c.caption);\n\tconsole.log(\"d :\" + question.d.caption);\n} //fucntion getChoices", "function displayAnswers() {\n const answersArray = STORE.questions[STORE.questionNumber].answers\n let answersHtml = '';\n let i=0;\n\n answersArray.forEach (answer => {\n answersHtml += `\n <div id=\"option-container-${i}\">\n <input type=\"radio\" name=\"options\" id=\"option${i+1}\" value=\"${answer}\" tabindex=\"${i+1}\" required>\n <label for=\"option${i+1}\"> ${answer}</label>\n </div>\n `;\n i++;\n });\n return answersHtml;\n }", "function displayQuestion() {\n var q = questionsArr[currentQuestion];\n\n question.innerHTML = \"<p>\" + q.question + \"</p>\";\n choiceA.innerHTML = q.choiceA;\n choiceB.innerHTML = q.choiceB;\n choiceC.innerHTML = q.choiceC;\n choiceD.innerHTML = q.choiceD;\n}", "function showQuestion(){\n let listQuestion = theQuestions[questionIndex].question\n placeQuestion.textContent = listQuestion\n questionEl.appendChild(placeQuestion)\n \n //show answers as buttons\n function showAnswers(){\n let answerA = theQuestions[questionIndex].answer[0].list\n let answerB = theQuestions[questionIndex].answer[1].list\n let answerC = theQuestions[questionIndex].answer[2].list\n let answerD = theQuestions[questionIndex].answer[3].list\n btnTextA.textContent = answerA\n btnTextB.textContent = answerB\n btnTextC.textContent = answerC\n btnTextD.textContent = answerD\n multChoiceA.appendChild(btnTextA)\n multChoiceB.appendChild(btnTextB)\n multChoiceC.appendChild(btnTextC)\n multChoiceD.appendChild(btnTextD)\n }\n\n showAnswers()\n }", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function displayQuestion() {\n\t$(\"#question\").html(questionID.question);\n\n\t// Displays question's possible answers.\n\tdisplayQuestionAnswers();\n}", "function showQuestion() {\n var showQuestion = document.getElementById(\"showQuestion\");\n showQuestion.style.display = \"block\";\n var intro = document.getElementById(\"intro\");\n intro.style.display = \"none\";\n\n var currentQuestion = questions[currentQuestionIndex];\n questionEl.innerHTML = currentQuestion.question;\n answerButtonAEl.innerHTML = currentQuestion.choices[0];\n answerButtonBEl.innerHTML = currentQuestion.choices[1];\n answerButtonCEl.innerHTML = currentQuestion.choices[2];\n answerButtonDEl.innerHTML = currentQuestion.choices[3];\n}", "function questionDisplay(answer) {\n if (answer != \"start-button\") {\n checkAnswer(answer);\n counter++\n }\n if (counter < 5) {\n document.getElementById(\"questionText\").textContent = questions[counter].title;\n document.getElementById(\"optionA\").textContent = questions[counter].choices[0];\n document.getElementById(\"optionB\").textContent = questions[counter].choices[1];\n document.getElementById(\"optionC\").textContent = questions[counter].choices[2];\n document.getElementById(\"optionD\").textContent = questions[counter].choices[3];\n }\n else {\n document.getElementById(\"questionText\").style.display = \"none\"\n document.getElementById(\"questionChoices\").style.display = \"none\"\n }\n}", "function getQuestion() {\n // Get current question\n let questionInfoEl = questions[questionNumEl];\n // If there are no questions left, stop time, end function\n if (questionInfoEl == undefined) {\n endGame();\n return;\n }\n\n // loop show choices\n for (let i = 0; i < responseOptionsEl.length; i++) {\n responseOptionsEl[i].textContent = i + 1 + \". \" + questionInfoEl.choices[i];\n responseOptionsEl[i].value = questionInfoEl.choices[i];\n responseOptionsEl[i].onclick = answerCheck;\n }\n\n document.getElementById(\"question-text\").textContent = questionInfoEl.title;\n // show the question\n questionContainerEl.classList.remove(\"hide\");\n}", "function displayQuestions(questionNum) {\n var questionLine = $(\"<div></div>\").text(trivia[questionNum].question );\n var choice1Line = $(\"<div></div>\").text(trivia[questionNum].choices[0] );\n var choice2Line = $(\"<div></div>\").text(trivia[questionNum].choices[1] );\n var choice3Line = $(\"<div></div>\").text(trivia[questionNum].choices[2] );\n var choice4Line = $(\"<div></div>\").text(trivia[questionNum].choices[3] );\n\n trivia[0].choices\n $(\"#insertHere\").append(questionLine); \n $(\"#insertHere\").append(choice1Line); \n $(\"#insertHere\").append(choice2Line); \n $(\"#insertHere\").append(choice3Line); \n\n $(\"#insertHere\").append(choice4Line); \n\n alert(trivia[0].question + trivia[0].choices[trivia[0].answer] );\n }", "function showQuestions(index) {\n // var question = questions[index].question\n // var question_number = questions[index].numb\n var question_tag =\n \"<span>\" +\n questions[index].numb +\n \". \" +\n questions[index].question +\n \"</span>\";\n // var question_tag =`<span> ${question_number} </span> <span> ${question} </span>`\n var option_tag = '<div class=\"option\"><span>' +\n questions[index].options[0] +\n \"</span></div>\" +\n '<div class=\"option\"><span>' +\n questions[index].options[1] +\n \"</span></div>\" +\n '<div class=\"option\"><span>' +\n questions[index].options[2] +\n \"</span></div>\" +\n '<div class=\"option\"><span>' +\n questions[index].options[3] +\n \"</span></div>\"\n question_text.innerHTML = question_tag //display questions\n option_list.innerHTML = option_tag\n var option = document.querySelectorAll(\".option\")\n \n option.forEach(function(item) {\n item.addEventListener(\"click\", function() {\n selectedOption(this)\n })\n })\n}", "function showOptions() {\n let questions = STORE.questions[STORE.currentQuestion];\n for (let i = 0; i < questions.options.length; i++) {\n $('.js-options').append(`\n <li><input type = \"radio\" name=\"options\" id=\"option${i + 1}\" value = \"${questions.options[i]}\" tabIndex=\"${i + 1}\">\n <label for=\"option${i + 1}\"> ${questions.options[i]}</label>\n <span class=\"response\" id=\"js-r${i + 1}\"></span></li>`\n );\n }\n}", "function showQuestion() {\n\t$('#answer').text(''); // Reset user input\n\t$('#answer').focus();\n\t$('#question').text(questionNumber + '. ' + Questions[questionIndex][0]); // Print question\n\tquestionNumber++;\n}", "function displayOptions() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"options\",\n\t\t\ttype: \"list\",\n\t\t\tmessage: \"Welcome! What would you like to do today?\",\n\t\t\tchoices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\",\n\t\t\t\"Add New Product\"]\n\t\t}\n\t]).then(function(answers) {\n\t\tif (answers.options === \"View Products for Sale\") {\n\t\t\tviewProducts();\n\t\t}\n\t\telse if (answers.options === \"View Low Inventory\") {\n\t\t\tlowInventory();\n\t\t}\n\t\telse if (answers.options === \"Add to Inventory\") {\n\t\t\taddInventory();\n\t\t}\n\t\telse if (answers.options === \"Add New Product\") {\n\t\t\taddProduct();\n\t\t}\n\t});\n}", "function questionContent() {\n \t$(\".gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "function displayQuestions(){\n\n //restarts countdown timer at each question\n stopwatch.stop();\n stopwatch.timer();\n \t\t\n \t\t// displays question and choices\n $(\"#questions\").text(questions[qCounter].question);\n\t\t$(\"#answer0\").text(questions[qCounter].choices[0]);\n\t\t$(\"#answer1\").text(questions[qCounter].choices[1]);\n\t\t$(\"#answer2\").text(questions[qCounter].choices[2]);\n\t\t$(\"#answer3\").text(questions[qCounter].choices[3]);\n }", "function showQuestions() {\n if (quizBank.length == questionCounter) {\n endQuiz();\n } else {\n questionDisplay.innerText = quizBank[questionCounter].question;\n showAnswers();\n }\n}", "function showQuestions(index){\n \n document.querySelector(\"#que_text\").textContent = questions[index].numb + \". \" + questions[index].question\n document.querySelector(\"#button0\").textContent = questions[index].options[0]\n document.querySelector(\"#button1\").textContent = questions[index].options[1]\n document.querySelector(\"#button2\").textContent = questions[index].options[2]\n document.querySelector(\"#button3\").textContent = questions[index].options[3]\n \n}", "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "function questionContent() {\n \n $(\"#gameScreen\").append(\"<p><strong>\" +\n questions[questionCounter].question + \"</p><p class= 'choices'>\" +\n questions[questionCounter].choices[0] + \"</p><p class='choices'>\" + \n questions[questionCounter].choices[1] + \"</p><p class='choices'>\" + \n questions[questionCounter].choices[2] + \"</p><p class='choices'>\" + \n questions[questionCounter].choices[3] + \"</strong></p>\");\n \n }", "function printQuizQuestion(questionNumber, question, options){\n return readLineSync.question(`Q${questionNumber}. ${question}\\n1. ${options[0]}\\n2. ${options[1]}\\n3. ${options[2]}\\n4. ${options[3]}\\n\\nEnter your option : `);\n}", "function showQuestion(){\n var q = questions[runningQuestion];\n questionContainer.innerHTML = q.question;\n a.innerHTML = q.answerA;\n b.innerHTML = q.answerB;\n c.innerHTML = q.answerC;\n d.innerHTML = q.answerD;\n}", "function displayQuestions() {\n\n if (textcompletionquestions[questioncounter].correctanswer2) {\n $(\"#D\").hide();\n $(\"#E\").hide();\n $(\"#Dradio\").hide();\n $(\"#Eradio\").hide();\n }\n else{\n $(\"#D\").show();\n $(\"#E\").show();\n $(\"#Dradio\").show();\n $(\"#Eradio\").show()\n \n }\n\n $(\"#practice-question\").text(textcompletionquestions[questioncounter].question)\n $(\"#A\").text(textcompletionquestions[questioncounter].correctanswer1);\n $(\"#Aradio\").val(textcompletionquestions[questioncounter].correctanswer1);\n $(\"#B\").text(textcompletionquestions[questioncounter].wronganswerA1);\n $(\"#Bradio\").val(textcompletionquestions[questioncounter].wronganswerA1);\n $(\"#C\").text(textcompletionquestions[questioncounter].wronganswerB1);\n $(\"#Cradio\").val(textcompletionquestions[questioncounter].wronganswerB1);\n $(\"#D\").text(textcompletionquestions[questioncounter].wronganswerC1);\n $(\"#Dradio\").val(textcompletionquestions[questioncounter].wronganswerC1);\n $(\"#E\").text(textcompletionquestions[questioncounter].wronganswerD1);\n $(\"#Eradio\").val(textcompletionquestions[questioncounter].wronganswerD1);\n\n if (textcompletionquestions[questioncounter].correctanswer2) {\n $(\"#second-question-set\").show();\n $(\"#A2\").text(textcompletionquestions[questioncounter].correctanswer2);\n $(\"#A2radio\").val(textcompletionquestions[questioncounter].correctanswer2);\n $(\"#B2\").text(textcompletionquestions[questioncounter].wronganswerA2);\n $(\"#B2radio\").val(textcompletionquestions[questioncounter].wronganswerA2);\n $(\"#C2\").text(textcompletionquestions[questioncounter].wronganswerB2);\n $(\"#C2radio\").val(textcompletionquestions[questioncounter].wronganswerB2);\n }\n else{\n $(\"#second-question-set\").hide();\n }\n\n if (textcompletionquestions[questioncounter].correctanswer3) {\n $(\"#third-question-set\").show();\n $(\"#A3\").text(textcompletionquestions[questioncounter].correctanswer3);\n $(\"#A3radio\").val(textcompletionquestions[questioncounter].correctanswer3);\n $(\"#B3\").text(textcompletionquestions[questioncounter].wronganswerA3);\n $(\"#B3radio\").val(textcompletionquestions[questioncounter].wronganswerA3);\n $(\"#C3\").text(textcompletionquestions[questioncounter].wronganswerB3);\n $(\"#C3radio\").val(textcompletionquestions[questioncounter].wronganswerB3);\n }\n else{\n $(\"#third-question-set\").hide();\n }\n questioncounter=questioncounter+1;\n \n }", "function printQuestion(question, quiz){\n //storing some variables from the html to change\n //storing important data from the questions object to be used\n var questionBox = $(\".question-text\");\n var answers = question.choices;\n\n //changing the text in the boxes needed\n //adding buttons/answer choices to boxes needed\n questionBox.text(question.title);\n createAnswers(answers, quiz);\n}", "function askQuestions() {\n if (currentQuestion === arrayOfQuestions.length) {\n questionSection.style.display = \"none\";\n initialsSection.style.display = \"block\";\n }\n presentQuestion.textContent = arrayOfQuestions[currentQuestion].quizQuestion;\n firstChoice.textContent = arrayOfQuestions[currentQuestion].potentialAnswers[0];\n secondChoice.textContent = arrayOfQuestions[currentQuestion].potentialAnswers[1];\n thirdChoice.textContent = arrayOfQuestions[currentQuestion].potentialAnswers[2];\n fourthChoice.textContent = arrayOfQuestions[currentQuestion].potentialAnswers[3]\n}", "function renderQuestion() {\n var q = multipleChoice[currentQuestionIndex];\n\n question.innerHTML = \"<p>\" + q.question + \"<p>\";\n answerA.innerHTML = q.answerA;\n answerB.innerHTML = q.answerB;\n answerC.innerHTML = q.answerC;\n}", "function showQ() {\n\t$question.show();\n}", "function showQuestion() {\n\n questionSpot.textContent = questions[questionIndex].question;\n showAnswers(); \n \n \n}", "function displayQuestion() {\n //we need an empty array to hold the \n //content of the array //it will be in html format\n const contents = [];\n\n\n///per each question we want to storage the answer \n questions.forEach((currentQuestion, questionIndex) => {\n //create options array to hold the answers(option)\n\n const options = [];\n \n//per each question we want to create radio \n//we use interpolation to concatenate the radio button question to each letter(questionIndex . I did not use\n//the push method, instead I use interpolation. Reference https://campushippo.com/lessons/how-to-do-string-interpolation-with-javascript-7854ef9d\n// we asign the value of the)\n\n///////////////////////////INFORMATION////////////////////////\n// To build code below I used https://www.sitepoint.com/simple-javascript-quiz/ \n\n//for each answer we add a radio buttom. we use concatenation\n for (var key in currentQuestion.answers) {\n options[options.length] = `<div>\n <input type=\"radio\" name=\"question${questionIndex}\" value=\"${key}\"/>\n <span>${currentQuestion.answers[key]}</span>\n </div>`;\n }\n\n contents[contents.length] = `\n <div class=\"question-wrap\">\n <div class=\"question\"> ${questionIndex + 1}. ${\n currentQuestion.question\n } </div>\n <div class=\"answers\"> ${options.join(\"\")} </div>\n </div>`;\n });\n\n quizContainer.innerHTML = contents.join(\"\");\n}", "function displayQuestion() {\n\n $(\"#question\").html(questionID.question);\n\n\n\n // Displays question's possible answers.\n\n displayQuestionAnswers();\n\n}", "function display(num) {\n num = num - 1;\n choices = \"'choices\" + num + \"'\";\n var text = \"\";\n if (questions[num].prompt && questions[num].prompt.includes(\" \")) {\n text += \"<p>\" + questions[num].prompt + \"</p>\";\n }\n text += \"<p>\" + questions[num].question +\"</p>\";\n text += \"<input type='radio' name=\" + choices + \" value='A'> \" + questions[num].A + \"<br>\";\n text += \"<input type='radio' name=\" + choices + \" value='B'> \" + questions[num].B + \"<br>\";\n text += \"<input type='radio' name=\" + choices + \" value='C'> \" + questions[num].C + \"<br>\";\n text += \"<input type='radio' name=\" + choices + \" value='D'> \" + questions[num].D + \"<br>\";\n text += \"<input type='radio' name=\" + choices + \" value='E'> \" + questions[num].E + \"<br>\";\n /*\n text += \"<input type='radio' name='choices1' value='A'>\" + questions[num].A + \"<br>\";\n text += \"<input type='radio' name='choices' value='B'>\" + questions[num].B + \"<br>\";\n text += \"<input type='radio' name='choices' value='C'>\" + questions[num].C + \"<br>\";\n text += \"<input type='radio' name='choices' value='D'>\" + questions[num].D + \"<br>\";\n text += \"<input type='radio' name='choices' value='E'>\" + questions[num].E + \"<br>\";\n */\n return text; \n}", "function displayQuestion() {\n let i = questions[currentQuestion];\n question.innerHTML = i.question;\n answerA.innerHTML = i.answerA;\n answerB.innerHTML = i.answerB;\n answerC.innerHTML = i.answerC;\n answerD.innerHTML = i.answerD;\n console.log();\n}", "function showQuestionInfo(category, difficulty, question){ \n // console.log(`Function showQuestionInfo Started!`); \n document.getElementById(\"category\").innerHTML = category;\n document.getElementById(\"difficulty\").innerHTML = difficulty;\n document.getElementById(\"question\").innerHTML = question; \n}", "function renderQuestion() {\n document.getElementById(\"start\").addEventListener(\"click\", startQuiz) \n test = get(\"button\");\n if (position >= window.question) {\n test.innerHTML = \"<h2>You got \" + correct + \" of \" + questions.length + \" questions correct</h2>\";\n get(\"submission\").innerHTML = \"Test completed\";\n //resets variable for quiz restart\n position = 0;\n correct = 0;\n //stops renderQuestion function when test is complete\n return false;\n }\n get(\"quest\").innerHTML = \"Question \" + (position + 1) + \" of \" + questions.length;\n\n question = questions[position].question;\n chA = questions[position].a;\n chB = questions[position].b;\n chC = questions[position].c;\n chD = questions[position].d;\n console.log(\"these are the questions\")\n // display the question\n question.innerHTML = \"<h3>\" + question + \"</h3>\";\n console.log(\"this is the question\")\n // display the answer options\n get \n // document.getElementById(\"userinput1\").value = \"chA\";\n // document.getElementById(\"userinput2\").value = \"chB\";\n // document.getElementById(\"userinput3\").value = \"chC\";\n // document.getElementById(\"userinput4\").value = \"chD\";\n\n}", "function displayQuestion() {\n let q = questions[currentQuestion];\n question.innerHTML = q.question;\n btnA.innerHTML = q.choiceA;\n btnB.innerHTML = q.choiceB;\n btnC.innerHTML = q.choiceC;\n btnD.innerHTML = q.choiceD\n}", "function questionSelect() {\n var currentQuestion = questionsArray[questionOptions];\n questionAsk.innerHTML = \"<h2>\" + currentQuestion.question;\n button1.innerHTML = currentQuestion.answer1;\n button2.innerHTML = currentQuestion.answer2;\n button3.innerHTML = currentQuestion.answer3;\n button4.innerHTML = currentQuestion.answer4;\n}", "function renderQuestion(){\n\n // Create a variable to hold the index\n let q = questions[runningQuestion];\n \n // Show the question\n question.html(q.question);\n\n // Show the choices\n choiceA.html(q.choiceA);\n choiceB.html(q.choiceB);\n choiceC.html(q.choiceC);\n // choices.show();\n}", "function showQuestion() {\n\n if (currentQuestion <= lastQuestion) {\n\n console.log(currentQuestion);\n questionDisplayed = questions[currentQuestion];\n\n question.textContent = questionDisplayed.question;\n answer1.textContent = questionDisplayed.optionA;\n answer2.textContent = questionDisplayed.optionB;\n answer3.textContent = questionDisplayed.optionC;\n answer4.textContent = questionDisplayed.optionD;\n\n }\n\n}", "function printQA() {\n var currentQA = getRandomQA();\n var message = '<h3 class=\"question\">Q: ' + currentQA.question + \"</h3>\";\n message += '<p class=\"answer\">A: ' + currentQA.answer + \"</p><footer>\";\n if (currentQA.readmore) {\n message += '<p><a class=\"readmore\" href=\"' + currentQA.readmore + '\">Read More...</a></p>';\n }\n if (currentQA.tags) {\n \tmessage += '<span class=\"tags small\">tags: ' + currentQA.tags + '</span>';\n }\n message += \"</footer>\";\n\n document.getElementById(\"qa-box\").innerHTML = message;\n}", "function displayQs() {\n\tfor (i = 1; i <=10; i++) {\t\n\t\t$(\"#displayQ\" + i).html(\"<h2>\" + trivia[currentQuestion].question + \"</h2>\");\n\t\tcurrentQuestion++;\n\t}\n}", "function displayQuestions() {\n let q = triviaQuestions[questionCount];\n \n question.innerHTML = \"<p>\"+ q.question +\"</p>\";\n choice1.innerHTML = q.choice1;\n choice2.innerHTML = q.choice2;\n choice3.innerHTML = q.choice3;\n choice4.innerHTML = q.choice4;\n\n //Ends the quiz after the questions are finished and displays results\n if (questionCount > 9) {\n alert(\"The quiz is now over. Let's see your results.\");\n stopTimer();\n $(\"#timer\").hide();\n $(\"#trivia\").hide();\n showResults(); \n } \n }", "function displayQuestion() {\n questionBox.textContent = myQuestions[questionIndex].question\n displayAnswers()\n}", "function displayQuestion() {\n //generate random index in array\n index = Math.floor(Math.random()*options.length);\n pick = options[index];\n \n //\tif (pick.shown) {\n //\t\t//recursive to continue to generate new index until one is chosen that has not shown in this game yet\n //\t\tdisplayQuestion();\n //\t} else {\n //\t\tconsole.log(pick.question);\n //iterate through answer array and display\n $(\"#questionblock\").html(\"<h2>\" + pick.question + \"</h2>\");\n for(var i = 0; i < pick.choice.length; i++) {\n var userChoice = $(\"<div>\");\n userChoice.addClass(\"answerchoice\");\n userChoice.html(pick.choice[i]);\n //assign array position to it so can check answer\n userChoice.attr(\"data-guessvalue\", i);\n $(\"#answerblock\").append(userChoice);\n //\t\t}\n }\n \n \n \n //click function to select answer and outcomes\n $(\".answerchoice\").on(\"click\", function () {\n //grab array position from userGuess\n userGuess = parseInt($(this).attr(\"data-guessvalue\"));\n \n //correct guess or wrong guess outcomes\n if (userGuess === pick.answer) {\n stop();\n correctCount++;\n userGuess=\"\";\n $(\"#answerblock\").html(\"<p>Correct!</p>\");\n hidepicture();\n \n } else {\n stop();\n wrongCount++;\n userGuess=\"\";\n $(\"#answerblock\").html(\"<p>Wrong! The correct answer is: \" + pick.choice[pick.answer] + \"</p>\");\n hidepicture();\n }\n })\n }", "function displayQuestion() {\n $(\"#question,#answer,#options\").empty();\n $(\"#question\").html(questions[questionsIndex].question);\n for (let i = 0; i < questions[questionsIndex].options.length; i++) {\n let option =\n \"<div class='option'>\" + questions[questionsIndex].options[i] + \"</div>\";\n $(\"#options\").append(option);\n }\n startTimer();\n}", "function showquestion(){\n answersUL.setAttribute(\"style\", \"display: flex\")\n question.innerHTML = questions[questionNumber].question\n let questionChoices = questions[questionNumber].choices\n for(let i=0; i<questionChoices.length; i++){\n answersUL.children[i].textContent = questionChoices[i]\n }\n}", "function question(questionNum) {\n $(\"h2\").text(allQuestions[questionNum].question);\n\n $.each(allQuestions[questionNum].choices, function (i, answers) {\n $(\"#\" + i).html(answers);\n });\n}", "function displayQuestion() {\n for (var i = 0; i < totalQuestions; i++) {\n $(\".form-group\").prepend(\"<div class=\" + questions[i].divClass + \"></div>\");\n var divQuestion = $('<div class=\"statement\">' + questions[i].statement + '</div>');\n $('.' + questions[i].divClass).append(divQuestion);\n\n let answersArrayLen = questions[i].answers.length;\n for (var x = 0; x < answersArrayLen; x++) {\n $(\".\" + questions[i].divClass).append(\"<div class='radio-inline'><input class='form-check-input' type='radio' name=\" + questions[i].divClass + \" value=\" + questions[i].answers[x] + \"><label class='form-check-label' for=\" + labels[x] + \">\" + questions[i].answers[x] + \"</label></div>\");\n }\n }//for i<totalQuestions\n }", "function displayQuestion(data){\n //Update the question, text, answers and categories\n $(\"#questionText\").text(data.question);\n $(\"#quizgamecategory\").text(data.category);\n\n //show the question section\n $('#quizgamequestion').show();\n}", "function renderQuestion (){\n var q = questions[runningQuestion];\n\n question.innerHTML = \"<p>\" + q.question +\"<p>\"\n choiceA.innerHTML = q.choiceA;\n choiceB.innerHTML = q.choiceB;\n choiceC.innerHTML = q.choiceC;\n // choiceD.innerHTML = q.choiceD;\n \n\n}", "function showQuestion(n) {\n\t\t// cache the current question number for use by other functions\n\t\tcurrentQuestionNumber = n;\n\t \t// Update the current question number indicator, ex : Question 3 of 20\n\t \t$(\".q-number span\").first().text(currentQuestionNumber);\n\t \t// Hide the next button until user submits the answer\n\t\t$(\"#quiz-panel .next\").hide();\n\n\t\tvar question = QUESTIONS[currentTrackName][n - 1];\n\t\t\n\t\tvar questionHtml = buildHTML(QUIZ_TEMPLATE_QUESTION, question.title);\n\n\t\tvar answersHtml = \"\";\n\t\t$.each(question.options, function (index, value) {\n\t\t\t// constructing the li including radio button\n\t\t\tanswersHtml += buildHTML(QUIZ_TEMPLATE_OPTION, index + 1, value);\n\t\t});\n\t\tanswersHtml = buildHTML(QUIZ_TEMPLATE_LIST, answersHtml);\n\n\t\t$(\"#question-box\").html(questionHtml + answersHtml);\n\n\t\t$(\"#quiz-panel .submit\").attr(\"disabled\", \"disabled\").show();\n\n \t\t// we should enable the submit button when radio button value changes\n\t \t$(\"input:radio[name=answer]\").change(function () {\n\t \t\t$(\"#quiz-panel .submit\").removeAttr(\"disabled\");\n\t \t});\n\t}", "function questionDisplay() {\n\n //1 - update the each question text\n $('#question').text(questionsArray[currentQuestionNumber].questionText);\n\n\n\n //2 - display the what are the choices for the current question\n //2.1 - first delete all the existing choices before populating it with new ones\n $('#choices').empty();\n //2.2 - the get the total number of choices for the current question\n var totalNumberOfChoices = questionsArray[currentQuestionNumber].questionChoices.length;\n //2.3 - loop through all the choices and append them to the choices container\n for (var i = 0; i < totalNumberOfChoices; i++) {\n //2.3.1 - loop thru the answer choices and create a dynamically generated row for each of them\n var buildEachChoiceHTML = \"<input type='radio' class='option' name='option' value=\" + i + \">\" + questionsArray[currentQuestionNumber].questionChoices[i] + \"<br>\";\n //2.3.2 append that row to the choices container in html\n $('#choices').append(buildEachChoiceHTML);\n }\n\n\n\n //3 - displays the number of the current question\n $('#questionNumberDisplay').text(\"Question \" + (currentQuestionNumber + 1) + \" of \" + totalNumberOfQuestion);\n}", "function questions() {\n timer.answerTime = 30;\n timer.runTimer();\n // to show the div contains question and choices\n $(\"#wraper\").show();\n //Attempt to uncheck the question choice for start of each quesiton \n $('input:radio').prop(\"checked\",false);\n //print text of question in html \n $(\"#problems\").text(problems[counter].question);\n $(\"#choice-0\").text(problems[counter].choices[0]);\n $(\"#choice-1\").text(problems[counter].choices[1]);\n $(\"#choice-2\").text(problems[counter].choices[2]);\n $(\"#choice-3\").text(problems[counter].choices[3]);\n \n}", "function showQuestion(question) {\n questionEl.innerText = question.question;\n}", "function show_question(){\n\t\t$(\".box\").html(\"\");\n\n\t\tif(next_question > questions.length){\n\t\t\tconsole.log(\"No more questions\");\n\t\t\t// show results\n\t\t\tresults();\n\t\t\treturn;\n\t\t}\n\n\t\tselected_question=questions[next_question-1];\n\t\tconsole.log(selected_question.question);\n\t\t\n\t\tvar tick = 30;\n\t\t$(\".timer\").html(\"<p id=\\'timer\\' class=centered>Time Remaining: \"+tick+\" Seconds</p>\");\n ticker = window.setInterval(function(){\n \tif(tick>0){\n \t\ttick--;\n \t\t$(\".timer\").html(\"<p id=\\'timer\\' class=centered>Time Remaining: \"+tick+\" Seconds</p>\");\n \t}\n }, 1000);\n\n\t\tdisplay_question.html(\"<p class=centered>\"+selected_question.question+\"<p>\");\n\t\t// create var and store <p> tag in it\n\t\t//add attributes to var \n\t\t// in for loop that loops for questions.length times add data-answer=answer+i attr and text selected_question.answer+i\n\t\tfor (var i=0; i<questions.length;i++){\n\t\t\tvar print_answ=$(\"<p>\");\n\t\t\tprint_answ.attr(\"class\", \"answer centered btn btn-primary btn-lg container-fluid\");\n\t\t\tprint_answ.attr(\"data-answer\", \"answer\"+i);\n\t\t\tprint_answ.text(selected_question['answer'+i]);\n\t\t\tdisplay_question.append(print_answ);\n\t\t\t$(\".box\").append(display_question);\n\t\t\tconsole.log(\"printing answers\");\n\t\t}\n\t\t// display_question.append(\"<p data-answer=answer0 class=\\\"answer centered btn btn-primary btn-lg container-fluid\\\">\"+selected_question.answer0+\"</p>\"+\n\t\t// \t\"<p data-answer=answer1 class=\\\"answer centered btn btn-primary btn-lg container-fluid \\\">\"+selected_question.answer1+\"</p>\"+\n\t\t// \t\"<p data-answer=answer2 class=\\\"answer centered btn btn-primary btn-lg container-fluid \\\">\"+selected_question.answer2+\"</p>\"+\n\t\t// \t\"<p data-answer=answer3 class=\\\"answer centered btn btn-primary btn-lg container-fluid \\\">\"+selected_question.answer3+\"</p>\");\n\n\t\tnext_question++;\n\t\t//If the player runs out of time, tell the player that time's up and display \n\t\t//the correct answer. Wait a few seconds, then show the next question.\n\t\ttimeout = setTimeout(function() {\n unanswered++;\n console.log(unanswered);\n display_question.html(\"<h3 class=centered>Out Of Time!</h3>\");\n\t\t display_question.append(\"<p class=centered>The Correct Answer Was: \"+selected_question.correctAnswer+\"</p>\");\n\t\t $(\".box\").html(display_question);\n\t\t gif();\n\t\t timeout = setTimeout(show_question, 6000);\n // return;\n }, 30000);\n\t}", "function WriteQuestion(x) {\n\t\t$('#questDisplay').html('<p>' + formOne[x].question +'</p>');\n\t}", "function showQuestion(questionNumber) {\n \n currentQuestion = questionNumber;\n var questionDetails = questionAnswersOptions[questionNumber-1];;\n var question = questionDetails.question;\n var options = questionDetails.options;\n \n $(\"#questionTxt\").html(question);\n $(\"#questionCounter\").html(showQuestionCounter(questionNumber));\n var optionsHtml = \"\";\n $('#optionsContainer').html(optionsHtml);\n \n for ( var i = 0; i < options.length; i++ ) {\n // Use of AND operator\n if ( answerByStudent[questionNumber] && answerByStudent[questionNumber] === (i+1) ) {\n optionsHtml += '<input type=\"radio\" name=\"option\" checked onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n } else {\n optionsHtml += '<input type=\"radio\" name=\"option\" onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n }\n }\n $('#optionsContainer').html(optionsHtml);\n if(questionNumber === questionAnswersOptions.length){\n $(\"#nextBtn\").hide()\n }else{\n $(\"#nextBtn\").show()\n }\n}", "function renderQuestion() {\n var q = questions[runningQuestion];\n\n questionDisplay.textContent = q.question;\n choiceA.innerHTML = q.choiceA;\n choiceB.innerHTML = q.choiceB;\n choiceC.innerHTML = q.choiceC;\n choiceD.innerHTML = q.choiceD;\n}", "function displayQuestionsAndAnswers(questionsList) {\n\n\tdisplayContainer.insertAdjacentHTML('beforeend', \"<h1> Your Input </h1>\");\n\n\tvar i;\n\t// For loop that basically iterates through the list and prints out what the user responded.\n\tfor (i = 0; i < questionsList.length; i ++) {\n\t\t//Every index into questionsList will be a question object.\n\t\tprocessQuestionAndAnswerObject(questionsList[i]);\n\t}\n}", "function show(count) {\r\n let user_name = sessionStorage.getItem(\"player_name\");\r\n document.querySelector(\".user_name\").innerHTML = user_name;\r\n let question = document.getElementById(\"questions\");\r\n let [first, second, third, fourth] = questions[count].options;\r\n\r\n question.innerHTML = `\r\n <h2>Q${question_count + 1}. ${questions[count].question}</h2>\r\n <ul class=\"option_group\">\r\n <li class=\"option\">${first}</li>\r\n <li class=\"option\">${second}</li>\r\n <li class=\"option\">${third}</li>\r\n <li class=\"option\">${fourth}</li>\r\n</ul> \r\n `;\r\n selectedAnswer();\r\n}", "function show_answers() {\n $(\".answers\").show(500);\n $(\".result-info\").show(500);\n }", "function showQusestion(index){\n\nconst que_text = document.querySelector(\".que_text\");\nconst que_tag = '<span>'+questions [index].numb +\".\"+ questions [index].question + '</span>';\nlet option_tag = '<div class=\"option\">'+ questions [index].options[0] +'<span></span></div>'\n +'<div class=\"option\">'+ questions [index].options[1] +'<span></span></div>'\n +'<div class=\"option\">'+ questions [index].options[2] +'<span></span></div>'\n +'<div class=\"option\">'+ questions [index].options[3]+'<span></span></div>';\nque_text.innerHTML = que_tag ;\noption_list.innerHTML = option_tag ;\n\n\n\nconst option = option_list.querySelectorAll(\".option\");\n\n\n// set onclick attribute to all available options\nfor(i=0; i < option.length; i++){\n option[i].setAttribute(\"onclick\", \"optionSelected(this)\");\n}\n\n}", "function showAnswers(){\n let answerA = theQuestions[questionIndex].answer[0].list\n let answerB = theQuestions[questionIndex].answer[1].list\n let answerC = theQuestions[questionIndex].answer[2].list\n let answerD = theQuestions[questionIndex].answer[3].list\n btnTextA.textContent = answerA\n btnTextB.textContent = answerB\n btnTextC.textContent = answerC\n btnTextD.textContent = answerD\n multChoiceA.appendChild(btnTextA)\n multChoiceB.appendChild(btnTextB)\n multChoiceC.appendChild(btnTextC)\n multChoiceD.appendChild(btnTextD)\n }", "function displayQuestion() {\r\n var questionEl = document.querySelector(\"#question\")\r\n questionEl.textContent = questions[currentQuestion].question\r\n var optionsEl = document.querySelector(\"#options\")\r\n optionsEl.innerHTML =''\r\n for (let i = 0; i < questions[currentQuestion].answers.length; i++) {\r\n var button = document.createElement(\"button\")\r\n button.textContent = questions[currentQuestion].answers[i]\r\n button.setAttribute(\"value\", i)\r\n button.setAttribute(\"class\", \"answer\")\r\n optionsEl.appendChild(button)\r\n }\r\n}", "function loadQuestion (questionIndex) {\n var q = questions[questionIndex];\n questionEl.textContent = (questionIndex + 1) + '. ' + q.question; \n opt1.textContent = q.option1;\n opt2.textContent = q.option2;\n opt3.textContent = q.option3;\n }", "function displayQuiz() {\n\tcounter = 31;\n\tcountDown();\n\tfor (var i = 0; i < quizQuestions.length; i++) {\n\t\t$(\"#quizzy\").html('<p>' + quizQuestions[i].question + '</p>');\n\n\t\t$(\"#choices\").html('<form>'\n\t\t\t+ '<p><input type=\"radio\" id=\"dot\"> ' + quizQuestions[i].answer[0] + '</p>'\n\t\t\t+ '<p><input type=\"radio\" id=\"dot\"> ' + quizQuestions[i].answer[1] + '</p>'\n\t\t\t+ '<p><input type=\"radio\" id=\"dot\"> ' + quizQuestions[i].answer[2] + '</p>'\n\t\t\t+ '<p><input type=\"radio\" id=\"dot\"> ' + quizQuestions[i].answer[3] + '</p>'\n\t\t\t+ '</form>');\n\t\t//Now we add a function that will record the choice the user picks among the answers\n\t\t//function pick() {\n\t\t\t//options = document.getElementByID(\"dot\").value; \n\t\t//}\n\t\tconsole.log(quizQuestions[i].question);\n\t\tfunction choice (){\n\t\t\toptions = document.getElementByID(\"dot\").value;\n\t\t}\n\t}\t\n}", "function showHelp() { \n var search = $(select).find(':selected').nextAll().andSelf();\n var num_display = 1;\n\n // Clear out div.\n $(suggest_div).find('.suggest-prompt').empty();\n \n // Add help text.\n for (var i = 0; i < Math.min(num_display, search.length); i++) {\n $(suggest_div).find('.suggest-prompt').append(\n search[i].value + ' -- ' + search[i].title + '<br/>' \n );\n }\n }" ]
[ "0.7839162", "0.7729639", "0.7702389", "0.7502837", "0.7470076", "0.74347293", "0.7391643", "0.7376265", "0.7345987", "0.7327849", "0.73261034", "0.7322166", "0.73218083", "0.7262212", "0.72584856", "0.724914", "0.72452974", "0.718478", "0.71621937", "0.7160063", "0.7139286", "0.71361125", "0.71099395", "0.7109833", "0.70532405", "0.70506084", "0.70429885", "0.70311326", "0.7011499", "0.6996497", "0.6975676", "0.6966511", "0.6965049", "0.69610447", "0.69598264", "0.69570297", "0.6956952", "0.69566435", "0.6925747", "0.6925031", "0.6924918", "0.6918188", "0.690414", "0.68970436", "0.6894793", "0.68908376", "0.6884052", "0.6883138", "0.6879421", "0.68793446", "0.68753296", "0.6864488", "0.6864488", "0.68617994", "0.6861532", "0.6852676", "0.6846786", "0.6843029", "0.6840292", "0.68327874", "0.6831626", "0.6822642", "0.68224156", "0.68144727", "0.67913747", "0.6791181", "0.6787423", "0.6777932", "0.67759705", "0.67633086", "0.6760477", "0.67590797", "0.6754628", "0.67510265", "0.67201245", "0.671964", "0.6714527", "0.6709479", "0.6705274", "0.6700904", "0.66886306", "0.66820383", "0.6677739", "0.66684914", "0.6665406", "0.6664766", "0.66581243", "0.66546816", "0.66487324", "0.66459703", "0.6641934", "0.6639214", "0.6636291", "0.66331166", "0.6630464", "0.66290355", "0.66282254", "0.6622147", "0.6615905", "0.6614736" ]
0.7123231
22
this checks the answer
function checkans(value) { if (game === " ") { alert("Select a game"); } if (game === "java") { if (value === JavaAns[qcount]) { curr_score++; } } if (game === "c") { if (value === CAns[qcount]) { curr_score++; } } if (game === "cplus") { if (value === CPlusAns[qcount]) { curr_score++; } } if (game === "python") { if (value === PythonAns[qcount]) { curr_score++; } } qcount++; seconds=30; DisplayScore(curr_score); Quiz(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnswers() {\n\n}", "checkResult() {\n const MAX_ANSWERS_LENGTH = 10;\n if (this.model.isDead()) {\n this.loose();\n } else if (this.model.defineAnswersLength() === MAX_ANSWERS_LENGTH) {\n this.win();\n } else {\n this.startGame();\n }\n }", "function checkAnswers(answers){\n var correctAns = model.transition(false);\n var result = []; var sum = 0;\n var allCorrect = 1;\n var error = {errorName:\"none\",badInputs:[]};//[error name, position that error was found]\n \n for (var i = 0; i < answers.length; i++){\n sum += answers[i];\n if(isNaN(answers[i])){\n error.errorName = \"nonnumber_error\";\n error.badInputs.push(i);\n }\n else if(answers[i] <0){\n error.errorName = \"negative_error\";\n error.badInputs.push(i);\n }\n if (round_number(answers[i],3) == round_number(correctAns[i],3)){\n result[i] = \"right\"; \n }\n else {result[i] = \"wrong\"; allCorrect = 0;}\n }\n result[answers.length] = allCorrect;\n if (round_number(sum,3) != round_number(1,3) && error.errorName==\"none\"){ error.errorName = \"sum_error\"; error.badInputs =[]}\n// else {result[answers.length+1] = \"sum_correct\";}\n \n result[answers.length+1] = error;\n return result;\n }", "checkAnswer(answer) {\n let check = false;\n if (answer == this.rightAnswer)\n check = true;\n check ? console.log(`CORRECT`) : console.log(`INCORRECT`);\n return check;\n }", "function checkAnswer(answer) {\n\t\treturn answer.isCorrect;\n\t}", "function checkSum(answer,observation){\n console.log(answer[0]);\n var correctAns = model.prob_OnS()[observation];\n var sum = 0;\n for (var i = 0; i < Object.keys(correctAns).length; i++){\n sum += correctAns[i];\n }\n // console.log(sum);\n if (answer[0].toFixed(3) == sum.toFixed(3)) {return 1;}\n else {return 0;}\n }", "function answerIsIncorrect () {\r\n feedbackForIncorrect();\r\n}", "function printQuizResult(ans, result){\n if(result == ans){\n console.log(`CORRECT ANSWER 😁\\n`);\n return 1;\n }else{\n console.log(`OOPS!WRONG ANSWER 🙁\\nCORRECT ANSWER IS: ${result}`);\n }\n return 0;\n}", "function correctAnswer() {\n return $scope.answer.value === $scope.data.solution;\n }", "evaluateAnswer(userAnswer){\n \tconst {value1, value2, value3, proposedAnswer} = this.state;\n \tconst corrAnswer = value1 + value2 + value3;\n \treturn(\n \t\t (corrAnswer === proposedAnswer && userAnswer === 'true') ||\n \t\t (corrAnswer !== proposedAnswer && userAnswer === 'false')\n \t);\n }", "isCorrect(index, answers) {\n if (answers.indexOf(index) != -1) {\n return 100;\n }\n return 0;\n }", "function isAnswerCorrect(answer){\n\n if(correctAnswer === answer){\n return true;\n }\n else{\n return false;\n }\n}", "function checkanswer(){\r\n if (userClickedPattern[currentspot]===gamePattern[currentspot])\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function is_correct_answer(answer_text){\n if (answer_text == correctAnswer) {\n return true;\n }\n return false;\n}", "function add_check() {\n\t\tvar ans = [];\n\t\tvar localScore = 0;\n\t\t// console.log(curOperation);\n\t\t\n\t\t// Get answer vals and put in an array\n\t\t$('#'+curOperation+'-quest .answer').each(function (){\n\t\t\tans.push(this.value);\n\t\t})\n\n\t\t// Problems here with undefined rs\n\t\t// console.log(probArr.length)\n\t\tif(probArr.length > 0 ) {\n\t\t\t// console.log(probArr.length)\n\t\t\tfor(var i = 0;i<probArr.length;i++){\n\t\t\t\t// var a = $('#add-quest .answer').get(i)\n\t\t\t\t// console.log(probArr)\n\t\t\t\tif(probArr[i] !== undefined) {\n\n\t\t\t\t\tif(probArr[i].r !== parseInt(ans[i])){\n\t\t\t\t\t\t// console.log(i+': incorrrect');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlocalScore += 1;\n\t\t\t\t\t\t// console.log(\"localScore: \"+localScore)\n\t\t\t\t\t} \n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif(!played){\n\t\t\t// console.log(\"adding \"+score+' plus '+localScore)\n\t\t\tscore += localScore;\n\t\t\tupdate_score();\n\t\t\tplayed = true;\t\n\t\t}\t\n\t\tadd_sub_nums(curOpMax);\n\t}", "function checkPass(result) {\n let labMarks = result.labMarks ? result.labMarks : 0;\n return result.theoryMarks + labMarks >= 50;\n }", "function checkcurr() {\n outresult[position][1] = $(\"input[name=answer]:checked\", \"#ansform\").val();\n if (outresult[position][1] === outresult[position][3]) {\n outresult[position][2] = \"Correct\";\n } else {\n outresult[position][2] = \"Incorrect\";\n }\n}//end of checkcurr", "function checkUserAnswer(answer) {\n//when the user selects an answer and it is exactly equal to an index in the correctAnswer object key,\n\tif(answer.text() === questionList[getCurrentIndex()].ansArray[questionList[getCurrentIndex()].correctAnswer]) {\n return true;\n console.log(true);\n } else {\n return false;\n console.log(false);\n }\n}", "verifySolution() {\n // userInput == curr solution\n // alert(userInput)\n \n this.player.prevResponseCorrectness = true\n this.foundSolution = true\n return true\n // console.log(this.input._value)\n // let userInput = this.input._value\n // alert(userInput)\n // let solution = this.player.currSolution\n // // set this to true in order to handle updates when solution is found\n // this.foundSolution = true\n // if (userInput == solution) {\n // this.foundSolution = true\n // }\n // this.player.prevResponseCorrectness = this.foundSolution\n \n // return this.foundSolution\n }", "function checkAnswer() {\r\n // get first factor\r\n var factor1 = document.getElementById('factor1').innerHTML;\r\n console.log(\"factor 1 = \" + factor1);\r\n // get second factor\r\n var factor2 = document.getElementById('factor2').innerHTML;\r\n console.log(\"factor 2 = \" + factor2);\r\n // get answer\r\n var answer = document.getElementById('answer').value;\r\n console.log(\"answer = \" + answer);\r\n console.log((factor1*factor2) == answer);\r\n return (factor1*factor2) == answer;\r\n}", "function evaluateAnswer(userAnswer, correctAnswer){\n console.log('evaluating answer');\n if(userAnswer === correctAnswer){\n return true;\n }else {\n return false;\n } \n}", "function answerQ () {\n let val = document.getElementById('answer');\n \n if (val === '') { alert('Mohon jawab dulu!'); generateAngka(); }\n \n if (val === ops) { alert('Jawaban kamu benar!\\nMembuat pertanyaan baru lagi..'); generateAngka(); }\n}", "function isTautology(results){\r\n for (var i= 0; i < results.length; i++) if (results[i] == 0) return false;\r\n return true;\r\n}", "function evaluateAnswers(answer) {\n\n\tif(answer === answers[0].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[0].isCorrect;\n\t}\n\n\telse if(answer === answers[1].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[1].isCorrect;\n\t}\n\telse if(answer === answers[2].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[2].isCorrect;\n\t}\n\telse if(answer === answers[3].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[3].isCorrect;\n\t}\n\n\telse {\n\t\tunanswered = true;\n\t}\n}", "function trueOrFalse1() {\n\t\t \tconsole.log(eachone[count].option1.truth);\n\t\t \tif (eachone[count].option1.truth == true){\n\t\t \t\tcorrectAnswers++;\n\t\t \t\tguessedIt = true;\n\t\t \t} else {\n\t\t \t\tincorrectAnswers++;\n\t\t \t\tguessedIt = false;\n\t\t \t};\n\t\t}", "function q1 (){\n let answer = prompt('Is Quen from Maine?');\n answer = answer.toLowerCase();\n \n //question1\n if (answer === answerBank[2] || answer === answerBank[3]){\n console.log('correct');\n globalCorrect = globalCorrect + 1;\n alert('You got it correct, ' + userName + '!');\n }\n else if (answer === answerBank[0] || answer === answerBank[1]){\n console.log('Wrong');\n alert('Ouch! Better luck on the next one.');\n }\n else{\n //console.log('Non accepted answer submitted');\n alert('Wow, really?');\n }\n}", "function check(){\n if(trivia.questions.userGuess==trivia.questions.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions.userGuess!=trivia.questions.answer){\n \tincorrectAnswer++;\n }\n if(trivia.questions2.userGuess==trivia.questions2.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions2.userGuess!=trivia.questions2.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions3.userGuess==trivia.questions3.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions3.userGuess!=trivia.questions3.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions4.userGuess==trivia.questions4.answer){\n \tcorrectAnswer++;\n }\n\n else if(trivia.questions4.userGuess!=trivia.questions4.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions5.userGuess==trivia.questions5.answer){\n \tcorrectAnswer++;\n }\n\n else if(trivia.questions5.userGuess!=trivia.questions5.answer){\n \tincorrectAnswer++;\n }\n\nCorrect();\nIncorrect();\n}", "function check_correctness() {\n\tvar answerText = document.getElementById(\"answer-input\").value.replace(/,/g , \"\");\n\tvar answerSplit = answerText.split(\" \");\n\tvar weightTotal = 0; //sums weight of matching user input matching keywords\n\tvar keywords = [];\n\tvar toCheck;\n\t//brute force, but should be okay with the low amount of keywords we expect\n\tfor (var i = 0; i < answerSplit.length; i++) {\n\t\tfor (var j = 0; j < chosenTopics[numAnswered].keywords.length; j++) {\n\t\t\tkeywords.push(chosenTopics[numAnswered].keywords[j].keyword);\n\t\t}\n\t\ttoCheck = $.inArray(answerSplit[i], keywords);\n\t\tif (toCheck !== -1) {\n\t\t\tweightTotal += parseInt(chosenTopics[numAnswered].keywords[toCheck].weight);\n\t\t\tpresentKeywordIds.push(chosenTopics[numAnswered].keywords[toCheck].id);\n\t\t}\n\t}\n\tchosenTopics[numAnswered].answerWeightSum = weightTotal;\n}", "function validateAnswer() {\n switch (current_question_number) {\n case 1: {\n return validateQuestion1();\n }\n case 2: {\n return validateQuestion2();\n }\n case 3: {\n return validateQuestion3();\n }\n case 4: {\n return validateQuestion4();\n }\n case 5: {\n return validateQuestion5();\n }\n }\n }", "checkSolution()\n {\n return (this.solutionString == this.givenSolutionString);\n }", "function checkA() { \n if (ans == \"0\") {\n correct();\n }\n else {\n incorrect();\n }\n}", "function checkAnswer(answer, answerSelection) {\n //Write your code in here\n // if the \"veryPositive\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"very positive\"\n if (possibleAnswers.veryPositive.includes(answer, [answerSelection])) {\n return \"very positive\";\n }\n // if the \"positive\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"positive\"\n else if (possibleAnswers.positive.includes(answer, [answerSelection])) {\n return \"positive\";\n }\n // if the \"negative\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"negative\"\n else if (possibleAnswers.negative.includes(answer, [answerSelection])) {\n return \"negative\";\n }\n // if the \"veryNegative\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"very negative\"\n else if (possibleAnswers.veryNegative.includes(answer, [answerSelection])) {\n return \"very negative\";\n }\n}", "function checker () {\n\tfinalResult += exercises[pointer].studentAnswer;\n\t++pointer;\n\tif ( pointer == exercises.length ) {\n\t\talert(\"The exam is finished.\");\n\t\treturn 0;\n\t}\n\tnxtbtnContainer.style.display = \"none\";\n\tbuildAndShow();\n}", "function checkAnswer(questionNumber, answer) {\n\n}", "function newCalc() {\n let ans = rs.question('Another calculation?\\n');\n\n if (ans.slice(0, 1).toLowerCase() === 'y') {\n return true;\n } else {\n console.log('Goodbye.');\n }\n}", "checkAnswers() {\n let gotRight = true;\n // see that they got them all right\n for (var i in this.displayedAnswers) {\n if (\n gotRight != false &&\n this.displayedAnswers[i].correct &&\n this.displayedAnswers[i].userGuess\n ) {\n gotRight = true;\n } else if (\n this.displayedAnswers[i].correct &&\n !this.displayedAnswers[i].userGuess\n ) {\n gotRight = false;\n } else if (\n !this.displayedAnswers[i].correct &&\n this.displayedAnswers[i].userGuess\n ) {\n gotRight = false;\n }\n }\n return gotRight;\n }", "function checkAnswer() {\n var answer = document.getElementById('riddle-answer').value;\n console.log(answer);\n var hash = 0, i, chr;\n for (i = 0; i < answer.length; i++) \n {\n chr = answer.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0;\n }\n \n console.log(hash);\n if (hash == 1852442505 || hash == 1787798377)\n {\n document.getElementById('riddle-won').textContent = \"Really?? This is incredible, nobody gets this right. Want to play sometime?\";\n }\n return false;\n}", "validateAnswer(answer){\n \n if(answer === this.rightAnswer){\n \n return true;\n // return imageUrl;\n }\n \n return false;\n }", "check(user_choice){\n return user_choice === this.answer;\n }", "function verifierEquation(item,min,max,numberDisplay) {\n\t\n\tvar reponseUser = item.innerHTML;\n\tvar nbr1 = parseInt(document.getElementById(\"nbr1\").innerHTML);\n\tvar nbr2 = parseInt(document.getElementById(\"nbr2\").innerHTML);\n\tvar signe = document.getElementById(\"signe\").innerHTML;\n\t\n\tclearAnswer(numberDisplay);\n\t\n\tvar reponseEquation = calculEquation(nbr1,nbr2,signe);\n\t\n\tif (reponseUser == reponseEquation) {\n\t\t\n\t\tdisplayAfterGoodAnswer(reponseEquation)\n\t\t\n\t\tnumberGoodAnswer ++; \n\t\tnumberTotalAnswer ++;\n\t\t\n\t\tafficheNumberGoodAnswer();\n\t\t\n\t\tsetTimeout(load_game_mathEquation, 2000, signe,min,max,numberDisplay);\n\t}else {\n\n\t\tdisplayAfterBadAnswer(reponseEquation)\n\t\t \n\t\tnumberTotalAnswer ++;\n\t\t\t\n\t\tafficheNumberGoodAnswer();\n\t\t\n\t\tsetTimeout(load_game_mathEquation, 2000, signe,min,max,numberDisplay);\n\t}\t\n}", "function checkObs(answers, obs){\n var result = []; var sum = 0;\n var correctAns = model.observe(obs,false);\n var allCorrect = 1;\n var error = [\"\",-1];\n \n for (var i = 0; i < answers.length; i++){\n sum += answers[i];\n if(answers[i] < 0){\n error = [\"negative_error\",i];\n }\n if (answers[i].toFixed(3) == correctAns[i].toFixed(3)){\n result[i] = \"right\"; \n }\n else {result[i] = \"wrong\"; allCorrect = 0;}\n }\n result[answers.length] = allCorrect;\n if (sum != 1){error[0] = \"sum_error\";}\n result[answers.length+1] = error;\n return result;\n }", "function check_a(a_nun) {\n\n if (a_nun == answer[q_nun]) {\n score++;\n chance = 1;\n q_finish();\n q_next();\n feed(2);\n } else if (a_nun != answer[q_nun] && chance > \"0\") {\n chance--;\n feed(1);\n } else {\n chance = 1;\n q_finish();\n q_next();\n feed(0);\n }\n}", "function checkAnswers() {\n\n\t\t$( '.button-question').on('click', function() {\n\t\t\tvar $this = $(this);\n\t\t\tconsole.log($this);\n\t\t\tvar val = $this.attr('value');\n\t\t\t// console.log(val);\n\n\t\t\tif (val === 'true'){\n\t\t\t\trightAnswer ++;\n\t\t\t\tconsole.log(rightAnswer);\n\t\t\t} else {\n\t\t\t\twrongAnswer ++;\n\t\t\t\tconsole.log(wrongAnswer);\n\t\t\t}\n\t\t\tnoAnswer = 5 - (rightAnswer + wrongAnswer);\n\t\t\t// console.log(\"unanswered\" + noAnswer);\n\t\t});\n\n\t}", "function checkAnswer(userAnswer) {\n if (yesResponseArray.includes(userAnswer.toLowerCase())) {\n console.log('Input equates to true');\n return true;\n } else if (noResponseArray.includes(userAnswer.toLowerCase())) {\n console.log('Input equates to false');\n return false;\n } else {\n console.log('Unrecognized');\n }\n return userAnswer;\n}", "function checkAnswerValid() {\n\tlet answerIndex = $('input[name=answer]:checked').val()\n\tlet answerNotSelected = !answerIndex\n\n\tif (answerNotSelected) {\n\t\talert('Whoever didnt pick an answer...ya moms a h0e')\n\t} else {\n\t\tlet answer =\n\t\t\tQUESTIONS[currentQuestionIndex].answers[\n\t\t\t\tNumber($('input[name=answer]:checked').val())\n\t\t\t]\n\n\t\tupdateForm({ answer, answerIndex })\n\n\t\t// increment correct / incorrect count\n\t\tanswer.correct ? numCorrect++ : numIncorrect++\n\t\tupdateCorrectIncorrect()\n\t}\n}", "function checkAnswer() {\n let userAnswer = parseInt(document.getElementById(\"answer-box\").value);\n let calculatedAnswer = calculateCorrectAnswer();\n let isCorrect = userAnswer === calculatedAnswer[0];\n\n if (isCorrect) {\n alert(\"Hey! You got it right! :D\");\n incrementScore();\n } else {\n alert(`Awwww.....you answered ${userAnswer}. The correct answer was ${calculatedAnswer[0]}!`);\n incrementWrongAnswer();\n }\n\n runGame(calculatedAnswer[1]);\n\n\n}", "function checkAnswer(choice, answer) {\n if (choice == answer) {\n return true;\n } else {\n return false;\n }\n }", "function choose0() { checkAnswer(0) }", "function checkAns() {\n\tdocument.getElementById(\"outputyes\").innerHTML = (\"\");\n\tdocument.getElementById(\"outputno\").innerHTML = (\"\");\n\t\n\tnumb1 = parseInt(number1);\n\tnumb2 = parseInt(number2);\n\tansIn = parseInt(document.getElementById(\"check\").value);\n\n\tvar ansCor = numb1 * numb2;\n\n\n\tif (ansCor == ansIn) {\n\t\tdocument.getElementById(\"yes_no\").className = \"block\";\n\t\tdocument.getElementById(\"outputyes\").innerHTML = (\"Very Good! Do you want to try again?\");\n\t\t\t\t$(\"#myform\")[0].reset();\n\t\t\n\n\t\t\n\n\t} else\n\n\t{\t\n\t\tdocument.getElementById(\"yes_no\").className = \"none\";\n\t\tdocument.getElementById(\"outputno\").innerHTML = (\"No. Please try again.\");\n\t\t//document.getElementById(\"ansIn\").innerHTML = ansIn;\n\t\t$(\"#myform\")[0].reset();\n\t\t\n\n\t\t\n\n\t}\n}", "function checkAnswer(){\n trueAnswer = returnCorrectAnswer();\n userAnswer = getInput();\n// this if statement is stating if user inputs the right answer what happens and if not what happens\n if(userAnswer === trueAnswer){\n var messageCorrect = array[global_index].messageCorrect;\n score ++;\n swal({\n title: messageCorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n else{\n var messageIncorrect = array[global_index].messageIncorrect;\n swal({\n title: messageIncorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n }", "function isAnswer() {\n var input = document.getElementsByName('number');\n \n for (let x = 0; x < input.length; x++) {\n let li = input[x].parentElement;\n let span = li.getElementsByTagName('span');\n let [number1, number2, symbol] = [\n span[0].innerHTML,\n span[2].innerHTML,\n span[1].innerHTML\n ];\n let math = new mathNumber(number1, number2);\n\n if (input[x].value == '' || input[x].value == null) {\n continue;\n } else {\n switch (symbol) {\n case '+':\n if (parseInt(input[x].value) === math.add()) {\n li.classList.add(\"z-right\");\n } else {\n li.classList.add(\"z-error\");\n }\n break;\n \n case '-':\n if (parseInt(input[x].value) === math.minus()) {\n li.classList.add(\"z-right\");\n } else {\n li.classList.add(\"z-error\");\n }\n break;\n\n case '×':\n if (parseInt(input[x].value) === math.multiplication()) {\n li.classList.add(\"z-right\");\n } else {\n li.classList.add(\"z-error\");\n }\n break;\n\n case '÷':\n if (parseInt(input[x].value) === Math.round(math.division())) {\n li.classList.add(\"z-right\");\n } else {\n li.classList.add(\"z-error\");\n }\n break;\n }\n }\n }\n }", "function _is_simple_same(question, answer, msg){\n\t_complete(question == answer, msg);\n }", "function checkResult(){\n if(collectedFruit.length < eatenFruit.length){\n return 'lost';\n } else if(collectedFruit.length === eatenFruit.length) {\n return 'even';\n } else {\n if(collectedFruit.length >= 8){\n return 'won';\n } else {\n return 'ok';\n }\n }\n}", "function evaluateAnswer(i){\n\tclearInterval(counter); \n\tvar answerPos = parseInt(i);\n\tvar thisq\t = question[standing['u']]; \n\tvar correctPos = thisq['k'];\n\tif (correctPos === answerPos){\n\t\ttoastr.success('Jawaban '+ thisq['v'] +' benar! '+thisq['s']+' adalah '+ thisq['b']);\n\t\tstanding['b'] += 1;\n standing['u'] += 1;\n\t} else {\n\t\ttoastr.error('Jawaban '+ thisq['j'][answerPos] +' salah! Seharusnya '+ thisq['v'] +'!<br /><br />'+thisq['s']+' adalah '+ thisq['b'] + '<br /><br />Tetap Semangat!');\n\t\tstanding['s'] += 1;\n standing['u'] += 1;\n }\n if(!isGameOver()){\n \tdisplayBoard();\n }\n\treturn null;\n}", "function checkAnswer() {\n}", "checkCorrectness(answer) {\n var playerAnswer = answer.toLowerCase().replace(\", \", \" ja \").replace(\" & \", \" ja \")\n var latinName = this.props.game.currentImage.bone.nameLatin.toLowerCase().replace(\" & \", \" ja \")\n return 100 * StringSimilarity.compareTwoStrings(playerAnswer, latinName); // calculate similarity \n //return 100 * StringSimilarity.compareTwoStrings(this.props.game.currentImage.bone.nameLatin.toLowerCase(), this.state.value.toLowerCase()); // calculate similarity \n }", "function answerIsCorrect() {\n correctAnswerFeedback();\n nextQuestion();\n addToScore();\n}", "function scoreQ8a() {\n console.log(\"q8a answer: \" + q8a)\n console.log(\"Q8a correct: \" + q8aCorrect)\n return (q8a == q8aCorrect);\n}", "function checkAnswer(answer){\n if( answer == questions[runningQuestion].correct){\n isCorrect();\n nextQuestion();\n } else {\n isWrong();\n nextQuestion();\n }\n}", "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex){\n score++;\n alert(\"Thats Right!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n }else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n alert(\"WRONG!\");\n //-----DEDUCT TIME FOR WRONG ANSWERS------\n timeLeft = timeLeft - deduction;\n currentQuestionIndex++;\n generateQuizQuestion();\n }else{\n showScore();\n }\n}", "function checkAns(pick) {\n var ans = questionCollection[index - 1].answer;\n if (pick === ans) {\n isCorrect = true;\n score++;\n }\n else {\n isCorrect = false;\n timeLeft -= 15;\n }\n if (index < qcLength)\n renderQuestion();\n}", "function checkOnS(answers, obs){\n var result = [];\n var correctAns = model.prob_OnS()[obs];\n var allCorrect = 1;\n var error = [\"\",-1];\n \n for (var i = 0; i < answers.length; i++){\n if(answers[i]<0){\n error = [\"negative_error\",i];\n }\n else if(answers[i]>1){\n error = [\"greater_error\",i];\n }\n if (answers[i].toFixed(3) == correctAns[i].toFixed(3)){\n result[i] = \"right\"; \n }\n else {result[i] = \"wrong\"; allCorrect = 0;}\n }\n result[answers.length] = allCorrect;\n result[answers.length+1] = error;\n return result;\n }", "function answerIsCorrect () {\r\n feedbackForCorrect();\r\n updateScore();\r\n}", "function checkAnswered() {\n var anyAnswers = false;\n var answers = $('[name=' + game.questions[0].question + ']');\n var answers = $('[name=' + game.questions[1].question + ']');\n var answers = $('[name=' + game.questions[2].question + ']');\n var answers = $('[name=' + game.questions[3].question + ']');\n var answers = $('[name=' + game.questions[4].question + ']');\n\n for (var i = 0; i < answers.length; i++) {\n if (answeres[i].checked) {\n anyAnswered = true;\n }\n }\n return anyAnswered;\n }", "function verifyAnswer(selection) {\n\n if (selection === questions[rand][2]) {\n correct++;\n setGif(0);\n } else {\n incorrect++;\n setGif(1);\n }\n\n } //ends verifyAnswer", "function checkAnswer(answer) {\n //Write your code in here\n}", "function generalChecks(){\n checkSumGenerated = dataConv.generateCheckSum(data.slice(1,-2)); //No tiene en cuenta el caracter inicial ni los 2 finales (estos son el checksum)\n checkSumIncoming = data.substr(data.length - 2); //Toma solo los 2 ultimos caracteres de la respuesta\n if (checkSumGenerated !== checkSumIncoming){\n console.log(\"Checksum validation error, the response is not valid\");\n return false; \n }else{\n return true;\n }\n}", "function processAnswers(answers) {\n\tconsole.log(\"Does this look right?\", answers);\n}", "function scoreQ5a() {\n console.log(\"Q5a answer: \" + q5a)\n console.log(\"Q5a correct: \" + q5aCorrect)\n\n return (q5a == q5aCorrect);\n\n}", "function checkAnswer() {\n \n var numOfQs = 0;\n \n var choices = [];\n var chosen = [];\n \n for (var i = 0; i < pos; i++ ) {\n numOfQs += qNum[i];\n }\n \n firstQ = numOfQs - qNum[pos - 1];\n //document.write(questions[pos].Correct);\n for (var j = firstQ; j < numOfQs; j++) {\n choices.push(document.getElementsByName(\"choices\" + j));\n for (var i=0; i < choices[j -firstQ].length; i++) {\n if (choices[j - firstQ][i].checked) {\n chosen.push(choices[j - firstQ][i].value);\n //document.write(\"if\");\n }\n }\n }\n \n //document.write(questions[pos].Correct);\n //document.write(choices.length);\n //document.write(\"Holass\");\n for (var i=0; i < chosen.length; i++) {\n\n if (chosen[i] == questions[pos].Correct) {\n score++;\n }\n }\n \n //document.write(\"Hola\");\n if (pos == test.length) {\n document.write(\"<h1>Te sacaste \" + score + \" de \" + numOfQs + \" preguntas</h1><br>\");\n document.write(qNum);\n } else {\n renderQuestion();\n }\n}", "function determineAnswer() {\n switch (answer) {\n case 'Yes':\n timeGTOne = 1\n GettingBlobsOfDoom()\n break;\n case 'No':\n writeText('All righty then. See ya later!')\n InInn()\n break;\n }\n }", "function scoreQ3() {\n console.log(\"Q3 answer: \" + q3)\n console.log(\"Q3 correct: \" + q3Correct)\n\n return (q3 == q3Correct);\n\n}", "function checkAnswer() {\n let userAnswer = document.getElementsByName('ans');\n let cAns;\n for (i = 0; i < userAnswer.length; i++) {\n if (userAnswer[i].checked) {\n cAns = userAnswer[i].value;\n }\n }\n if (cAns == correct[qtrack]) {\n score++;\n wright.push(qtrack);\n }\n else wrong.push(qtrack);\n}", "function checkAnswer(event) {\r\n return event.target.innerText === question.answer;\r\n }", "function check(answer){\n\t\t\t\n\t\t\tconsole.log(\"check() invoked\");\n\t\t\t\n\t\t\tif(answer === quiz.questions[i].answer){\n\t\t\t\t\n\t\t\t\tupdate($feedback, \"Correct!\", \"right\");\n\t\t\t\tscore++;\n\t\t\t\tupdate($score, score);\n\t\t\t}else{\n\t\t\t\tupdate($feedback, \"Wrong!\", \"wrong\");\n\t\t\t}\n\t\t\t\n\t\t\t//increments i and sees if there are more questions or if the quiz is over\n\t\t\ti++;\n\t\t\tif(i === quiz.questions.length){\n\t\t\t\tgameOver();\n\t\t\t}else{\n\t\t\t\tchooseQuestion();\n\t\t\t}\n\t\t}", "function showAnswer(){\n equalsToIsClicked=true;\n numberIsClicked=true;\n numberOfOperand=1;\n if(numberIsClicked && operatorIsClicked && numberOfOperand===1 && equalsToIsClicked===true){\n switch(myoperator){\n case \"*\":\n num1*=(Number($values.innerText));\n $values.innerText=num1;\n if($values.innerText.length>8){\n $values.innerText=num1.toPrecision(3);\n throw \"the number of digits exceeded\";\n \n }\n break;\n case \"+\":\n num1+=(Number($values.innerText));\n $values.innerText=num1;\n if($values.innerText.length>8){\n $values.innerText=num1.toPrecision(3);\n throw \"the number of digits exceeded\";\n }\n break;\n case \"-\":\n num1-=(Number($values.innerText));\n $values.innerText=num1;\n if($values.innerText.length>8){\n $values.innerText=num1.toPrecision(2);\n throw \"the number of digits exceeded\";\n }\n break;\n case \"/\":\n num1/=(Number($values.innerText));\n $values.innerText=num1;\n if($values.innerText.length>8){\n $values.innerText=num1.toPrecision(3);\n throw \"the number of digits exceeded\";\n }\n break;\n\n }\n }\n numberIsClicked=false;\n operatorIsClicked=false;\n equalsToIsClicked=false;\n numberOfOperand=0;\n numberChecker=0;\n\n}", "function scoreQ1() {\n q1 = q1.toLowerCase();\n console.log(\"Q1 answer: \" + q1);\n console.log(\"Q1 correct: \" + q1Correct)\n return (q1.substring(0, 2)!=q1Correct);\n\n}", "function check(question, answer,i) {\n console.log(chalk.bold.cyan(`\\n Question ${i+1} :`));\n console.log(question);\n var userAnswer = readlineSync.question(chalk.yellowBright(`\\n${questions[i].options}`));\n\n if (userAnswer === answer) \n {\n console.log(chalk.bold.green(\"\\n Correct answer! \"));\n score = score + 1;\n if(i>=0 && i<=3)\n {credit=credit+5;}\n else if(i>=4 && i<=8)\n {credit=credit+10;}\n else if(i==9)\n {credit=credit+30;}\n }\n else {\n console.log(chalk.bold.red(\"\\n Wrong answer!\"));\n }\n console.log(chalk.bold.bgWhite.black(` Current score: ${score} `));\n console.log(chalk.bold.magentaBright(\"-----------------------\"));\n}", "function checkAns(compAns) {\n\t//get value of user input\n\tvar userAns = document.getElementById(\"answer\").value;\n\tif(isNaN(userAns)) {\n\t\t//check if input is valid number\n\t\talert(\"Please enter valid numeric input.\");\n\t\tres();\n\t}\n\telse {\n\t\tuserAns = parseInt(userAns);\n\t\t//check if user answer = correct comp. answer\n\t\tif(userAns == compAns) {\n\t\t\tdocument.getElementById(\"comment\").innerHTML = \"Very good!\";\n\t\t\tdocument.getElementById(\"answer\").value = \"\";\n\t\t\t//delay confirmation statement \n\t\t\tsetTimeout(function() {\n\t\t\t\tvar confirmation = confirm(\"Do you want to answer another problem?\");\n\t\t\t\tif(confirmation == true) {\n\t\t\t\t\tres();\n\t\t\t\t\tgenerateQ();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tres();\n\t\t\t\t}\n\t\t\t}, 1);\n\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t//if user answer incorrect, have user input another answer\n\t\t\tdocument.getElementById(\"comment\").innerHTML = \"No. Please try again.\";\n\t\t\tdocument.getElementById(\"answer\").value = \"\";\n\t\t\t\n\t\t}\n\t}\n\t\n}", "function checkWords() {\r\n\ttakeInputWords();\r\n\t\r\n\tvar rightAnswers = 0;\r\n\t\r\n\tfor (var i = 0; i < inputWords.length; i++) {\r\n\t\tif (inputWords[i] == mapList[i]) {\r\n\t\t\trightAnswers ++;\r\n\t\t}\r\n\t}\r\n\t\r\n\tlistenResult.value = rightAnswers.toString();\r\n}", "function test() {\n function square(x) {\n return Math.pow(x, 2);\n }\n function cube(x) {\n return Math.pow(x, 3);\n }\n function quad(x) {\n return Math.pow(x, 4);\n }\n if (square(2) !== 4 || cube (3) !== 27 || quad(4) !== 256) {\n console.log(\"check question 1\");\n }\n else {\n console.log(\"You are great at math!\");\n }\n}", "function answer(msg) {\n if(matches(msg, pattern_1)) {\n return \"Well, yes \" + Dagdeel() + \"I'm all ear, fire away sport!\";\n\n } else if (matches(msg, pattern_3)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwneg) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw3) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_4)) {\n return choice(AVh) + choice(bijvnwneg) + choice(zlfstnw_antw4) + maybe(bijw) + choice(ww) + ' be' + choice(wwneglijd) + maybe(acc) + maybe(aanvul) + '.' + maybe(aanvul1)\n \n } else if (matches(msg, pattern_5)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwpos) + maybe(AV) + maybe(bijvnwpos) + choice(zlfstnw_antw5) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_6)) {\n return choice(AVh) + maybe(bijvnwneg) + choice(zlfstnw_antw6) + maybe(bijw) + choice(ww) + ' be' + choice(wwneglijd) + maybe(acc) + '. There will be a wall' + maybe(aanvul) + '!'\n\n } else if (matches(msg, pattern_7)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwneg) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw7) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_8)) {\n return \"Don't get me started, yes,\" + choice(zlfstnw_antw8) + \". A sickning group indeed. But o well, let's\" + maybe(bijw) + choice(wwpos) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw8) + \n \". No just kidding, just saying that so I don't look like a complete asshole... Which I am.\"\n \n } else if (matches(msg, pattern_2)) {\n return \"I'm doing amazing, really amazing indeed, thanks for asking.\"\n //Has to be the last one otherwise it'll respond to questions such as HOW DO YOU FEEL about immigrants?\n\n } else if (matches(msg, pattern_9)) {\n return \"You're done already? Great... Now fuck off!\"\n\n } else if (matches(msg, pattern_10)) {\n return \"Who cares what you think? Please continue.\"\n\n } else {\n return choice(default_answers);\n }\n}", "function checkMath() {\n var answer, text;\n\n // Takes the checked value and the answer to see if they are true\n answer = document.getElementById(\"numb\").value;\n\n // If answer is between 5 psi on either side of totalFriction\n if (answer == totalFriction() ||\n answer == totalFriction() - 5 ||\n answer == totalFriction() + 5 ||\n answer == totalFriction() - 4 ||\n answer == totalFriction() + 4 ||\n answer == totalFriction() - 3 ||\n answer == totalFriction() + 3 ||\n answer == totalFriction() - 2 ||\n answer == totalFriction() + 2 ||\n answer == totalFriction() - 1 ||\n answer == totalFriction() + 1)\n {\n text = \"This is the correct PSI\";\n } else {\n text = \"Nope, remember your training my young padawan!\";\n };\n document.getElementById(\"demo\").innerHTML = text;\n }", "function checkAnswer(){\n var sum = operand1 +operand2;\n var userAnswer = document. getElementById(\"answerInput\").value;\n \n if(sum == userAnswer){\n document.getElementById(\"response\").innerHTML=\"Correct!\";\n }\n else{\n document.getElementById(\"response\").innerHTML=\"Congrats, YOU GOT IT WRONG SUCKER!\";\n }\n \n}", "function checkInputs(arr, thisButton, answer){\n var counter = 0;\n\n //wildChar shows one other specific Character that the string should have, like . or =\n\n for(var i=0; i< arr.length; i++){\n /*http://stackoverflow.com/questions/17938186/trimming-whitespace-from-the-end-of-a-string-only-with-jquery*/\n var trimmedAns= $(arr[i][0]).val().replace(/\\s*$/,\"\");\n var wrongPhrase = '';\n var falsePos = '';\n\n //check if it contains all key phrases\n for(var j=0; j < arr[i][1].length; j++){\n var activeChar= arr[i][1][j];\n if(trimmedAns.indexOf(activeChar) == -1){\n wrongPhrase = activeChar;\n break;\n }\n }\n\n // this is for the Characters we don't want to see in there\n for(var l=0; l < arr[i][2].length; l++){\n var activeChar= arr[i][2][l];\n if(trimmedAns.indexOf(activeChar) > -1)\n falsePos = activeChar;\n }\n\n // make sure we save original err msg\n var origMsg= $(thisButton).siblings('.warn').text();\n\n // if it has both correct property name and value, and semi and colon are in there\n if(falsePos.length ==0 && wrongPhrase.length ==0)\n counter++\n else if(wrongPhrase.length > 1 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('Did you spell everything correctly in answer '+(i+1)+'? Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length > 1 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('I think you are missing ' + wrongPhrase + ' in answer ' +(i+1)+ '. Attempts Remaining: ' +(5-wrongCount) ).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length == 1 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('Did you remember all the correct syntax? Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length == 1 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('I think you forgot to include '+wrongPhrase + ' in answer ' +(i+1) + '. Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(falsePos.length > 0 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('You included a character that should not be in there in answer ' +(i+1)+'! Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(falsePos.length > 0 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('You included ' +falsePos+ ' in answer '+(i+1)+', which should not be in there. Attempts Remaining: ' +(5-wrongCount) ).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n //this case should never happen but fuck it I am leaving it in there\n else{\n $(thisButton).siblings('.warn').text(origMsg).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n\n //user has gotten it wrong three times or more\n if (wrongCount > 5){\n //put it in a span so the answer looks distinct\n if(answer.length == 1)\n $(thisButton).siblings('.warn').html(\"The answer is- <span>\"+answer[0]+\"</span>\").show('slide');\n else{\n $(thisButton).siblings('.warn').html(\"The answer is- <span>\"+answer[0]+\"</span><span>\"+answer[1]+\"</span>\").show('slide');\n }\n }\n }\n\n if(counter === arr.length){\n wrongCount=0;\n $(thisButton).siblings('.warn').hide()\n\n // enable continue button\n $('.advanceBtn:visible').css('pointer-events', 'auto');\n $('.advanceBtn:visible').css('background-color', 'green');\n $('.advanceBtn:visible').css('opacity', '1');\n\n // this needs to be outside the function below due to setTimeout\n //http://stackoverflow.com/questions/5226285/settimeout-in-for-loop-does-not-print-consecutive-values\n function setTheFields(i){\n var startTime = 2000 * i\n var endTime= 2000 * (i+1);\n setTimeout(function(){\n $('.interactme:visible').find('.userIn').eq(i).parent().siblings('.codeExp').css('opacity', '0')\n $('.interactme:visible').find('.userIn').eq(i).children('span').first().trigger('mouseover')\n }, startTime)\n setTimeout(function(){\n $('.interactme:visible').find('.userIn').eq(i).parents().eq(1).trigger('mouseleave')\n $('.interactme:visible').find('.userIn').eq(i).parent().siblings('.codeExp').css('opacity', '1')\n }, endTime)\n }\n\n // do all animations with delay in between\n for(var i=0; i< arr.length; i++){\n setTheFields(i);\n }\n\n }\n}", "function validateUserResponse() {\n\n console.log('VALIADATION');\n\n // If answer was correct, animate transition to next card\n if (currentcard['french'] === $('#firstField').val()) {\n\n acceptAnswer();\n } else {\n // show solution\n animateShake();\n revealSolution();\n }\n}", "function returnCorrectAnswer(){\n const answers = array[global_index].answers \n for(var x = 0; x < answers.length; x++){\n if(answers[x].correct === true){\n correctAnswer = answers[x].text;\n }\n }\n return correctAnswer;\n }", "function checkAnswers() {\n console.log(\"Max value is: \", maxValue(firstNum, secondNum));\n console.log(\"Min value is: \", minValue(firstNum, secondNum));\n if (checkParity(num)) console.log(`${num} is even`);\n else console.log(`${num} is odd`);\n}", "function checkmarried(married) {\n\nif(married === null) return null;\n\tmarried = married.toLowerCase();\n\t\n\n\tif (married === expectedvalue1 || married === expectedvalue2) {\n\t\talert('Congratulations!! your is answer is correct');\n correctAnswers++;\n\t}\n else if(married === expectedvalue3 || married === expectedvalue4){\n alert('Ops!! that is incorrect answer');\n }\n\telse {\n alert('Please enter YES/NO or Y/N.');\n var married = getUserInput('Am i married');\n checkmarried(married);\n\t}\n}", "function checkResult(){\n\tvar val = \"\";\n\tvar ans = \"\";\n\n\tfor(var i = 0; i < quizList.length; i++){\n\n\t\t//Get the value of checked button and compare it with answer of the question. Update the counters accordingly.\n\t\tval = $(\"input[name='\" + quizList[i].name + \"']:checked\").attr(\"value\");\n\t\tans = quizList[i].answer;\n\n\t\tif(val === ans)\n\t\t\tcorrectCount++;\n\t\telse if (val === undefined)\n\t\t\tunAnsweredCount++;\n\t\telse\n\t\t\tinCorrectCount++;\n\t}\n\n\tdisplayResult(correctCount,inCorrectCount,unAnsweredCount);\n}", "function answer1() {\n checkAnswer(1)}", "function checkSign(){\n return result.length === 1 && (result === \"/\" || result === \"*\" || result === \"+\" || result === \"-\");\n }", "function checkAnswer() {\n return document.answered;\n}", "function checkss(){\n if (memory.length>1){\n if(/\\+|\\-/.test(memory.join())){\n sumres();\n checkss();\n }\n }\n }", "checkSolution() {\n if (this.state.solvedRoots.length === this.state.wordRoots.length) {\n const solution = this.fillIn(null, true)\n this.setState({ answerParts: solution });\n setTimeout(() => this.props.nextQuestion(this.state.autohintOn), 1500);\n } else {\n this.setState({choices: this.randomChoices(this.state.answerParts, this.state.allRoots) }, this.autohint)\n }\n }", "function checkAnsers(){\n var radioValue1 = $(\"input[name='answer1']:checked\").val();\n if (radioValue1 === \"Lake Superior\"){\n correct++;\n unanswered--;\n } else if (radioValue1 === \"Lake Huron\"){\n incorrect++;\n unanswered--;\n } else if (radioValue1 === \"Lake Michigan\"){\n incorrect++;\n unanswered--;\n } else if (radioValue1 === \"Lake Erie\"){\n incorrect++;\n unanswered--;\n }\n var radioValue2 = $(\"input[name='answer2']:checked\").val();\n if (radioValue2 === \"350\"){\n correct++;\n unanswered--;\n } else if (radioValue2 === \"None\"){\n incorrect++;\n unanswered--;\n } else if (radioValue2 === \"143\"){\n incorrect++;\n unanswered--;\n } else if (radioValue2 === \"492\"){\n incorrect++;\n unanswered--;\n }\n var radioValue3 = $(\"input[name='answer3']:checked\").val();\n if (radioValue3 === \"36°F\"){\n correct++;\n unanswered--;\n } else if (radioValue3 === \"12°F\"){\n incorrect++;\n unanswered--;\n } else if (radioValue3 === \"45°F\"){\n incorrect++;\n unanswered--;\n } else if (radioValue3 === \"57°F\"){\n incorrect++;\n unanswered--;\n }\n var radioValue4 = $(\"input[name='answer4']:checked\").val();\n if (radioValue4 === \"Lake Michigan\"){\n correct++;\n unanswered--;\n } else if (radioValue4 === \"Lake Superior\"){\n incorrect++;\n unanswered--;\n } else if (radioValue4 === \"Lake Erie\"){\n incorrect++;\n unanswered--;\n } else if (radioValue4 === \"Lake Ontario\"){\n incorrect++;\n unanswered--;\n }\n var radioValue5 = $(\"input[name='answer5']:checked\").val();\n if (radioValue5 === \"35,000\"){\n correct++;\n unanswered--;\n } else if (radioValue5 === \"700\"){\n incorrect++;\n unanswered--;\n } else if (radioValue5 === \"2,000\"){\n incorrect++;\n unanswered--;\n } else if (radioValue5 === \"11,000\"){\n incorrect++;\n unanswered--;\n }\n var radioValue6 = $(\"input[name='answer6']:checked\").val();\n if (radioValue6 === \"Lake Sturgeon\"){\n correct++;\n unanswered--;\n } else if (radioValue6 === \"Basking Shark\"){\n incorrect++;\n unanswered--;\n } else if (radioValue6 === \"Walleye\"){\n incorrect++;\n unanswered--;\n } else if (radioValue6 === \"Blue Whale\"){\n incorrect++;\n unanswered--;\n }\n var radioValue7 = $(\"input[name='answer7']:checked\").val();\n if (radioValue7 === \"Lake Huron\"){\n correct++;\n unanswered--;\n } else if (radioValue7 === \"Lake Superior\"){\n incorrect++;\n unanswered--;\n } else if (radioValue7 === \"Lake Michigan\"){\n incorrect++;\n unanswered--;\n } else if (radioValue7 === \"Lake Erie\"){\n incorrect++;\n unanswered--;\n }\n var radioValue8 = $(\"input[name='answer8']:checked\").val();\n if (radioValue8 === \"20%\"){\n correct++;\n unanswered--;\n } else if (radioValue8 === \"1%\"){\n incorrect++;\n unanswered--;\n } else if (radioValue8 === \"5%\"){\n incorrect++;\n unanswered--;\n } else if (radioValue8 === \"7%\"){\n incorrect++;\n unanswered--;\n }\n $(\"#page3\").show();\n $(\"#page2\").hide();\n $(\"#correct\").html(\"Correct: \" + correct);\n $(\"#incorrect\").html(\"Incorrect: \" + incorrect);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function checkAnswer(){\n let correct=false;\n if(answer==\"correct\") correct=true;\n if(correct) correctAnswer(this);\n else {wrongAnswer(this)};\n}", "function processResponse(inQuestion, inAnswers) {\n var userAnswer = prompt(inQuestion).toLowerCase();\n for (var answerIndex = 0; answerIndex < inAnswers.length; answerIndex++) {\n if (userAnswer === inAnswers[answerIndex])\n return 'Correct!';\n }\n return 'Incorrect';\n}", "checkAnswerCorrect(answerValue)\n {\n\n if (answerValue === this.correct_p)\n {\n alert('YOU ARE CORRECT SIR!');\n }\n else\n {\n alert('Sorry Pal! That is INCORRECT!!!');\n }\n }", "function compareAnswer(answer){\n if(getText() === answer){\n alert(\"You Answered Correctly!\")\n $(\"#score\").html(parseInt($(\"#score\").html()) + parseInt($(\"#point-value\").html()))\n } else {\n alert(\"Better luck next time...\")\n }\n }", "function testJackpot(result) {\n for (i = 0; i < result.length; i++)\n if(result[3] == result[i]){\n return true\n } else {\n return false\n }\n}" ]
[ "0.6912821", "0.6823528", "0.6757113", "0.67390555", "0.6637274", "0.6632853", "0.6561223", "0.6522037", "0.6513745", "0.648443", "0.6465354", "0.64372724", "0.6409199", "0.6407746", "0.6391609", "0.63914615", "0.6371627", "0.6366948", "0.63581717", "0.6350234", "0.63434505", "0.6333315", "0.6325129", "0.6320948", "0.6305074", "0.63018924", "0.62673646", "0.6255437", "0.6253493", "0.62494344", "0.62402564", "0.6225412", "0.6223671", "0.62193716", "0.61961454", "0.61885864", "0.6182725", "0.61727166", "0.61679167", "0.61578745", "0.6147648", "0.61458313", "0.61451524", "0.61202013", "0.6114456", "0.6110907", "0.6110685", "0.6099439", "0.6091648", "0.6085457", "0.6085176", "0.60833955", "0.6063906", "0.60588837", "0.6057304", "0.6044383", "0.6039399", "0.6035819", "0.6019961", "0.6009983", "0.6009178", "0.60045373", "0.60038745", "0.6001905", "0.6001011", "0.59981984", "0.59929055", "0.59896874", "0.5988126", "0.59834623", "0.5981283", "0.59750384", "0.5973768", "0.59707284", "0.596923", "0.5968249", "0.59678197", "0.59586436", "0.59561783", "0.5956057", "0.5952268", "0.5944531", "0.5942837", "0.59323776", "0.59322035", "0.59286493", "0.5928608", "0.5920719", "0.59189534", "0.591819", "0.59145945", "0.5907881", "0.590292", "0.5901345", "0.5900947", "0.58926946", "0.58871895", "0.5883091", "0.5870661", "0.58685184", "0.58558047" ]
0.0
-1
Helper function for success alert
function Alert(props) { return <MuiAlert elevation={6} variant="filled" {...props} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "alertSuccess(content) {\n alert(\"success\", content)\n }", "function AlertSuccess(msg) {\n $(\"#alertSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertSuccess\").html(success);\n}", "function AlertDialogSuccess(msg) {\n\n $(\"#alertDialogSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertDialogSuccess\").html(success);\n}", "function sentSuccess(){\n //User denied action\n swal({\n title: \"Transaction Successful!\",\n text: \"Reloading Data\",\n type: \"success\",\n timer: 3000,\n showConfirmButton: false\n });\n\n }", "function successTest(data){\r\n return showSuccess(data.message)\r\n}", "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\tnotif(\"success\", \"Brief envoyé avec <strong>succès</strong> !\");\n\t\t}", "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t}", "function printSuccess($alert,$id_name){\n\t$(\".alert-area\").append(\"<div class=\\\"alert alert-success\\\" role=\\\"alert\\\">\"+$id_name+\" \"+$alert+\"</div>\");\n}", "function successHandler (result) {\n //alert('result = ' + result);\n}", "function successMsg(where){\r\n\tsuccess(where,\"Available!\");\r\n}", "function onSuccess () {}", "function onSuccess() {}", "function emailSuccess() {}", "function success(message, data, title) {\n toastr.success(message, title);\n $log.info('Success: ' + message, data);\n }", "function popupSuccess(title, mensagem) {\n swal(title, mensagem, 'success');\n}", "function showManageAgentSuccessAlert() {\n\t\t \tvar successMsg = $(\"#myModal\").attr(\"saveAgentWithSuccess\");\n\t\t \t\n\t\t \tif (successMsg !== undefined) {\n\t\t \t\tdisplaySuccessMsg(successMsg);\n\t\t \t}\n\t\t }", "function successCB() {\n\talert(\"Note successfully saved\");\n}", "function successMessage(){\n window.alert(\"Success: Deadline Sent to Deadline Dashboard\");\n}", "function onMethodSuccess() {\n alert = $(\"#info-alert\");\n alert.text(\"Success!\").removeClass(\"alert-danger\").addClass(\"alert-success\");\n alert.show();\n setTimeout(function() {\n alert.hide();\n }, 2000);\n }", "function successAlert(text){\r\n swal({\r\n title: 'Success!',\r\n text: text,\r\n type: 'success',\r\n showCancelButton: false,\r\n confirmButtonClass: 'btn btn-success',\r\n cancelButtonClass: 'btn btn-danger ml-2'\r\n });\r\n }", "function successSave() {\n var saveSuccess = $('#save-success');\n showSaveResult(saveSuccess);\n}", "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\treturn true;\n\t\t}", "function createSuccessMsg (loc, msg) {\r\n\t\tloc.append(\r\n\t\t\t'<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button><strong><i class=\"en-checkmark s24\"></i> Well done!</strong> '+ msg + ' </div>'\r\n\t\t);\r\n\t}", "function success(where, data){\r\n\t//due to design this parent().parent() thing is required\r\n\tx=where.parent().parent();\r\n\t// clear the error color and make it success\r\n\tx.removeClass(\"has-error\");\r\n\tx.addClass(\"has-success\");\r\n\t//remove the error box and append a new one\r\n\t$(x.children()[2]).remove();\r\n\tx.append('<div class=\"alert alert-dismissable alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>'+data+'</div>');\r\n}", "function successCB() {\n //debug\n //alert(\"banco populado\");\n //\n}", "function showSuccess() {\n showStatus();\n}", "function sweetAlertSuccessPopUp (title='',text='') {\n swal({\n title: title,\n text: text,\n type: \"success\",\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"CONFIRM\"\n }, function() {\n window.location.href = '/admin/email-template';\n });\n\t}", "function successHandler() {\n if (response.get_statusCode() == 200)\n onSuccess(response.get_body());\n else\n onError(response.get_body());\n }", "function success() {\n\n Modal.success({\n okText:\"Done\",\n title: 'Submit successful!',\n // content: 'View your requests to see your new entry.',\n onOk() {\n doneRedirect();\n }\n });\n }", "function successHandler(result) {\n console.log('Success. Result:', result);\n}", "function displaySuccessMsg(msg) {\n\t\t \tswal({\n\t\t \t\t title: \"The action was successfully completed\",\n\t\t \t\t text: msg,\n\t\t \t\t timer: 5000,\n\t\t \t\t type: \"success\",\n\t\t \t\t showConfirmButton: false\n\t\t \t});\n\t\t }", "function showSuccessAlert(ev) {\n customSetting.color = '#000000';\n customSetting.bgColor = '#90ee90';\n customAlert('This operation was successful!', customSetting);\n}", "function addSuccessAlert() {\n $scope.alerts.push({\n type: 'success',\n msg : $filter('translate')('pages.sm.service.SERVICE_MGMT_ALERTS.SERVICE_MGMT_ALERT_SERVICE_ADD_SUCCESSFUL')\n });\n }", "function dataResponse(success) {\n\tif (success) {\n\t\t$(\"<div/>\", {\n\t\t\t\"class\": \"alert alert-success\",\n\t\t\ttext: \"Data successfully added!\"\n\t\t}).append('<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>').appendTo(\"#alertBox\");\n\t}\n\telse {\n\t\t$(\"<div/>\", {\n\t\t\t\"class\": \"alert alert-danger\",\n\t\t\ttext: \"Oh no! Something went wrong!\"\n\t\t}).append('<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>').appendTo(\"#alertBox\");\n\t}\n}", "function executing_success(){\n\t\t\t\t\t\t\tvar ret = null;\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tif App.HTTP['METHOD'] is called with the 'success' field settled, the next conditional is executed\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tif (typeof function_success != \"undefined\") {\n\t\t\t\t\t\t\t\tif (typeof function_success != \"object\") {\n\t\t\t\t\t\t\t\t\tret = {\n\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tfunction_success(ret, textStatus, jqXHR);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tret = Array();\n\n\t\t\t\t\t\t\t\t\tfor (i in function_success) {\n\t\t\t\t\t\t\t\t\t\tret.push({\n\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t}, textStatus, jqXHR);\n\t\t\t\t\t\t\t\t\t\tfunction_success[i]({\n\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t}, textStatus, jqXHR);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\ta lateral message ('alertify' plugin) is shown if the 'log_ui_msg' is active (settled as 'true')\n\n\t\t\t\t\t\t\t\ta default message is shown if the response of the server doesn't have the field 'message'\n\n\t\t\t\t\t\t\t\tthe default message depends of the type of operation (CREATE, READ, UPDATE, DELETE, POST, PUT)\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tvar semantic_ref = {\n\t\t\t\t\t\t\t\t\t\"CREATE\" : \"success\",\n\t\t\t\t\t\t\t\t\t\"READ\" : \"warning\",\n\t\t\t\t\t\t\t\t\t\"UPDATE\" : \"success\",\n\t\t\t\t\t\t\t\t\t\"DELETE\" : \"error\",\n\t\t\t\t\t\t\t\t\t\"POST\" : \"message\",\n\t\t\t\t\t\t\t\t\t\"GET\" : \"message\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsemantic_default_message = {\n\t\t\t\t\t\t\t\t\t\"CREATE\" : \tApp.__GENERAL__.http_message_default_create,\n\t\t\t\t\t\t\t\t\t\"READ\" : \tApp.__GENERAL__.http_message_default_read,\n\t\t\t\t\t\t\t\t\t\"UPDATE\" : \tApp.__GENERAL__.http_message_default_update,\n\t\t\t\t\t\t\t\t\t\"DELETE\" : \tApp.__GENERAL__.http_message_default_delete,\n\t\t\t\t\t\t\t\t\t\"POST\" : \tApp.__GENERAL__.http_message_default_post,\n\t\t\t\t\t\t\t\t\t\"GET\" : \tApp.__GENERAL__.http_message_default_get,\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(settings.log_ui_msg){\n\t\t\t\t\t\t\t\tif(!jqXHR.responseJSON){\n\t\t\t\t\t\t\t\t\tjqXHR.responseJSON ={}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif(!jqXHR.responseJSON.message){\n\t\t\t\t\t\t\t\t\tjqXHR.responseJSON.message = semantic_default_message[semantic.toUpperCase()];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\talertify[semantic_ref[semantic.toUpperCase()]](jqXHR.responseJSON.message);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tApp.__debug__(ret);\n\n\t\t\t\t\t\t\treturn ret;\n\t\t\t\t\t\t}", "alertSuccess(message, autoClose) {\n this.$root.alert.type = 'success';\n this.$root.alert.message = message;\n this.$root.alert.show = true;\n }", "function getSuccessAlertHTML(text) {\n return $('<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' + text +'</div>');\n}", "function showSuccessAlert(message) {\r\n $.pnotify({\r\n type: 'success',\r\n text: message,\r\n opacity: 0.9\r\n });\r\n}", "function alertSuccess(alertId, msgString){\n // make sure it's clean and empty\n $(alertId).text('');\n \n var msg = '<p>'+msgString+'</p>';\n $(alertId).append(msg);\n $(alertId).slideDown('slow').fadeIn(3000, function(){\n setTimeout(function(){\n $(alertId).fadeOut({duration:1000, queue:false}).slideUp('slow');\n },2000);\n \n });\n }", "function alert_success(mes,callback) {\n bootbox.alert({\n size: \"small\",\n title: \"Thành công\",\n message: mes,\n callback: callback\n });\n}", "function success(result) {\n return { kind: \"success\", result: result };\n }", "function ShowMessage(title, description, status) {\n debugger\n if (status==1) {\n\n toastr.error(description, title);\n } else {\n\n toastr.success(description, title);\n\n }\n\n}", "function success(){\n return {\n deleteSuccess: 'Great, you deleted an item!'\n };\n }", "success(text, dismissable = false){\n this.message(text, 'success', dismissable);\n }", "function showToastr(success, msg) {\n if (success) {\n toastr.success(msg, 'Success');\n } else {\n toastr.error(msg, 'Error');\n }\n }", "function successCB(msg) {\r\n // Success handling\r\n success(msg);\r\n }", "function success_message(message, title) {\n if (!title) title = \"Success!\";\n toastr.remove();\n toastr.success(message, title, {\n closeButton: true,\n timeOut: 5000,\n progressBar: true,\n newestOnTop: true\n });\n}", "function onSuccess (){\n AlertsService.addAlert(\"Your data has been submitted. Showing you the result set...\",\"success\");\n vm.resultset = true;\n onfocusEventCall(true);\n }", "function success() {\n finish( false );\n }", "function successAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n successMsg.current.append(wrapper)\n }", "function STORE_successCallback(data, HTTPstatus) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert('success: ' + data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}", "getSuccessMessage () {\n return SUCCESS_MESSAGE\n }", "function defaultSuccess(json)\n{\n msg(\"success! \" + (typeof json == \"string\" ? json : JSON.stringify(json)));\n}", "function welcome_alert(){\n\n $.ajax({\n url: url_path+\"welcome\", type: \"GET\", dataType: \"json\", success: function (msg) {\n if(msg.status){\n alert(\"Welcome! Please finish annotating the seed!\");\n }else{\n alert(\"Welcome! Already finished the seed! Go to the Corpus now!\");\n }\n }\n });\n}", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "function successCB(msg) {\n // Success handling\n success(msg);\n }", "setSuccessMsg(event, data) {\n let _this = event.data;\n _this.tableerr.hide();\n if (data.status === -1) {\n _this.updateMsg(data.errmsg);\n }\n }", "function successCB() {\n alert(\"funca!\");\n \n}", "function add_success_message(js) {\n\teEngine.model('message').msg(JSON.parse(js));\n}", "function successSplitChange() {\n const alert = document.createElement(\"ion-alert\");\n alert.cssClass = \"successSplit\";\n alert.header = \"Success\";\n alert.message = \"Updated!\";\n alert.buttons = [\"OK\"];\n\n //console.log(\"Change success\");\n document.body.appendChild(alert);\n return alert.present();\n}", "function success(data) {\n flag = 1;\n }", "function emailSuccess(response) {\n showSuccessMessage(\"Email sent successfully.\");\n $rootScope.closeSpinner();\n }", "function showSuccess(){\n\n//\tDiv where the alert is going to be\n\tvar father = document.getElementById('alertSuccess');\n\tfather.style.display = 'block';\n\t\n\tif(father.childNodes.length > 0)\n\t\tconsole.log(\"already has...\");\n\telse{\n\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.innerHTML = \"Book has been modified.\";\n\t\tdiv.setAttribute(\"class\", \"alert alert-success alert-dismissible\");\n\t\tdiv.setAttribute(\"role\", \"alert\");\n\t\tvar button = document.createElement(\"button\");\n\t\tbutton.setAttribute(\"type\", \"button\");\n\t\tbutton.setAttribute(\"class\", \"close\");\n\t\tbutton.setAttribute(\"data-dismiss\", \"alert\");\n\t\tbutton.setAttribute(\"aria-label\", \"Close\");\n\t\tvar span = document.createElement(\"span\");\n\t\tspan.setAttribute(\"aria-hidden\", \"true\");\n\t\tspan.innerHTML = \"&times;\";\n\t\tbutton.appendChild(span);\n\t\tdiv.appendChild(button);\n\t\tfather.appendChild(div);\n\t}\n\t\n}", "function onSuccess(result){\n console.log(\"Success:\"+result);\n}", "function updateCallbackOk(result) {\n $(\"#mdlAlert\").modal(\"hide\");\n $(\"#tblAlerts\").bootstrapTable(\"updateRow\", {\n index: TableUtil.getTableIndexById(\"#tblAlerts\", $(\"#txtAlertId\").val()),\n row: {\n Id: $(\"#txtAlertId\").val(),\n Name: $(\"#txtAlertName\").val(),\n Description: $(\"#txtAlertDescription\").val(),\n DueDate: DateUtil.formatDateTime($(\"#txtAlertDueDate\")\n .data(\"DateTimePicker\").date())\n }\n });\n }", "function successCallBack() {\n\t//alert(\"DEBUGGING: success\");\n\n}", "function alertSuccess(time) {\n var $elem = $('.app-alert-success');\n $elem.fadeIn();\n setTimeout(function () {\n $elem.fadeOut();\n }, time || 3000);\n }", "function Success(msg, devmsg) {\n success(msg);\n $log.info(devmsg);\n }", "function successCallback() {\n\t\t\tif (showMessage) this.controller.hideMessage();\n\t\t\tsuccess.apply(this, arguments);\n\t\t}", "handleSuccess() {\n // showing success message\n this.dispatchEvent(\n new ShowToastEvent({\n title: \"Success!!\",\n message: \" Successfully!!.\",\n variant: \"success\"\n })\n );\n this.dispatchEvent(new CustomEvent(\"savefinancial\"));\n }", "function issuesuccess(){\n $(document).ready(function () {\n $(\"#alertx\").show();\n setTimeout(function () {\n $(\"#alertx\").hide();\n },2000);\n });\n}", "function flashSuccess(message) { flashMessage(message, 0); }", "function successRetrieval() {\n console.log(\"Recupero delle notizie completato!\");\n}", "function msg_SuccessfulSave(){\n new PNotify({\n title: 'Saved',\n text: 'New Record Added.',\n type: 'success'\n });\n }", "function showSuccess(message) {\n window.scrollTo(0, 0);\n $('#alert').html('<div class=\"alert alert-success\" role=\"alert\">' + message + '</div>');\n $('#alert').show();\n\n setTimeout(function () {\n $('#alert').hide();\n }, 6000);\n}", "function successAlertRegister(title, content) {\n Swal.fire({\n title: title,\n text: content,\n icon: 'success'\n }).then(function () {\n window.location.href = 'Login';\n });\n }", "function news_result(response, statusText, xhr, $form) \n {\n // Parse the JSON response\n var result = jQuery.parseJSON(response);\n if (result.success == true)\n {\n // Display our Success message, and ReDraw the table so we imediatly see our action\n $('#js_news_message').attr('class', 'alert success').html(result.message);\n newstable.fnDraw();\n }\n else\n {\n $('#js_news_message').attr('class', 'alert ' + result.type).html(result.message);\n }\n }", "function reservationSuccessfulAlert(){\n return '<div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\">\\n' +\n ' Reservation created successfully.\\n' +\n ' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\\n' +\n ' <span aria-hidden=\"true\">&times;</span>\\n' +\n ' </button>\\n' +\n ' </div>'\n}", "function resAlert(){\n alert('Reservation Confirmed');\n}", "function notifyResult(goodmsg, badmsg, result) {\n if (result) {\n window.alert(goodmsg);\n window.opener.location.href = window.opener.location.href; /* force reload */\n } else {\n window.alert(badmsg);\n };\n}", "function setupSuccess(title, message, affirm_button, success_function) {\n \"use strict\";\n if (!title)\n title = \"Success!\";\n if (!message)\n message = \"\";\n if (!affirm_button)\n affirm_button = \"CONTINUE\";\n\n return {title: title, message: message, affirm_button: affirm_button, success_function: success_function};\n}", "function requestCallback(response) {\n if(response){\n $('.notice-area').html(\"<div class='alert alert-success'>Thanks! Your invite was successfully sent.</div>\");\n alertInfo();\n }\n}", "function displaySuccess () {\n $('.validationText').hide();\n $('#wishForm').hide();\n return $(\"#successMsg\").show();\n }", "function showSuccess() {\n\t$('.alerts .alert-success').removeClass('hidden');\n}", "function doShowSuccess(message){\n $('#olShowSuccess').find('div#showSuccess').remove();\n var html = '<div class=\"alert alert-default valider alertWidth\" id=\"showSuccess\" role=\"alert\">' +\n '<span class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></span>' +\n '<span class=\"sr-only\">Error:</span></div>';\n $('#olShowSuccess').prepend(html);\n $('#showSuccess').html('');\n $('#showSuccess').append(message);\n $('#showSuccess').fadeIn();\n setTimeout(function(){ $('#showSuccess').fadeOut(); }, 5000);\n}", "function showNotificationWhenSuccess(res) {\n iSuccess.css('display', 'inline-block');\n iError.css('display', 'none');\n iMessage.html(res);\n notification.removeClass('error').addClass('success slide-left');\n notification.css('display', 'flex');\n }", "function showAlert(response) {\n if ($('.alert').length == 0) {\n html = \"<div class='alert alert-success'>\" + response + \"</div>\";\n $(html).insertAfter('.col-sm-12');\n } else {\n $('.alert').html(response);\n }\n }", "function onSuccess() {\n\tset2SendView();\n\n\tconsole.log('success');\n\tvar detail = document.getElementById(\"detail\");\n\tdetail.innerHTML = \"success\";\n}", "function addedSuccessfully() {\n noty({\n text: 'Item added successfully',\n type: 'success',\n layout: 'topCenter',\n timeout: 2000\n });\n }", "function saveSuccess(response) {\n showSuccessMessage(\"Plan saved successfully.\");\n $rootScope.closeSpinner();\n }", "static notifySuccess()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Success);\n\t\t}", "success(res) {\n if ((res.data.status == \"SUCCEED\") && (\"data\" in res.data)) {\n self.setData({\n showModa: true,\n result: res.data\n });\n } else {\n wx.showModal({\n title: '警告',\n content: '此烟是假货',\n confirmColor: '#FF0000',\n showCancel: false,\n success: function (res) {\n if (res.confirm) {//这里是点击了确定以后\n console.log('用户点击确定')\n } else {//这里是点击了取消以后\n console.log('用户点击取消')\n }\n }\n })\n }\n }", "function successfulSaveToast() {\n const savedToast = Swal.mixin({\n toast: true,\n position: 'top',\n showConfirmButton: false,\n timer: 1500,\n })\n savedToast.fire({\n type: 'success',\n title: '\"' + pluginModule.project.projectName + '\" saved successfully',\n })\n}", "function successfulSaveToast() {\n const savedToast = Swal.mixin({\n toast: true,\n position: 'top',\n showConfirmButton: false,\n timer: 1500,\n })\n savedToast.fire({\n type: 'success',\n title: '\"' + pluginModule.project.projectName + '\" saved successfully',\n })\n}", "function defaultSuccess(data, status, headers, config) {\n //when it's successful, just return the data\n return data;\n }" ]
[ "0.79590094", "0.74244833", "0.7323266", "0.7313692", "0.72795856", "0.72465163", "0.72221565", "0.719848", "0.7189192", "0.71766734", "0.7141358", "0.712742", "0.7126327", "0.709392", "0.70542043", "0.70228773", "0.6974896", "0.6971931", "0.69339854", "0.6916426", "0.69157237", "0.69034815", "0.6902813", "0.6900183", "0.68955266", "0.685573", "0.68188876", "0.6813954", "0.68138236", "0.68075585", "0.67987895", "0.6794354", "0.67660683", "0.67566466", "0.6753151", "0.6748729", "0.67417926", "0.6706937", "0.67060584", "0.66977936", "0.6691373", "0.66829306", "0.66828823", "0.6680201", "0.6676043", "0.6667203", "0.6658978", "0.66580236", "0.6645666", "0.6635214", "0.6617677", "0.66163224", "0.660073", "0.6600585", "0.65953475", "0.65953475", "0.65953475", "0.65953475", "0.65953475", "0.65953475", "0.65953475", "0.65953475", "0.6589737", "0.65874493", "0.6569315", "0.6565847", "0.6544328", "0.65331876", "0.65245146", "0.6519273", "0.6510441", "0.64986324", "0.6493361", "0.64922214", "0.6489619", "0.6484096", "0.64657134", "0.6465687", "0.6452832", "0.6447408", "0.64417046", "0.644029", "0.6438967", "0.6437311", "0.6431427", "0.642961", "0.6428772", "0.64228904", "0.64220494", "0.64179265", "0.6412477", "0.641247", "0.6411813", "0.6410689", "0.64075017", "0.6383531", "0.63763905", "0.637245", "0.63700396", "0.63700396", "0.63647366" ]
0.0
-1
pass server response into an object
function getUsers(users) { const userList = JSON.parse(users); getRepos(userList); displayUser(userList) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getResponseObj(response, callback) {\n\tvar serverData = '';\n\tresponse.on('data', function(chunk) {\n\t\tserverData += chunk;\n\t});\n\n\tresponse.on('end', function() {\n\t\tif(callback != null)\n\t\t\tcallback(JSON.parse(serverData));\n\t});\n}", "function NWTIOResponse (request) {\n\tthis.request = request;\n\ttry {\n\t\tthis.obj = JSON.parse(request.responseText);\n\t} catch(e) {}\n}", "constructor(response) {\n this.response = response;\n }", "function processServerResponse(response){\n if(response.error){\n\n }\n else if (response.success) {\n\n }\n}", "function processResponse(){\n //\n }", "function response(response) {\n console.log(response)\n res.status(response.status).json({msg: response.msg})\n }", "function handleSuccess( response ) {\n\t\t return( response.data.responseObject);\n\t\t }", "function response(obj) {\n resp.writeHead(200, {'Content-Type': 'application/json' });\n resp.write(JSON.stringify(obj));\n resp.end();\n }", "update_response(response) {\n this.response = response;\n }", "function handleSuccess( response ) {\n return( response.data.responseObject);\n }", "response(response) {\n\t\tconsole.log(response);\n\t\treturn response;\n\t}", "get response() {\n return this._request.response;\n }", "get response() {\n\t\treturn this.__response;\n\t}", "function showResponse(response) {\r\n YT = response;\r\n}", "function createResponse(){\n resp = {success: true}\n return resp\n}", "constructor(response) {\n Object.assign(this, response); //Assign data properties to Class TODO\n }", "get response () {\n\t\treturn this._response;\n\t}", "get response () {\n\t\treturn this._response;\n\t}", "function Mesibo_onHttpResponse(mod, cbdata, response, datalen) {\n\tvar rp_log = \" ----- Recieved http response ----\";\n\tmesibo_log(mod, rp_log, rp_log.length);\n\tmesibo_log(mod, response, datalen);\n\n\tp = JSON.parse(cbdata);\n\tmesibo_log(mod, rp_log, rp_log.length);\n\n\treturn MESIBO_RESULT_OK;\n}", "function nlobjServerResponse() {\n}", "function KradResponse(contents) {\r\n this.responseContents = contents;\r\n}", "function nlobjResponse() {\n}", "function Response(socket) {\n this.socket = socket;\n return this;\n}", "get response() {\n return this.responseHandler.bind(this);\n }", "function cb (_error, _response, _context) {\n if(_error) {\n callback({errorMessage: _error.message, errorCode: _error.code},null,_context);\n } else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\n var parsed = JSON.parse(_response.body);\n parsed = new GetAClientResponse(parsed);\n callback(null,parsed,_context);\n } else {\n callback({errorMessage: \"HTTP Response Not OK\", errorCode: _response.statusCode, errorResponse: _response.body}, null, _context);\n }\n }", "constructor(resp) {\r\n this.status = resp.statusCode;\r\n this.headers = resp.headers;\r\n let body = resp.body || \"\";\r\n this.text = _.isString(body) ? body : JSON.stringify(body);\r\n\r\n try {\r\n this.parsedData = _.isString(body) ? JSON.parse(body) : body;\r\n } catch (err) {\r\n this.parsedData = undefined;\r\n this.parseError = err;\r\n }\r\n this.request = resp.request;\r\n }", "function Response (fd,server,request) {\n this._server = server;\n this.headersSent = false;\n this.request = request;\n util.extend(this,{\n sock: fd,\n status: 200,\n contentLength: 0,\n contentType: 'text/html',\n cookies: {},\n headers: {\n Server: 'Perl-js Server'\n },\n data: ''\n });\n}", "function WrappedResponse(msg, hdr, err, res) {\n this._msg = msg;\n this.headers = hdr;\n this.error = err;\n this.response = res;\n}", "set body(response) {\n\t\tthis.koa.body = response;\n }", "success(response) {\n\t\tthis.response = response;\n\t\tthis.status = response.status;\n\t}", "function receivedResponse(){\n \t//console.log(\" req.responseText: \"+oReq.response);\n \tpopMap( JSON.parse(oReq.response) );\n }", "_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }", "function ok(obj) {\n response({ status: 'ok', response: obj });\n }", "responseHandler(res, retObj) {\n const outString = JSON.stringify(retObj)\n res.writeHead(retObj.error? 500:200, {\n 'Access-Control-Allow-Origin': this.acao,\n 'Content-Length': Buffer.byteLength(outString, 'utf8'),\n 'Content-Type': 'application/json;charset=utf-8'\n })\n res.end(outString)\n }", "on_REPLY (e, callback) {\n\n\t\tif (e.target.status >= 200 && e.target.status < 400) {\n\t\t\t\n\t\t\tvar response = e.target.response;\n\n\t\t\t// convert to object if request is a JSON string\n\t\t\tif (typeof response === 'string') {\n\t\t\t\tresponse = JSON.parse(e.target.response);\n\t\t\t}\n\n\t\t\t// Go ahead and pass the response to the caller\n\t\t\tcallback(response);\n\n\t\t} else {\n\t\t\t\n\t\t\tconsole.log('Error: There was an error loading the JSON. -- Status:', e.target.status);\n\t\t}\n\t}", "function cb (_error, _response, _context) {\n if(_error) {\n callback({errorMessage: _error.message, errorCode: _error.code},null,_context);\n } else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\n var parsed = JSON.parse(_response.body);\n parsed = new UpdateAClientResponse(parsed);\n callback(null,parsed,_context);\n } else {\n callback({errorMessage: \"HTTP Response Not OK\", errorCode: _response.statusCode, errorResponse: _response.body}, null, _context);\n }\n }", "function response(event)\n{\n if ( event.data instanceof ArrayBuffer ) {\n responseArrayBuffer(event.data);\n }\n else if ( typeof(event.data) == 'string' ) {\n responseString(event.data);\n }\n else {\n console.log(\"Unhandled response type: \" + typeof(event.data));\n }\n}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// return customized response data to New Relic\n\t\tthis.responseData = {\n\t\t\tpost: Utils.ToNewRelic(this.codeError, this.post, this.users)\n\t\t};\n\t\treturn super.handleResponse();\n\t}", "setObj(obj, on_response = empty_fun) {\n this.httpPost('mset', function(resp) {\n on_response(resp.isOk());\n }, _obj2str(obj));\n }", "function pageResponse() {\n var Promise = require('promise');\n var self = this;\n this._id = \"\";\n this.title = \"\";\n this.tags = [];\n this.pollsCount = 0;\n\n this.fromDBObject = function (inputObject) {\n return new Promise(function(resolve, reject){\n self.title = inputObject.title;\n self._id = inputObject._id;\n self.tags = inputObject.tags;\n self.pollsCount = inputObject.pollsCount;\n resolve(self);\n });\n };\n\n}", "function process_response(response) {\n\tif (!response) {\n\t\thandle_error();\n\t\treturn;\n\t}\n\tresponse = JSON.parse(response);\n\tswitch (response.type) {\n\t\tcase \"deleted\":\n\t\t\twindow.location.reload();\n\t\t\tbreak;\n\t\tcase \"requested\":\n\t\t\tclear_divs();\n\t\t\tbreak;\n\t\tcase \"trade\":\n\t\t\tif (response.error) {\n\t\t\t}\n\t\t\telse {\n\t\t\t\tclear_divs();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tupdate_divs(response);\n\t}\n}", "function upgradeResponse(response, obj) {\n var ok = response.ok,\n headers = response.headers,\n status = response.status,\n statusText = response.statusText;\n var bodyType = obj.config.bodyType;\n\n obj.headers = headers;\n obj.status = status;\n obj.statusText = statusText;\n\n var reader = defineReader(ok, headers, bodyType);\n\n if (reader === 'raw') {\n obj.data = response.body;\n return Promise.resolve(obj);\n }\n\n return response[reader]().then(function (data) {\n obj.data = data;\n return obj;\n });\n}", "function _downloaded(response) {\n // --- receive response result ---\n\n\n return response;\n }", "function serverResponseHandler (response) {\n\tresultContainer.className = response.status;\n\n\tif (response.status == \"success\") {\n\t\tresultContainer.innerHTML = \"Success\";\n\t}\n\tif (response.status == \"error\") {\n\t\tresultContainer.innerHTML = response.reason;\n\t}\n\t// warning! can cause recursion\n\tif (response.status == \"progress\") {\n\t\tresultContainer.innerHTML = 'Attempt to connect to server...';\n\n\t\tsetTimeout(function () {\n\t\t\tsendGetRequest(myForm.action, serverResponseHandler);\n\t\t}, response.timeout);\n\n\t}\n}", "function get_response_object(sstate /* or state */) {\n\t\tvar state = is_bosh_session_state(sstate) ? sstate : sstate.state;\n\n\t\tvar res = state.res;\n\t\tassert(res instanceof Array);\n\n\t\tvar ro = res.length > 0 ? res.shift() : null;\n\n\t\tif (ro) {\n\t\t\tclearTimeout(ro.timeout);\n\t\t\tlog_it(\"DEBUG\", \n\t\t\t\tsprintfd(\"BOSH::%s::Returning response object with rid: %s\", state.sid, ro.rid)\n\t\t\t);\n\t\t}\n\n\t\tlog_it(\"DEBUG\", \n\t\t\tsprintfd(\"BOSH::%s::Holding %s response objects\", state.sid, (res ? res.length : 0))\n\t\t);\n\n\t\treturn ro;\n\t}", "function ready(response) {\n switch (args.named[\"--output\"]) {\n case \"stat\":\n console.log(response.status);\n break;\n case \"head\":\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n break;\n case \"headers\":\n console.log(response.getHeaderString());\n break;\n case \"body\":\n if (response.data) console.log(response.data);\n break;\n case \"status\":\n console.log(response.statusLine);\n break;\n case \"full\":\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n if (response.data) console.log(response.data);\n break;\n case \"auto\":\n case false:\n if (response.data) console.log(response.data);\n else {\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n }\n break;\n default:\n throw new Error(\"unrecognized out format \" + args.named[\"-o\"]);\n }\n }", "function mapResponse(response) {\n response.body = response.text\n response.statusCode = response.status\n return response\n}", "function immonitResponse(URI) {\r\n var requestObject = Requests();\r\n var response = \"failed\";\r\n var options = { uri: URI };\r\n requestObject.get(options, function(err, data) {\r\n try{\r\n if (err) {\r\n response = stringToJSONConveter(err);\r\n } else {\r\n response = stringToJSONConveter(data).Result;\r\n }\r\n // return response;\r\n }catch(e){\r\n response=e;\r\n } \r\n });\r\nreturn response;\r\n}", "async function receiveJSONObj(_response, _result) {\n _response.setHeader(\"content-type\", \"application/json\");\n _response.write(JSON.stringify(await _result));\n }", "__handleResponse() {\n this.push('messages', {\n author: 'server',\n text: this.response\n });\n }", "buildResult(response) {\n return {\n text: response.data,\n };\n }", "buildResult(response) {\n return {\n text: response.data,\n };\n }", "createNavigateHomeObject() {\n // let response = \"\";\n const response_object = {\n speech: '',\n displayText: '',\n data: {\n expectUserResponse: false\n },\n messages: [\n {\n type: 0,\n speech: 'If you say so.'\n },\n {\n type: 'navigate_home',\n speech: ''\n }\n ]\n };\n return response_object;\n }", "function handleResponse(response) {\n\n var str = '';\n response.on('data', function (chunk) {\n // Add data as it returns.\n str += chunk;\n });\n\n response.on('end', function () {\n res.setHeader('Content-Type', 'application/json');\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.end(str);\n\n });\n }", "function handleSuccess(response) {\r\n\t\tconsole.log('handle success');\r\n\t\tconsole.log(response);\r\n\t\treturn (response.data.responseBody);\r\n\r\n\t}", "function responseWrapper(data,error){\n\n\tvar result ={};\n\tif(error){\n\t\tresult['error'] = error;\n\t}\n\tif(data){\n\t\tresult['result'] = data;\n\t}\n\n\treturn result;\n}", "function handleResponse(response) {\n\n var str = '';\n response.on('data', function (chunk) {\n // Add data as it returns.\n str += chunk;\n });\n\n response.on('end', function () {\n res.setHeader('Content-Type', 'application/json');\n res.setHeader('Access-Control-Allow-Origin', '*');\n\n res.end(str);\n\n });\n }", "function ResponseBase() {}", "function handleSuccess( response ) {\n\n return response.data;\n }", "function httpResponse (res, response) {\n res.setHeader('Content-Type', 'application/json');\n res.end(JSON.stringify(response));\n}", "handleResponse(response){\n this.#addTransactionToView(response.transaction);\n console.log(response) //TODO Continue\n }", "static async fromRequestAndResponse(request, response) {\n const { url, method } = request;\n const { status, statusText } = response;\n\n if (response.headers.get('content-type')?.startsWith('application/json')) {\n const body = await response.json();\n const error = body.error || 'No message';\n const errorCode = body.error_code;\n const link = body.link;\n\n return new MongoDBRealmError(\n method,\n url,\n status,\n statusText,\n error,\n errorCode,\n link\n );\n } else {\n return new MongoDBRealmError(method, url, status, statusText);\n }\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "function ClientResponse() {\n _classCallCheck(this, ClientResponse);\n\n this._response = {};\n }", "function sendResultWithResponse(result, response) {\n response.status(200).end(JSON.stringify(result));\n}", "function ServerResponse(resPromise, isStreaming) {\n\tlocal.util.EventEmitter.call(this);\n\n\tthis.resPromise = resPromise;\n\tthis.isStreaming = isStreaming;\n\tthis.clientResponse = new ClientResponse();\n}", "function handleServerResponse(response) {\n if (!!response.error) {\n deferred.reject(response.error);\n } else {\n deferred.resolve(response.data);\n }\n }", "function loadResponse() {\n var status = getStatusCode()\n var body = getBody()\n var error = errorFromStatusCode(status, body)\n var response = {\n body: body,\n statusCode: status,\n statusText: xhr.statusText,\n raw: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n } else {\n response.headers = {}\n }\n\n callback(error, response, response.body)\n }", "function loadResponse() {\n var status = getStatusCode()\n var body = getBody()\n var error = errorFromStatusCode(status, body)\n var response = {\n body: body,\n statusCode: status,\n statusText: xhr.statusText,\n raw: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n } else {\n response.headers = {}\n }\n\n callback(error, response, response.body)\n }", "function loadResponse() {\n var status = getStatusCode()\n var body = getBody()\n var error = errorFromStatusCode(status, body)\n var response = {\n body: body,\n statusCode: status,\n statusText: xhr.statusText,\n raw: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n } else {\n response.headers = {}\n }\n\n callback(error, response, response.body)\n }", "static response(response, status, msgCode, message, data) {\n data = data || {};\n const dat = {\n code: status,\n date: DateHelper.now(),\n message,\n msgCode,\n data,\n };\n\n response.status(status).json(dat);\n }", "function Response(run) {\n\n var writer = this._writer = WritableStream.create();\n this._reader = writer.getReader();\n\n // todo - pass writable instead\n if (run) {\n // var ret = run(this._writable);\n var ret = run(writer);\n\n // thenable? Automatically end\n if (ret && ret.then) {\n ret.then(function () {\n writer.close();\n }, writer.abort.bind(writer));\n }\n }\n}", "function loadResponse() {\n var status = getStatusCode();\n var error = errorFromStatusCode(status);\n var response = {\n body: getBody(),\n statusCode: status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders())\n };\n\n callback(error, response, response.body);\n }", "function fillInResponse(response){\n $(\"#response\").text(response.responseText);\n }", "function __haveResponse(args, obj) {\n\n if (args.diagnostic === true) {\n console.log(\"Response parser arguments: #2yib4\");\n console.log(args);\n }\n\n var _r = __this.response;\n var i, l, j, lj, sortedKeys, key, timeInterval;\n\n // Do we even have a good response from the server?\n if (obj.SUMMARY.RESPONSE_CODE !== 1) {\n console.log(\"Error code issued from Mesonet API. #oggi1\");\n console.log(obj.SUMMARY.RESPONSE_MESSAGE);\n return false;\n }\n\n if (typeof args.time_interval === \"undefined\") {\n timeInterval = 86400;\n } else {\n timeInterval = Number(args.time_interval);\n }\n\n /*\n * The filtering logic here is:\n *\n * IF : QcTypes\n * EIF: Variables\n * EIF: QcSegments\n * EIF: Metadata\n * E : (all the others)\n */\n\n if (args.web_service === \"QcTypes\") {\n /** Service: QcTypes */\n\n // !!! _r.qc.metadata = obj.QCTYPES;\n l = obj.QCTYPES.length;\n for (i = 0; i < l; i++) {\n _r.qc.metadata[Number(obj.QCTYPES[i].ID)] = obj.QCTYPES[i];\n }\n\n } else if (args.web_service === \"Variables\") {\n /** Service: Variables */\n\n // Rank is an array of the sensor names in their order\n // !!! _r.sensor.metadata = obj.VARIABLES;\n _r.sensor.metadata.rank = [];\n _r.sensor.metadata.meta = {};\n _r.sensor.metadata.meta_vid = {};\n l = obj.VARIABLES.length;\n for (i = 0; i < l; i++) {\n // key name: getKeys(obj.VARIABLES[i])\n // object: obj.VARIABLES[i][getKeys(obj.VARIABLES[i])]\n _r.sensor.metadata.rank[i] = __this._getKeys(obj.VARIABLES[i])[0];\n _r.sensor\n .metadata.meta[__this._getKeys(obj.VARIABLES[i])] =\n obj.VARIABLES[i][__this._getKeys(obj.VARIABLES[i])];\n _r.sensor.metadata\n .meta_vid[obj.VARIABLES[i][__this._getKeys(obj.VARIABLES[i])].vid] =\n obj.VARIABLES[i][__this._getKeys(obj.VARIABLES[i])];\n }\n\n } else if (args.web_service === \"QcSegments\") {\n /**\n * Service: QcSegments\n *\n * We need to modify the response object to reflect the\n * nature of this query. Due to the nature of this beast we\n * have to do it item by item.\n */\n delete _r.sensor.units;\n delete _r.qc.active;\n delete _r.qc.flags;\n\n _r.summary = obj.SUMMARY;\n\n if (args.diagnostic || args.data_complete) {\n _r.station = [];\n } else {\n delete _r.station;\n }\n\n if (typeof args.ledger !== \"undefined\" && args.ledger) {\n _r.qc.ledger = {\n station: {},\n summary: {}\n };\n }\n\n if (typeof args.d3_compat !== \"undefined\" && args.d3_compat) {\n // Do something\n } else {\n args.d3_compat = false;\n delete _r.station;\n _r.qc.events = {};\n _r.qc.time_interval = timeInterval;\n }\n\n if (!args.d3_compat) {\n\n /**\n * Limit definitions in Epoch/Unix time (0:00z):\n * a: range start, b: range end\n * aa: event start, bb: event end\n * o: this event\n */\n\n var a = __this.apiDateToEpoch(args.api_args.start, true);\n var b = __this.apiDateToEpoch(args.api_args.end, true);\n\n //var nIntervals = Math.ceil((b - a) / timeInterval);\n\n var intervals = __linspace(\n __this.apiDateToEpoch(args.api_args.start, true),\n Math.ceil((b - a) / timeInterval),\n timeInterval\n );\n\n _r.qc.time_hacks = intervals;\n\n /* ---------------------------------------------------------\n * TEST CODE! \n * High-jack some data for testing\n */\n // var bingo = 1;\n // obj.STATION[bingo].QC[0].start = \"2016-07-01T01:00:00Z\";\n // obj.STATION[bingo].QC[0].end = \"2016-07-03T01:00:00Z\";\n // obj.STATION[bingo].QC[0].qc_flag = 9999;\n /* -------------------------------------------------------- */\n\n var sidx, eidx, didx, aa, bb, stationID, _o, k;\n\n l = obj.STATION.length;\n for (i = 0; i < l; i++) {\n stationID = obj.STATION[i].STID;\n _r.qc.events[stationID] = {};\n\n // For statistics\n if (typeof args.ledger !== \"undefined\" && args.ledger) {\n _r.qc.ledger.station[stationID] = {\n A: {},\n B: {}\n };\n }\n\n if (typeof obj.STATION[i].QC !== \"undefined\") {\n lj = obj.STATION[i].QC.length;\n for (j = 0; j < lj; j++) {\n\n // Evaluate to see if the date is w/in our limits, if\n // so then append/add the response.\n _o = obj.STATION[i].QC[j];\n aa = __this.epochDate(_o.start);\n bb = __this.epochDate(_o.end);\n\n sidx = Math.floor((aa - a) / timeInterval);\n eidx = Math.floor((bb - a) / timeInterval);\n didx = (eidx - sidx);\n if (didx === 0) {\n didx = 1;\n }\n\n if (typeof args.ledger !== \"undefined\" && args.ledger) {\n __punchStats(_o);\n }\n\n for (k = 0; k < didx; k++) {\n if (typeof _r.qc.events[stationID][intervals[sidx + k]] === \"undefined\") {\n _r.qc.events[stationID][intervals[sidx + k]] = [];\n }\n _r.qc.events[stationID][intervals[sidx + k]].push(_o);\n }\n }\n }\n }\n }\n\n var tmp = [];\n l = obj.STATION.length;\n for (i = 0; i < l; i++) {\n _r.tableOfContents[obj.STATION[i].STID] = i;\n\n // If in diagnostic mode, then pass along the raw QC stack\n // for the user to inspect. A) this consumes a decent\n // amount of memory and B) DO NOT build any function that\n // depends on this data object.\n if (args.diagnostic || args.data_complete) {\n _r.station[i] = obj.STATION[i];\n _r.qc.segments = [];\n _r.qc.segments[i] = obj.STATION[i].QC;\n }\n\n // Create the `sensor` and `qc` stacks.\n if (typeof obj.STATION[i].QC !== \"undefined\") {\n lj = obj.STATION[i].QC.length;\n for (j = 0; j < lj; j++) {\n tmp.push(obj.STATION[i].QC[j].qc_flag);\n }\n _r.qc.stack[i] = __this._sortUnique(tmp);\n _r.sensor.stack[i] = __this._getKeys(obj.STATION[i].SENSOR_VARIABLES);\n } else {\n _r.qc.stack[i] = [null];\n _r.sensor.stack[i] = [null];\n }\n }\n\n } else if (args.web_service === \"Metadata\") {\n /**\n * Service: Metadata\n *\n * We need to modify the response object to reflect the\n * nature of this query. Due to the nature of this beast we\n * have to do it item by item.\n */\n delete _r.qc;\n delete _r.sensor.units;\n\n _r.metadata = [];\n _r.metadata.status = {};\n _r.metadata.mnetID = {};\n\n l = obj.STATION.length;\n for (i = 0; i < l; i++) {\n _r.station[i] = obj.STATION[i];\n _r.sensor.stack[i] = __this._getKeys(obj.STATION[i].SENSOR_VARIABLES);\n _r.metadata.status[obj.STATION[i].STID] = obj.STATION[i].STATUS;\n _r.metadata.mnetID[obj.STATION[i].STID] = obj.STATION[i].MNET_ID;\n _r.tableOfContents[obj.STATION[i].STID] = i;\n }\n\n } else if (\n args.web_service === \"TimeSeries\" ||\n args.web_service === \"Latest\"\n ) {\n /**\n * Services: TimeSeries, Latest\n */\n _r.summary = obj.SUMMARY;\n _r.qc.active.push(false);\n l = obj.STATION.length;\n for (i = 0; i < l; i++) {\n\n // Reverse the stack order so they display correctly\n //\n // Sometimes we have multiples of sensors in the same stack.\n // i.e. `air_temp_set_1`, `air_temp_set_2` etc. We want to \n // sort them by their order.\n // @TODO: Depending on the service call, the `_set_` \n // signature might cause some trouble.\n\n _r.sensor.stack[i] = [];\n for (key in obj.STATION[i].SENSOR_VARIABLES) {\n sortedKeys = Object.keys(obj.STATION[i].SENSOR_VARIABLES[key]).sort();\n for (j = 0; j < sortedKeys.length; j++) {\n _r.sensor.stack[i].push(sortedKeys[j]);\n }\n }\n\n _r.qc.active[i] = obj.STATION[i].QC_FLAGGED;\n _r.station[i] = obj.STATION[i];\n _r.sensor.units[i] = obj.UNITS;\n _r.tableOfContents[obj.STATION[i].STID] = i;\n\n if (_r.qc.active[i]) {\n _r.qc.stack[i] = __this._getKeys(obj.STATION[i].QC);\n _r.qc.flags[i] = obj.STATION[i].QC;\n }\n }\n } else {\n console.log(\"Unsupported Mesonet service. #34wjt\");\n return false;\n }\n\n if (args.diagnostic === true) {\n t2 = performance.now();\n console.log(\"apiBrokerEngine.haveResponse time: \" + (t2 - t1) + \" ms #xk6zr\");\n }\n\n\n function __punchStats(event) {\n var __r = _r.qc.ledger;\n var thisSensor = (event.sensor).replace(/\\_qc\\_+./, '');\n var thisFlag = \"F\" + event.qc_flag;\n\n // First `punch` the `Qc-by-flag` (A) branch\n if (typeof __r.station[stationID].A[thisFlag] === \"undefined\") {\n __r.station[stationID].A[thisFlag] = {\n total: 0\n };\n __r.summary[thisFlag] = {\n total: 0\n };\n }\n if (typeof __r.station[stationID].A[thisFlag][thisSensor] === \"undefined\") {\n __r.station[stationID].A[thisFlag][thisSensor] = 0;\n __r.summary[thisFlag][thisSensor] = 0;\n }\n // Next `punch` the `Qc-by-variable` (B) branch\n if (typeof __r.station[stationID].B[thisSensor] === \"undefined\") {\n __r.station[stationID].B[thisSensor] = {\n total: 0\n };\n __r.summary[thisSensor] = {\n total: 0\n };\n }\n if (typeof __r.station[stationID].B[thisSensor][thisFlag] === \"undefined\") {\n __r.station[stationID].B[thisSensor][thisFlag] = 0;\n __r.summary[thisSensor][thisFlag] = 0;\n }\n\n // Do the punching... \n __r.station[stationID].A[thisFlag][thisSensor] += 1;\n __r.station[stationID].A[thisFlag].total += 1;\n __r.summary[thisFlag][thisSensor] += 1;\n\n __r.station[stationID].B[thisSensor][thisFlag] += 1;\n __r.station[stationID].B[thisSensor].total += 1;\n __r.summary[thisSensor][thisFlag] += 1;\n\n __r.summary[thisFlag].total += 1;\n __r.summary[thisSensor].total += 1;\n }\n\n /**\n * Create a linear array\n * \n * @param {number} start - starting integer\n * @param {number} nvalues - how many values\n * @param {number} interval - interval (optional)\n */\n function __linspace(start, nvalues, interval) {\n if (typeof interval === \"undefined\") {\n interval = 0;\n }\n var i;\n var r = [];\n for (i = 0; i < nvalues; i++) {\n r.push(start + (i * interval));\n }\n return r;\n }\n\n }", "function loadResponse() {\n var status = getStatusCode()\n var error = errorFromStatusCode(status)\n var response = {\n body: getBody(),\n statusCode: status,\n statusText: xhr.statusText,\n raw: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n } else {\n response.headers = {}\n }\n\n callback(error, response, response.body)\n }", "function respond(args) {\n var request = args.request||null;\n var response = args.response||null;\n var action = args.action||null;\n var object = args.type||\"\";\n var config = args.config||{};\n\n return utils.handler(request,response,action,object,config);\t\n}", "function respond(args) {\n var request = args.request||null;\n var response = args.response||null;\n var action = args.action||null;\n var object = args.type||\"\";\n var config = args.config||{};\n\n return utils.handler(request,response,action,object,config);\t\n}", "createResponse(name, handler) { throw new Error('Server is not configured use responses.'); }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function initResponse(response) {\n\tresponse.set('Content-Type', 'application/json');\n}", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function processResponse(respObj) {\r\n $(position1).html(respObj);\r\n }", "function HttpResponse(init) {\n if (init === void 0) {\n init = {};\n }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }" ]
[ "0.7067715", "0.690353", "0.68746305", "0.6598924", "0.65437895", "0.6533029", "0.65246516", "0.649672", "0.6442917", "0.64121", "0.6405134", "0.63961935", "0.63860685", "0.6385292", "0.6352331", "0.6351982", "0.6349718", "0.6349718", "0.63416886", "0.6317918", "0.6285735", "0.6270928", "0.6235358", "0.6216464", "0.619646", "0.61534226", "0.61447465", "0.6117038", "0.6106018", "0.6091133", "0.6077883", "0.6069717", "0.60584176", "0.6045896", "0.6033849", "0.6012135", "0.59980696", "0.5985003", "0.59750557", "0.5966603", "0.5957768", "0.5947606", "0.59388196", "0.5938767", "0.59240526", "0.5922842", "0.590972", "0.5908488", "0.59080213", "0.58930963", "0.5876732", "0.5876732", "0.5870887", "0.5867465", "0.5866344", "0.58617485", "0.58571595", "0.58499974", "0.58383864", "0.58270717", "0.58254534", "0.58220404", "0.5792775", "0.5781947", "0.5778046", "0.5775884", "0.5775846", "0.5774636", "0.5773374", "0.5773374", "0.5773374", "0.57683295", "0.57666695", "0.57664895", "0.57585883", "0.57572454", "0.5752104", "0.575195", "0.575195", "0.5749399", "0.5748207", "0.5748207", "0.5748207", "0.574748", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.5746866", "0.57462025", "0.57436013", "0.5742546", "0.5738273", "0.5737993", "0.5737993" ]
0.0
-1
send request to get all user repositories
function displayUser(users) { Promise.all(users.map(function(user) { const userDisplay = document.createElement('div'); userDisplay.className= "user" userDisplay.innerHTML = user.login; document.body.appendChild(userDisplay); })) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "repositories(username) {\n return this.request(`/users/${username}/repos`);\n }", "function getRepositories(username) {\n // console.log('Function called: getRepositories()');\n let urlRepository = `https://api.github.com/users/${username}/repos`;\n fetch(urlRepository).then((response) => {\n return response.json();\n }).then((repo) => {\n userRepositories(repo);\n }).catch((error) => {\n console.log(error);\n });\n}", "listAuthUserRepos(params) {\n\t\t\treturn minRequest.get('/user/repos', params)\n\t\t}", "static getUserRepos() {\n return resolver(axios.get(`${API}/user/repos?per_page=200`, optionsMaker()));\n }", "function getRepos(username) {\n return axios.get('https://api.github.com/users/' + username + '/repos' + param + '$per_page=100');\n }", "function getRepos(username){\n return axios.get(\n 'https://api.github.com/users/' + username + '/repos' + param + '&per_page=100'\n );\n}", "function getRepositories(user){\n getRepositories(user.gitHubUsername,getCommits);\n}", "function fetchUsersRepos(user){\n repoList.innerHTML = ''\n fetch(`https://api.github.com/users/${user.login}/repos`)\n .then(resp => resp.json())\n .then(json => {\n json.forEach((repo) => {\n renderRepos(repo)\n })\n })\n}", "function usersRepos(user){\n console.log(user);\n getRepositories(user.profile,getRepos)\n}", "function fetch_repos(res) {\n // check if user has public repos and only process public repos\n if (!res.public_repos) {\n console.log(res.message);\n return 0;\n }\n // make several requests, limits records per page to 100\n var pages = Math.ceil(res.public_repos / 100),\n i = pages,\n repos = [];\n while (i--) {\n // * second round request call to get repos' info\n var url = '/users/' + user_username + '/repos?per_page=100&page=' + (i + 1);\n make_request(url, process_repos);\n }\n // inner function to \n // 1. get repos' info page by page\n // 2. when all repos' info are fetched, start to count\n function process_repos (res) {\n repos = repos.concat(res);\n pages--;\n if (!pages) process_count(repos);\n }\n}", "function getRepos() {\n var username = 'kevinstock';\n \n\tvar request = {access_token: '8a5baccc4a904b12e75a447bd35803bc3358101b'};\n\t\n\tvar result = $.ajax({\n\t\turl: 'http://api.github.com/users/' + username + '/repos',\n\t\tdata: request,\n\t\tdataType: 'jsonp',\n\t\ttype: 'GET',\t\n\t})\n\t.done(function(result) {\n\t\t\n\t\t// get each repo object\n\t\t$.each(result.data, function(i, repo) {\n \t\t\n \t\t// check for repo name matches on the filter list\n \t\tvar matches = 0;\n for (var j = 0; j < repoFilter.length; j++) {\n if (repo.name == repoFilter[j]) {\n matches++; }\n }\n \n // if repo is not on the filter list then create the repo HTML\n if (matches == 0) {\n \n createRepos(repo);\n }\n\t\t})\n\t\t\n\t})\n\t.fail(function(jqXHR, error, errorThrown) {\n\t\t$('.error').append(error);\n\t});\n}", "getUserRepos() {\n\t\tvar request = new Request(\n\t\t\t'https://api.github.com/users/' + this.state.username \n\t\t\t+ \"/repos?per_page=\" + this.state.perPage \n\t\t\t+ \"&client_id=\" + this.props.clientId\n\t\t\t+ \"&client_secret=\" + this.props.clientSecret\n\t\t\t+ \"&sort=created\"\n\t\t);\n\n\t\tfetch(request)\n\t\t.then(function(response) {\n\t\t\tif(response.ok) {\n\t\t\t\tresponse\n\t\t\t\t.json()\n\t\t\t\t.then(function(data) {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tuserRepos: data\n\t\t\t\t\t});\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t}.bind(this));\n\t}", "getRepoList(opts) {\n\t\tconst query = encodeQueryString(opts);\n\t\treturn this._get(`/api/user/repos?${query}`);\n\t}", "function getUserRepos(uri, repos) {\n return request({\n \"method\": \"GET\",\n \"uri\": uri,\n \"json\": true,\n \"resolveWithFullResponse\": true,\n \"headers\": {\n \"User-Agent\": \"sbolande\"\n }\n }).then(function (response) {\n /* If the arrat repos doesn't exist (the first time the call is made), create it */\n if (!repos) {\n repos = [];\n }\n /* For each repo, it will push a json object with the name, clone url, if there are open issues, and url in github */\n response.body.forEach(repo => {\n repos.push({\n name: repo.name,\n clone_url: repo.clone_url,\n open_issues: repo.open_issues,\n url: repo.html_url\n });\n cloneUrls.push(`'${repo.clone_url}'`);\n });\n console.log(repos.length + \" repos so far\");\n /* Checks the response header to see if there are more calls to be made (if there are more repos) since it willonly grab 100 per call */\n if (response.headers.link.split(\",\").filter(function (link) { return link.match(/rel=\"next\"/) }).length > 0) {\n var next = new RegExp(/<(.*)>/).exec(response.headers.link.split(\",\").filter(function (link) { return link.match(/rel=\"next\"/) })[0])[1];\n return getUserRepos(next, repos);\n }\n writeToCsv(repos);\n writeCloneUrlsToJson(cloneUrls);\n return repos;\n });\n}", "async fetchRepos() {\n let repos = await this.callApi(`/users/${this.username}/repos?per_page=100`);\n // let repos = dummyJSON; //-> Used for testing\n\n if (typeof (this.forked) === 'boolean') {\n return repos.filter(repo => repo.fork === this.forked);\n }\n\n return repos;\n }", "async function getRepos(username) {\n try {\n const { data } = await axios(apiURL + username + '/repos?sort=created')\n console.log('repos', data);\n addReposToCard(data)\n } catch (err) {\n console.log(err)\n createErrorForFetchingRepos('Problem fetching repos')\n }\n}", "async function getRepositories(req, res) {\n const repositories = await repositoryService.getRepositories();\n return res.json(repositories);\n}", "async fetchRepos_BIG() {\n let repos = [];\n const NUM_PER_PAGE = 100;\n let pageNumber = 1;\n\n do {\n let response = await this.callApi(`/users/${this.username}/repos?page=${pageNumber}?per_page=${NUM_PER_PAGE}`);\n repos = repos.concat(response);\n pageNumber++;\n } while (response.length === NUM_PER_PAGE);\n\n return repos;\n }", "function getRepositroies(user) {\r\n getRepositroies(user.gitHubUsername, getCommits);\r\n}", "function getRepos(callback) {\n if (ns.repoData.length > 0){\n callback(ns.repoData);\n return;\n }\n $.ajax({\n type: 'GET',\n url: 'https://api.github.com/user/repos',\n dataType: 'json',\n headers: {\n Authorization: \"token \" + ns.userToken\n },\n success: function (data){\n ns.repoData = data;\n console.log(data);\n callback(ns.repoData);\n },\n error: function (){\n callback(null);\n }\n });\n }", "function listRepos(callback){\n if( OTW.user !== undefined){\n OTW.user.repos(function (err,repos) {\n callback(repos);\n });\n } else{\n callback([{message:\"user is not logged\"}])\n }\n }", "function getRepositories(user) {\n getRepositories(user.gitHubUserName, getCommits)\n}", "function getRepos(username) {\n fetch(`https://api.github.com/users/${username}/repos`)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => displayResults(responseJson))\n .catch(error => {\n $('#results-list').empty();\n $('.results').empty();\n $('#js-error-message').text(`Something went wrong - ${error.message}`);\n \n });\n}", "async function getRepos(req,res){\n\n\ttry{\n console.log('Fetching Data...');\n\n const {username} = req.params;\n\tconst response = await fetch(`https://api.github.com/users/${username}`);\n\n\tconst data = await response.json();\n const repo = data.public_repos;\n\tconsole.log(data.public_repos);\n\n //set data to redis\n\tclient.setex(username,3600,repo);\n\n\n\tres.send(setResponse(username,repo));\n\n\t}catch(err){\n\t console.error(err);\n\t res.status(500);\n\t}\n\n res.end(()=>{console.log('Finished data fetching')});\n}", "function getRepos(username){\n\treturn axios.get(`https://api.github.com/users/${username}/repos`);\n}", "async function getListOfRepos() {\n\ttry {\n\t\tlet resRepos = await axios({\n\t\t\turl: 'https://api.github.com/orgs/ramda/repos',\n\t\t\tmethod: 'get',\n\t\t\theaders: {\n\t\t\t\t'Authorization': 'token abc123',\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t}\n\t\t})\n\t\treturn resRepos;\n\n\t} catch (err) {\n\t\tconsole.error(err);\n\t}\n}", "function getUser(username) {\n const queryUrl = \"https://api.github.com/users/\"+{username}+\"/repos?per_page=100\";\n\n axios.get(queryUrl).then(function(res) {\n const repo = res.data;\n console.log(repo)\n });\n }", "function getRepos(username){\n return axios.get('https://api.github.com/users/' + username + '/repos').then(function(response){\n if(!response.headers.link){\n return response.data;\n }\n else{\n var data = response.data;\n var rels = getRels(response.headers.link)\n var calls = makeCalls(username, rels.total);\n return axios.all(calls)\n .then(function(arr){\n for(var i = 0; i < arr.length; i++){\n data = data.concat(arr[i].data);\n console.log(\"DATA:\", data)\n }\n return data;\n })\n }\n });;\n}", "getUserRepos(){\n let client_id = '?client_id='.concat(this.props.clientId);\n let client_secret = '&client_secret='.concat(this.props.clientSecret);\n let perPageParam = '&per_page='.concat(this.state.perPage);\n\n fetch('https://api.github.com/users/'.concat(this.state.username).concat('/repos' + client_id + perPageParam + client_secret))\n .then( (response) => {\n return response.json() }) \n .then( (json) => {\n this.setState({userRepos: json});\n });\n }", "function getAllRepos(org) {\n\n // This array is used to store all the repositories fetched from Github\n let repos = [];\n\n return fetch('https://api.github.com/users/publiclab/repos?sort=pushed&direction=desc&per_page=100')\n .then(function gotRepos(data) {\n if(data.status=='200') {\n return data.json();\n }\n })\n .then(function mapToEachRepo(results) {\n results.map(function mappingToEachRepo(repo, index) {\n return repos[index] = repo.name;\n })\n // Stores all of the Publiclab's repos to localStorage\n localStorage.setItem('repos', JSON.stringify(repos));\n \n return(repos);\n });\n }", "async function getUserRepos() {\n await axios\n .get(`https://api.github.com/users/${userName}/repos`)\n .then((res) => {\n setRepoData({ ...data, repos: res.data });\n })\n .catch((err) => {\n console.error(err)\n setError(err);\n setLoading(false);\n });\n }", "list(owner, callback) {\n\t\tthis.userlib.get(owner, (err, doc) => {\n\t\t\tif (err) {\n\t\t\t\tcallback(false, err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (doc) {\n\t\t\t\tcallback(true, doc.repos);\n\t\t\t} else {\n\t\t\t\tcallback(false, \"user_not_found\");\n\t\t\t}\n\t\t});\n\t}", "function getRepositories(username, callback){\n setTimeout(() => {\n console.log('Calling Github API...');\n callback(['repo1', 'repo2', 'repo3']);\n}, 2000);\n}", "@action\n async loadRepos() {\n this.loading = true;\n\n try {\n this.repos = await this.service.getReposFor(this.orgName);\n this.loading = false;\n this.error = null;\n\n } catch (error) {\n this.repos = [];\n this.loading = false;\n this.error = error;\n }\n }", "function getRepos(username) {\n // Ici, la requête sera émise de façon synchrone.\n const req = new XMLHttpRequest();\n req.open('GET', API + username + \"/repos\", false);\n req.send(null);\n if (req.status === 200) {\n var monTableau = getTable(JSON.parse(req.response));\n document.getElementById('tableContainer').innerHTML = monTableau;\n } else {\n console.log(JSON.parse(req.response).message);\n document.getElementById('tableContainer').innerHTML = \"Aucun Repository n'a été récupéré\";\n }\n}", "async function fetchRepositories() {\n console.log('Fetching repository data');\n\n // Fake a GET request\n var repos = await new Promise((resolve) => setTimeout(() => {\n return resolve(repositoryData);\n }, 1000));\n console.log('Finished fetching repository data.');\n return repos;\n}", "function getAll(){\n return repository;\n }", "synchronize() {\n\t\treturn this._post(\"/api/user/repos\");\n\t}", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "async function getRepos(req, res, next){\n try{\n console.log('Fetching Data...')\n const{ username } = req.params;\n const response = await fetch(`https://api.github.com/users/${username}`);\n const data = await response.json();\n \n\n const repos = data.public_repos;\n\n //Set data to redis\n\n client.setex(username, 30, repos);\n\n res.send(setResponse(username, repos));\n\n }catch(err){\n console.error(err);\n res.status(500);//server error\n }\n}", "function getRepositories(userName) {\r\n // **** return a promise ****\r\n return new Promise((resolve, reject) => {\r\n const delay = 2000;\r\n console.log(\"getRepositories <<< calling GitHub API...\");\r\n\r\n // **** start some async work ****\r\n setTimeout(() => {\r\n console.log(\"getRepositories <<< GitHub API call done!!!\");\r\n // resolve([\"repo1\", \"repo2\", \"repo3\", \"repo4\"]);\r\n reject(new Error(\"getRepositories <<< failed getting repos :o(\"));\r\n }, delay);\r\n });\r\n}", "async function displayDataCommits() {\n try {\n const user = await getUser(1);\n const repos = await getRepositories(user.gitHubUsername);\n console.log(repos);\n } catch (err) {\n console.log(err.message);\n }\n}", "function getGitHubRepos() {\n return getGitHubResource('user/repos');\n}", "function getUsers(params, callback) {\n var github = GithubSession.connect(params.accessToken);\n var respondWith = formatJsend.respondWith(callback);\n\n github.repos.getCollaborators({\n user: params.userName,\n repo: params.urlName\n }, function(err, collaborators) {\n if (err) { return respondWith(err); }\n\n collaborators = collaborators.map(translator.toBpUser);\n respondWith({ users: collaborators });\n });\n}", "function fetchRepoContributors(org, repo) {\n // This array is used to hold all the contributors of a repo\n var arr = [];\n\n return api.Repositories\n .getRepoContributors(org, repo, {method: \"HEAD\", qs: { sort: 'pushed', direction: 'desc', per_page: 100 } })\n .then(function gotContribData(contribData) {\n var headers = contribData;\n if (headers.hasOwnProperty(\"link\")) {\n var parsed = parse(headers['link']);\n var totalPages = parseInt(parsed.last.page);\n } else {\n var totalPages = 1;\n }\n return totalPages;\n })\n .then(function gotTotalPages(totalPages) {\n // This array is used to collect all the promises so that \n // we can wait for all of them to finish first...\n let promises = [];\n \n for(let i = 1; i <= totalPages; i++) {\n var currentPromise = api.Repositories\n .getRepoContributors(org, repo, { method:\"GET\", qs: { sort: 'pushed', direction: 'desc', per_page: 100, page:i } })\n .then(function gotContributorsOnParticularPage(contributors) {\n if (contributors!=undefined && (contributors != null || contributors.length > 0)) {\n contributors.map((contributor, i) => arr.push(contributor));\n }\n });\n // Push currentPromise to promises array\n promises.push(currentPromise);\n }\n // Waits for all the promises to resolve first, returns the array after that...\n return Promise.all(promises)\n .then(()=> {\n return arr;\n });\n })\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "function makeCalls(username, total){\n var calls = [];\n for(var i = 2; i <= total; i++){\n calls.push(axios.get('https://api.github.com/users/' + username + '/repos?page=' + i.toString()));\n }\n return calls;\n}", "getUsersGitHub() {\n fetch('https://api.github.com/users/FerdinandObermeier')\n .then(res => \n res.json().then(data => {\n this.setState({gitHubUser: data});\n fetch(this.state.gitHubUser.repos_url).then(res => res.json().then(data => {\n this.setState({userReposDefault: data, userRepos: data});\n }));\n }));\n }", "function makeTheCall(userName){\n\n fetch(gitHubURL + userName +\"/repos\")\n .then(response => response.json())\n .then(responseJson => listOnlyName(responseJson)); \n}", "async function getUserRepositories(url) {\n let fURL = url + \"/repos\";\n try {\n let response = await fetch(fURL);\n\n if (response.status >= 400) {\n showError(`Request (Repo) failed with error ${response.status}`)\n return Promise.reject(`Request failed with error ${response.status}`)\n }\n return response.json();\n } catch (e) {\n console.log(e);\n }\n}", "async index(req, res) {\n\n // Busca por todos os usuarios e retorna eles\n const usersGit = await UserGit.find({})\n res.status(200).json(usersGit)\n }", "function githubRepos(){\n $http({\n method: 'GET',\n url: '/github/repos/'\n }).then(function(response) {\n console.log(response.data);\n repos.data = response.data;\n });\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n var requestURL = 'https://'+ GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors';\n console.log(requestURL);\n\n var options = {\n url: requestURL,\n headers: {\n 'User-Agent': 'GitHub Avatar Downloader - Student Project'\n }\n };\n\n request.get(options, function(err, response) {\n if (err) {\n throw err\n } if (response.statusCode === 200) {;\n cb(response);\n }\n });\n}", "async function buscaRepos() {\n const repos = await fetch(requisicao.resultado.repos_url),\n reposResult = await repos.json();\n var repo = \" \";\n if (!reposResult.length) {\n repo += \"<li>Usuário não possui repositórios</li>\";\n } else {\n for (let i = 0; i < reposResult.length; i++) {\n repo += \"<li>\" + reposResult[i].name + \"</li>\";\n }\n }\n document.getElementById(\"repos\").innerHTML = repo;\n }", "function getReposList() {\n fs.readFile(dir+filteredResults, function(err,data) {\n if (err) {\n return console.log(err);\n }\n var repos = JSON.parse(data);\n console.log(\"File \"+(dir+filteredResults)+\" has \"+repos.length+\" elements\");\n var index = 0;\n while (index < repos.length) {\n getDirectoryForRepo(repos[index]);\n index++;\n }\n });\n}", "function getUser(user) {\n const endpoint = `https://api.github.com/users/${user}/repos`;\n fetch(endpoint)\n .then(response => response.json())\n .then(responseJson => displayRepos(responseJson))\n .catch(error => console.log(error));\n}", "function obter_dados_do_repo() {\n \n const url2 = API_REPO\n \n let r = fetch(url2)\n r.then(function(response) { \n \n var data = response.json()\n\n .then(complete_os_dados_do_repositório)\n })\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function getAll() {\n return repository;\n }", "function userOrganisations(opts) {\n var url = ApiUrl + 'user/orgs' +\n '?access_token=' + opts.access_token;\n var moreHeaders = {};\n var orgs = {};\n\n cache.get(url, function(err, store) {\n if (!err && Object.keys(store).length !== 0) {\n console.log('Orgs from cache: ' + url);\n orgs = store[url].orgs;\n moreHeaders = {'If-None-Match': store[url].etag};\n }\n });\n\n return new Promise(function (resolve, reject) {\n prequest({\n url: url,\n headers: _.defaults({'User-Agent': opts.nickname}, moreHeaders),\n arrayResponse: true\n }).spread(function (response, data) {\n if (response.statusCode === 304) {\n return resolve(orgs);\n }\n data.push({login: opts.nickname}); // Add user into list of orgs\n orgs = githubOrganisations(data);\n cache.set(url, {orgs: orgs, etag: response.headers.etag});\n resolve(orgs);\n }).catch(function (err) {\n err.message = 'Cannot access ' + url;\n reject(err);\n });\n });\n}", "function getRepositories(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "async function displayReps(){\n try {\n const user = await getUser(1);\n const repo = await getRepos(user.githubName);\n console.log(repo);\n }catch(err){\n console.log(err);\n }\n }", "function getStarredRepos(arr) {\n var counter = 0;\n var starredRepos = [];\n arr.forEach(function(element) {\n var starOptions = {\n url: element,\n headers: {\n 'User-Agent': 'request',\n 'Authorization': 'token ' + github.password\n }\n };\n request(starOptions, function(err, res, body) {\n //Get starred repos from user and parse JSON string to object\n var result = JSON.parse(body);\n var repos = [];\n //Store each starred repo of user\n result.forEach(function(element) {\n var fullName = element['full_name'];\n repos.push(fullName);\n });\n //Add user's starred repos to starredRepos array\n starredRepos.push(...repos);\n counter++;\n //When finished going through all users, pass starredRepos array into countStars\n if (counter === arr.length) {\n countStars(starredRepos);\n }\n });\n });\n}", "function getUsers () {\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': 'getUsers',\n\t\t}, complete: function (data) {\n\t\t\tconsole.log(\"RESPONSE JSON FOR getUsers() = \",data.responseJSON);\n\t\t\tif (data.responseJSON) {\n\t\t\t\tusers = data.responseJSON;\n\t\t\t\tconsole.log(\"USERS = \",users);\n\t\t\t}\n\t\t\tgetStates();\n\t\t\tvar managers = getProjectManagers();\n\t\t\tconsole.log(\"managers are \", managers);\n\t\t createUserDropDown(users,managers);\n\t\t}\n\t\t\n\t});\t\n}", "function getMoreRepos() {\n // Get input text\n const userText = searchUser.value\n // Paginate by count 5\n repo_count+=5\n\n if(userText !== '') {\n // Make http call\n github.getUser(userText, repo_count)\n .then(res => {\n if (res.profile.message === 'Not Found') {\n // Show alert\n ui.showAlert('User not found', 'alert alert-danger')\n } else {\n // Show profile\n ui.showProfile(res.profile)\n ui.showRepos(res.repos)\n }\n })\n } else {\n // Clear profile\n ui.clearProfile()\n }\n}", "function getGithubRepos() {\n return fetch(\n \"https://api.github.com/search/repositories?q=stars:>25000+language:javascript&sort=stars&order=desc\"\n ).then(data => data.json());\n}", "function getUsers() {\n\tif (ite <= 40) {\n\t\tsetTimeout(() => {\n\t\t\tite += 1;\n\t\t\tinit().then(() => {\n\t\t\t\tgetUsers();\n\t\t\t});\n\t\t}, 600000);\n\t}\n\n\tconst options = {\n\t\t'method': 'GET',\n\t\t'hostname': 'api.intra.42.fr',\n\t\t'path': '/v2/cursus/21/users/?access_token=' + accessToken.token.access_token + '&per_page=100&filter[primary_campus_id]=1&page=' + ite + '&filter[staff?]=false&sort=-pool_year&range[pool_year]=0,3000'\n\t};\n\tconst req = https.request(options, (res) => {\n\t\tlet data;\n\t\tres.on(\"data\", d => {\n\t\t\tdata += d;\n\t\t});\n\t\tres.on(\"end\", () => {\n\t\t\tconst json = JSON.parse(data.substring(9));\n\t\t\tjson.map((j) => {\n\t\t\t\tuserIds.push(j.id);\n\t\t\t});\n\t\t\tconsole.log('\\x1b[32mFetched ' + userIds.length + ' students ids\\x1b[0m');\n\t\t\tgetUsersInfo();\n\t\t});\n\t});\n\treq.end();\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n 'myToken' : 'process.env.KEY'\n }\n };\n\n //converts the requests body and converts to an actual javascript object/array.\n request(options, function(err, res, body) {\n let requested = JSON.parse(body);\n cb(err, requested);\n });\n\n}", "async getUserData(){\n let urlProfile = `http://api.github.com/users/${this.user}?client_id=${this.client_id}&client_secrt=${this.client_secret}`;\n let urlRepos = `http://api.github.com/users/${this.user}/repos?per_page=${this.repos_count}&sort=${this.repos_sort}&${this.client_id}&client_secrt=${this.client_secret}`;\n\n\n const profileResponse = await fetch(urlProfile);\n const reposResponse = await fetch(urlRepos);\n\n const profile = await profileResponse.json();\n const repo = await reposResponse.json();\n\n\n return{\n profile,\n repo\n }\n }", "function findAllUsers(callback) {\n \treturn fetch(this.url)\n .then(function(response) {\n return response.json();\n });\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n var requestURL = 'https://'+ GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors';\n var requestOptions = {\n url: requestURL,\n headers: {\n 'User-Agent' : 'VidushanK'\n }\n };\n// request options and parse the body and output the avatar_url and invoke DownloadImageByURL function to create the images\n request.get(requestOptions,function(err, result, body){\n\n if (!err && result.statusCode === 200) {\n var parsedData = JSON.parse(body);\n parsedData.forEach(function (releaseObject) {\n var dir = \"./avatars/\"\n var loginFileName = dir + releaseObject.login + \".jpg\";\n console.log(releaseObject.avatar_url);\n downloadImageByURL(releaseObject.avatar_url, loginFileName);\n });\n }\n });\n\n}", "function displayUserRepos (user){\n console.log('User' , user);\n getReposWithEmail(user.email, displayRepos);\n}", "repositoriesGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.RepositoriesApi();\n let opts = {\n // 'after': \"after_example\", // String | Filter the results to include only repositories created on or after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`\n // 'role': \"role_example\", // String | Filters the result based on the authenticated user's role on each repository. * **member**: returns repositories to which the user has explicit read access * **contributor**: returns repositories to which the user has explicit write access * **admin**: returns repositories to which the user has explicit administrator access * **owner**: returns all repositories owned by the current user\n // 'q': \"q_example\", // String | Query string to narrow down the response as per [filtering and sorting](../meta/filtering). `role` parameter must also be specified.\n // 'sort': \"sort_example\" // String | Field by which the results should be sorted as per [filtering and sorting](../meta/filtering).\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.repositoriesGet(\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "function getAll() {\n return repository;\n }", "function traverseAllCursors(prevRepos, endCursor) {\n return fetch('https://api.github.com/graphql', {\n method: 'POST',\n body: JSON.stringify(reposPayload(username, userInfo['id'], endCursor)),\n headers: {\n 'Authorization': 'bearer ' + process.env.GIT_TOKEN,\n 'Content-Type': 'application/json'\n }\n })\n .then(response => {\n if (response.ok) return response.json();\n\n error_logs.error('error');\n throw new Error('error');\n })\n .then(userData => {\n debug_logs.debug('Repo data fetched. Points remaining: ' + userData['data']['rateLimit']['remaining']);\n\n if (userData['data'] === null) {\n error_logs.error(userData['errors'][0]['message']);\n throw new Error(userData['errors'][0]['message']);\n }\n\n userData = userData['data']['user'];\n let repos = [];\n for (let i = 0; i < userData['repositories']['nodes'].length; i++) {\n let repoNode = userData['repositories']['nodes'][i];\n if (repoNode['isFork']) {\n repoNode = repoNode['parent'];\n } else {\n userInfo['own_repos']++;\n }\n\n // contributions null for empty repos\n let userCommits = repoNode['contributions'] ? repoNode['contributions']['target']['userCommits']['totalCount'] : 0;\n let totalCommits = repoNode['contributions'] ? repoNode['contributions']['target']['totalCommits']['totalCount'] : 0;\n\n repos.push({\n 'full_name': repoNode['nameWithOwner'],\n 'branch': repoNode['branch'] ? repoNode['branch']['name'] : \"\", // branch null for empty repos\n 'stars': repoNode['stargazers']['totalCount'],\n 'watchers': repoNode['watchers']['totalCount'],\n 'forks': repoNode['forks']['totalCount'],\n 'url': repoNode['url'],\n 'languages': repoNode['languages'],\n 'total_commits': totalCommits,\n 'user_commits': userCommits,\n });\n\n // count total stars, forks and watchers of owned repos\n if (userInfo['login'] === repoNode['owner']['login']) {\n userInfo['stars'] += repoNode['stargazers']['totalCount'];\n userInfo['forks'] += repoNode['forks']['totalCount'];\n userInfo['watchers'] += repoNode['watchers']['totalCount'];\n }\n\n // count total commits in owned or parent of forked repos.\n userInfo['commits'] += userCommits;\n }\n\n prevRepos = prevRepos.concat(repos);\n\n if (userData['repositories']['pageInfo']['hasNextPage']) {\n return traverseAllCursors(prevRepos, userData['repositories']['pageInfo']['endCursor']);\n }\n return prevRepos;\n })\n .catch(error => console.log(error.message)) // error_logs already updated above, hence, not updating here\n }", "async function fetchAllPulls(owner, repo) {\n const queryString = `\n query p1 ($owner:String!, $repo:String!, $after:String) {\n repository(owner:$owner, name:$repo) {\n pullRequests (first:100, after:$after) {\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n edges {\n node {\n number\n title\n url\n author {\n login\n }\n createdAt\n updatedAt\n closed\n mergedAt\n timeline(last: 1) {\n totalCount\n }\n }\n }\n }\n }\n }`;\n\n let numPages = 0;\n let allPulls = [];\n\n let hasNextPage = null;\n let endCursor = null;\n do {\n let variablesObject = { owner: owner, repo: repo, after: endCursor };\n let variablesString = JSON.stringify(variablesObject);\n\n let pulls = await fetchOnePage(queryString, variablesString);\n console.log(++numPages);\n console.log(pulls);\n allPulls.push(...pulls.data.repository.pullRequests.edges);\n\n let pageInfo = pulls.data.repository.pullRequests.pageInfo;\n hasNextPage = pageInfo.hasNextPage;\n endCursor = pageInfo.endCursor;\n } while (hasNextPage);\n\n return allPulls;\n}", "function fetchUsers() {\n return fetch('https://api.github.com/users')\n .then(response => response.json());\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request' \n }\n };\n\n request(options, function(err, res, body) {\n cb(err, body);\n });\n\n}", "function findAllUsers(){//https://developers.google.com/web/ilt/pwa/working-with-the-fetch-api\n return fetch(this.url).then(function(res){\n if( !(res.ok) ){\n throw Error(res.statusText)\n }\n return res\n }).then(function(response){\n return response.json()\n }).catch(function(error){alert(\"error try refresh\")})\n }", "getUserRepos() {\r\n $.ajax({\r\n url: 'https://api.github.com/users/' + this.state.username + \r\n '/repos?per_page='+ this.state.perPage +'&client_id=' + \r\n this.props.clientId + '&client_secret=' + this.props.clientSecret +\r\n '&sort=created',\r\n dataType: 'jsonp',\r\n crossDomain: true,\r\n cache: false,\r\n success: function(data) {\r\n // Change the userRepos state to the fetched data\r\n this.setState({userRepos: data.data});\r\n }.bind(this),\r\n error: function(xhr, status, err) {\r\n this.setState({userRepos: null});\r\n alert(err);\r\n }.bind(this)\r\n });\r\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n var options = {\n url: 'https://'+ GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors',\n headers:{\n 'User-Agent':'request'\n }\n };\n //when you request if the response is good, callback the data in JSON format\n request(options,function(error, response, body){\n if (!error && response.statusCode == 200){\n cb(JSON.parse(body));\n }\n });\n\n}", "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "function getrepos(callback) {\n _get('getrepos', undefined, callback);\n}", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "static getUsers() {\n const req = new Request('/api/users/', {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "function getUsers () {\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': 'getUsers',\n\t\t}, complete: function (data) {\n\t\t\tconsole.log(\"RESPONSE JSON FOR getUsers() = \",data.responseJSON);\n\t\t\tif (data.responseJSON) {\n\t\t\t\tusers = data.responseJSON;\n\t\t\t\tconsole.log(\"USERS = \",users);\n\t\t\t\tcreateDropdown(data.responseJSON);\n\t\t\t\tgetTasks();\n\t\t\t}\n\t\t}\n\t\t\n\t});\t\n}", "async function findAllUsers() {\n console.log(\"reached finallusers\");\n try {\n const response = await fetch(USER_URL);\n console.log(\"findAllUsers: \" + response);\n return response.json();\n } catch(err) {\n console.log(err);\n console.log(err.message);\n }\n}", "fetchContributors() {\n return Util.fetchJSON(this.data.contributors_url);\n }", "function getAllData() {\n return Promise.all(gitHubUsers.map( item => getUserData(item)))\n }", "function get_repositorie(){\n let xhr = new XMLHttpRequest();\n let search = document.getElementById(\"git\").value;\n xhr.open(\"GET\",\"https://api.github.com/search/repositories?q=\"+search, true);\n xhr.onload = () => show_list(JSON.parse(xhr.responseText));\n xhr.send();\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n 'Authorization': process.env.GITHUB_TOKENsec\n }\n };\n request.get(options, function(err, response, body) {\n var contributers = JSON.parse (body);\n console.log(contributers);\n cb(err, contributers)\n });\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n// Added logic to enforce command-line arguments. If the two arguments are not passed, then the program fails. Otherwise, it proceeds normally.\n if (!owner || !name) {\n console.log(\"USER ERROR. Please enter two arguments. The first should be the GitHub username of the repo owner, and the second should be the repo name. Please note, the repo must be public.\" + \"\\n\" + \"\\n\");\n }\n else {\n// We need to define our URL in this format, in order to pass 'User-Agent' in the headers.\n var options = {\n url: 'https://' + GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors',\n headers: {\n 'User-Agent': 'GitHub Avatar Downloader - Student Project'\n }\n };\n\n// This is a very simple request that either throws an error or parses the body of the response from our URL. It passes the err and the response to the callback function.\n request(options, function(err, response, body) {\n if (err) throw err;\n cb(err, JSON.parse(response.body));\n });\n }\n}", "function listContributors(error, response, body){\n // Check for asynchronous errors\n switch(true) {\n case (response.statusCode == 404):\n console.log (\"Repo or user not found\")\n return;\n case (response.statusCode == 401):\n console.log (\"Bad Credentials\")\n return;\n }\n var contributors = JSON.parse(body);\n\n // create array of which resolves when a contributor's stars have been counted\n const allPromises = contributors.map(function(person, contributorIndex) {\n var myPromise = new Promise(function(resolve, reject){\n var url = 'https://' + username + ':' + token + '@api.github.com/users/' + person.login + \"/starred\"\n listStarred(url, person.login, function(){\n resolve();\n });\n })\n return myPromise;\n });\n // When all star counting promises have returned, return..\n // encompassing promise, and count stars to find the most popular repo\n Promise.all(allPromises).then(function(){\n var sorted = Object.keys(repoCount).sort(function(a, b){\n return repoCount[b].count - repoCount[a].count;\n }).slice(0, 6);\n sorted.forEach(function(repo){\n console.log(`[${repoCount[repo].count} stars] ${repoCount[repo].name} / ${repoCount[repo].owner}`);\n });\n\n })\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n\n// if statement to check if user have the required arguments on node\n if(repoOwner && repoName) {\n\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n Authorization: 'token ' + getKey.GITHUB_TOKEN\n }\n };\n request(options, function(err, res, body) {\n cb(err, body);\n });\n\n } else {\n console.log(\"Error: Please add your repoOwner and repoName to node.\");\n }\n\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n var options = {\n url: 'https://api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors',\n headers: {\n 'User-Agent': 'request',\n 'Authorization': 'token ' + github.password\n }\n };\n request(options, function(err, res, body) {\n //Get repo contributors and parse JSON string to object\n var result = JSON.parse(body);\n //Pass result into callback function\n cb(err, result);\n });\n}", "function getUserRepos(user) {\n let url = user._json.repos_url;\n\n let options = {\n 'headers': {\n 'User-Agent': 'Red-Portal',\n 'Accept': 'application/vnd.github.v3+json',\n 'Authorization': `token ${user.tokens.access_token}`,\n },\n 'json': true,\n 'uri': url,\n };\n\n return rp(options);\n}", "retrieveUsers() {\n\n this.__updateToken__()\n return fetch(`${this.url}/users`, {\n\n headers: {\n authorization: `Bearer ${this.__userToken__}`\n }\n })\n .then(response => response.json())\n .then(response => {\n if (response.error) throw Error(response.error)\n\n return response\n })\n }", "function setRepositories(reposApi, numOfRepos) {\n let html = \"\";\n if (numOfRepos === 0) { // if no repositories, no need to fetch request for them\n document.getElementById(\"reposList\").innerHTML = `<p> No repositories</p>`;\n return;\n }\n\n // fetch repositories request\n fetchUrl(reposApi)\n .then(function(response) {\n const api = JSON.parse(JSON.stringify(response));\n for (i = 0; i < api.length; ++i)\n // set html url in the link, and the user's repositories name as the name\n html += `<li><a href='${api[i].html_url}' target=\"blank\">${api[i].full_name}</a></li>`;\n document.getElementById(\"reposList\").innerHTML = html;\n\n }).catch(function(error) {\n console.log('Request failed', error);\n });\n }", "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n 'Authorization' : env.GITHUB_TOKEN\n }\n };\n\n request(options, function(err, res, body) {\n var body = JSON.parse(body);\n // if the repo or owner doesn't exist, let them know\n if (body.message === \"Not Found\") {\n console.log(\"Download failed: this repo doesn't exist.\");\n return;\n }\n /******************************************************* \n * callback: takes the error, and JSON body as arguments.\n * Loops through each collaborator's info and download's \n * their image\n *******************************************************/\n cb(err, body);\n });\n }" ]
[ "0.78215235", "0.7514822", "0.7474211", "0.746273", "0.70939463", "0.70924145", "0.7090029", "0.7062159", "0.70045006", "0.7002224", "0.695895", "0.6958748", "0.6957067", "0.69214356", "0.6881332", "0.68375385", "0.6797113", "0.6796072", "0.67531645", "0.6747702", "0.67408663", "0.67404824", "0.6728152", "0.6717949", "0.6703826", "0.6691401", "0.66875315", "0.66434306", "0.6641786", "0.6631757", "0.6527443", "0.65241057", "0.65118974", "0.64867675", "0.64817554", "0.64662963", "0.64571047", "0.64381766", "0.6385823", "0.63729465", "0.636659", "0.6318546", "0.6305017", "0.6303876", "0.6299972", "0.6298409", "0.62969494", "0.62692165", "0.6240125", "0.6217837", "0.6206032", "0.62045425", "0.61968577", "0.61963737", "0.6184204", "0.61770993", "0.61703426", "0.61673397", "0.61579126", "0.6152482", "0.6149563", "0.6143825", "0.6136356", "0.6133036", "0.61242455", "0.61099404", "0.6107663", "0.6100224", "0.60941106", "0.6090736", "0.60816956", "0.60807884", "0.60787433", "0.6072864", "0.6070126", "0.60687", "0.60672307", "0.6057775", "0.6053307", "0.604806", "0.60461295", "0.6024407", "0.6023022", "0.6022922", "0.6011524", "0.6008513", "0.6006931", "0.600579", "0.5998461", "0.59943736", "0.59929895", "0.59893084", "0.59823966", "0.59812653", "0.5978709", "0.59714496", "0.596158", "0.5960303", "0.5944235", "0.5938086", "0.5935856" ]
0.0
-1
Exits the database connection via mongoose
function exit() { mongoose.disconnect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disconnect() {\n mongoose.connection.close();\n}", "function exit(){\n mongoose.disconnect();\n}", "function exit() {\n mongoose.disconnect();\n}", "function exit() {\r\n mongoose.disconnect();\r\n}", "disconnect() {\n mongoose.connection.close();\n this.connected = false;\n }", "disconnect() {\n if (this.isConnected()) {\n mongoose.connection.close();\n }\n this.emit('disconnected');\n }", "function exit()\n{\n mongoose.disconnect(); // saved!\n}", "function quit() {\n mongoose.disconnect();\n console.log(\"All Done!\");\n}", "function quit() {\n mongoose.disconnect();\n console.log('\\nDISCONNECTING');\n}", "function exit() {\n mongoose.disconnect();\n process.exit(0);\n}", "function exit() {\n mongoose.disconnect();\n process.exit(0);\n}", "function closeMongooseConnection() {\n if (mongooseConnection) {\n mongooseConnection.close();\n }\n}", "async function closeConnection() {\n mongoose.connection.close();\n}", "function quit() {\n mongoose.disconnect();\n console.log('\\nQuitting!');\n}", "function quit() {\n mongoose.disconnect();\n console.log('\\nQuitting!');\n}", "function gracefulExit() {\n mongoose.connection.close(() => {\n console.log(`Mongoose default connection with DB : ${config.testing.db} is disconnected through app termination`);\n process.exit(0);\n });\n}", "function finishConnection() {\n\tmongoose.connection.close(function () {\n\t\t\t console.log('Mongodb connection disconnected');\n\t\t\t console.log('Exiting script');\n\t\t });\n}", "async closeDB() {\n await mongoose_1.default.disconnect();\n await services_1.Store.quit();\n }", "function startDB() {\n console.log(\"Trying to connect to \" + connectionString);\n mongoose.connect(connectionString);\n}", "function tearDownDb() {\r\n return mongoose.connection.dropDatabase();\r\n}", "setupConnection(dbName) {\n\n if (mongoose.connection.readyState != 0)\n return\n\n mongoose.connect(\n `mongodb://localhost:27017/${dbName}`,\n { useNewUrlParser: true }\n )\n .then(success => {\n mongoose.set(\"useCreateIndex\", true)\n mongoose.set('useFindAndModify', false)\n console.log(`Succesfully conntected to mongodb on port ${27017}`)\n mongoose.connection.on(\"close\", () => {this.connection = false})\n })\n .catch(error => {\n console.error(\"Unable to connect to mondodb. Perhaps mongo isn't installed?\")\n console.log(error)\n })\n }", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function tearDownDb() {\n console.warn('Deleting database');\n return mongoose.connection.dropDatabase();\n}", "function disconnect() {\n if (client != null) {\n client.close();\n client = undefined;\n db = undefined;\n debug('Disconnected from MongoDB');\n }\n }", "function setupDatabase() {\r\n // Connect to MongoDB\r\n let mongoose = require('mongoose');\r\n\r\n mongoose.connect('mongodb://localhost:27017/agar_io');\r\n\r\n // Handle MongoDB error\r\n let db = mongoose.connection;\r\n\r\n db.on('error', console.error.bind(console, 'connection error:'));\r\n db.once('open', function () {\r\n console.log(\"connected to MongoDB\");\r\n });\r\n}", "async initMongo() {\n return new Promise(async (resolve, reject) => {\n try {\n HealthManager.addHealthCheckHook(this.mongoHealthHook.bind(this), 'mongo');\n Logger.trace('Server : initMongo');\n this.app.locals.db = await mongoose.createConnection(Config.env.MONGO_URI, {promiseLibrary: global.Promise});\n this.app.locals.models = {\n Voter: require('../db/models/Voter'),\n };\n resolve();\n } catch(err) {\n reject(err);\n }\n });\n }", "closeConnections() {\n this.models = {};\n if (this.sequelize_connection) {\n this.sequelize_connection.close();\n this.sequelize_connection = undefined;\n }\n }", "mongo() {\n this.mongoConnection = mongoose.connect(process.env.MONGO_URL, {\n useNewUrlParser: true,\n useFindAndModify: true,\n });\n\n // DO NOT FORGET to execute it in this.init()\n }", "function shutdown(msg, callback) {\n db.close(() => {\n console.log('Mongoose disconnected through ' + msg);\n callback();\n });\n }", "handleCon() {\n if (!Store.connection) {\n Store.connection = mongoose\n .connect(MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true })\n .then(() => {\n console.log('[DB] Success contected');\n })\n .catch((reject) => {\n console.log(`[DB] fail contected ${reject}`);\n });\n mongoose.set('useFindAndModify', false);\n }\n return Store.connection;\n }", "async function startServer(){\n await loaders({ expressApp:app })\n server.listen(port);\n server.on('error', onError);\n server.on('listening', onListening);\n process.on('SIGINT', function(){\n mongoose.connection.close(function(){\n console.log(\"Mongoose default connection is disconnected due to application termination\");\n process.exit(0);\n });\n });\n}", "function initDb(callBack){\n mongoose.connect(config.getEnv().url,callBack);\n}", "function connect() {\n mongoose.connect(settings.config.getEnv().mongodb);\n}", "function exitFromServer() {\n console.log('Disconnecting from DB, stopping server...')\n mongoose.disconnect()\n .then(() => {\n console.log('Server stopped successfully')\n process.exit(0)\n })\n .catch(error => {\n console.log('Error when disconnecting from DB. Error:', error.message)\n process.exit(1)\n })\n}", "function closeDatabaseConnection() {\n connection.end(function () {\n console.log('connection closed successfully');\n });\n }", "async function mongodb() {\n mongoose.connect(process.env.MONGO_URL,\n { useNewUrlParser: true });\n await mongoose.connection.on('connected',\n ()=> console.info('mongodb connected')); \n\n app.listen(port,\n ()=>console.info(`App is listening on port ${port}`));\n }", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n }", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n }", "function initMongo() {\n if (!(mongoose.connection.readyState === 1)) {\n logger.info('Connecting offchain db connection', config.db.MONGO_URL_SERVICE);\n\n return mongoose.connect(config.db.MONGO_URL_SERVICE, config.db.MONGO_CONFIG, function(err) {\n if (err) {\n logger.error('Could not connect offchain db', err);\n }\n });\n }\n return true;\n}", "function clearDB() {\n\n // console.log('Clearing DB', mongoose.connection);\n for (let i in mongoose.connection.collections) {\n\n // console.log('Clearing', i);\n mongoose.connection.collections[i].remove(function() {});\n }\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "constructor() {\n\n mongoose.set('debug', Config.get(\"app.debug\") && !Boolean(process.env.APP_CONSOLE));\n\n mongoose.set('toObject', {\n getters: true,\n virtuals: true,\n minimize: true,\n versionKey: false\n });\n\n mongoose.set('toJSON', {\n getters: true,\n virtuals: true,\n minimize: true,\n versionKey: false,\n });\n\n this.connect();\n }", "function onTerminate() {\n console.log('')\n \n // Handle Database Connection\n switch (config.schema.get('db.driver')) {\n case 'mongo':\n dbMongo.closeConnection()\n break\n case 'mysql':\n dbMySQL.closeConnection()\n break\n }\n\n // Gracefully Exit\n process.exit(0)\n}", "function gracefulShutdown(msg, callback) {\n mongoose.connection.close(function () {\n console.log('Mongoose disconnected through: ' + msg);\n callback();\n });\n }", "connect() {\n mongoose.connect(\n `mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}/${\n this.dbName\n }?retryWrites=true`,\n { useNewUrlParser: true }\n );\n this.connected = true;\n }", "function initDatabaseConnection() {\n if (appHelper.isProd()) {\n options.user = process.env.MONGODB_ADDON_USER;\n options.pass = process.env.MONGODB_ADDON_PASSWORD;\n }\n\n mongoose.connect(process.env.MONGODB_ADDON_URI, options);\n\n // Use native promises\n mongoose.Promise = global.Promise;\n\n db = mongoose.connection;\n db.on('error', (err) => {\n log.error('Database connection error', err);\n });\n\n db.once('open', () => {\n log.info('Connection with database succeeded.');\n });\n}", "async function start(){\n try\n {\n \n await mongoose.connect(config.MONGO_URL,{useUnifiedTopology: true,useNewUrlParser:true,useFindAndModify: false})\n\n app.listen(PORT,()=>{\n console.log(`Server is running on port ${PORT}`)\n }) \n } catch(e)\n {\n console.log(e)\n }\n}", "function gracefulShutdown(msg, callback) {\r\n mongoose.connection.close(function() {\r\n console.log('Mongoose disconnected through ' + msg);\r\n callback();\r\n });\r\n }", "function setUpMongo() {\n const db = process.env.MONGODB_URI || 'mongodb://localhost/meetupdb';\n mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true });\n const mongodb = mongoose.connection;\n\n mongodb.on('error', console.error.bind(console, 'connection error:'));\n mongodb.once('open', () => console.log('Database connected successfully!'));\n return mongodb;\n}", "close() {\n this.botStateCollection = null;\n if (this.mongoDb) {\n this.mongoDb.close();\n this.mongoDb = null;\n }\n }", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "async function seedDb(){\n try {\n await mongoose.connect(process.env.MONGODB_URL, dbOptions)\n const celebrity = await Celebrity.create(celebValue)\n console.log(celebrity)\n mongoose.connection.close()\n }catch(err){\n console.error(err)\n }\n}", "function init(url) {\n mongoose.Promise = global.Promise;\n return new Promise((resolve, reject) => {\n mongoose.connect(url);\n const db = mongoose.connection;\n db\n .on('error', reject)\n .once('open', () => {\n Object.keys(mongoose.models).forEach(model => {\n global[model] = mongoose.models[model];\n });\n resolve(db);\n });\n });\n}", "function init() {\n return {\n connect:function(url){\n mongoose.connect(url);\n var db = mongoose.connection;\n db.on('error', console.error.bind(console, 'connection error:'));\n db.once('open', function(callback) {\n console.log('Connected to:' + url);\n });\n\n this.bootstrapModels();\n\n },\n bootstrapModels:function(){\n var modelsPath = path.join(__dirname, './schemas');\n fs.readdirSync(modelsPath).forEach(function(file) {\n var fileNameArray=file.split('.');\n require(modelsPath + '/' + file)(mongoose);\n var Model = mongoose.model(fileNameArray[fileNameArray.length-2]);\n models[fileNameArray[fileNameArray.length-2]]= Model;\n });\n },\n getCollections:function(){\n console.log(Object.keys(models));\n return Object.keys(models);\n },\n insert:function(name,obj){\n var instance,Model;\n models[name]=Model;\n instance=new Model(obj);\n instance.save(function (err) { // Save\n if (err) {\n console.log(err);\n }\n console.log(obj);\n });\n },\n findAll:function(name,callback){\n models[name].find({}, function (err, docs) {\n if(err){\n console.log(err);\n }\n callback(docs);\n })\n },\n findOne:function(name,criteria,callback){\n models[name].findOne(criteria , function (err, doc){\n if(err){\n console.log(err);\n }\n callback(doc);\n });\n },\n findWhere:function(name,criteria,callback){\n models[name].find(criteria , function (err, docs){\n if(err){\n console.log(err);\n }\n callback(docs);\n });\n },\n findDistinct:function(name,field, criteria, callback){\n models[name].distinct(field,criteria, function(err, results) {\n if(err){\n console.log(err);\n }\n callback(results);\n });\n },\n delete:function(name,criteria){\n models[name].remove(criteria, function (err) {\n if (err) return handleError(err);\n // removed!\n });\n },\n update:function(name,criteria,obj,callback){\n model[name].update(criteria, {\n $set: obj\n }, {\n multi: true\n },function(err, result) {\n\n callback(result);\n }\n );\n\n },\n count:function(name, criteria, callback){\n models[name].count(criteria, function(err,count){\n if(err){\n console.log(err);\n }\n callback(count);\n });\n }\n }\n }", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\t\n if (err) {\n return reject(err);\n }\n resolve(); \n });\n });\n });\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "function connection(){\r\n // A funcao connect do mongoose recebe como parametro o host com a porta e o nome do banco.\r\n // useNewUrlParser: true | Eh um novo formato em que ele vai analisar esta string de conexao.\r\n // useUnifiedTopology: true | Isso deixa o monitoramento do nosso banco de dados ativo.\r\n mongoose.connect(\"mongodb://localhost:27017/escolarecode\", {useNewUrlParser: true, useUnifiedTopology: true})\r\n // Um parametro de connect e o .then() que pode se assimilar ao Try do try-catch, e ele eh executado qunado a conexao foi bem sucedida.\r\n .then(() => {\r\n // Dentro do .then() tenho uma funcao de callback que me retonar no console uma string com \"1\"\r\n console.log(\"1\")\r\n })\r\n // catch eh caso ocorra um erro na conexao com o banco ele executa o catch, e ele possui um parametro que e o erro do porque a conexao nao foi bem sucedida.\r\n .catch((error) => {\r\n console.log(error)\r\n })\r\n}", "function connectToDb() {\n mongoose.connect(database); \n return mongoose;\n}", "function gracefulShutdown(msg, callback) {\n mongoose.connection.close(() => {\n log(`Mongoose disconnected through ${msg}`);\n callback();\n });\n }", "function connectDatabase(){\n mongoose.connect('mongodb://127.0.0.1:27017/radmin', { useNewUrlParser: true , useUnifiedTopology: true})\n .then( () => {\n console.log('connected to radmin') \n })\n .catch( (err) => {\n console.log('error while conecting') \n }) \n}", "function connect(funct){\n mongoose.connect('mongodb://localhost/bidding');\n mongoose.connection.once('open', function(){\n console.log('Connection has been made');\n if (funct) funct();\n }).on('error', function(err){\n console.log('Connection error: ', err);\n });\n}", "function clearDB() {\n for (var i in mongoose.connection.collections) {\n mongoose.connection.collections[i].deleteMany(function() {});\n }\n return done();\n }", "async connect() {\n this.client = await mongoose.connect(this.dsn, { useNewUrlParser: true });\n this.schemas.forEach(schema => {\n this.client.model(schema.name, schema.schema);\n });\n }", "async function start() {\n try {\n const UrlDb = `mongodb+srv://${UserDB}:${PasswordDB}@clusterapp.uu6gw.mongodb.net/${NameDB}?retryWrites=true&w=majority`;\n await mongoose.connect(UrlDb);\n \n app.listen(PORT, () => {\n console.log(`Server is running on port ${PORT}`);\n })\n } catch (e) {\n console.log(e);\n }\n}", "function closeServer() {\n\treturn mongoose.disconnect().then(() => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconsole.log('Closing server');\n\t\t\tserver.close(err => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn reject(err);\n\t\t\t\t}\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t});\n}", "function closeServer() {\n\treturn mongoose.disconnect().then(() => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconsole.log('Closing server');\n\t\t\tserver.close(err => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn reject(err);\n\t\t\t\t}\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t});\n}", "function tearDownDb() {\n return new Promise((resolve, reject) => {\n console.warn('Deleting database');\n mongoose.connection.dropDatabase()\n .then(result => resolve(result))\n .catch(err => reject(err));\n });\n }", "function tearDownDb() {\n return new Promise((resolve, reject) => {\n console.warn(`tearing down db`);\n mongoose.connection.dropDatabase()\n .then(result => resolve(result))\n .catch(err => reject(err));\n });\n}", "async function connect() {\n mongoose.Promise = global.Promise;\n\n // establish Connection\n mongoose.connect(process.env.DATABASE, { \n useUnifiedTopology: true,\n useNewUrlParser: true\n });\n mongoose.set('useCreateIndex', true);\n //Mongoose events\n //Successfull Connection\n mongoose.connection.on(\"connected\", function() {\n console.log(\"Mongoose Connected to \" + process.env.DATABASE);\n })\n}", "async function stop() {\n if (server) {\n return new Promise(resolve => server.close(resolve));\n }\n\n await mongodb.disconnect();\n logger.info('Mongodb disconnected');\n\n return Promise.resolve();\n}", "function exitFunc(done) {\n const conn = require('../../models/oauth2-mongodb/connection');\n\n conn.connection.dropDatabase(function() {\n if (config.oauth2.db.engine === 'mongodb') {\n let { http, https } = require('../../oauth2');\n http && http.close();\n https && https.close();\n }\n conn.close(function() {\n done(null);\n });\n });\n}", "function NativeConnection() {\n MongooseConnection.apply(this, arguments);\n this._listening = false;\n}", "function NativeConnection() {\n MongooseConnection.apply(this, arguments);\n this._listening = false;\n}", "async disconnectFromDatabase () {\n await Database.close()\n }", "constructor() {\n const proto = Object.getPrototypeOf(this);\n if (!proto.connection) {\n proto.connection = mongoose.connect(`mongodb://${process.hope.db.user}:${process.hope.db.password}@${process.hope.db.host}:${process.hope.db.port}/${process.hope.db.database}`);\n }\n }", "async init() {\n //TODO\n client = await mongo.connect(this.dbUrl);\n db = client.db(dbName);\n }", "async function start() {\n try {\n await mongoose.connect(keys.MONGO_URI, mongooseOptions);\n\n app.listen(PORT, () => {\n console.log(`Server is running on port ${ PORT }`);\n });\n } catch (e) {\n console.log(e);\n }\n}", "function setupInstance(){\n\t\tMongoClient.connect(\"mongodb://ordertrackinguser:[email protected]:31812/heroku_app36432204\", function(err, db) {\n\t\t\t\tif (err) {\n\t\t\t\t\t logger.error('unable to open mongo client instance');\n\n\t\t\t\t}\n\t\t\t\telse {\n\t \t\t\t\t_db = db;\n\t\t\t\t}\n\t \t\t});\n\t}", "constructor(mongodb_uri) {\n mongoose.connect(mongodb_uri);\n mongoose.Promise = bluebird;\n const db = mongoose.connection;\n db.on('error', (err) => {\n throw new Error('MongoDB Connection Error: ' + err);\n });\n db.once('open', () => {\n debug('MongoDB Connection Established.');\n });\n }", "function nodeProcessShutdown(msg, callback) {\n mongoose.connection.close(() => {\n console.log(`Mongoose disconnected through ${msg}`)\n callback()\n })\n}", "function initDb(callback) {\n if (dbInstance) {\n console.warn(\"Trying to init DB again!\")\n return callback()\n }\n\n// Connect to the db\nMongoClient.connect(\"mongodb://10.128.0.3:80\", { useNewUrlParser: true, useUnifiedTopology: true }, function(err, client) {\n if (err) throw err;\n \n db = client.db(\"truckdb\");\n console.log(\"We are connected\")\n dbInstance = db;\n return callback();\n\n })\n}", "function gracefulShutdown(msg, callback) {\n\t\tmongoose.connection.close(function() {\n\t\t\tconsole.log(`Mongoose disconnected through ${msg}`);\n\t\t\tcallback();\n\t\t});\n\t}", "async function startDbAndServer() {\n db = await mongodb.connect(MONGO_URL);\n collection = db.collection('card');\n \n await app.listen(3000);\n console.log('It is on 3000');\n}", "function connect () {\n var options = { server: { socketOptions: { keepAlive: 1 } } };\n return mongoose.connect(config.dbAddr, options).connection;\n}", "function openDBConnection(){\n return new Promise((resolve,reject)=>{\n mongoose.connect(configs.mongoDBURL, (err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve();\n }\n });\n })\n}", "clearDatabase() {\n const User = require(\"../../db/user.js\");\n const Course = require(\"../../db/course.js\");\n const Class = require(\"../../db/class.js\");\n const ClassEnrollment = require(\"../../db/classEnrollment.js\");\n const Deliverable = require(\"../../db/deliverable.js\");\n const DeliverableSubmission = require(\"../../db/deliverableSubmission.js\");\n\n // Set up the MongoDB.\n const mongoose = require(\"mongoose\");\n mongoose.connect(\"mongodb://localhost/cmsApp\");\n const db = mongoose.connection;\n db.on(\"error\", console.error.bind(console, \"MongoDB Connection Error:\"));\n\n // Clear the database.\n // NOTE: DO NOT USE THE 'AWAIT' KEYWORD HERE!!! IT DOES NOT WORK!!!\n\n // Delete all the student Users.\n User.deleteMany({accountType: \"student\"}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n });\n // Delete all the professor Users.\n User.deleteMany({accountType: \"professor\"}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n });\n // Delete all the Courses.\n Course.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the Classes.\n Class.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the ClassEnrollments.\n ClassEnrollment.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the Deliverables.\n Deliverable.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the DeliverableSubmissions.\n DeliverableSubmission.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n \n return null\n }", "destroy() { /* There are no resources to clean up on MySQL server */ }" ]
[ "0.7734291", "0.76625323", "0.7640811", "0.75648713", "0.74477345", "0.7317763", "0.72882223", "0.7280426", "0.7236973", "0.72127885", "0.72127885", "0.71561474", "0.7108676", "0.7026041", "0.6977602", "0.6873794", "0.68703586", "0.6864171", "0.6788023", "0.67015725", "0.6661242", "0.6518322", "0.6518322", "0.6518322", "0.6465817", "0.6465817", "0.6465817", "0.6465817", "0.6465817", "0.6465817", "0.6465817", "0.6465817", "0.63763446", "0.62718546", "0.6268812", "0.6251345", "0.6242724", "0.6235322", "0.6176392", "0.61762786", "0.61725914", "0.6166651", "0.616431", "0.61479837", "0.61444026", "0.6110317", "0.6097487", "0.60844743", "0.607476", "0.6055461", "0.6055461", "0.6055134", "0.60540605", "0.6035406", "0.6028176", "0.6026607", "0.6020742", "0.60129803", "0.6008813", "0.59699154", "0.59632504", "0.5957227", "0.5955651", "0.5955044", "0.5954345", "0.5952795", "0.5952795", "0.5952795", "0.5952795", "0.59380466", "0.58778137", "0.5848038", "0.58380497", "0.5812794", "0.5806739", "0.5805601", "0.57694393", "0.5747325", "0.5747325", "0.5745157", "0.5735129", "0.571093", "0.5710374", "0.5707852", "0.5707817", "0.5707817", "0.5706671", "0.57029235", "0.57008237", "0.57000977", "0.5687433", "0.56854266", "0.56670535", "0.5657094", "0.56567705", "0.5651885", "0.56453675", "0.56436276", "0.5640009", "0.5639544" ]
0.7455724
4
read keys from key.json as an array
function getKeyInfo(keyJson){ var keyInfo = {}; keyInfo.arr = []; keyInfo.updateYear = keyJson[0].updateYear; keyInfo.updateMonth = keyJson[0].updateMonth; for(var i = 0; i<keyJson.length; i++){ if(keyJson[i].expire == "false"){ keyInfo.arr.push(keyJson[i].key); } } return keyInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyToArray(key) {\n if (!key) return [];\n if (typeof key != \"string\") return key;\n return key.split('.');\n }", "keys(key) {\n return state[`keys.${key}`] || [];\n }", "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n keysArray.push(this.data[i][0][0]);\n }\n }\n return keysArray;\n }", "get keys() {}", "static getArray(key) {\n if (Array.isArray(Preferences.get(key))) {\n return Preferences.get(key);\n }\n return JSON.parse(Preferences.get(key));\n }", "static getArray(key) {\n if (Array.isArray(Preferences.get(key))) {\n return Preferences.get(key);\n }\n return JSON.parse(Preferences.get(key));\n }", "keySet() {\n return fetch(\"http://localhost:3003/keys/0\")\n .then(res => res.json())\n .then(res => {return res.key})\n }", "async keys () {\n const results = await this.client.zRange(this.ZSET_KEY, 0, -1);\n return results.map(key => key.slice(`${this.namespace}`.length));\n }", "keys() {\n const keyArr = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n for (let j = 0; j < this.data[i].length; j++) {\n keyArr.push(this.data[i][j][0]);\n }\n }\n }\n return keyArr;\n }", "async function keylist() {\r\n const db = await connectDB();\r\n let keys = [];\r\n await new Promise((resolve, reject) => {\r\n db.createKeyStream()\r\n .on(\"data\", data => keys.push(data))\r\n .on(\"error\", err => reject(err))\r\n .on(\"end\", () => resolve(keys));\r\n });\r\n debug(`keylist: Returning following keys: ${util.inspect(keys)}`);\r\n return keys;\r\n}", "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n // if there's something in memory space\n console.log(this.data[i][0][0]);\n keysArray.push(this.data[i][0][0]);\n }\n }\n return keysArray;\n }", "function getDataFileKeysFromManifest(manifestObject) {\n var listOfKeys = [];\n var ionReader = ion_js_1.makeReader(manifestObject);\n ionReader.next();\n ionReader.stepIn();\n ionReader.next();\n ionReader.stepIn();\n try {\n while (ionReader.next()) {\n listOfKeys.push(ionReader.stringValue());\n }\n }\n catch (e) {\n // When we reach end of ionReader.next(), exception is thrown. Catch here and do nothing.\n }\n return listOfKeys;\n}", "async getPartialKeyArray(ctx, indexName, partialKey) {\n //Calling ing the function with the partial key and storing the iterator\n let iterator = await ctx.stub.getStateByPartialCompositeKey(indexName, [partialKey]);\n //declaring an empty array\n let array = [];\n //while condtion to iterate over the itertaor\n while (true) {\n var data = await iterator.next();\n //If iterator has a value\n if (data.value) {\n array.push(data.value.value.toString('utf8'));\n }\n if (data.done) {\n await iterator.close();\n //return array\n return array;\n }\n }\n }", "function JsonToArray(list,key){\r\n\r\n\tvar array = [];\r\n\r\n\tif(!list){\r\n\t\treturn array;\r\n\t}\r\n\r\n\t$.each(list,function(i,v){\r\n\t\tif(v[key] != undefined){\r\n\t\t\tarray.push(v[key]);\r\n\t\t}\r\n\t});\r\n\r\n\treturn array;\r\n}", "function getKeyValues(req){\n var reqArray = [];\n var i = 0;\n for(var key in req.body){\n reqArray[i] = JSON.parse(key);\n i++;\n }\n return reqArray;\n}", "getKeys() {\n this.logger.trace(\"Retrieving all cache keys\");\n // read cache\n const cache = this.getCache();\n return [...Object.keys(cache)];\n }", "function FindKeysContent(SearchKey, jsonFile) {\r\n \r\n for(var exKey in jsonFile) {\r\n \r\n if(exKey = SearchKey){\r\n var NewJson = jsonFile[exKey];\r\n \r\n }\r\n }\r\n \r\n \r\n return NewJson;\r\n}", "keys() {\n let keysArr = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n //loop through out entire hashmap\n if (this.keyMap[i]) {\n //check if exist and check for subarrays\n for (let j = 0; j < this.keyMap[i].length; j++) {\n //loop through subarrays\n if (!keysArr.includes(this.keyMap[i][j][0])) {\n //make sure there are not duplicates of keys in oour hashmap\n keysArr.push(this.keyMap[i][j][0]); //push to our initialized arary because we want to keep in insisde of DS\n }\n }\n }\n }\n return keysArr;\n }", "function loadKeyFile() {\n var input, file, fr;\n\n if (typeof window.FileReader !== 'function') {\n alert(\"The file API isn't supported on this browser yet.\");\n return;\n }\n\n input = document.getElementById('keyFileInput');\n if (!input) {\n alert(\"Um, couldn't find the fileinput element.\");\n }\n else if (!input.files) {\n alert(\"This browser doesn't seem to support the `files` property of file inputs.\");\n }\n else if (!input.files[0]) {\n alert(\"Please select a file before clicking 'Load'\");\n }\n else {\n file = input.files[0];\n fr = new FileReader();\n fr.onload = receivedText;\n fr.readAsText(file);\n }\n\n function receivedText(e) {\n lines = e.target.result;\n var newArr = JSON.parse(lines);\n var newAccount = browserAccounts.set(newArr.address, newArr);\n console.log(newArr);\n listAccounts();\n }\n}", "function json2array(json){\n var result = [];\n var keys = Object.keys(json);\n keys.forEach(function(key){\n result.push(json[key]);\n });\n return result;\n}", "async function getPublicKeys() {\n const url = `${ISSUER}/.well-known/jwks.json`;\n const publicKeys = await axios.get(url);\n return publicKeys.data.keys.reduce((agg, current) => {\n const pem = jwkToPem(current);\n // eslint-disable-next-line no-param-reassign\n agg[current.kid] = { instance: current, pem };\n return agg;\n }, {});\n}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "getKeys() {\n this._ensureUnpacked();\n if (this.unpackedArray) {\n return Array.from(this.unpackedArray.keys());\n } else if (this.unpackedAssocArray) {\n this._ensureAssocKeys();\n return Array.from(this.unpackedAssocKeys);\n }\n return [];\n }", "function listKeys() {\n return ec2.describeKeyPairs({})\n .then(data => data.KeyPairs.filter(key => key.KeyName.indexOf(UID) === 0));\n}", "function loadKey(filename) {\n return fs.readFileSync(path.join(__dirname, filename));\n}", "async function getPersistent(key) {\n return [];\n}", "getKeys() {\n return [...this.keys];\n }", "function getKeys(data){\n\tconsole.table(data)\n\tlet keys = Object.keys(data[0])\n\tconsole.log(\"Keys: \", keys)\n\treturn keys\n}", "function SelectKeys(key, countFeat,jsonContent) {\r\n \r\n var k = 0;\r\n var content = [];\r\n \r\n //console.log(key);\r\n \r\n for(i in key) {\r\n \r\n \r\n if (i == 0){\r\n \r\n //Select the Environment Root content\r\n var content1 = FindKeysContent(key[i],jsonContent);\r\n content = repeatelem(content1,countFeat);\r\n countFeat = 0;\r\n \r\n }\r\n \r\n if (i>0){\r\n\r\n \r\n content[countFeat] = FindKeysContent(key[i],content[countFeat]);\r\n countFeat = countFeat+1;\r\n \r\n \r\n }\r\n \r\n }\r\n return content;\r\n}", "getAllPubkeys () {\n const pubkeys = []\n\n return new Promise((resolve, reject) => {\n this.pubkeys.createReadStream()\n .on('data', (data) => {\n pubkeys.push(data.value)\n })\n .on('error', function (err) { reject(err) })\n .on('end', function () { resolve(pubkeys) })\n })\n }", "function loadKey( root ) {\n\tvar fileText;\n\tvar filePath = root + \"key.json\" ;\n\tif ( typeof Ti !== \"undefined\" ) {\n\t\tfileText = Ti.Filesystem.getFile(filePath).read().text;\n\t} else {\n\t\tfileText = require('fs').readFileSync(filePath, 'utf8' );\n\t}\n\tvar key = CircularJSON.parse( fileText );\n\tkey.url = root;\n\n\tvar rehydrated = rehydrateKey( key );\n\trehydrateSpeedBug( key );\n\n\treturn rehydrated;\n}", "function getKeys(getJsonObject){\r\n\t\treturn Object.keys(getJsonObject);\r\n\t}", "keys() {\n\t\treturn createHeadersIterator$1(this, 'key');\n\t}", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "async get(...keys) {}", "get keys() {\n return Object.keys(this._keyMap);\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "function get_keys() {\n const buffer = new ArrayBuffer(12, { \"maxByteLength\": 4096 });\n const u16array = new Uint16Array(buffer, 0, 5);\n buffer.resize()\n let keys = \"none\";\n try { keys = u16array.keys(); } catch (e) {}\n return keys;\n}", "function getArrayOfKeys(objects, key) {\n let arrayOfKeys = [];\n\n executeforEach(objects, function(el) {\n arrayOfKeys.push(el[key]);\n });\n\n console.log(arrayOfKeys);\n return arrayOfKeys;\n}", "keys() {\n let result = []\n for (let i = 0; i<this.keyMap.length; i++) {\n if (!!this.keyMap[i]) {\n if (this.keyMap[i].length>0) {\n for (let j=0; j<this.keyMap[i].length; j++) {\n result.push(this.keyMap[i][j][0])\n }\n }\n }\n }\n return result\n }", "function getAllKeys2(req, res) {\n let pais_a_buscar = \"Guatemala\";\n\n let llaves = [];\n\n client.keys(\"*\", async (err, keys) => {\n if (err) return res.send(err);\n\n if (keys.length < 1) {\n return res.send([]);\n }\n\n try {\n for (var i = 0, len = keys.length; i < len; i++) {\n console.log(\"La llave es: \", keys[i]);\n await getValueOfKey(keys[i]).then((resp) => {\n console.log(\"La respuesta es: \", resp);\n llaves.push(JSON.parse(resp));\n });\n }\n\n const locations = llaves.reduce((locations, item) => {\n const location = locations[item.location] || [];\n location.push(item);\n locations[item.location] = location;\n return locations;\n }, {});\n\n res.send(locations[pais_a_buscar]);\n } catch (error) {\n console.error(\"ERROR:\", error);\n res.send([]);\n }\n });\n}", "function importAll(r) { return r.keys().map(r); }", "listKeys(bucket) {\n\n let allKeys = this.store.keys();\n let bucketKeys = [];\n\n for (let i in allKeys) {\n\n if (allKeys[i].startsWith(`${bucket}${DELIM}`)) {\n bucketKeys.push(allKeys[i]);\n }\n }\n\n return bucketKeys;\n }", "function keys() {\n return this.pluck('key');\n }", "get keys() {\n return Object.keys(this.raw());\n }", "async read_resources(file_path) {\n try {\n const file_json = await this.kubectl(`apply -f ${file_path} --dry-run='client' -o json`);\n const resources = JSON.parse(file_json);\n return resources.items;\n } catch (err) {\n console.error(`failed to load noobaa resources from ${file_path}. error:`, err);\n throw err;\n }\n }", "function getByKey() {\n if (!keyArray) {\n keyArray = asArray().sort(function (a, b) {\n return a.key < b.key ? -1 : 1;\n });\n }\n return keyArray;\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "function getArrayOfKeys(arr, key) {\n\tlet arrVal = [];\n\texecuteforEach(arr, function(arr){\n\t\tarrVal.push(arr[key])\n\t});\n\treturn arrVal;\n}", "async getParsedElementsOfListInRedis(key) {\n var results = await new Promise(function(fulfilled, rejected) {\n var array = [];\n //get first to last element\n redisClient.lrange(key, 0, -1, function(err, replies) {\n if (err) {\n rejected(err);\n return;\n }\n replies.forEach(function(item, i) {\n array.push(JSON.parse(item))\n });\n fulfilled(array);\n });\n });\n return results;\n }", "getKeys() {\n return(this.keys);\n }", "keys() {\n const result = [];\n for (let i = 0; i < this.map.length; i += 1) {\n if (this.map[i] !== undefined) {\n for (let j = 0; j < this.map[i].length; j += 1) {\n const key = this.map[i][j][0];\n result.push(key);\n }\n }\n }\n\n return result;\n }", "getKeys() {\n return this.keys;\n }", "mget( keys, cb ){\n\t\t// convert a string to an array of one key\n\t\tif (!isArray( keys )) {\n\t\t\tlet _err = this._error( \"EKEYSTYPE\" );\n\t\t\tif (cb != null) { cb( _err ); }\n\t\t\treturn _err;\n\t\t}\n\n\t\t// define return\n\t\tlet oRet = {};\n\t\tfor (let key of keys) {\n\t\t\t// handle invalid key types\n\t\t\tlet err;\n\t\t\tif ((err = this._isInvalidKey( key )) != null) {\n\t\t\t\tif (cb != null) {\n\t\t\t\t\tcb( err );\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get data and increment stats\n\t\t\tif ((this.data[ key ] != null) && this._check( key, this.data[ key ] )) {\n\t\t\t\tthis.stats.hits++;\n\t\t\t\toRet[ key ] = this._unwrap( this.data[ key ] );\n\t\t\t} else {\n\t\t\t\t// if not found return a error\n\t\t\t\tthis.stats.misses++;\n\t\t\t}\n\t\t}\n\n\t\t// return all found keys\n\t\tif (cb != null) { cb( null, oRet ); }\n\t\treturn oRet;\n\t}", "getKeys() {\n return this.keys;\n }", "keys( cb ){\n\t\tlet _keys = Object.keys( this.data );\n\t\tif (cb != null) { cb( null, _keys ); }\n\t\treturn _keys;\n\t}", "function getKeys(compositeKey) {\n if (typeof compositeKey === 'string') {\n // else assume string and split around dots\n var keyList = keyMap[compositeKey];\n if (!keyList) {\n keyList = compositeKey.split('.');\n keyMap[compositeKey] = keyList;\n }\n return keyList;\n }\n // Wrap in array if needed\n return Array.isArray(compositeKey) ? compositeKey : [compositeKey];\n}", "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "getObjectKeys(obj){\n\t\tlet arr = '';\n\t\tObject.keys(obj).map(function(keyName, keyIndex) {\t\t\t\n\t\t\tarr = obj[keyName]['name'];\n\t\t})\n\t\treturn arr;\n\t}", "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n\n return flattened.reverse();\n}", "function getAllKeys(req, res) {\n let llaves = [];\n\n client.keys(\"*\", async (err, keys) => {\n if (err) return res.send(err);\n\n if (keys.length < 1) {\n return res.send(\"No data found in redis\");\n }\n\n try {\n for (var i = 0, len = keys.length; i < len; i++) {\n //console.log(\"La llave es: \", keys[i]);\n await getValueOfKey(keys[i]).then((resp) => {\n if (keys[i] !== 'indice') {\n console.log(\"La respuesta es: \", resp);\n llaves.push(JSON.parse(resp));\n }\n });\n }\n\n const locations = llaves.reduce((locations, item) => {\n const location = locations[item.location] || [];\n location.push(item);\n locations[item.location] = location;\n return locations;\n }, {});\n\n const paises_total = [];\n for (const property in locations) {\n console.log(`{\"${property}\": ${locations[property].length}}`);\n paises_total.push(\n JSON.parse(\n `{\"pais\":\"${property}\", \"vacunados\": ${locations[property].length}}`\n )\n );\n }\n\n paises_total.sort((a, b) =>\n a.vacunados < b.vacunados ? 1 : b.vacunados < a.vacunados ? -1 : 0\n );\n\n res.send(paises_total);\n } catch (error) {\n console.error(\"El error fue: \" + error);\n res.send([]);\n }\n });\n}" ]
[ "0.64732945", "0.6385631", "0.6296652", "0.6220346", "0.6126636", "0.6126636", "0.60790753", "0.6013503", "0.59854645", "0.59023184", "0.58518124", "0.5729408", "0.567515", "0.56726915", "0.56368244", "0.5603044", "0.5596861", "0.558372", "0.55745333", "0.55432165", "0.5528621", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.54981565", "0.5488551", "0.5478136", "0.5477464", "0.5470374", "0.5469823", "0.5462679", "0.5437684", "0.5437157", "0.5431411", "0.54030424", "0.5401471", "0.5401418", "0.5395606", "0.5395606", "0.5395606", "0.5395606", "0.5395606", "0.5386665", "0.5382209", "0.5377046", "0.5371846", "0.53472805", "0.53471404", "0.53375816", "0.5329762", "0.53231084", "0.5315009", "0.5306643", "0.5301639", "0.5298126", "0.52961916", "0.52961916", "0.52961916", "0.52961916", "0.52961916", "0.5281012", "0.5278181", "0.5266641", "0.52653897", "0.5249851", "0.5246209", "0.5238255", "0.5224686", "0.52144116", "0.52133113", "0.5203456", "0.5188123", "0.51838017" ]
0.5379029
71
Calculate the time gap
function getTime(startTime){ endTime = new Date(); return (endTime-startTime)/1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function B(a){return a.clone().stripTime().diff(G.start,\"days\")}", "function main() {\n var testCases = nextInt();\n var AC, AJ, DC, JK, full, DCSUm, JKSum, res, gaps, gapsDC, gapsJK;\n\n for (var testCase = 1; testCase <= testCases; ++testCase) {\n res = 0;\n AC = nextInt();\n AJ = nextInt();\n\n DC = [];\n for (var i = 0; i < AC; i++) {\n DC.push({\n start: nextInt(),\n end: nextInt(),\n parent: 0\n });\n }\n\n JK = [];\n for (var i = 0; i < AJ; i++) {\n JK.push({\n start: nextInt(),\n end: nextInt(),\n parent: 1\n });\n }\n\n full = DC.concat(JK).sort((a, b) => a.start - b.start);\n\n DCSUm = full.filter(interv => interv.parent === 0).reduce((a, b) => a + (b.end - b.start), 0);\n JKSum = full.filter(interv => interv.parent === 1).reduce((a, b) => a + (b.end - b.start), 0);\n\n gapsDC = [];\n gapsJK = [];\n for (let i = 0; i < full.length; i++) {\n if (i === full.length - 1) {\n if (full[i].parent !== full[0].parent) {\n res++;\n } else {\n let gap = 24 * 60 + (full[0].start - full[i].end);\n full[i].parent ? gapsJK.push(gap) : gapsDC.push(gap);\n }\n } else {\n if (full[i].parent !== full[i + 1].parent) {\n res++;\n } else {\n let gap = full[i + 1].start - full[i].end;\n full[i].parent ? gapsJK.push(gap) : gapsDC.push(gap);\n }\n }\n }\n\n\n gapsDC = gapsDC.sort((a, b) => a - b);\n gapsJK = gapsJK.sort((a, b) => a - b);\n // console.log(DCSUm, JKSum, gapsDC, gapsJK);\n\n while (DCSUm <= 12 * 60 && gapsDC.length > 0) {\n DCSUm += gapsDC.shift();\n }\n\n if (DCSUm > 12 * 60) {\n res += (gapsDC.length + 1) * 2;\n }\n\n // console.log(DCSUm, gapsDC);\n\n while (JKSum <= 12 * 60 && gapsJK.length > 0) {\n JKSum += gapsJK.shift();\n }\n\n if (JKSum > 12 * 60) {\n res += (gapsJK.length + 1) * 2;\n }\n\n // console.log(JKSum, gapsJK);\n\n\n // console.log(res);\n\n\n print(\"Case #\" + testCase + \": \" + (res < 2 ? 2 : res));\n }\n}", "calcTime(){\n const numIng=this.ingredients.length;//ingredients is an array \n const periods= Math.ceil(numIng/3);\n this.time=periods*15;\n }", "function computeTimeDifference(hh1,mm1,ampm1,hh2,mm2,ampm2) {\n\th1 = hh1;\n\tm1 = mm1;\n\th2 = hh2;\n\tm2 = mm2;\n\tvar er3a = 1;\n\tvar er3b = 0;\n\tif ((er3a==0) && (h1==12)) {h1=0}\n\n\tif ((er3a==0) && (er3b==1)) {\n\tt1= (60*h1) + m1;\n\tif (h2==12) {\n\tt2= ((h2) * 60) + m2;}\n\telse {\n\tt2= ((h2+12) * 60) + m2;}\n\tt3= t2-t1;\n\tt4= Math.floor(t3/60)\n\tt5= t3-(t4*60)\n\t}\n\telse if ((er3a==1) && (er3b==0)) {\n\tif (h2==12) {h2=0}\n\tif (h1==12) {h1=0}\n\tt1= (60*h1) + m1;\n\tt2= ((h2+12) * 60) + m2;\n\tt3= t2-t1;\n\tt4= Math.floor(t3/60)\n\tt5= t3-(t4*60)\n\t}\n\telse if ((er3a==0) && (er3b==0)) {\n\tt1= (h1*60) + m1;\n\n\tif (h2==12) {h2=0}\t\n\n\tt2= (h2*60) + m2;\n\t\tif (t2>t1) {\n\t\tt3= t2-t1;\n\t\tt4= Math.floor(t3/60)\n\t\tt5= t3-(t4*60)\n\t\t}\n\t\telse {\n\t\tt2= ((h2+24)*60) + m2;\n\t\tt3= t2-t1;\n\t\tt4= Math.floor(t3/60)\n\t\tt5= t3-(t4*60)\n\t\t}\n\t}\n\telse if ((er3a==1) && (er3b==1)) {\n\t\tif (h1!=12) {h1=h1+12}\n\t\tif (h2!=12) {h2=h2+12}\n\t\tt1= (h1*60) + m1;\n\t\tt2= (h2*60) + m2;\n\t\tif (t2>t1) {\n\t\tt3= t2-t1;\n\t\tt4= Math.floor(t3/60)\n\t\tt5= t3-(t4*60)\n\t\t}\n\t\telse {\n\t\tt2= ((h2+24)*60) + m2;\n\t\tt3= t2-t1;\n\t\tt4= Math.floor(t3/60)\n\t\tt5= t3-(t4*60)\n\t\t}\n\t\t}\n\t\n\t//alert(\" \" + t4 + \" hours \" + \" \" + t5 + \" minutes\");\n return t4+\":\"+t5;\n}", "calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "function solution(A) {\n let totalSum = A.reduce((ac,c)=>ac+c)\n let sumNow = 0;\n let tempMinGap = null;\n debugger;\n for(let i =0; i<A.length-1; i++){\n sumNow+=A[i]\n const gap = Math.abs(-totalSum+2*sumNow)\n if(tempMinGap===null) tempMinGap = gap;\n else tempMinGap = Math.min(gap, tempMinGap);\n }\n return tempMinGap;\n // write your code in JavaScript (Node.js 8.9.4)\n}", "calcTime() {\n const ingNum = this.ingredients.length;\n const periods = Math.ceil(ingNum / 3);\n this.time = periods * 15;\n }", "calcTime() {\n const numberOfIngredients = this.ingredients.length;\n const periods = Math.ceil(numberOfIngredients / 3);\n this.time = periods * 15;\n }", "napablePeriods( minSpanMilliseconds ) {\n var nonBlackouts = new Array();\n\n let blackouts = this.generateBlackoutPeriods();\n var prevBlackout = null\n for (var blackout of blackouts) {\n if ( prevBlackout != null && (blackout.start - prevBlackout.end) > minSpanMilliseconds ) {\n let napablePeriod = new TimePeriod(prevBlackout.end, blackout.start);\n nonBlackouts.push(napablePeriod);\n }\n prevBlackout = blackout;\n }\n /*\n * I presume we allow napping after arrival?? I will presume, for now, that all trips result\n * in a nap during a flight. In a more complete implementation, my guess is, multiple naps are\n * accounted for; and in that case, I would expect a nap on arrival day is possible.\n */\n return nonBlackouts;\n }", "function calculateFillTime(){\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\n\t\t\t// Si la produccion es 0, el tiempo es infinito\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\n\n var produccionHora = get('l' + (i+1)).title;\n var tiempoRestante = \"<span id='timeouta' style='font-weight:bold'>\" + formatear_tiempo(tiempo) + \"</span>\";\n var celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\n\t\t\tvar a = get('l'+(i+1)).previousSibling;\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\n\t\t\ta.appendChild(celda);\n\t\t}\n\t}", "napPeriodNoRemedies() {\n let departLeg = this.departLeg();\n let arrivalLeg = this.arrivalLeg();\n\n let flightDayWakeTime = this.departureDayWakeTimeOfDay().toDate(departLeg.departDate, departLeg.departTZ);\n let arrivalDaySleepTime = this.arrivalDaySleepTimeOfDay().toDate(arrivalLeg.arriveDate, arrivalLeg.arriveTZ);\n let napLengthMS = this.napLengthHours()*(3600 * 1000);\n\n let dateUsualSleep = this.departSleep.toDate(departLeg.departDate, departLeg.departTZ);//time of day on the date and place of departure\n let preferredWake = this.dstWake.toDate(arrivalLeg.arriveDate, arrivalLeg.arriveTZ);//time of day on the date and place of arrival\n\n //milliseconds from dateUsualSleep\n let midpointMS = (preferredWake - dateUsualSleep)/2.0;\n\n let napStartMS = midpointMS - napLengthMS/2.0;\n let napStart = new Date(dateUsualSleep.getTime() + napStartMS);\n let napEnd = new Date(napStart.getTime() + napLengthMS);\n var napPeriod = new TimePeriod(napStart, napEnd);\n\n return napPeriod;\n }", "adjustTime(tadj) {\nreturn this.timeStamp += tadj;\n}", "function fixGaps(data) {\n var fixed_data = new Array();\n $.each(data, function(index, sensor_data) {\n var next_timestamp;\n if (index+1 < data.length) next_timestamp = data[index+1][0];\n fixed_data.push(sensor_data);\n // push a zero point 1ms before and after the gap\n if (next_timestamp - sensor_data[0] > 60000) {\n fixed_data.push([sensor_data[0]+1,0]);\n fixed_data.push([next_timestamp-1, 0]);\n }\n });\n return fixed_data;\n}", "function _getTimeDelta(value) {\n\t\tvar curTime = Date.now();\n\t\tvar time = _getTime(value);\n\t\tvar delayMin = (time - curTime) / 1000 / 60;\n\n\t\tif (delayMin < 0) {\n\t\t\tdelayMin = MIN_IN_DAY + delayMin;\n\t\t}\n\t\treturn delayMin;\n\t}", "function calculateDuration() {\n return endTime - startTime;\n }", "function calcAwaitingTime(arrMin, depMin, arrHours, depHours) {\n\n\n var awaiting;\n if (depHours > arrHours) {\n if (arrMin > depMin) {\n awaiting = 60 - (arrMin - depMin);\n }\n else {\n awaiting = 60 + (depMin - arrMin);\n\n }\n\n }\n else {\n\n awaiting = depMin - arrMin;\n\n }\n return awaiting;\n\n\n}", "function getMinutesAway() {\n var timestamp = $(\"#train-Start\").val().trim();\n timestamp = moment(timestamp, \"HH:mm\").format();\n timeDiff = moment(now).diff(moment(timestamp), \"minutes\");\n timeRemainder = timeDiff % frequency;\n minutesAway = frequency - timeRemainder;\n getNextArrivalTime(timestamp);\n}", "function minTime(machines, goal) {\n const hm = machines.reduce((acc, rate, id) => {\n acc[rate] = acc[acc[rate]] ? acc[rate] + 1 : 1;\n return acc;\n }, {});\n const keys = Object.keys(hm);\n\n let days = +keys[0];\n let items = 0;\n while (items < goal) {\n keys.forEach(key => {\n if (days % +key === 0){\n const rate = hm[key];\n items = items + rate;\n }\n });\n days = days + 1;\n }\n return days - 1;\n}", "function calculateFillTime(){\r\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\r\n\t\t\t// Si la produccion es 0, el tiempo es infinito\r\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\r\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\r\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\r\n\t\t\t\t\t\tif(getv2()!=1){\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (4-i)).title;} else{\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (1+i)).title;}\r\n\t\t\t\t\t\tvar tiempoRestante = \"<span id='timeouta' style='font-weight:bold' noreload='1'>\" + formatear_tiempo(tiempo) + \"</span>\";\r\n\t\t\t\t\t\tvar celda = elem(\"span\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + calculateHighlight(produccionHora, tiempo, tiempoRestante) + ')</span>');\r\n\t\t\t\t\t\t//var celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\r\n\t\t\tif(getv2()!=1){\r\n\t\t\t\tvar a = get('l'+(4-i)).previousSibling;\r\n\t\t\t} else {\r\n\t\t\t\tvar a = get('l'+(1+i)).previousSibling;\r\n\t\t\t}\r\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\r\n\t\t\ta.appendChild(celda);\r\n\t\t}\r\n\r\n\t\tget('l1').style.cssText = 'padding-bottom: 5px;';\r\n\t}", "function getUsageIntervals( start_time )\n{\n var datetime = new Date();\n var ctime = parseInt( datetime.getTime()) / 1000 ;\n var diff = ctime - parseInt(start_time);\n return parseInt(diff).timeLeft();\n}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateMinsAway(trainTime, freqMinute) {\n var nextTrainTime = calculateArrival(trainTime, freqMinute);\n nextTrainTime = moment(nextTrainTime, \"HH:mm\");\n console.log(nextTrainTime);\n\n var diff = moment(nextTrainTime).diff(moment(), \"minutes\");\n console.log(diff);\n return diff;\n}", "function allPossibleTime(){\n const result = [];\n for (let i = 10.00 ; i < 18.30 ; i = i + 0.30) {\n result.push(`${i}-${i + 0.30}`);\n }\n return result;\n }", "function calculateDuration() {\n return endTime - startTime;\n }", "function deltaTime(finishHr, finishMin, currentHr, currentMin){\n let finishHr = finishHr % 24;\n let currentHr = currentHr % 24; \n // Day time\n if(finishHr >= currentHr){\n let diffHr = finishHr - currentHr;\n let diffMin = finishMin - currentMin;\n let absDiffMin = diffHr * 60 + diffMin;\n }\n // Night time\n else{\n let diffHr = Math.abs(currentHr - 24) + finishHr;\n let diffMin = finishMin - currentMin;\n let absDiffMin = diffHr * 60 + diffMin;\n }\n return absDiffMin;\n}", "calcTime () {\n const numberOfIngredients = this.ingredients.length;\n const period = Math.ceil( numberOfIngredients / 3 )\n this.time = period * 15;\n }", "function droppedRequests(requestTime) {\n // Write your code here\n let dropCount = 0;\n\n const counts = [0];\n\n let place = 0;\n for (let t = 1; t <= requestTime[requestTime.length - 1]; t++) {\n let reqCount = 0;\n let t9 = Math.max(0, t - 9);\n let t59 = Math.max(0, t - 59);\n let requestPast10 = counts.slice(t9).reduce((a, b) => a + b, 0);\n let requestPast60 = counts.slice(t59).reduce((a, b) => a + b, 0);\n // console.log('time:', t, 'requestPast10:', requestPast10, 'requestPast60', requestPast60)\n while (t === requestTime[place]) {\n if (reqCount < 3 && requestPast10 + reqCount < 20 && requestPast60 + reqCount < 60) {\n\n } else {\n dropCount++;\n }\n reqCount++;\n place++;\n }\n // console.log('time:', t, 'reqCount:', reqCount);\n counts.push(reqCount);\n // console.log(counts);\n }\n\n return dropCount;\n}", "function computeTimeDifference(start,end){\n\t\t\t\t//var start = '8:00';\n\t\t\t //var end = '23:30';\n\t\t\t var diff;\n\t\t\t start=convertTimeTo24HourSystem(start);\n\t\t\t end=convertTimeTo24HourSystem(end);\n\t\t\t\n\t\t\t s = start.split(':');\n\t\t\t e = end.split(':');\n\t\t\t // alert(\"End: \"+e);\n\t\t\t // alert(\"Start: \"+s);\n\t\t\t min = parseInt(e[1])-parseInt(s[1]);\n\t\t\t hour_carry = 0;\n\t\t\t if(min < 0){\n\t\t\t min += 60;\n\t\t\t hour_carry += 1;\n\t\t\t }\n\t\t\t //alert(\"Start H: \"+parseInt(s[0]));\n\t\t\t hour = parseInt(e[0])-parseInt(s[0])-hour_carry;\n\t\t\t diff = hour + \"Hrs \" + min+\" min\";\n\t\t\t //alert(\"Time diff is: \"+diff);\n\t\t\t \n\t\t\t return diff;\n\t\t\t\t}", "function calculateTime() {\n displayTime(Date.now() - startTime);\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "function calculateGameTime() {\n var d = new Date();\n endTime = d.getTime();\n\n var elapsedTime = endTime - startTime;\n\n metrics.set(\"elapsedTime\", elapsedTime);\n}", "function gap(g, m, n) {\n // your code\n if (g < 2 || m < 2 || n <= m || g % 2 !== 0) {\n return null;\n }\n let tempM = m;\n let tempN = n;\n let temp = 0;\n let newArr = [];\n for (tempM; tempM < tempN; tempM++) {\n temp = tempM + g;\n if (tempM % 2 === 0 && tempM !== 2) {\n continue;\n } else if (tempM === 1) {\n continue;\n } else if ((temp % 5) === 0 || temp % 3 === 0) {\n continue;\n }\n if (temp > n) {\n newArr = null;\n break;\n }\n\n if ((temp - tempM) === g) {\n newArr = [tempM, temp];\n break;\n }\n }\n return newArr;\n\n}", "function calcGap(start, end) {\n let dx = end.x - start.x;\n let dy = end.y - start.y;\n return {\n x: dx,\n y: dy\n };\n}", "function calculateArrival(trainTime, freqMinute) {\n console.log(trainTime);\n console.log(freqMinute);\n\n var startTime = moment(trainTime, \"HH:mm\");\n console.log(startTime);\n console.log(startTime.hour());\n console.log(startTime.minute());\n startTimeInMin = startTime.hour()*60 + startTime.minute();\n console.log(startTimeInMin);\n\n var diff = moment().diff(startTime, \"minutes\");\n console.log(diff);\n\n var noOfTrains = Math.ceil(diff / freqMinute);\n console.log(noOfTrains);\n\n var minsDiff = noOfTrains*freqMinute - diff;\n console.log(minsDiff);\n var resultTime = moment().add(minsDiff, \"m\");\n console.log(resultTime);\n console.log(moment(resultTime).format(\"HH:mm\"));\n return moment(resultTime).format(\"HH:mm\");\n}", "calculateDepartArive(route) {\n const startTime = moment(route[0].legs[0].locs[0].arrTime, 'YYYYMMDDHHmm').format('HH:mm')\n return startTime\n }", "calculateDepartArive(route) {\n const startTime = moment(route[0].legs[0].locs[0].arrTime, 'YYYYMMDDHHmm').format('HH:mm')\n return startTime\n }", "function calcNextAndMinsAway(firstTrain, frequency) {\n // Convert times to moment objects. Note: subtracted 1 year from first train to ensure before current time\n var firstTrainTime = moment(firstTrain, \"HH:mm\");\n // Compare current time to first train time to determine time difference in minutes\n var timeDiff = moment().diff(moment(firstTrainTime), 'minutes');\n // Declare variables for later assignment\n var minsAway;\n var nextArrival;\n\n // Calculate mins away from next train\n minsAway = frequency - (timeDiff % frequency)\n // Add minsAway to current time for next arrival and format as HH:mm\n nextArrival = moment().add(minsAway, 'minutes').format('HH:mm');\n return [nextArrival, minsAway]\n}", "function gapDown(){\n\t\tvar res=[];\n\t\t\t\t\n\t\tfor (var i=1;i<count();i++){\n\t\t\tres.push(HIGH[i]<LOW[i-1]);\n\t\t}\n\t\t\n\t\treturn res;\t\t\n\t}", "function getTime(data) {\n var nextStopId = data.data.entry.status.nextStop;\n var prevStopId = data.data.entry.schedule.stopTimes[0].stopId;\n var prevStopTime = data.data.entry.schedule.stopTimes[0].arrivalTime;\n var i = 0;\n while(i < data.data.entry.schedule.stopTimes.length - 1 && data.data.entry.schedule.stopTimes[i].stopId != nextStopId) {\n prevStopId = data.data.entry.schedule.stopTimes[i].stopId;\n prevStopTime = data.data.entry.schedule.stopTimes[i].arrivalTime;\n i++;\n }\n nextStopTime = data.data.entry.schedule.stopTimes[i].arrivalTime;\n if(i == 0) return 1000 * (data.data.entry.schedule.stopTimes[data.data.entry.schedule.stopTimes.length - 1].arrivalTime - prevStopTime);\n return (nextStopTime - prevStopTime) * 1000;\n}", "function a$4(e){return n$9(e.frameDurations.reduce(((t,e)=>t+e),0))}", "function toIntervals(times) {\n var start_day = new Date();\n start_day.setTime(times[0]);\n resetDay(start_day);\n \n var next_day = new Date();\n next_day.setTime(times[0]);\n next_day.setDate(next_day.getDate() + 1);\n resetDay(next_day);\n \n var start_i = 0;\n var intervals = [];\n var TIME_GAP = 25*60*1000; // 25m in ms\n var MS_PER_1H = 60*60*1000;\n for (var i=1; i<=times.length; i++) {\n // Check if we need to close the current interval because there's a\n // gap >25m\n if (i == times.length || (times[i] - times[i-1]) > TIME_GAP) {\n // times[i] is the first time that's outside the interval starting\n // at timest[start_i]\n if ((times[i-1] - times[start_i]) > MS_PER_1H) {\n // The interval starting at times start_i has non-zero duration\n // (i.e. it consists of more times than just times[start_i])\n // Add it to the result.\n var start = times[start_i] - start_day.getTime(),\n end = times[i-1] - start_day.getTime();\n intervals.push(new I(start, end));\n }\n start_i = i; // Start a new interval at i\n }\n \n // Check if we need to close the current interval because it crosses\n // the end of a day\n // if (times[i].getTime > )\n }\n return intervals;\n}", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "function runProgram(input){\n let input_arr = input.trim().split(\"\\n\")\n let [_, days] = input_arr[0].trim().split(\" \").map(Number)\n let array = input_arr[1].trim().split(\" \").map(Number)\n let total_time = array.reduce((acc, i) => acc + i)\n \n let low = 0\n let high = total_time\n let time;\n while(low <= high){\n let mid = Math.floor(low + ((high - low) / 2))\n if(possibility_check(mid, days, array)){\n time = mid\n high = mid - 1 \n }\n else{\n low = mid + 1\n }\n }\n console.log(time)\n\n function possibility_check(time, days, array){\n let count = 0\n for(let i = 0; i < array.length; i++){\n let time_taken = 0\n let flag = false\n while(time_taken + array[i] <= time){\n flag = true\n time_taken += array[i]\n // console.log(time_taken + \" \" + time)\n i = i + 1\n }\n if(flag){\n i = i - 1\n }\n // console.log(i)\n count++\n }\n if(count <= days){\n return true\n }\n else{\n return false\n }\n }\n \n}", "function timeRun() {\n return ((new Date()).getTime() - START_TIME)/1000;\n}", "setupTimes(){\n\n\n this.fixation_time_1 = 4;\n this.fixation_time_2 = 1;\n\n this.learn_time = 0.4 * this.stimpair.learn.getDifficulty();\n this.test_time = this.learn_time;\n\n this.total_loop_time = this.learn_time+this.fixation_time_1+this.test_time+this.fixation_time_2;\n\n this.t_learn = SchedulerUtils.getStartEndTimes(0,this.learn_time);\n\n this.t_test = SchedulerUtils.getStartEndTimes(this.t_learn.end+this.fixation_time_1,this.test_time);\n\n console.log(\"times: \",\"fixation: \",this.initial_fixation,\" learn: \",this.learn_time,\" total: \",this.total_loop_time);\n\n }", "function intervals(y, a, b) {\n\n // console.log('======================> INTERVAL '+starttime+' '+a+' | '+b)\n // IF STARTTIME POINTS WITH SCHEDULE\n if(starttime <= a && starttime < b) {\n\n\n\n \n // LOOP ORDERS AND COMPARE WITH INTERVAL\n // console.log('ORDERS: '+a + ' ' + y+ ' '+JSON.stringify(orders[k]))\n var k = 0;\n function orderloop(k, a, y) {\n\n // CHECK 1 ORDER WITH KEY-VALUE\n for(okey in orders[k]) {\n\n // console.log('okeyf '+sttm+' '+parseInt(okey)+' '+orders[k][okey])\n\n if(parseInt(okey) <= sttm && sttm < orders[k][okey]) {\n // console.log('OKEY!!!!!!!!!')\n // IF IS ORDER AT THIS INTERVAL THE ENDTIME OF THE ORDER WILL BE TAKEN\n sttm = orders[k][okey];\n // starts.push(sttm);\n }\n\n }\n\n k++;\n if(k < orders.length) {\n orderloop(k, a, y);\n }\n else {\n // IF NO ORDER AT THIS INTERVAL\n if(y == 0) {\n // IF STARTTIME IS GREATER THAN NOW\n // console.log(new Date(sttm*1000) + ' ' + new Date(stoptimestay*1000) + ' ' + new Date(a*1000) + ' ' + new Date(when*1000));\n if(parseInt(a) > when && parseInt(a) < stoptimestay) {\n // console.log('NOKEY 1 !!!!!!!!!')\n starts.push(parseInt(a));\n // sttm = parseInt(a) + parseInt(interval);\n }\n // else if(parseInt(a) < when && parseInt(a) < stoptimestay) {\n // starts.push(when);\n // sttm = when + parseInt(interval);\n // }\n // else {\n // sttm = parseInt(a) + parseInt(interval);\n // }\n \n sttm = parseInt(a) + parseInt(interval);\n }\n else {\n // IF STARTTIME IS GREATER THAN NOW\n // console.log(new Date(sttm*1000) + ' ' + new Date(stoptimestay*1000) + ' ' + new Date(a*1000) + ' ' + new Date(when*1000));\n if(sttm > when && sttm < stoptimestay) {\n // console.log('NOKEY 2 !!!!!!!!!')\n starts.push(parseInt(sttm));\n }\n sttm = parseInt(sttm) + parseInt(interval);\n }\n }\n }\n orderloop(0, a, y);\n\n\n\n\n\n }\n\n y++;\n if(y < intervalslength) {\n intervals(y, a, b);\n }\n }", "function tArrival(tStart, tFreq ){\n // var tFreq = 45;\n var tFreq = moment().minutes(Number);\n // Time is 3:30 AM\n\n // var firstTime = \"03:30\";\n var firstTime = moment().minute(Number);\n\n // First Time (pushed back 1 year to make sure it comes before current time)\n var firstTimeConverted = moment(firstTime, \"hh:mm\").subtract(1, \"years\");\n console.log(firstTimeConverted);\n\n // Current Time\n var currentTime = moment();\n console.log(\"CURRENT TIME: \" + moment(currentTime).format(\"hh:mm\"));\n\n // Difference between the times\n var diffTime = moment().diff(moment(firstTimeConverted), \"minutes\");\n console.log(\"DIFFERENCE IN TIME: \" + diffTime);\n\n // Time apart (remainder)\n var tRemMins = diffTime % tFreq;\n console.log(tRemMins );\n\n // Next Train\n var nextArrival = moment().add(tMinsAway, \"minutes\");\n console.log(\"ARRIVAL TIME: \" + moment(nextArrival).format(\"hh:mm\"));\n\n // Minute Until Train\n var tMinsAway = tFreq - tRemMins ;\n console.log(\"MINUTES TILL TRAIN: \" + tMinsAway);\n\n\nreturn nextArrival;\nreturn tMinsAway;\n }", "function getTrainTime(t, f) {\n\n var now = moment();\n // console.log(now);\n // This next variable fixes the bug that happens with the blue Line\n var first = moment(t, \"HH:mm\").subtract(1, 'years');\n // console.log(first);\n\n \n if (moment(now).isBefore(first)) {\n return [first.format(\"HH:mm\"), (first.diff(now, 'minutes'))];\n }\n\n while (moment(now).isAfter(first)) {\n first.add(f, 'm');\n } \n\n return [first.format(\"HH:mm\"), (first.diff(now, 'minutes'))];\n}", "function calculateTimeDifference(currTime, prevTime) {\n return (currTime[0] * 60 + currTime[1]) - (prevTime[0] * 60 + prevTime[1]);\n}", "function nextArrival(obj) {\n\n if (updateTime === 0) {\n clearInterval(updateTime);\n }\n\n var tName = (obj.trainName).split(\" \").join(\"\"),\n trainFreq = obj.frequency,\n firstTrainTime = obj.firstTrainTime;\n\n if (moment().isAfter(moment(firstTrainTime, \"HH:mm\"))) {\n var newTime = moment(firstTrainTime, \"HH:mm\").add(trainFreq, \"minutes\"),\n timeGap = Math.abs(moment().diff(newTime, \"minutes\"));\n\n $(\"#\" + tName + \" > #trainTime\").text(newTime.format(\"HH:mm\"));\n $(\"#\" + tName + \" > #timeDiff\").text(timeGap);\n\n }\n\n\n}", "function race(v1, v2, g) {\n let totalSeconds = 0\n let hours = 0\n let minutes = 0\n let seconds = 0\n let result = []\n\n let spedFirstTortPerSec = v1 / 60 / 60\n let spedSecondTortPerSec = v2 / 60 / 60\n\n let distanceFirst = g\n let distanceSecond = 0\n if (v1 >= v2) {\n return null\n } else {\n hours = Math.trunc(totalSeconds / 60 / 60)\n minutes = Math.trunc((totalSeconds - (hours * 60 * 60)) / 60)\n seconds = (totalSeconds - (hours * 60 * 60)) - (minutes * 60);\n if (distanceFirst <= distanceSecond) return [hours, minutes, seconds - 1];\n\n while (distanceFirst > distanceSecond) {\n distanceFirst += spedFirstTortPerSec\n distanceSecond += spedSecondTortPerSec\n totalSeconds++\n }\n hours = Math.trunc(totalSeconds / 60 / 60)\n minutes = Math.trunc((totalSeconds - (hours * 60 * 60)) / 60)\n seconds = (totalSeconds - (hours * 60 * 60)) - (minutes * 60)\n result = [hours, minutes, seconds - 1]\n return (result)\n }\n }", "function timeDifference(date1, date2) {\n return Math.round(Math.abs(date2.getTime() - date1.getTime()) / 1000);\n }", "async function noGaps (schedule) {\n let hasGaps = false\n const sorted = sortedIntervals(schedule.elements)\n let lastEnd = null\n for (let i = 0; i < sorted.length; i++) {\n if (lastEnd !== null) {\n if (sorted[i].start > lastEnd) {\n hasGaps = true\n break\n }\n }\n lastEnd = sorted[i].end\n }\n\n if (hasGaps) {\n return { schedule: {\n [schedule._id]: [{\n class: 'strict',\n finding: `There are gaps in the schedule.`,\n source: {\n id: schedule._id,\n type: 'schedule'\n },\n id: `${schedule._id}_noGaps`\n }]\n }}\n }\n}", "function timePenalty() {\n timeRem =- 5;\n}", "function diff_minutes(dt2, dt1) \r\n {\r\n console.log(dt1);\r\n var diff =(dt2.getTime() - dt1.getTime()) / 1000;\r\n diff /= 60;\r\n return Math.abs(Math.round(diff));\r\n \r\n }", "function z(a){return G.start.clone().add(a,\"days\")}", "function timeCycle() {\r\n var time2 = Date.now();\r\n var msTimeDiff = time2 - gTime1;\r\n var timeDiffStr = new Date(msTimeDiff).toISOString().slice(17, -1);\r\n document.querySelector('.timer').innerHTML = timeDiffStr;\r\n}", "function beforeTime(age, quantity, length){//This will return the value for the amount of time before their current age.\n var priorDays = age * 365 - 365;//The formula for finding the information.\n var lengthTime = quantity * length;//This is used for determining the length of time per day spent on hygiene.\n var totalTime = priorDays * lengthTime;//Total of time from the first year of their life.\n return totalTime;//The return value from the function.\n}", "function delta() {\n var now = Date.now(),\n d = now - timeOffset;\n timeOffset = now;\n return d;\n}", "function nextArrivalMinutesAway(firstSpaceshipTime, frequency) {\n // convert the first spaceship time to make sure it comes before the current time\n var firstTimeConverted = moment(firstSpaceshipTime, \"HH:mm\").subtract(1, \"years\");\n // get the difference, in minutes, between the current time and the first spaceship time converted\n var timeDifference = moment().diff(moment(firstTimeConverted), \"minutes\");\n // get the remainder of the time difference divided by the frequency\n var timeRemaining = timeDifference % frequency;\n // compute the minutes away\n minutesAway = frequency - timeRemaining;\n // get the time of the next spaceship in AM/PM format\n var next = moment().add(minutesAway, \"minutes\");\n nextSpaceshipArrival = moment(next).format(\"hh:mm A\");\n \n}", "function distOverTime(input) {\n let [speed1, speed2, timeInSec] = [input[0], input[1], input[2]];\n let distance1 = speed1 * timeInSec / 60 / 60;\n let distance2 = speed2 * timeInSec / 60 / 60;\n console.log(1000 * Math.abs(distance1 - distance2));\n}", "getDelta() {\n\t\tlet diff = 0;\n\t\tif ( this.autoStart && ! this.running ) {\n\t\t\tthis.start();\n\t\t\treturn 0;\n\t\t}\n\t\tif ( this.running ) {\n\t\t\tconst newTime = ( typeof performance === 'undefined' ? Date : performance ).now();\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\t\t\tthis.elapsedTime += diff;\n\t\t}\n\t\treturn diff;\n\t}", "function getLapTime() {\r\n\r\n if (initTime !== 0 && timerControl) {\r\n // get lap time\r\n clickTime = getCurrTime();\r\n let passedTime = calcPassedTime(initTime, clickTime)\r\n let lapTime = passedTime - lapInitialTimer;\r\n\r\n lapInitialTimer = passedTime;\r\n // update and store lap times array, unless laptime == 0\r\n if (lapTime !== 0) {\r\n lapTimesArray.unshift(lapTime);\r\n lapHistory(lapTimesArray);\r\n localStorage[\"laps\"] = JSON.stringify(lapTimesArray);\r\n }\r\n }\r\n}", "function berkeleysAverage (gaps_list) {\n let api_time = 0; //AQUÍ TOCA SACAR EL TIEMPO DE LA API XD\n let local_gap_time = (time - api_time)/1000; //AQUÍ EL DESFASE DEL COORDINADOR\n let avg_gap = 0; // AQUÍ VAMOS A CALCULAR EL PROMEDIO DE TODOS LOS DESFASES (INCLUIDO EL DEL COORDINADOR)\n for(let i = 0; i < gaps_list; i++) {\n avg_gap += gaps_list[i].desfase;\n }\n avg_gap += local_gap_time; //SE INCLUYE EL DESFASE DEL COORDINADOR, TODO ESTÁ EN SEGUNDOS\n let final_avg = avg_gap/(gaps_list.length+1); // SE DIVIDE EN LA CANTIDAD DE INSTANCIAS + 1 (POR EL COORDINADOR)\n my_time += final_avg; //SE AJUSTA EL TIEMPO DEL COORDINADOR CON final_avg\n let adjusts_list = []; //acá vamos a guardar los ajustes para las demás instancias\n for(let i = 0; i < gaps_list; i++) {\n const adjust_object = {id: gaps_list[i].id, adjustment: (my_time - (api_time + gaps_list[i])) } // acá vamos a calcular esos ajustes para cada instancia, y añadimos su respectivo ID a cada ajuste\n adjusts_list.push(); // vamos agretando cada desajuste con su id a la lista\n }\n return adjusts_list; // aquí va la lista de objetos así [{id,desajuste}, {id,desajuste}, {id,desajuste}...]\n}", "function countNoMinBetween(startTime, endTime){\n console.log(\"startTime\",startTime);\n console.log(\"endTime\",endTime);\n var total = 0;\n var hourNo = 0;// = Math.floor(total/100);\n var minNo = 0;//total%100;\n if(endTime > startTime) {\n total = endTime - startTime;\n hourNo = Math.floor(total/100);\n minNo = total%100;\n if(minNo > 60) minNo -= 60;\n }\n else{\n total = 2359 - (startTime - endTime);\n hourNo = Math.floor(total/100);\n minNo = total%100;\n if(minNo >= 60) {\n hourNo +=1;\n minNo -= 60;\n }\n }\n return hourNo*60 + minNo;\n}", "function calculateTravelTime(departureRoute, arrivalRoute)\n\t{\n\t\tvar start = xmlDoc.getElementsByTagName(\"departure\")[departureRoute].getElementsByTagName(\"datetime\")[0].childNodes[0].nodeValue;\n\t\tvar stop = xmlDoc.getElementsByTagName(\"arrival\")[arrivalRoute].getElementsByTagName(\"datetime\")[0].childNodes[0].nodeValue;\n\t\tstartH = start.substring(11,13);\n\t\tstartM = start.substring(14,16);\n\t\tstopH = stop.substring(11,13);\n\t\tstopM = stop.substring(14, 16);\n\n\t\t //console.log(\"start = \" + start);\n\t\t //console.log(\"stop = \" + stop);\n\n\t\tvar h = stopH-startH;\n\t\tvar m = stopM-startM;\n\n\t\tif(m<0){\n\t\t\th = h-1;\n\t\t\tm = 60+m;\n\t\t}\n\t\t\n\t\t//console.log(\"vilket blir: \" + h + \" timmar och \" + m + \" minuter\");\n\t\treturn {h: h , m: m};\n\t}", "function culcTimeLeftStore1() {\n let totalTime = 120;\n\n let distanceToStore1 = 10;\n\n let myHome = 0;\n\n let distanceFromMeToStore1 = myHome + distanceToStore1 * 2 + 5;\n\n let result = totalTime - distanceFromMeToStore1;\n\n return result;\n}", "function gps(sec, arr) {\n if (arr.length <= 1 ) {return 0};\n var diff = [];\n for (let i = 0; i < (arr.length-1) ; i ++) {\n diff.push((arr[(i+1)] - arr[i]));\n }\n var sortDiff = diff.sort((a,b) => { return a-b});\n return (sortDiff.pop()/(sec/3600));\n}", "function calculateTimeDifference(startHour, startMin, endHour, endMin)\n{\n\t// Work out the time difference in hours and round to 2dp\n\tvar startDate = new Date('July 27, 2011 ' + startHour + ':' + startMin + ':' + '00');\n\tvar endDate = new Date('July 27, 2011 ' + endHour + ':' + endMin + ':' + '00');\t\t\t\t\n\tvar timeDifference = (endDate - startDate)/1000;\n\tvar timeDifferenceInHours = (timeDifference/60/60);\n\t\n\treturn roundNumber(timeDifferenceInHours, 2);\n}", "function getNextArrivalTime(trainStartTime) {\n nextArrival = moment(trainStartTime).add((timeDiff + minutesAway), \"minutes\").format(\"HH:mm\");\n // console.log(\"pls work \" + nextArrival);\n}", "function timeFrame() {\n return Math.round(Math.random() * (MAX - MIN) + MIN)\n }", "diff () {\n if (this.stopped.length === 0) {\n throw new Error('Timer has not been stopped.')\n }\n\n return this.stopped[0] * 1e9 + this.stopped[1]\n }", "function timeDiff(time1, time2) {\n return DMath.fixHour(time2- time1);\n}", "function alignPDT(details,lastDetails){if(lastDetails&&lastDetails.fragments.length){if(!details.hasProgramDateTime||!lastDetails.hasProgramDateTime){return;}// if last level sliding is 1000 and its first frag PROGRAM-DATE-TIME is 2017-08-20 1:10:00 AM\n// and if new details first frag PROGRAM DATE-TIME is 2017-08-20 1:10:08 AM\n// then we can deduce that playlist B sliding is 1000+8 = 1008s\nvar lastPDT=lastDetails.fragments[0].programDateTime;var newPDT=details.fragments[0].programDateTime;// date diff is in ms. frag.start is in seconds\nvar sliding=(newPDT-lastPDT)/1000+lastDetails.fragments[0].start;if(Number.isFinite(sliding)){logger_1.logger.log(\"adjusting PTS using programDateTime delta, sliding:\"+sliding.toFixed(3));adjustPts(sliding,details);}}}", "function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}", "function timeDifference(laterTime, earlierTime) {\n return Math.round((((laterTime - earlierTime) % 86400000) % 3600000) / 60000);\n}", "calculateTime(newTime, oldTime) {\n let { startHr, startMin, startType } = this.state;\n \n const { hr: newHr = 0, min: newMin = 0 } = newTime || {};\n const { hr: oldHr = 0, min: oldMin = 0 } = oldTime || {};\n\n let totalHr = newHr - oldHr;\n let totalMin = newMin - oldMin;\n\n // convert extra minutes into hours\n totalHr += (totalMin >= 0 ? (Math.floor(totalMin / 60)) : (Math.ceil(totalMin / 60)));\n totalMin = (totalMin % 60);\n\n // if the total hrs > 12, figure out the 12/24 cycles so that we can just change switch between 'AM' or 'PM'\n // ex. if total hrs is 12, and our end time is 1 PM, then we can set start to 1 AM\n if (Math.abs(totalHr) >= 12) {\n if (Math.floor(Math.abs(totalHr)/12) % 2 == 1) { // if odd, then switch time type\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n }\n totalHr = totalHr % 12;\n }\n\n // Update start hour\n if (totalHr < 0) { // we want to increase start time by totalHrs\n // add total hrs to start time\n startHr += (totalHr * -1);\n if (startHr >= 12) {\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n startHr -= 12;\n }\n } else if (totalHr > 0) { // we want to decrease start time by totalHrs\n if (startHr == 12) {\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n }\n // subtract total hrs from start time\n startHr -= totalHr;\n if (startHr <= 0) {\n if (startHr < 0) {\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n }\n startHr += 12;\n }\n }\n\n // Update start min\n if (totalMin < 0) { // we want to increase start time by totalMin\n // subtract total min from start time \n startMin += (totalMin * -1);\n if (startMin >= 60) {\n startHr++;\n if (startHr == 13) {\n startHr = 1;\n } else if (startHr == 12) {\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n }\n startMin -= 60;\n }\n } else if (totalMin > 0) { // we want to increase start time by totalMin\n // subtract total min from start time \n startMin -= totalMin;\n if (startMin < 0) {\n startHr--;\n if (startHr == 0) {\n startHr = 12;\n } else if (startHr == 11) {\n startType = ((startType === 'PM') ? 'AM' : 'PM');\n }\n startMin += 60;\n }\n }\n\n this.setState({ startHr, startMin, startType });\n }", "function calcualteStayDuration(){\n // Variable that minuses the stored inputed time stamps from each other to find their difference\n var dateResult = (bookingDates.checkOutDate - bookingDates.checkInDate);\n // Variable that converts the timestamp outputed by dateResult into days\n var resultConverted = Math.floor(dateResult / (1000 * 60 * 60 * 24));\n bookingData.stayDuration = resultConverted;\n } // Invoked at line 390", "function tripTime(departure, arrival) {\n var start = departure.split(\":\");\n start = new Date(2018, 0, 0, ...start);\n var end = arrival.split(\":\");\n end = new Date(2018, 0, 0, ...end);\n var diff = Math.abs(end - start);\n var hours = Math.floor(diff / (1000*60*60))\n diff = diff - hours*(1000*60*60);\n var minutes = Math.floor(diff/ (1000*60));\n diff = diff - minutes*(1000*60);\n var seconds = Math.floor(diff/(1000))\n var res = hours + \" hours \" + minutes + \" minutes \" + seconds + \" seconds\"\n return res;\n}", "function timeIncrements() {\n const quantity = 10;\n const granularity = 5;\n let data = [];\n var i = 0;\n for (i; i <= quantity; i++) {\n let minutes = i * granularity;\n data.push({ id: `${i}`, value: minutes + ' minutes' })\n }\n return data;\n }", "estimatedTime(peak) {\n // The estimated time depends on the distance in blocks\n // and whether the trip is occurring during peak hours or off peak hours.\n\n if (peak === true) {\n // while during peak hours\n // - two blocks in a minute.\n console.log(this.blocksTravelled()/2)\n let blocksOnPeak = this.blocksTravelled()/ 2;\n return Math.ceil(blocksOnPeak)\n } else {\n // During off peak hours,\n // - three blocks in a minute,\n console.log(this.blocksTravelled()/3)\n let blocksOnPeak = this.blocksTravelled()/ 3;\n return Math.ceil(blocksOnPeak)\n }\n }", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function gd(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}", "function nextTrainArrival(arg1, arg2) {\r\n\r\n let tFrequency = arg1; \r\n let FirstArrival = arg2;\r\n\r\n //let convertArrTime = moment(FirstArrival, \"hmm\").format(\"h:mm A\");\r\n //console.log(convertArrTime);\r\n\r\n let differenceTimes = moment().diff(FirstArrival, \"minutes\");\r\n let tRemainder = differenceTimes % tFrequency; //Specifically I really don't understand how the modulus is supposed to be used here.\r\n tMinutes = tFrequency - tRemainder;\r\n tArrival = moment().add(tMinutes, \"m\").format(\"hh:mm A\");\r\n\r\n console.log(differenceTimes, tFrequency, FirstArrival, tRemainder, tMinutes, tArrival);\r\n\r\n return [tMinutes, tArrival]\r\n}", "function timersweep() {\n let t0, t1 = timerqueueHead, time = Infinity;\n\n while (t1) {\n if (t1.f) {\n t1 = t0 ? t0.n = t1.n : timerqueueHead = t1.n;\n } else {\n if (t1.t < time) {\n time = t1.t;\n }\n t1 = (t0 = t1).n;\n }\n }\n timerqueueTail = t0;\n return time;\n}", "function reduceTime() {\n timeLeft = timeLeft - 10;\n}", "function timeToWalk(steps, strideLength, speed){\n\n let speedInMetersPerSecond = Number(speed) / 3.6;\n let distance = Number(steps) * Number(strideLength);\n let stridesPerSecond = speedInMetersPerSecond / Number(strideLength);\n let timeInSeconds = distance / speedInMetersPerSecond;\n\n let restTime = Math.floor(distance / 500);\n timeInSeconds += restTime * 60;\n\n let hours = Math.floor(timeInSeconds / 3600);\n timeInSeconds %= 3600;\n let minutes = Math.floor(timeInSeconds / 60);\n timeInSeconds %= 60;\n timeInSeconds = Math.round(timeInSeconds);\n\n\n var hoursResult = hours < 10 ? \"0\" + hours : hours;\n var minutesResult = minutes < 10 ? \"0\"+ minutes : minutes;\n var secondsResult = timeInSeconds < 10 ? \"0\"+ timeInSeconds : timeInSeconds;\n\n var result = hoursResult \n + \":\" \n + minutesResult\n + \":\"\n + timeInSeconds;\n\n console.log(result);\n}", "function irdTimeDifference(firstTime,secondTime)\n{\n\tvar endResult = 0;\n\t\n\tif(firstTime!= null && secondTime!=null){\n\t\t\n\t\tendResult = secondTime - firstTime; \n\t\tif(firstTime>secondTime){\n\t\t\tendResult = endResult + 86400000;\n\t\t}\n\t}\n\t\n\treturn endResult;\n}", "function lessTime(elementID){\n var i, j;\n //Get the index of the selected element id\n for (i = 0; i < diagram.length; i++) {\n var cur = diagram[i];\n if (cur._id == elementID) {\n break;\n }\n }\n\n // reduce the time of all the elements\n for (var j = i; j < diagram.length; j++) {\n var cur = diagram[j];\n \n if (j == i) {\n if (diagram[i].end_time - diagram[i].start_time == 1) {\n return;\n }\n diagram[j].end_time = diagram[j].end_time - 1; // Decrease end time of current element by 1\n $(\"#time_\"+diagram[j]._id).text(diagram[j].end_time - diagram[j].start_time);\n totalTime--;\n continue;\n }\n diagram[j].start_time = diagram[j].start_time - 1;\n diagram[j].end_time = diagram[j].end_time - 1; \n //alert(diagram[j]._id);\n $(\"#time_\"+diagram[j]._id).text(diagram[j].end_time - diagram[j].start_time);\n }\n}", "function minTime(machines, goal) {\n let fastest = Number.MAX_VALUE; // máquina más rápida\n let slowest = 0; // máquina más lenta\n const n = machines.length;\n /*\n mapa de maquinas en forma {\"dias por unidad\" : cantidad de maquinas} sirve para reducir \n iteraciones en el cáculo de la producción de unidades \n */\n const daysMachines = new Map();\n\n machines.forEach(days => {\n daysMachines.set(days, daysMachines.get(days) ? daysMachines.get(days) + 1 : 1)\n \n //busqueda de las máquinas más rapida y más lenta\n if(days < fastest){\n fastest = days;\n }\n\n if(days > slowest){\n slowest = days;\n }\n });\n // calculo de límites del rango de días de búsqueda\n let lower = Math.ceil(goal * fastest/n); // rango inferior, suponiendo n máquinas igual a la más rápida\n let upper = Math.ceil(goal * slowest/n); // rango inferior, suponiendo n máquinas igual a la más lenta\n\n while(upper - lower > 1){\n\n let mid = Math.floor(lower + (upper - lower) / 2);\n\n const numUnits = numberOfUnits(daysMachines, mid);\n\n\n if(numUnits < goal){ //solo si numUnits es estrictamente inferior a la meta, se busca en subrango de días mayores\n lower = mid;\n } else {\n upper = mid;\n }\n }\n\n return upper; // se devuelve el ceiling del rango, ya que lower arroja una canitdad de unidades menores a la meta\n}", "calculate() {\n if (this.store.length == 0) return 0;\n let intervals = [];\n let total = 0;\n for (var i = 1; i < this.store.length; i++) {\n let interval = this.store[i] - this.store[i - 1];\n if (isNaN(interval)) debugger;\n intervals.push(interval);\n total += interval;\n }\n\n if (this.store[0] < performance.now() - 5000) {\n // Haven't received any pulses for a while, reset\n this.store = [];\n return 0;\n }\n if (total == 0) return 0;\n return total / (this.store.length - 1);\n }", "function calculateTimeFraction() {\n const rawTimeFraction = timeLeft / TIME_LIMIT;\n return rawTimeFraction - (1 / TIME_LIMIT) * (1 - rawTimeFraction);\n }", "static get THREAD_STEP_INTERVAL () {\n return 1000 / 60;\n }" ]
[ "0.6467856", "0.60338944", "0.5960126", "0.5890192", "0.58631605", "0.5702654", "0.5692202", "0.5681206", "0.5675939", "0.56543803", "0.565272", "0.55481726", "0.55466646", "0.5520459", "0.5510194", "0.54867524", "0.5478566", "0.5470181", "0.5461966", "0.5461962", "0.5457977", "0.5457977", "0.5457977", "0.54422706", "0.54381543", "0.5426584", "0.54225785", "0.5415325", "0.539618", "0.53729224", "0.5358326", "0.5346372", "0.5331583", "0.5317434", "0.53145546", "0.5305286", "0.5294892", "0.5294892", "0.52882254", "0.5282691", "0.52789", "0.52745557", "0.5269241", "0.52566457", "0.5250446", "0.52488875", "0.52487713", "0.5246812", "0.5233485", "0.5232975", "0.52183735", "0.5217839", "0.5217476", "0.51930195", "0.5184892", "0.5182295", "0.5179771", "0.5175307", "0.51748055", "0.51715463", "0.51711047", "0.51627946", "0.5162139", "0.51514876", "0.5147757", "0.5145358", "0.5145262", "0.51450515", "0.51381785", "0.51251477", "0.512213", "0.5109824", "0.5104748", "0.51029426", "0.5098716", "0.50973874", "0.50919336", "0.5085323", "0.5084495", "0.5082317", "0.5079846", "0.50790817", "0.50739294", "0.50702345", "0.50702345", "0.50702345", "0.50702345", "0.50702345", "0.50702345", "0.50702345", "0.50702345", "0.5068854", "0.5065437", "0.50599885", "0.5054205", "0.50499517", "0.5049494", "0.5046822", "0.50466406", "0.5042508", "0.50394917" ]
0.0
-1
Get the Api key from tinypng.com See
function getKey(arr){ keyIndex = Math.floor(Math.random()*arr.length); console.log(arr[keyIndex]); return arr[keyIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAPIKey(){\n\n}", "function returnAPIKey(){\r\n\treturn \"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\";\r\n}", "function getAPIKey(){\n\treturn $('#api-key-input').val();\n}", "function getAPIKey() {\n return ss.getRange(API_KEY).getValue();\n}", "async function GetAPI() {\n const req = await fetch('/api');\n let data = await req.json();\n apiKey = data.key;\n console.log(apiKey)\n return apiKey;\n }", "function getAPIKeyRequest() {\n console.log(\"MarvelAPIURL \", marvelApiURL().marvelApiKey);\n return $.ajax ({\n url: marvelApiURL().marvelApiKey,\n method: \"GET\"\n }).done((marvelData) => {\n return marvelData;\n });\n}", "function getMapBoxAPIKey() {\n \n var mapboxAPIKey = \"\";\n\n mapboxAPIKey = C_MAPBOX_API_KEY;\n \n // Later = Replace API key fetch from DB \n // mapboxAPIKey = d3.request(apiUrlMapboxKey).get({retrun});\n\n return mapboxAPIKey;\n\n}", "static getApiKey(apiKey) {\n return apiKey;\n }", "static getApiKey(apiKey) {\n return apiKey;\n }", "getApiKey() {\n return `get${this.apiKey}List`\n }", "get key2() {\n return this.apiKey();\n }", "static apiKey(key) {\n return new Credentials('api-key', 'api-key', { key });\n }", "function getNewApikey() {\n var newApikey = \"\";\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 16; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function checkApiKey(){\n cc('checkApiKey','run');\n var apiKey = localStorage.getItem( 'apiKey');\n if (isItemNullorUndefined(apiKey,true)) {\n cc('No apiKey is set so check URL for parameter','warning');\n var this_page_apiKey = urlParams['apiKey'];\n if (isItemNullorUndefined(this_page_apiKey,true)) {\n cc('No apiKey is found in the URL. Queries will not find data.','fatal');\n }else{\n setApiKey(this_page_apiKey);\n apiKey = this_page_apiKey; \n }\n }\n return apiKey;\n}", "get apiKey() {\n return this.config.apiKey;\n }", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function initAPIKeys() {\n $.ajax({\n 'url':'/flickrKey',\n 'dataType':'text'\n }).done(function(data){\n flickrKey = data;\n });\n}", "async function key() {\n return await $.ajax({\n url: domain + \"/peer/key\",\n method: \"GET\",\n });\n }", "get accessTokenKey() {\n return this.API\n ? `Vssue.${this.API.platform.name.toLowerCase()}.access_token`\n : '';\n }", "function getSignature()\n{\n var timeStamp = Math.floor((new Date()).getTime()/1000);\n return (md5(api_key+shared_secret+timeStamp));\n}", "getRequestToken() {\n return apiClient.get(\n '/authentication/token/new?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3'\n )\n }", "function getRandomKey() {\n return apiKeyBank[Math.floor(Math.random() * apiKeyBank.length)];\n}", "static GetVKInfo() {\n connect.send(\"VKWebAppGetUserInfo\", {});\n }", "function ApiKey() {\n _classCallCheck(this, ApiKey);\n\n ApiKey.initialize(this);\n }", "getDeveloperKey() {\n return this._prefs.get('developer-key');\n }", "function getApiKey() {\n let key = document.getElementById(\"apikey\").value;\n if(key == \"\") {\n window.alert(\"Set your API key.\");\n console.log(\"API key hasn't been set yet.\");\n return \"\";\n }\n return key;\n}", "get_url() {\n this._authentication.state = crypto.randomBytes(6).toString('hex');\n // Replace 'api' from the api_url to get the top level trakt domain\n const base_url = this._settings.endpoint.replace(/api\\W/, '');\n return `${base_url}/oauth/authorize?response_type=code&client_id=${this._settings.client_id}&redirect_uri=${this._settings.redirect_uri}&state=${this._authentication.state}`;\n }", "function getapi(){\n\tif (window.location.protocol != \"https:\"){\n\t\treturn \"http://wev.se/etc/api\";\n\t} else{\n\t\treturn \"https://wev.se/etc/api\";\n\t}\n}", "publicKeyParam(){\n return `api_key=${this.publicKey}`\n }", "generateApiKey(values, cb) {\n \tvar apiKey = idGen.generateApiKey();\n \tvalues['apikey'] = apiKey;\n \tcb();\n }", "function gatherStorage(result) { \r\n API_KEY = result.api_key; //Save in memory\r\n}", "weatherAPI(){\n return this.apiKeyGC;\n }", "constructor(){\n\t\tthis.params = new URLSearchParams();\n\t\tthis.params.append('apikey', '47f218b0-b5d5-11e8-8c0c-03e1b17d6f1e');\n\t\tthis.params.append('size', 100);\n\t}", "function generalKey() {\n return 'GKEY1234567890';\n}", "function getAPI() {\n\treturn \"http://\" + apiUrl + \":\" + apiPort + \"/\" + apiResource;\n}", "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "setApiKey() {\n\n }", "function hashAPIKey(apiKey) {\n const { createHash } = require('crypto');\n \n const hashedAPIKey = createHash('sha256').update(apiKey).digest('hex');\n \n return hashedAPIKey;\n }", "async getLocalApiKey() {\n const machine_guid_location = '/var/lib/netdata/registry/netdata.public.unique.id';\n const machine_guid = await readFile(machine_guid_location, 'utf8');\n log.info(`NetData receiver is identified by: ${machine_guid}`)\n return machine_guid; \n }", "function get_key(NpolarApiSecurity,path) {\n let system = NpolarApiSecurity.getSystem('read', path);\n console.log(system.key);\n if (system.key) {\n return system.key;\n }\n}", "function getApiToken() {\n\n if (!apiToken) {\n console.log(\"Fetching Youtube API token...\");\n $http.get('/api/googlekey/', {})\n .success(function(data) {\n if (data.length === 0) {\n $log.error(\"No key was found.\");\n apiToken = null;\n return;\n }\n apiToken = null;\n apiToken = data.googleApiKey;\n })\n .error(function(error) {\n $log.error('Error retrieving google api key: ' + JSON.stringify(error));\n });\n } else {\n return apiToken;\n }\n\n }", "static get apiEndpoint() {\n return 'secretmanager.googleapis.com';\n }", "createAPIKey(callback) {\n crn\n .createAPIKey()\n .then(res => {\n let key = res && res.body ? res.body.key : null\n return callback(null, key)\n })\n .catch(err => {\n return callback(err, null)\n })\n }", "async function get_api_info () {\n const { username, password } = await get_options();\n\n // Base64-encoded user:pass for HTTP auth\n const credentials = window.btoa(`${username}:${password}`);\n\n const headers = new Headers();\n headers.append(\"Authorization\", `Basic ${credentials}`);\n\n return {\n headers, // HTTP auth headers\n credentials: 'include' // Send cookies with request\n }\n}", "function generateApiKey() {\n deploymentsService.generateApiKey(vm.deployment).then(function (data) {\n if (!data.hasOwnProperty('apiKey')) {\n alertsService.pushAlert('Could not generate API key.', 'warning');\n return false;\n }\n var webhookUrl = location.protocol+'//'+location.hostname;\n webhookUrl += '/api.php?ak='+data.apiKey+'&ap='+data.apiPassword;\n vm.apiUrl = webhookUrl;\n }, function (reason) {\n alertsService.pushAlert(reason, 'warning');\n });\n }", "function makeURL(domain, userApiKey) {\r\n var base = \"https://api.shodan.io/shodan/host/search?key=\";\r\n var url = base + userApiKey + '&query=hostname:' + domain;\r\n console.log(url);\r\n return url;\r\n}", "function getApiKeys() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/GetApiKeys' + cacheBuster });\n }", "keySet() {\n return fetch(\"http://localhost:3003/keys/0\")\n .then(res => res.json())\n .then(res => {return res.key})\n }", "async ldGetKey({id}) {\n const self = this;\n // get scheme from public key ID (URL)\n let scheme = url.parse(id).protocol || ':';\n scheme = scheme.substr(0, scheme.length - 1);\n // dereference URL if supported\n if(self.dereferenceUrlScheme[scheme]) {\n if(scheme === 'did') {\n return self.getDidPublicKey(id);\n }\n if(scheme === 'https') {\n return self.getHttpsPublicKey(id);\n }\n }\n throw new HttpSignatureError(\n `URL scheme '${scheme}' is not supported.`, 'NotSupportedError');\n }", "get apiUrl() {\n return `http://${this.host}:${this.tempApiPort}/api`; // setups up the url that the api is located at and used as a shortcut for our fetch api scripts to retrieve data\n }", "getApiKey() {\n let apiKey;\n if(this.props.config.app && this.props.config.app.apiKey) {\n apiKey = this.props.config.app.apiKey\n }\n return this.props.apiKey || apiKey;\n }", "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "function getTokenUrl($key) {\n\t\tlet url = 'https://api.checkout.com/tokens'\n\n\t\tif($key.includes('_test_')){\n\t\t\turl = 'https://api.sandbox.checkout.com/tokens'\n\t\t}\n\n\t\treturn url;\n\t}", "function createApiKey () {\n return jwt.sign({user: 'API', admin: 0}, process.env.JWT_STRING);\n}", "function generateApiKey(userid, createTime) {\n var body = userid + createTime.toString();\n var crypted = crypto.createHash('sha256').update(body).digest(\"hex\");\n\n console.log(\"----------- ApiKey ---------------\");\n console.log(crypted);\n return crypted;\n}", "function getToken(){\n var enc_key = ENC_KEY\n var USERNAME = \"omarsow\"\n var APIKEY = API_KEY\n var timestr = Utilities.formatDate(new Date(), \"GMT\", \"yyyy-MM-dd HH:mm:ss\").replace(\" \",\"T\") + \"Z\"\n var raw = \"Username=\"+USERNAME+\"&ApiKey=\"+APIKEY+\"&GenDT=\"+timestr+\"&\"\n Logger.log(raw)\n //use Cipher-Block Chaining (CBC) to encrypt\n Logger.log(sjcl.encrypt(enc_key,raw))\n}", "function checkApiKey(){\n var apiKey_from_storage = localStorage.getItem( 'apiKey');\n console.log('function - get apiKey from STORAGE: '+apiKey_from_storage);\n return apiKey_from_storage;\n}", "function getGiphyApi() {\n var apiUrl = 'https://api.giphy.com/v1/gifs/trending?api_key=HvaacROi9w5oQCDYHSIk42eiDSIXH3FN'\n fetch(apiUrl).then(function (data) {\n console.log(data);\n })\n}", "function LoadAPIKeyFromConfigStrategy () {\n}", "static get API_URL() {\n const port = 1337; // Change this to your server port\n return `http://localhost:${port}`;\n }", "static get API_BASE_URL() {\n return 'https://andrew-wanex.com/mundusvestro_v1.0.0/weather';\n }", "function tinyPng(settings) {\n var ENDPOINT = 'https://api.tinify.com/shrink';\n\n /**\n * Gets the API sepcific request options\n *\n * @return object\n */\n function getRequestOptions() {\n var requestOptions = url.parse(ENDPOINT);\n requestOptions.auth = 'api:' + settings.key;\n requestOptions.method = 'POST';\n\n return requestOptions;\n }\n\n /**\n * [apiSuccess description]\n *\n * @param object res\n *\n * @return boolean\n */\n function apiSuccess(res) {\n return res.statusCode === 201;\n }\n\n /**\n * Gets file information from a file path and applies callback\n *\n * @param string file\n * @param function callback\n *\n * @return function\n */\n function getFileInfo(file, callback) {\n return callback({\n readable: fs.createReadStream(file),\n paths: {\n input: file,\n output: file\n }\n });\n }\n\n /**\n * Calls the Tiny PNG API\n *\n * @param object fileInfo\n * @param function callback\n *\n * @return object\n */\n function callApi(fileInfo, callback) {\n return https.request(getRequestOptions(), function(res) {\n var json = '';\n\n // Return an error\n if (! apiSuccess(res)) {\n return callback('An API error (' + res.statusCode + ') occured whilst processing file ' + path.basename(fileInfo.paths.input));\n }\n\n res.setEncoding('utf8');\n\n // Get JSON chunks\n res.on('data', function (chunk) {\n json += chunk;\n });\n\n // Resolve JSON response and process\n res.on('end', function() {\n var data = JSON.parse(json);\n\n data.input.filename = path.basename(fileInfo.paths.input);\n data.output.filename = path.basename(fileInfo.paths.output);\n\n // Get contents of file (set in response location header)\n https.get(res.headers.location, function(res) {\n // Setup writable stream\n var output = fs.createWriteStream(fileInfo.paths.output);\n\n // Pipe file data to writable stream\n res.pipe(output);\n\n // apply callback on stream write\n callback(null, data);\n });\n });\n });\n }\n\n /**\n * Grabs a file by it's path and pipes it to the API\n *\n * @param string file\n * @param function callback\n *\n * @return function\n */\n function compress(file, callback) {\n // Pipe file contents to API\n return getFileInfo(file, function(fileInfo) {\n fileInfo.readable.pipe(\n callApi(fileInfo, callback)\n );\n });\n }\n\n // Publicly returned API\n return {\n compress: compress\n }\n}", "function Authenticate(){\n var speakeasy = require('speakeasy');\n var key = speakeasy.generateSeceret();\n}", "get apiHostname() {\n return url.format({\n protocol: this.apiProtocol,\n host: this.apiHost\n });\n }", "static get DEFAULT_API_BASE_URL() { return 'https://api.todobot.io'; }", "get externalKey() {\n return this._externalKey;\n }", "addonLinkersLinkerKeyGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.AddonApi(); // String |\n /*let linkerKey = \"linkerKey_example\";*/ apiInstance.addonLinkersLinkerKeyGet(\n incomingOptions.linkerKey,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "async function getStripekey() {\n const { data } = await axios.get(\"/api/v1/stripeapi\");\n setStripeApikey(data.stripeApiKey);\n }", "get api() {\n\t\treturn this.tool.twitchapi\n\t}", "function pop_key() {\r\n document.getElementById('apikey').value = '06e944b3ddabd9087281af55d6f9b5b36f536cc5';\r\n}", "function getURL(zipCode){\n return 'http://api.openweathermap.org/data/2.5/weather?zip='+zipCode+'&appid='+apiKey;\n}", "function _buildApiUrl (datasetname, configkey) {\n\t\tlet url = API_BASE;\n\t\turl += '?key=' + API_KEY;\n\t\turl += datasetname && datasetname !== null ? '&dataset=' + datasetname : '';\n\t\turl += configkey && configkey !== null ? '&configkey=' + configkey : '';\n\t\t//console.log('buildApiUrl: url=' + url);\n\t\t\n\t\treturn url;\n\t}", "async function generateSecretAndQR() {\n\t//Generate a secret key that will need to be inputted to Google Authenticator\n\tvar secret = speakeasy.generateSecret({\n\t\tlength: KEYLENGTH,\n\t\tname: \"Team-Complex\",\n\t});\n\n\tvar data_url = await QRcode.toDataURL(secret.otpauth_url);\n\n\treturn {\n\t\t//\"secret\": secret.base32,\n\t\tsecret: secret.base32,\n\t\tQRcode: data_url,\n\t};\n}", "function helper(url) {\n var url = \"https://rsd05guo67.execute-api.us-east-2.amazonaws.com/default/beerstore\";\n getJSONAsync(url);\n}", "function getApiInfo () {\n fetch('https://randomuser.me/api/')\n .then( res => res.json() )\n .then( data => fillInInfo(data))\n}", "fetch () {\n return Api().get('signatures/');\n }", "function make_key() {\n return Math.random().toString(36).substring(2,8);\n }", "function apiBuilder(endpoint, params) {\n var url = 'https://api.stackexchange.com/2.2/',\n urlPath = url + endpoint;\n params.key ='Kdg9mxpgwALz)u5ubehUFw((';\n if (params !== undefined) {\n var query = [];\n for(var prop in params) {\n if (params.hasOwnProperty(prop)) {\n query.push( prop + '=' + encodeURI(params[prop]));\n }\n }\n urlPath = urlPath + '?' + query.join('&');\n }\n return urlPath;\n }", "function getAuthHeader() {\n\tvar key = process.env.API_KEY,\n\tpass = process.env.API_PASS\n\t// Base 64 encode as required by MySportsFeed\n\tencrypted_creds = Buffer.from(key + ':' + pass).toString('base64');\n\n\treturn {'Authorization': 'Basic ' + encrypted_creds};\n}", "getDiscoveryKey() {\n return super.getAsString(\"discovery_key\");\n }", "async getApiKey({ token }) {\n const [apiKey] = await this.mongoDB.getAll(this.collection, { token }); //busca en la coleccion el token y si lo encuentra lo devuelve el apikeytoken\n return apiKey;\n }", "function makeAuth(type) {\n return type === 'basic'\n ? 'Basic ' + btoa(appKey + ':' + appSecret)\n : 'Kinvey ' + localStorage.getItem('authtoken');\n }", "function pixabayGetter ( tag, callback ) {\n var key = process.env.PIXABAY;\n var url = 'https://pixabay.com/api/?key=' + key + '&q=' + tag + '&image_type=photo';\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.status === 200 && xhr.readyState === 4) {\n var randomImage = imgURLGetter(xhr.responseText);\n callback(randomImage);\n }\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function apiUrl(idclient,secretclient,cor,ti)\n{\nvar apiUrl ='https://api.foursquare.com/v2/venues/search?ll=' + cor.lat + ',' + cor.lng + \n '&client_id=' + idclient +'&client_secret=' + secretclient + '&query=' + ti +\n '&v=20170708' + '&m=foursquare';\nreturn apiUrl.toString();\n}", "function getClientKeyAndSecret(serverEndpoint, username, password) {\n var data = { \"applicationName\":\"WebOSApp\", \"tags\":[\"device_management\"]};\n\n var userCredentials = username + \":\" + password;\n var userCredentialsBase64 = btoa(userCredentials);\n\n $.ajax({\n type: \"POST\",\n url: serverEndpoint + \"/api-application-registration/register\",\n data: JSON.stringify(data),\n headers: {\n 'Authorization': 'Basic ' + userCredentialsBase64,\n 'Content-Type': 'application/json'\n },\n success: function (resp) {\n var obj = JSON.parse(resp);\n\n retrieveAccessToken(serverEndpoint, username, password, obj[\"client_id\"], obj[\"client_secret\"]);\n },\n error: function () {\n $(\"#message-board\").text(\"Failed to get client ID and secret\");\n }\n });\n }", "function UntappdApi() {\n\tvar baseUrl = 'https://api.untappd.com/v4/';\n\tvar accessToken = 'A3DF816D42AA28B509413D4903139E8650A2B5C4';\n\t//var clientId = '5F0863FC89478BD8806475EF88AADED10917AFAC';\n\t//var clientSecret = 'B28EA9A1FC17D06C412ADA070E1FABADC83E7EC6';\n\tvar localCheckin = 'thepub/local?';\n\tvar beerInfo = 'beer/info/';\n\t\n\tvar getPubsUri = function(lat, lng) {\n\t\tif (lat && lng) {\n\t\t\treturn (baseUrl + localCheckin + 'access_token=' + accessToken + '&lat=' + lat + '&lng=' + lng);\n\t\t} else {\n\t\t\tthrow (new Error('lat or lng is missing.'));\n\t\t}\n\t};\n\t\n\tvar getBeerInfoUri = function(beerId) {\n\t\tif (beerId) {\n\t\t\treturn (baseUrl + beerInfo + parseInt(beerId) + '?access_token=' + accessToken);\n\t\t}\n\t};\n\t\n\treturn {\n\t\tgetPubsUri: getPubsUri,\n\t\tgetBeerInfoUri: getBeerInfoUri\n\t};\n}", "function requestKey(url, callback)\n{\n\tvar request = new XMLHttpRequest();\n\trequest.open(\"GET\", url, true);\n\trequest.onreadystatechange = function () {\n\t\tif (this.readyState == 4)\n\t\t{\n\t\t\tif (this.status == 200)\n\t\t\t{\n\t\t\t\treturn callback(this.responseText);\n\t\t\t}\n\t\t}\n\t}\n\trequest.send();\n}", "createRequestUrl(actionFlag, searchTerm) {\n let url = \"https://keybase.io/_/api/1.0/user/\";\n\n if (actionFlag === EnigmailConstants.UPLOAD_KEY) {\n // not supported\n throw Components.Exception(\"\", Cr.NS_ERROR_FAILURE);\n } else if (\n actionFlag === EnigmailConstants.DOWNLOAD_KEY ||\n actionFlag === EnigmailConstants.DOWNLOAD_KEY_NO_IMPORT\n ) {\n if (searchTerm.indexOf(\"0x\") === 0) {\n searchTerm = searchTerm.substr(0, 40);\n }\n url +=\n \"lookup.json?key_fingerprint=\" +\n escape(searchTerm) +\n \"&fields=public_keys\";\n } else if (actionFlag === EnigmailConstants.SEARCH_KEY) {\n url += \"autocomplete.json?q=\" + escape(searchTerm);\n }\n\n return {\n url,\n method: \"GET\",\n };\n }", "function getCurrentWeatherURL(lat, lon) {\n return 'https://api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + lon + '&appid=YOUR_API_KEY';\n}", "async createApiKey (request) {\n const expiresIn = request.input.args.expiresIn || -1;\n const refresh = this.getRefresh(request, 'wait_for');\n const apiKeyId = this.getId(request, ifMissingEnum.IGNORE);\n const description = this.getBodyString(request, 'description');\n\n const user = request.context.user;\n const connectionId = request.context.connection.id;\n\n const apiKey = await ApiKey.create(\n user,\n connectionId,\n expiresIn,\n description,\n { apiKeyId, creatorId: user._id, refresh });\n\n return apiKey.serialize({ includeToken: true });\n }", "async restApiToken () {\n return indy.restApiToken(this)\n }", "function getIssue(key){\n genericRequest(\"https://yexttest.atlassian.net/rest/api/2/issue/\"+key+\"/\")\n}", "function getUserSecretKey() {\n return localStorage.getItem('userSecretKey');\n}", "function createWeatherURL() {\n weatherURL = \"https://api.openweathermap.org/data/2.5/forecast?q=davis,ca,us&units=imperial&appid=\" + APIKey;\n}", "getUrl({ base, quote }) {\n return `https://www.bitstamp.net/api/v2/ticker/${base}${quote}`.toLowerCase();\n }", "function alt_xapi()\n{\n\n\tconsole.log(\"????????????????????????????????????????\")\n\tconsole.log(\"Alt_image_id: \" + Alt_image_id)\n\tconsole.log(\"????????????????????????????????????????\")\n\n\nvar alttagStatement = {\n \"type\": \"alttag\",\n \"verb\": \"viewed\",\n \"module\": bCurrentMod + 1,\n \"lesson\": bCurrentLsn + 1,\n //\"page\": bCurrentPag + 1,\n\t\t\t\t\"page\": np_num,\n \"activity\": \"http://id.tincanapi.com/activitytype/resource\",\n \"objectID\":Alt_image_id, //some sort of generated id\n\n};\n\t\n\tif(typeof isXAPI !== \"undefined\"){\n\n\t\tLRSSend(alttagStatement);\n\n\t}\t\n\t\n}", "function getKey() {\r\n\treturn (window.location.search.substr(1).split(\"=\")[1]);\r\n}", "function getKey() {\r\n\treturn (window.location.search.substr(1).split(\"=\")[1]);\r\n}", "async function getApiHost(run) {\n const {stdout: apihost} = await run.command(`nim auth current --apihost`)\n return apihost.replace(/^(https:\\/\\/)/, '')\n}" ]
[ "0.736854", "0.68941015", "0.64681", "0.6440716", "0.6202085", "0.6140758", "0.60869175", "0.60404205", "0.60404205", "0.59931517", "0.5981127", "0.59727716", "0.58256686", "0.5800005", "0.5774258", "0.5770642", "0.5770642", "0.57602453", "0.57327396", "0.56934637", "0.56910735", "0.56603026", "0.565952", "0.56594086", "0.5624279", "0.56238014", "0.55940807", "0.55903447", "0.5546184", "0.551259", "0.5486589", "0.5486545", "0.5467006", "0.54619837", "0.54536206", "0.5443472", "0.54419255", "0.5441667", "0.54376465", "0.54244006", "0.5419994", "0.5411559", "0.54111534", "0.54042554", "0.53968376", "0.53953654", "0.5388453", "0.5381553", "0.53794515", "0.5371226", "0.53706896", "0.53662753", "0.53592086", "0.5356971", "0.5355235", "0.53421336", "0.533774", "0.5332068", "0.5322466", "0.5320089", "0.5311223", "0.53072923", "0.53026617", "0.5291583", "0.5274993", "0.5269676", "0.5264501", "0.5259018", "0.5256426", "0.525474", "0.52479345", "0.5241362", "0.52339965", "0.5233772", "0.5232394", "0.52161264", "0.5214898", "0.5201938", "0.5201055", "0.5194902", "0.5179809", "0.51772356", "0.5176221", "0.5173942", "0.5173663", "0.51613885", "0.51482904", "0.51479435", "0.5125327", "0.51232904", "0.51204115", "0.510846", "0.5104878", "0.51036185", "0.51001596", "0.5094681", "0.5088703", "0.508233", "0.50720245", "0.50720245", "0.50712985" ]
0.0
-1
Romove the useless api key from key file and draw a new key from it
function removeBadKey(keyIndex){ keyJson[keyIndex + 1].expire = "true"; fs.writeFile("key.json",JSON.stringify(keyJson)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewApikey() {\n var newApikey = \"\";\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 16; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\n let newApikey = \"\";\n let alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 32; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNextSignKey() {\n schedule = Buffer.from(fs.readFileSync(constant.SECRET_KEYPATH + 'sk_schedule')).toString();\n\n // if there are keys left in the keyschedule\n if (schedule != \"\") {\n schedule = schedule.split('\\n');\n new_line = schedule[0].split(',');\n\n from = new Date(new_line[0]);\n to = new Date(new_line[1]);\n\n next_key = new_line[2];\n\n // delete current key from key schedule\n exec(\"sed -i '/\" + next_key.split('\\/').join('\\\\\\/') + \"/d' \" + constant.SECRET_KEYPATH + 'sk_schedule', (err, stdout, stderr) => {\n if (err) {\n console.log(stderr);\n }\n })\n\n fs.writeFileSync(constant.SECRET_KEYPATH + 'sign_key', next_key);\n SIGNING_KEY = str2buf(next_key, 'base64');\n\n console.log(\"[***] NEW SIGNING KEY: \", Buffer.from(SIGNING_KEY).toString('base64'));\n\n } else {\n console.log(\"[***] No keys in the key schedule. Keep old PUBLIC KEY!\");\n }\n \n}", "function getRandomKey() {\n return apiKeyBank[Math.floor(Math.random() * apiKeyBank.length)];\n}", "function returnAPIKey(){\r\n\treturn \"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\";\r\n}", "function revocationKey() {\n return [...Array(10)].map(() => Math.random().toString(36)[2]).join('');\n}", "function getAPIKey(){\n\n}", "function LoadAPIKeyFromConfigStrategy () {\n}", "function make_key() {\n return Math.random().toString(36).substring(2,8);\n }", "function newKey() {\n return new Promise(function(resolve) {\n Minima.cmd('keys new', function(res) {\n if (res.status) {\n let key = res.response.key.publickey;\n resolve(key); \n }\n })\n });\n}", "async function useKey() {\n await cryptoWaitReady();\n const { keyType, keySuri } = program.opts();\n const keyring = new Keyring({ type: keyType });\n const pair = keyring.addFromUri(keySuri);\n return { keyring, pair };\n}", "function loadOrCreateKey() {\n try {\n let storedKey = JSON.parse(fs.readFileSync(KEYFILE));\n return listKeys()\n .then(keys => {\n if (!keys.some(key => key.KeyName === storedKey.KeyName)) {\n fs.unlinkSync(KEYFILE);\n return loadOrCreateKey();\n }\n return storedKey;\n });\n } catch (e) {\n let key;\n return createKey()\n .then(data => {\n key = data;\n return fs.writeFileSync(KEYFILE, JSON.stringify(key), { flags: 'w+' });\n })\n .then(() => fs.unlinkSync(PEMFILE))\n .catch(err => {\n if (err.code !== 'ENOENT') {\n throw(err);\n }\n })\n .then(() => fs.writeFileSync(PEMFILE, key.KeyMaterial, { mode: '400' }))\n .then(() => loadOrCreateKey());\n }\n}", "function generateApiKey(userid, createTime) {\n var body = userid + createTime.toString();\n var crypted = crypto.createHash('sha256').update(body).digest(\"hex\");\n\n console.log(\"----------- ApiKey ---------------\");\n console.log(crypted);\n return crypted;\n}", "static apiKey(key) {\n return new Credentials('api-key', 'api-key', { key });\n }", "function pop_key() {\r\n document.getElementById('apikey').value = '06e944b3ddabd9087281af55d6f9b5b36f536cc5';\r\n}", "function loadKey( root ) {\n\tvar fileText;\n\tvar filePath = root + \"key.json\" ;\n\tif ( typeof Ti !== \"undefined\" ) {\n\t\tfileText = Ti.Filesystem.getFile(filePath).read().text;\n\t} else {\n\t\tfileText = require('fs').readFileSync(filePath, 'utf8' );\n\t}\n\tvar key = CircularJSON.parse( fileText );\n\tkey.url = root;\n\n\tvar rehydrated = rehydrateKey( key );\n\trehydrateSpeedBug( key );\n\n\treturn rehydrated;\n}", "newKey(_sesKey) {\n const shaKey = sha256.hex(_sesKey + this.shaKey);\n this.oldKey = _sesKey;\n this.reqNum++;\n this.sesKey = this.reqNum + ':2:' + shaKey;\n this.shaKey = shaKey;\n }", "async function generateNewKeyPair() {\n const keypair = await Promise.resolve(crypto.subtle.generateKey({\n ...ADB_WEB_CRYPTO_ALGORITHM,\n modulusLength: MODULUS_SIZE_BITS,\n publicExponent: PUBLIC_EXPONENT,\n },\n ADB_WEB_CRYPTO_EXPORTABLE, ADB_WEB_CRYPTO_OPERATIONS));\n const jwk = await Promise.resolve(crypto.subtle.exportKey('jwk', keypair.publicKey));\n\n const jsbnKey = new RSAKey();\n jsbnKey.setPublic(decodeWebBase64ToHex(jwk.n), decodeWebBase64ToHex(jwk.e));\n\n const bytes = encodeAndroidPublicKeyBytes(jsbnKey);\n const userInfo = 'unknown@web-hv';\n\n const fullKey = await Promise.resolve(crypto.subtle.exportKey(\"jwk\", keypair.privateKey));\n fullKey.publicKey = btoa(String.fromCharCode.apply(null, bytes)) + ' ' + userInfo;\n\n localStorage.cryptoKey = JSON.stringify(fullKey);\n return localStorage.cryptoKey;\n }", "function restore_wif_key()\n{\n // TODO: only be able to do this dependent on state\n\n // TODO: catch invalid strings here\n set_funding_key(bitcore.PrivateKey.fromWIF(jQuery('#restore_key').value));\n create_uri();\n}", "static makePrivateKey(){\n let key = \"\";\n let limit = 14;\n while(var x=0;x<limit;x++){\n if(x==4 || x==9){\n key += \"-\";\n }\n else{\n var number = Math.random()*10;\n number = Math.floor(number);\n key += number;\n }\n }\n return key;\n }", "function loadKey() {\n var devkey = \"\";\n\n try {\n var localSettings = Windows.Storage.ApplicationData.current.localSettings;\n devkey = localSettings.values[\"devkey\"];\n if (devkey === undefined) {\n devkey = \"\";\n }\n }\n catch (err) {\n devkey = \"\";\n }\n if (devkey.length > 12) {\n document.getElementById(\"devkey\").value = devkey;\n toggleControls(true);\n } else {\n toggleControls(false);\n }\n }", "function random() {\r\n let key = ec.genKeyPair()\r\n let privateKey = key.getPrivate()\r\n //key.getPrivate() returns a BN object so we need to convert to string so we can store in DB\r\n let StringPrivateKey = \"\" + privateKey + \"\"\r\n document.getElementById(\"privateKey\").value = privateKey\r\n document.getElementById(\"publicKey\").value = key.getPublic('hex')\r\n saveKeyInDB(1,StringPrivateKey,key.getPublic('hex'))\r\n }", "function generateKey() { return 10*Math.random();}", "function generateAKey() {\n // Create a random key and put its hex encoded version\n // into the 'aes-key' input box for future use.\n\n window.crypto.subtle.generateKey(\n {name: \"AES-CBC\", length: 128}, // Algorithm using this key\n true, // Allow it to be exported\n [\"encrypt\", \"decrypt\"] // Can use for these purposes\n ).\n then(function(aesKey) {\n window.crypto.subtle.exportKey('raw', aesKey).\n then(function(aesKeyBuffer) {\n document.getElementById(\"aes-key\").value = arrayBufferToHexString(aesKeyBuffer);\n }).\n catch(function(err) {\n alert(\"Key export failed: \" + err.message);\n });\n }).\n catch(function(err) {\n alert(\"Key generation failed: \" + err.message);\n });\n }", "checkNextGeneratedKey() {\n if (!this.state.wallet) return;\n if (!aes_private) return; // locked\n\n if (!this.state.wallet.encrypted_brainkey) return; // no brainkey\n\n if (this.chainstore_account_ids_by_key === bitsharesjs__WEBPACK_IMPORTED_MODULE_11__.ChainStore.account_ids_by_key) return; // no change\n\n this.chainstore_account_ids_by_key = bitsharesjs__WEBPACK_IMPORTED_MODULE_11__.ChainStore.account_ids_by_key; // Helps to ensure we are looking at an un-used key\n\n try {\n this.generateNextKey(false\n /*save*/\n );\n } catch (e) {\n console.error(e);\n }\n }", "generateApiKey(values, cb) {\n \tvar apiKey = idGen.generateApiKey();\n \tvalues['apikey'] = apiKey;\n \tcb();\n }", "function makeKey () {\n var r = Math.floor(Math.random() * options.num)\n , k = keyTmpl + r\n return k.substr(k.length - 16)\n}", "createAPIKey(callback) {\n crn\n .createAPIKey()\n .then(res => {\n let key = res && res.body ? res.body.key : null\n return callback(null, key)\n })\n .catch(err => {\n return callback(err, null)\n })\n }", "function resetKeyFile(){\n startTime = new Date();\n var month = startTime.getMonth() + 1;\n var year = startTime.getFullYear();\n var date = startTime.getDate();\n if((month > keyInfo.updateMonth || year > keyInfo.updateYear) && date >1 ){\n console.log(\"yes\");\n keyJson[0].updateYear = year;\n keyJson[0].updateMonth = month;\n for(var i = 1; i<keyJson.length; i++){\n keyJson[i].expire = \"false\";\n }\n fs.writeFile(\"key.json\",JSON.stringify(keyJson));\n }\n\n }", "setApiKey() {\n\n }", "function retreiveSecretKeyBySaveas(skC) {\n downloadFile(skC, 'UniVoteKey.txt');\n}", "inputKey(key) {\n if (CHIP8.KH > 0x0) {\n CHIP8.r.V[CHIP8.KH - 1] = key;\n CHIP8.KH = 0x0;\n }\n \n CHIP8.KEYS[key] = 0x1;\n }", "function regenerateApiKey(apiKey) {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({\n method: 'POST',\n url: urlBase + '/RegenerateApiKey' + cacheBuster,\n transformRequest: transformRequest,\n params: {\n apiKey: apiKey,\n }\n });\n }", "function generateApiKey() {\n deploymentsService.generateApiKey(vm.deployment).then(function (data) {\n if (!data.hasOwnProperty('apiKey')) {\n alertsService.pushAlert('Could not generate API key.', 'warning');\n return false;\n }\n var webhookUrl = location.protocol+'//'+location.hostname;\n webhookUrl += '/api.php?ak='+data.apiKey+'&ap='+data.apiPassword;\n vm.apiUrl = webhookUrl;\n }, function (reason) {\n alertsService.pushAlert(reason, 'warning');\n });\n }", "function hashAPIKey(apiKey) {\n const { createHash } = require('crypto');\n \n const hashedAPIKey = createHash('sha256').update(apiKey).digest('hex');\n \n return hashedAPIKey;\n }", "function apiKeyUpdate(credentials) {\n dJson.decrypt(credentials, function(json) {\n var json = dJson._checkJson(json);\n \n json = akpHelper.prepareToSave(json);\n json = JSON.stringify(json);\n\n dJson.encrypt(credentials, json, encryptCallback);\n });\n }", "function generateKey(){\n return Math.random().toString(36).substr(-8)\n}", "get key2() {\n return this.apiKey();\n }", "createFileKey() {\n return c.randomBytes(32);\n }", "function Cn(t){var e=t;return e=e.replace(\"-----BEGIN RSA PRIVATE KEY-----\",\"\"),e=e.replace(\"-----END RSA PRIVATE KEY-----\",\"\"),e=e.replace(/[ \\n]+/g,\"\")}", "function generalKey() {\n return 'GKEY1234567890';\n}", "setApiKey(e) {\n\n e.preventDefault();\n const key = e.target[0].value;\n\n fetch(`${SnakeGame.API}${key}/high-scores`)\n .then(response => {\n if(response.status == 404) {\n alert('INVALID API KEY!');\n return;\n }\n\n if(!response.ok) {\n alert('ERROR CONNECTING TO SERVER!');\n return;\n }\n \n this.apiKey = key;\n this.board.classList.remove('welcome');\n this.controls.classList.remove('in-menu');\n });\n\n }", "fromPrivateKey() {\n\n\t\tlet keystoreFromPrivateKey = async (_private, _passwd ) => {\n\t\t\n\t\t\t/*\n\t\t\t\tInitialize private key. Note \"Wallet.default\" for [email protected]^\n\t\t\t*/\n\t\t\tconst privateKeyBuffer = EthUtil.toBuffer(_private);\n\n\t\t\tconst wallet = Wallet.default.fromPrivateKey(privateKeyBuffer);\n\t\t\t\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\t/*\n\t\t\t\tWe need the async block because of this function\n\t\t\t*/\n\t\t\tconst json = await wallet.toV3String(_passwd)\n\t\t\n\t\t\tfs.writeFile( this.path + address + \".json\" , json, (err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\t\n\n\t\t/*\n\t\t\tCreate a schema for user entry \n\t\t*/\n\t\tvar schema = {\n\t\t\t\n\t\t\tproperties: {\n\t\t\t\n\t\t\t\tprivate : { description: 'PASTE your private key', hidden: true, required: true },\n\n\t\t\t\tpasswd \t: { description: 'ENTER your password', hidden: true, required: true },\n\n\t\t\t\tverify \t: { description: 'RE-ENTER your password', hidden: true, required: true }\n\t\t\t}\n\t\t};\n\n\t\t/*\n\t\t\tStart prompt. The user inputs desired private key, followed by password\n\t\t*/\n\t\tprompt.start();\n\n\t\tprompt.get(schema, function (err, result) {\n\n\t\t\tif (err) { return onErr(err); }\n\n\t\t\t/*\n\t\t\t\tCheck to see if password is correct\n\t\t\t*/\n\t\t\tif ( result.passwd == result.verify ){\n\n\t\t\t\tconsole.log( \"OK: generating keystore\")\n\n\t\t\t\tkeystoreFromPrivateKey( result.private, result.passwd );\n\n\t\t\t\t/*\n\t\t\t\t\tClear private key from clipboard\n\t\t\t\t*/\n\t\t\t\tclipboardy.writeSync(\" \");\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log( \"ERROR: passwords do not match ... exiting.\")\n\t\t\t}\n\n\t\t});\n\n\t\tfunction onErr(err) {\n\t\t\tconsole.log(err);\n\t\t\treturn 1;\n\t\t}\n\t}", "function saveKey() {\n var devkey = document.getElementById(\"devkey\").value;\n if (devkey.length > 12) {\n try {\n var localSettings = Windows.Storage.ApplicationData.current.localSettings;\n localSettings.values[\"devkey\"] = devkey;\n }\n catch (err) {\n //do nothing;\n }\n toggleControls(true);\n updateDatasource();\n\n } else {\n toggleControls(false);\n }\n }", "function ApiKey() {\n _classCallCheck(this, ApiKey);\n\n ApiKey.initialize(this);\n }", "setScrambleKey(_key) {}", "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n const pc2bytes0 = [0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204];\n const pc2bytes1 = [0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101];\n const pc2bytes2 = [0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808];\n const pc2bytes3 = [0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000];\n const pc2bytes4 = [0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010];\n const pc2bytes5 = [0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420];\n const pc2bytes6 = [0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002];\n const pc2bytes7 = [0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800];\n const pc2bytes8 = [0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002];\n const pc2bytes9 = [0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408];\n const pc2bytes10 = [0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020];\n const pc2bytes11 = [0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200];\n const pc2bytes12 = [0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010];\n const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n const keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n let lefttemp;\n let righttemp;\n let m = 0;\n let n = 0;\n let temp;\n\n for (let j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n let left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n let right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 2 ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = left << 8 | right >>> 20 & 0x000000f0;\n //left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (let i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ temp << 16;\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "function prepare_key_pw(password) {\n return prepare_key(str_to_a32(password));\n}", "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n const pc2bytes0 = [\n 0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204,\n 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204\n ];\n const pc2bytes1 = [\n 0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100,\n 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101\n ];\n const pc2bytes2 = [\n 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808,\n 0x1000000, 0x1000008, 0x1000800, 0x1000808\n ];\n const pc2bytes3 = [\n 0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000,\n 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000\n ];\n const pc2bytes4 = [\n 0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000,\n 0x41000, 0x1010, 0x41010\n ];\n const pc2bytes5 = [\n 0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420,\n 0x2000000, 0x2000400, 0x2000020, 0x2000420\n ];\n const pc2bytes6 = [\n 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000,\n 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002\n ];\n const pc2bytes7 = [\n 0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000,\n 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800\n ];\n const pc2bytes8 = [\n 0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000,\n 0x2000002, 0x2040002, 0x2000002, 0x2040002\n ];\n const pc2bytes9 = [\n 0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408,\n 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408\n ];\n const pc2bytes10 = [\n 0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020,\n 0x102000, 0x102020, 0x102000, 0x102020\n ];\n const pc2bytes11 = [\n 0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000,\n 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200\n ];\n const pc2bytes12 = [\n 0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010,\n 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010\n ];\n const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n const keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n let lefttemp;\n let righttemp;\n let m = 0;\n let n = 0;\n let temp;\n\n for (let j = 0; j < iterations; j++) { //either 1 or 3 iterations\n let left = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n let right = (key[m++] << 24) | (key[m++] << 16) | (key[m++] << 8) | key[m++];\n\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= (temp << -16);\n temp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= temp;\n left ^= (temp << 2);\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= (temp << -16);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\n //left needs to be put upside down\n left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (let i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(\n left >>> 16) & 0xf] | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | pc2bytes6[(left >>> 4) &\n 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | pc2bytes9[(right >>> 20) & 0xf] |\n pc2bytes10[(right >>> 16) & 0xf] | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf];\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ (temp << 16);\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "function loadKeyFile() {\n var input, file, fr;\n\n if (typeof window.FileReader !== 'function') {\n alert(\"The file API isn't supported on this browser yet.\");\n return;\n }\n\n input = document.getElementById('keyFileInput');\n if (!input) {\n alert(\"Um, couldn't find the fileinput element.\");\n }\n else if (!input.files) {\n alert(\"This browser doesn't seem to support the `files` property of file inputs.\");\n }\n else if (!input.files[0]) {\n alert(\"Please select a file before clicking 'Load'\");\n }\n else {\n file = input.files[0];\n fr = new FileReader();\n fr.onload = receivedText;\n fr.readAsText(file);\n }\n\n function receivedText(e) {\n lines = e.target.result;\n var newArr = JSON.parse(lines);\n var newAccount = browserAccounts.set(newArr.address, newArr);\n console.log(newArr);\n listAccounts();\n }\n}", "function init_keys() {\n // funding_key = new bitcore.PrivateKey('75d79298ce12ea86863794f0080a14b424d9169f7e325fad52f60753eb072afc', network_name);\n set_funding_key(new bitcore.PrivateKey(network_name));\n client_key = new bitcore.PrivateKey(network_name);\n console.log(\"Funding address: \" + funding_address.toString());\n}", "async function updateApiKeys(response) {\n let newDotEnv = `ETH_GAS_API_KEY=${response.ETH_GAS_API_KEY}`;\n fs.writeFile(path.resolve(__dirname, \"../.env\"), newDotEnv, err => {\n if (err) return console.log(err);\n console.log(\"API Key Saved!\");\n });\n}", "function dispNewKey() {\r\n var edn = genKeyFrom();\r\n e = edn[0];\r\n d = edn[1];\r\n n = edn[2];\r\n \r\n // outputting values\r\n document.getElementById(\"output\").innerHTML = \"Output:<br>\" +\r\n \"Private Key:<br>d:<br> \" + d.toString() + \"<br>n:<br> \" + n.toString() + \"<br><br>\" + \r\n \"Public Key:<br>e:<br> \" + e.toString() + \"<br>n:<br> \" + n.toString();\r\n}", "function getKeyMaterial() {\n let password = window.prompt(\"Enter your password\");\n let enc = new TextEncoder();\n return window.crypto.subtle.importKey(\n \"raw\",\n enc.encode(password),\n {name: \"PBKDF2\"},\n false,\n [\"deriveBits\", \"deriveKey\"]\n );\n }", "getRandomKey () {\n return Math.random() * (1000000 - 100) + 100\n }", "function genUglifiedKey(){\n var keyObj = require(\"./key.js\");\n var kArr = [];\n for (var k in keyObj) {\n kArr.push(k);\n }\n kArr.sort(function(a, b){\n if(a.length > b.length) return 1;\n else if(a.length < b.length) return -1;\n else if(a > b) return 1;\n else if(a < b) return -1;\n else return 0;\n });\n var map = {}\n for (var i = 0, l_i = kArr.length; i < l_i; i++) {\n var k = kArr[i];\n map[k] = i+1;\n }\n var keyObjUglified = {};\n for (var k in keyObj) {\n keyObjUglified[k] = \"\" + map[k];\n }\n var content = \"module.exports = \" + JSON.stringify(keyObjUglified, null, 4) + \";\";\n fs.writeFileSync(path.join(__dirname, \"key_uglified.js\"), content);\n}", "restorePrivateKey(splitKey1, splitKey2) {\n // convert to byte array if passed in as String\n if (typeof splitKey1 === 'string') {\n splitKey1 = hexToBytes(splitKey1);\n splitKey2 = hexToBytes(splitKey2);\n }\n\n let res1 = this.extractCode(splitKey1);\n //printCode(res1);\n\n let res2 = this.extractCode(splitKey2);\n //printCode(res2);\n\n let pads = this.retrievePads(res1, res2);\n\n let keySegments = [];\n decodeKey(keySegments, res1, pads);\n // console.log(\"after parting code 1:\");\n // if (keyparts[0]) console.log(\"part 1: \" + asHex(keyparts[0]));\n // if (keyparts[1]) console.log(\"part 2: \" + asHex(keyparts[1]));\n // if (keyparts[2]) console.log(\"part 3: \" + asHex(keyparts[2]));\n\n decodeKey(keySegments, res2, pads);\n // console.log(\"after parting code 2:\");\n // if (keyparts[0]) console.log(\"part 1: \" + asHex(keyparts[0]));\n // if (keyparts[1]) console.log(\"part 2: \" + asHex(keyparts[1]));\n // if (keyparts[2]) console.log(\"part 3: \" + asHex(keyparts[2]));\n\n return bytesToHex(keySegments[0]) + bytesToHex(keySegments[1]) + bytesToHex(keySegments[2]);\n }", "async function generateSigningKeystore(ctx) {\n\n // Ask user for new password\n console.log('We will now generate a new signing key for you. Make sure you write down this password, as it is ' + chalk.yellow('required') + ' to upload new versions to the Play Store.')\n\n // Ask for first password\n let pass1 = await ctx.console.ask({ \n question: 'Enter new signing password:', \n type: 'password', \n validate: 'password' \n })\n \n // Ask for second password\n let pass2 = await ctx.console.ask({ \n question: 'Enter new signing password:', \n type: 'password', \n validate: ['password', inp => inp == pass1 ? true : 'Password did not match.']\n })\n\n // Generate keystore\n ctx.status('Saving keystore to ' + chalk.cyan('metadata/android.keystore'))\n let kpath = path.resolve(ctx.project.path, 'metadata/android.keystore')\n await fs.ensureDir(path.resolve(kpath, '..'))\n await ctx.runWithOutput(`keytool -genkeypair -keystore \"${kpath}\" -storepass \"${pass1}\" -alias androidreleasekey -keypass \"${pass1}\" -keyalg RSA -keysize 2048 -validity 100000 -dname \"CN=${ctx.android.packageName}\" -noprompt`)\n return pass1\n\n}", "function deleteApiKey() {\n document.cookie = \"apiKey=; expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n}", "function des_createkeys (key) {\r\n //declaring this locally speeds things up a bit\r\n pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);\r\n pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101);\r\n pc2bytes2 = new Array (0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808);\r\n pc2bytes3 = new Array (0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000);\r\n pc2bytes4 = new Array (0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010);\r\n pc2bytes5 = new Array (0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420);\r\n pc2bytes6 = new Array (0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002);\r\n pc2bytes7 = new Array (0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800);\r\n pc2bytes8 = new Array (0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002);\r\n pc2bytes9 = new Array (0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408);\r\n pc2bytes10 = new Array (0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020);\r\n pc2bytes11 = new Array (0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200);\r\n pc2bytes12 = new Array (0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010);\r\n pc2bytes13 = new Array (0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105);\r\n\r\n //how many iterations (1 for des, 3 for triple des)\r\n var iterations = key.length >= 24 ? 3 : 1;\r\n //stores the return keys\r\n var keys = new Array (32 * iterations);\r\n //now define the left shifts which need to be done\r\n var shifts = new Array (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\r\n //other variables\r\n var lefttemp, righttemp, m=0, n=0, temp;\r\n\r\n for (var j=0; j<iterations; j++) { //either 1 or 3 iterations\r\n left = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n right = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);\r\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n //the right side needs to be shifted and to get the last four bits of the left side\r\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\r\n //left needs to be put upside down\r\n left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\r\n right = temp;\r\n\r\n //now go through and perform these shifts on the left and right keys\r\n for (i=0; i < shifts.length; i++) {\r\n //shift the keys either one or two bits to the left\r\n if (shifts[i]) {left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26);}\r\n else {left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27);}\r\n left &= -0xf; right &= -0xf;\r\n\r\n //now apply pc-2, in such a way that e is easier when encrypting or decrypting\r\n //this conversion will look like pc-2 except only the last 6 bits of each byte are used\r\n //rather than 48 consecutive bits and the order of lines will be according to\r\n //how the s selection functions will be applied: s2, s4, s6, s8, s1, s3, s5, s7\r\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]\r\n | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]\r\n | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]\r\n | pc2bytes6[(left >>> 4) & 0xf];\r\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]\r\n | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]\r\n | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]\r\n | pc2bytes13[(right >>> 4) & 0xf];\r\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\r\n keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);\r\n }\r\n } //for each iterations\r\n //return the keys we've created\r\n return keys;\r\n} //end of des_createkeys", "AddKey() {}", "getKeyPair () {\n // Generate new random private key\n const master = bcoin.hd.generate();\n const key = master.derivePath('m/44/0/0/0/0');\n const privateKey = key.privateKey;\n\n // Derive public key from private key\n const keyring = bcoin.KeyRing.fromPrivate(privateKey);\n const publicKey = keyring.publicKey;\n\n return {\n publicKey: publicKey,\n privateKey: privateKey\n };\n }", "function generateKeysFile() {\n\tvar keys = JSON.stringify(rsaGenerateKeys());\n\tfs.writeFile(keysFile, keys, function(error) {\n\t\tif(error) {\n\t\t\tconsole.log(error);\n\t\t\tapp.exit(0);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(chalk.green(\"\\nGenerated Keys.\"));\n\t\t\tverifyKeys(keys);\n\t\t}\n\t});\n}", "function loadKey(filename) {\n return fs.readFileSync(path.join(__dirname, filename));\n}", "function generateFileKey () {\n let key = randomBytes(16);\n let nonce = randomBytes(8);\n\n return { key, nonce };\n}", "function generate (opts, pwd) {\n var newKeys = minisign.keypairGen(pwd, opts)\n var keys = minisign.formatKeys(newKeys)\n var publicKey = newKeys.publicKey.toString('hex')\n\n fs.writeFile(opts.PKfile, keys.PK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n fs.writeFile(opts.SKfile, keys.SK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n })\n\n console.log('public key: ' + publicKey)\n console.log('public key saved to ', opts.PKfile)\n console.log('secret key encrypted and saved to ', opts.SKfile)\n })\n}", "function alteredKeyIndicatingDesireForSecureStorage(key) {\n return key + \":desiredSecure\";\n }", "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n var pc2bytes0 = [0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204];\n var pc2bytes1 = [0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101];\n var pc2bytes2 = [0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808];\n var pc2bytes3 = [0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000];\n var pc2bytes4 = [0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010];\n var pc2bytes5 = [0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420];\n var pc2bytes6 = [0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002];\n var pc2bytes7 = [0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800];\n var pc2bytes8 = [0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002];\n var pc2bytes9 = [0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408];\n var pc2bytes10 = [0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020];\n var pc2bytes11 = [0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200];\n var pc2bytes12 = [0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010];\n var pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n var keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n var lefttemp = void 0;\n var righttemp = void 0;\n var m = 0;\n var n = 0;\n var temp = void 0;\n\n for (var j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n var left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n var right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 2 ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = left << 8 | right >>> 20 & 0x000000f0;\n //left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (var i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ temp << 16;\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "lock() { this.private_key = null }", "generatePrivateKey() {\n return faker.random.words(12);\n }", "function getMapBoxAPIKey() {\n \n var mapboxAPIKey = \"\";\n\n mapboxAPIKey = C_MAPBOX_API_KEY;\n \n // Later = Replace API key fetch from DB \n // mapboxAPIKey = d3.request(apiUrlMapboxKey).get({retrun});\n\n return mapboxAPIKey;\n\n}", "generatePrivateKey() {\n var key = Buffer.alloc(95)\n require('libp2p-pnet').generate(key)\n this.node.logger.silly(`Generate private key: ${key}`)\n return key\n }", "function main(\n bucketName = 'my-bucket',\n fileName = 'test.txt',\n oldKey = process.env.GOOGLE_CLOUD_KMS_KEY_US,\n newKey = process.env.GOOGLE_CLOUD_KMS_KEY_ASIA,\n generationMatchPrecondition = 0\n) {\n // [START storage_rotate_encryption_key]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The ID of your GCS file\n // const fileName = 'your-file-name';\n\n // The Base64 encoded AES-256 encryption key originally used to encrypt the\n // object. See the documentation on Customer-Supplied Encryption keys for\n // more info:\n // https://cloud.google.com/storage/docs/encryption/using-customer-supplied-keys\n // The Base64 encoded AES-256 encryption key originally used to encrypt the\n // const oldKey = 'TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g=';\n\n // The new encryption key to use\n // const newKey = '0mMWhFvQOdS4AmxRpo8SJxXn5MjFhbz7DkKBUdUIef8=';\n\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function rotateEncryptionKey() {\n const rotateEncryptionKeyOptions = {\n encryptionKey: Buffer.from(newKey, 'base64'),\n\n // Optional: set a generation-match precondition to avoid potential race\n // conditions and data corruptions. The request to copy is aborted if the\n // object's generation number does not match your precondition.\n preconditionOpts: {\n ifGenerationMatch: generationMatchPrecondition,\n },\n };\n await storage\n .bucket(bucketName)\n .file(fileName, {\n encryptionKey: Buffer.from(oldKey, 'base64'),\n })\n .rotateEncryptionKey({\n rotateEncryptionKeyOptions,\n });\n\n console.log('Encryption key rotated successfully');\n }\n\n rotateEncryptionKey().catch(console.error);\n // [END storage_rotate_encryption_key]\n}", "function validateIndoorAtlasApiKey(apikey) {\n console.log(`validating API key ${apikey}`);\n return new Promise((resolve, reject) => {\n if (apiKeyCache.valid[apikey]) {\n console.log(\"API key was valid (cached)\");\n return resolve('ok');\n } else if (apiKeyCache.invalid[apikey]) {\n console.log(\"API key is still invalid (cached)\");\n return reject(new Error('forbidden'));\n }\n\n return request(INDOORATLAS_POS_API_ENDPOINT + 'venues?key=' + apikey, (err, response, body) => {\n if (err || !response) {\n console.error(`authentication pos API error ${err}`);\n return reject(new Error('authentication error'));\n }\n else if (response.statusCode >= 400) {\n console.warn(`authentication HTTP error ${response.statusCode} ${JSON.stringify(body)}`);\n apiKeyCache.invalid[apikey] = true;\n return reject(new Error('forbidden'));\n }\n console.log(\"valid IndoorAtlas API key\");\n apiKeyCache.valid[apikey] = true;\n resolve('ok');\n });\n });\n}", "function getApiKeys(callback, errorcallback) {\n\tfs.readFile(path.resolve(__dirname,\"./api_key.txt\"), \"utf-8\", (err, api_key) => {\n\t\tif (err) {\n\t\t\terrorcallback(err);\n\t\t\treturn;\n\t\t}\n\t\tfs.readFile(path.resolve(__dirname,\"./api_secret.txt\"), \"utf-8\",(err, api_secret) => {\n\t\t\tif (err) {\n\t\t\t\terrorcallback(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(api_key.trim(), api_secret.trim());\n\t\t});\n\t});\n}", "function des_createKeys (key) {\r\n\t //declaring this locally speeds things up a bit\r\n\t pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);\r\n\t pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101);\r\n\t pc2bytes2 = new Array (0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808);\r\n\t pc2bytes3 = new Array (0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000);\r\n\t pc2bytes4 = new Array (0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010);\r\n\t pc2bytes5 = new Array (0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420);\r\n\t pc2bytes6 = new Array (0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002);\r\n\t pc2bytes7 = new Array (0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800);\r\n\t pc2bytes8 = new Array (0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002);\r\n\t pc2bytes9 = new Array (0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408);\r\n\t pc2bytes10 = new Array (0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020);\r\n\t pc2bytes11 = new Array (0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200);\r\n\t pc2bytes12 = new Array (0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010);\r\n\t pc2bytes13 = new Array (0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105);\r\n\r\n\t //how many iterations (1 for des, 3 for triple des)\r\n\t var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\r\n\t //stores the return keys\r\n\t var keys = new Array (32 * iterations);\r\n\t //now define the left shifts which need to be done\r\n\t var shifts = new Array (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\r\n\t //other variables\r\n\t var lefttemp, righttemp, m=0, n=0, temp;\r\n\r\n\t for (var j=0; j<iterations; j++) { //either 1 or 3 iterations\r\n\t left = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n\t right = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n\r\n\t temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n\t temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n\t temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);\r\n\t temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n\t temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\t temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n\t temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n\t //the right side needs to be shifted and to get the last four bits of the left side\r\n\t temp = (left << 8) | ((right >>> 20) & 0x000000f0);\r\n\t //left needs to be put upside down\r\n\t left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\r\n\t right = temp;\r\n\r\n\t //now go through and perform these shifts on the left and right keys\r\n\t for (var i=0; i < shifts.length; i++) {\r\n\t //shift the keys either one or two bits to the left\r\n\t if (shifts[i]) {left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26);}\r\n\t else {left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27);}\r\n\t left &= -0xf; right &= -0xf;\r\n\r\n\t //now apply PC-2, in such a way that E is easier when encrypting or decrypting\r\n\t //this conversion will look like PC-2 except only the last 6 bits of each byte are used\r\n\t //rather than 48 consecutive bits and the order of lines will be according to \r\n\t //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\r\n\t lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]\r\n\t | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]\r\n\t | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]\r\n\t | pc2bytes6[(left >>> 4) & 0xf];\r\n\t righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]\r\n\t | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]\r\n\t | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]\r\n\t | pc2bytes13[(right >>> 4) & 0xf];\r\n\t temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff; \r\n\t keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);\r\n\t }\r\n\t } //for each iterations\r\n\t //return the keys we've created\r\n\t return keys;\r\n\t} //end of des_createKeys", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j ++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "function requireAPIKey(req, res, next) {\n const api_key = req.query.api_key || ''\n const authToken = AuthService.createJwt(api_key, {\"user_hash\": bcrypt.hashSync(api_key, 8)})\n const payload = AuthService.verifyJwt(authToken);\n try {\n if (AuthService.compare(payload.sub, process.env.API_CLIENT_HASH) === false) {\n res.status(401).json({ error: 'Invalid API key provided' })\n }\n next();\n } catch(error) {\n res.status(401).json({ error: 'Invalid API key provided' })\n }\n }", "function AES_ExpandKey(key) {\n var kl = key.length, ks, Rcon = 1;\n switch (kl) {\n case 16: ks = 16 * (10 + 1); break;\n case 24: ks = 16 * (12 + 1); break;\n case 32: ks = 16 * (14 + 1); break;\n default: \n alert(\"AES_ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!\");\n }\n for(var i = kl; i < ks; i += 4) {\n var temp = key.slice(i - 4, i);\n if (i % kl == 0) {\n temp = new Array(AES_Sbox[temp[1]] ^ Rcon, AES_Sbox[temp[2]], \n\tAES_Sbox[temp[3]], AES_Sbox[temp[0]]); \n if ((Rcon <<= 1) >= 256)\n\tRcon ^= 0x11b;\n }\n else if ((kl > 24) && (i % kl == 16))\n temp = new Array(AES_Sbox[temp[0]], AES_Sbox[temp[1]], \n\tAES_Sbox[temp[2]], AES_Sbox[temp[3]]); \n for(var j = 0; j < 4; j++)\n key[i + j] = key[i + j - kl] ^ temp[j];\n }\n}", "function des_createKeys (key) {\n //declaring this locally speeds things up a bit\n var pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);\n var pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101);\n var pc2bytes2 = new Array (0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808);\n var pc2bytes3 = new Array (0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000);\n var pc2bytes4 = new Array (0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010);\n var pc2bytes5 = new Array (0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420);\n var pc2bytes6 = new Array (0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002);\n var pc2bytes7 = new Array (0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800);\n var pc2bytes8 = new Array (0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002);\n var pc2bytes9 = new Array (0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408);\n var pc2bytes10 = new Array (0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020);\n var pc2bytes11 = new Array (0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200);\n var pc2bytes12 = new Array (0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010);\n var pc2bytes13 = new Array (0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105);\n\n //how many iterations (1 for des, 3 for triple des)\n var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n var keys = new Array (32 * iterations);\n //now define the left shifts which need to be done\n var shifts = new Array (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\n //other variables\n var lefttemp, righttemp, m=0, n=0, temp, left, right;\n\n for (var j=0; j<iterations; j++) { //either 1 or 3 iterations\n left = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\n right = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\n\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\n temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\n //left needs to be put upside down\n left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (var i=0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26);}\n else {left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27);}\n left &= -0xf; right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]\n | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]\n | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]\n | pc2bytes6[(left >>> 4) & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]\n | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]\n | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]\n | pc2bytes13[(right >>> 4) & 0xf];\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n pc2bytes0 = new Array(\n 0,\n 0x4,\n 0x20000000,\n 0x20000004,\n 0x10000,\n 0x10004,\n 0x20010000,\n 0x20010004,\n 0x200,\n 0x204,\n 0x20000200,\n 0x20000204,\n 0x10200,\n 0x10204,\n 0x20010200,\n 0x20010204\n );\n pc2bytes1 = new Array(\n 0,\n 0x1,\n 0x100000,\n 0x100001,\n 0x4000000,\n 0x4000001,\n 0x4100000,\n 0x4100001,\n 0x100,\n 0x101,\n 0x100100,\n 0x100101,\n 0x4000100,\n 0x4000101,\n 0x4100100,\n 0x4100101\n );\n pc2bytes2 = new Array(\n 0,\n 0x8,\n 0x800,\n 0x808,\n 0x1000000,\n 0x1000008,\n 0x1000800,\n 0x1000808,\n 0,\n 0x8,\n 0x800,\n 0x808,\n 0x1000000,\n 0x1000008,\n 0x1000800,\n 0x1000808\n );\n pc2bytes3 = new Array(\n 0,\n 0x200000,\n 0x8000000,\n 0x8200000,\n 0x2000,\n 0x202000,\n 0x8002000,\n 0x8202000,\n 0x20000,\n 0x220000,\n 0x8020000,\n 0x8220000,\n 0x22000,\n 0x222000,\n 0x8022000,\n 0x8222000\n );\n pc2bytes4 = new Array(\n 0,\n 0x40000,\n 0x10,\n 0x40010,\n 0,\n 0x40000,\n 0x10,\n 0x40010,\n 0x1000,\n 0x41000,\n 0x1010,\n 0x41010,\n 0x1000,\n 0x41000,\n 0x1010,\n 0x41010\n );\n pc2bytes5 = new Array(\n 0,\n 0x400,\n 0x20,\n 0x420,\n 0,\n 0x400,\n 0x20,\n 0x420,\n 0x2000000,\n 0x2000400,\n 0x2000020,\n 0x2000420,\n 0x2000000,\n 0x2000400,\n 0x2000020,\n 0x2000420\n );\n pc2bytes6 = new Array(\n 0,\n 0x10000000,\n 0x80000,\n 0x10080000,\n 0x2,\n 0x10000002,\n 0x80002,\n 0x10080002,\n 0,\n 0x10000000,\n 0x80000,\n 0x10080000,\n 0x2,\n 0x10000002,\n 0x80002,\n 0x10080002\n );\n pc2bytes7 = new Array(\n 0,\n 0x10000,\n 0x800,\n 0x10800,\n 0x20000000,\n 0x20010000,\n 0x20000800,\n 0x20010800,\n 0x20000,\n 0x30000,\n 0x20800,\n 0x30800,\n 0x20020000,\n 0x20030000,\n 0x20020800,\n 0x20030800\n );\n pc2bytes8 = new Array(\n 0,\n 0x40000,\n 0,\n 0x40000,\n 0x2,\n 0x40002,\n 0x2,\n 0x40002,\n 0x2000000,\n 0x2040000,\n 0x2000000,\n 0x2040000,\n 0x2000002,\n 0x2040002,\n 0x2000002,\n 0x2040002\n );\n pc2bytes9 = new Array(\n 0,\n 0x10000000,\n 0x8,\n 0x10000008,\n 0,\n 0x10000000,\n 0x8,\n 0x10000008,\n 0x400,\n 0x10000400,\n 0x408,\n 0x10000408,\n 0x400,\n 0x10000400,\n 0x408,\n 0x10000408\n );\n pc2bytes10 = new Array(\n 0,\n 0x20,\n 0,\n 0x20,\n 0x100000,\n 0x100020,\n 0x100000,\n 0x100020,\n 0x2000,\n 0x2020,\n 0x2000,\n 0x2020,\n 0x102000,\n 0x102020,\n 0x102000,\n 0x102020\n );\n pc2bytes11 = new Array(\n 0,\n 0x1000000,\n 0x200,\n 0x1000200,\n 0x200000,\n 0x1200000,\n 0x200200,\n 0x1200200,\n 0x4000000,\n 0x5000000,\n 0x4000200,\n 0x5000200,\n 0x4200000,\n 0x5200000,\n 0x4200200,\n 0x5200200\n );\n pc2bytes12 = new Array(\n 0,\n 0x1000,\n 0x8000000,\n 0x8001000,\n 0x80000,\n 0x81000,\n 0x8080000,\n 0x8081000,\n 0x10,\n 0x1010,\n 0x8000010,\n 0x8001010,\n 0x80010,\n 0x81010,\n 0x8080010,\n 0x8081010\n );\n pc2bytes13 = new Array(\n 0,\n 0x4,\n 0x100,\n 0x104,\n 0,\n 0x4,\n 0x100,\n 0x104,\n 0x1,\n 0x5,\n 0x101,\n 0x105,\n 0x1,\n 0x5,\n 0x101,\n 0x105\n );\n\n //how many iterations (1 for des, 3 for triple des)\n var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n var keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\n //other variables\n var lefttemp,\n righttemp,\n m = 0,\n n = 0,\n temp;\n\n for (var j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n left =\n (key.charCodeAt(m++) << 24) |\n (key.charCodeAt(m++) << 16) |\n (key.charCodeAt(m++) << 8) |\n key.charCodeAt(m++);\n right =\n (key.charCodeAt(m++) << 24) |\n (key.charCodeAt(m++) << 16) |\n (key.charCodeAt(m++) << 8) |\n key.charCodeAt(m++);\n\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\n //left needs to be put upside down\n left =\n (right << 24) |\n ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) |\n ((right >>> 24) & 0xf0);\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (var i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp =\n pc2bytes0[left >>> 28] |\n pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] |\n pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] |\n pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf];\n righttemp =\n pc2bytes7[right >>> 28] |\n pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] |\n pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] |\n pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf];\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ (temp << 16);\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "function fixPkey(key) {\n if (key.indexOf(\"0x\") === 0) {\n return key.slice(2);\n }\n return key;\n }", "function _generateKey(){\n var s4;\n s4 = function () {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n };\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "function generateUserKeypair() {\n console.log(\"Generating user keypair...\");\n displayKeys();\n userKeyPair = new RSAKey(true);\n}", "function createApiKey () {\n return jwt.sign({user: 'API', admin: 0}, process.env.JWT_STRING);\n}", "function _createKeys(key) {\n\t var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n\t pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n\t pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n\t pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n\t pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n\t pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n\t pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n\t pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n\t pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n\t pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n\t pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n\t pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n\t pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n\t pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n\t // how many iterations (1 for des, 3 for triple des)\n\t // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n\t var iterations = key.length() > 8 ? 3 : 1;\n\n\t // stores the return keys\n\t var keys = [];\n\n\t // now define the left shifts which need to be done\n\t var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n\t var n = 0, tmp;\n\t for(var j = 0; j < iterations; j++) {\n\t var left = key.getInt32();\n\t var right = key.getInt32();\n\n\t tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n\t right ^= tmp;\n\t left ^= (tmp << 4);\n\n\t tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n\t left ^= tmp;\n\t right ^= (tmp << -16);\n\n\t tmp = ((left >>> 2) ^ right) & 0x33333333;\n\t right ^= tmp;\n\t left ^= (tmp << 2);\n\n\t tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n\t left ^= tmp;\n\t right ^= (tmp << -16);\n\n\t tmp = ((left >>> 1) ^ right) & 0x55555555;\n\t right ^= tmp;\n\t left ^= (tmp << 1);\n\n\t tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n\t left ^= tmp;\n\t right ^= (tmp << 8);\n\n\t tmp = ((left >>> 1) ^ right) & 0x55555555;\n\t right ^= tmp;\n\t left ^= (tmp << 1);\n\n\t // right needs to be shifted and OR'd with last four bits of left\n\t tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n\t // left needs to be put upside down\n\t left = ((right << 24) | ((right << 8) & 0xff0000) |\n\t ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n\t right = tmp;\n\n\t // now go through and perform these shifts on the left and right keys\n\t for(var i = 0; i < shifts.length; ++i) {\n\t //shift the keys either one or two bits to the left\n\t if(shifts[i]) {\n\t left = (left << 2) | (left >>> 26);\n\t right = (right << 2) | (right >>> 26);\n\t } else {\n\t left = (left << 1) | (left >>> 27);\n\t right = (right << 1) | (right >>> 27);\n\t }\n\t left &= -0xf;\n\t right &= -0xf;\n\n\t // now apply PC-2, in such a way that E is easier when encrypting or\n\t // decrypting this conversion will look like PC-2 except only the last 6\n\t // bits of each byte are used rather than 48 consecutive bits and the\n\t // order of lines will be according to how the S selection functions will\n\t // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n\t var lefttmp = (\n\t pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n\t pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n\t pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n\t pc2bytes6[(left >>> 4) & 0xf]);\n\t var righttmp = (\n\t pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n\t pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n\t pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n\t pc2bytes13[(right >>> 4) & 0xf]);\n\t tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n\t keys[n++] = lefttmp ^ tmp;\n\t keys[n++] = righttmp ^ (tmp << 16);\n\t }\n\t }\n\n\t return keys;\n\t}", "function formatSharedKey(sk) {\n return sk.toUpperCase()\n .replace(/...../g, function (match, orig) { return match + ' '; });\n}", "function getHackedKey(key,data){\n\tkey = key.toUpperCase();\n\tvar keys = data.hacked_keys[key];\n\t$(\"#key-val\").text(keys)\n\treturn null;\n}", "static getApiKey(apiKey) {\n return apiKey;\n }", "static getApiKey(apiKey) {\n return apiKey;\n }", "function generateAndSetKeypair() {\n var keys = peerId.create({\n bits: opts.bits\n });\n config.Identity = {\n PeerID: keys.toB58String(),\n PrivKey: keys.privKey.bytes.toString('base64')\n };\n\n writeVersion();\n }", "function reKey(evt) {\n\tevt = evt || window.event; // For IE\n\tstopPropagation(evt);\n\tevt.preventDefault();\n\n\tvar passphrase = document.getElementById('passphrase-in').value;\n\tdocument.getElementById('passphrase-in').value = '';\n\n\tif (!isProperPassphrase(passphrase)) {\n\t alert('Please use one of the passphrases made with the Generate passphrase button.\\n\\nYou may also be receiving this message if you mistyped one of those passphrases.');\n\t return false;\n\t}\n\n\tdocument.getElementById('passphrase-in').style.visibility = 'hidden';\n\tdocument.getElementById('passphrase-use').style.visibility = 'hidden';\n\n\tvar keyPair = nacl.box.keyPair.fromSecretKey(nacl.hash(nacl.util.decodeUTF8(passphrase)).subarray(0, nacl.box.secretKeyLength));\n\tdocument.getElementById('mykey').textContent = taggedB58Key(keyPair.publicKey);\n\n\tvar deBox = deBoxer(keyPair.secretKey);\n\tdocument.getElementById('decrypt-in').onchange = deBox;\n\tdocument.getElementById('decrypt-in').onkeyup = deBox;\n\tdeBox();\n\n\twindow.onunload = keyShredder(keyPair.secretKey);\n\n\tsetupHide();\n\n\tvar url = 'https://scrambl.is/write/' + taggedB58Key(keyPair.publicKey);\n\tvar address = document.getElementById('address-in').value;\n\tif (address) {\n\t switch (recipientType(address)) {\n\t case 'email':\n\t\turl += '/email/' + encodeURIComponent(address).replace(/%40/g, '@');;\n\t\tbreak;\n\t case 'tweet':\n\t\turl += '/tweet/' + encodeURIComponent(address);\n\t\tbreak;\n\t }\n\t}\n\tdocument.getElementById('share-link').href = url;\n\tdocument.getElementById('share-email').href = \"mailto:?body=\" + encodeURIComponent(url);\n\tdocument.getElementById('share-twitter').href = \"https://twitter.com/intent/tweet?text=My%20scrambl.is%20link&url=\" + encodeURIComponent(url);\n\n\tdocument.getElementById('your-address-cont').style.display = 'none';\n\tdocument.getElementById('passphrase-in-cont').style.display = 'none';\n\tdocument.getElementById('your-key-cont').style.display = 'block';\n\n\tdocument.getElementById('share-link').focus();\n\treturn false;\n }" ]
[ "0.67026174", "0.6672109", "0.6672109", "0.66440326", "0.6391867", "0.61754555", "0.61346287", "0.59729135", "0.5920984", "0.5904363", "0.58595127", "0.5856597", "0.58514726", "0.58473736", "0.58209825", "0.57977927", "0.5777562", "0.5774666", "0.57547617", "0.57395816", "0.5735746", "0.57345575", "0.5725017", "0.5712522", "0.5712294", "0.568449", "0.56512845", "0.5637581", "0.5580494", "0.55651116", "0.55633086", "0.5557068", "0.55393714", "0.5524085", "0.551962", "0.551083", "0.5509903", "0.54937917", "0.5466882", "0.5449304", "0.54437476", "0.54381114", "0.5423222", "0.5421767", "0.5414848", "0.5406535", "0.5367273", "0.5361255", "0.53544945", "0.5345374", "0.5335134", "0.5326373", "0.53006184", "0.5296669", "0.5291848", "0.52541256", "0.5251146", "0.5247679", "0.523888", "0.5232566", "0.52208793", "0.52190596", "0.52051073", "0.5202334", "0.5197695", "0.51973116", "0.5195832", "0.5193855", "0.51912576", "0.5182345", "0.5178313", "0.51774776", "0.5176411", "0.5172027", "0.5171869", "0.51637477", "0.5150374", "0.51493514", "0.5148593", "0.5148593", "0.5148593", "0.5148593", "0.5148593", "0.5148593", "0.5148593", "0.5141526", "0.51304203", "0.5122803", "0.5111678", "0.50989455", "0.5098479", "0.50982505", "0.5097675", "0.50975084", "0.5088291", "0.5087583", "0.5083138", "0.5083138", "0.507662", "0.507417" ]
0.5443478
41
reset the key file in the beginning of every month
function resetKeyFile(){ startTime = new Date(); var month = startTime.getMonth() + 1; var year = startTime.getFullYear(); var date = startTime.getDate(); if((month > keyInfo.updateMonth || year > keyInfo.updateYear) && date >1 ){ console.log("yes"); keyJson[0].updateYear = year; keyJson[0].updateMonth = month; for(var i = 1; i<keyJson.length; i++){ keyJson[i].expire = "false"; } fs.writeFile("key.json",JSON.stringify(keyJson)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetFile() {\n fs.writeFileSync(DATASTORE_FILENAME, JSON.stringify({\n 'users': {},\n 'notifications': {}\n }))\n}", "function resetWkbk() {\n workbook.revertAllAsync();\n }", "async reset () {\n let keys = await this.client.zRange(this.ZSET_KEY, 0, -1);\n await this.safeDelete(keys);\n }", "function getNextSignKey() {\n schedule = Buffer.from(fs.readFileSync(constant.SECRET_KEYPATH + 'sk_schedule')).toString();\n\n // if there are keys left in the keyschedule\n if (schedule != \"\") {\n schedule = schedule.split('\\n');\n new_line = schedule[0].split(',');\n\n from = new Date(new_line[0]);\n to = new Date(new_line[1]);\n\n next_key = new_line[2];\n\n // delete current key from key schedule\n exec(\"sed -i '/\" + next_key.split('\\/').join('\\\\\\/') + \"/d' \" + constant.SECRET_KEYPATH + 'sk_schedule', (err, stdout, stderr) => {\n if (err) {\n console.log(stderr);\n }\n })\n\n fs.writeFileSync(constant.SECRET_KEYPATH + 'sign_key', next_key);\n SIGNING_KEY = str2buf(next_key, 'base64');\n\n console.log(\"[***] NEW SIGNING KEY: \", Buffer.from(SIGNING_KEY).toString('base64'));\n\n } else {\n console.log(\"[***] No keys in the key schedule. Keep old PUBLIC KEY!\");\n }\n \n}", "function removeBadKey(keyIndex){\n keyJson[keyIndex + 1].expire = \"true\";\n fs.writeFile(\"key.json\",JSON.stringify(keyJson));\n }", "resetKeys() {\n let key = 0; //reset it\n this.collection.forEach((row) => {\n row[this.sgkey] = key;\n key++;\n });\n }", "function resetAll() {\n //reset date\n entries = [];\n localStorage.clear();\n\n //clear most of the chart\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawAxis();\n\n //remove all items from list\n while (dataList.firstChild) dataList.removeChild(dataList.firstChild);\n}", "reset() {\n\t\tthis.#keyslist.length = 0;\n\t}", "function reset_last_line(){\n PropertiesService.getScriptProperties().setProperty(\"ExportManager.export_vers_planning_malditof\", 0);\n}", "reset() {\n // Shortcut\n const hasher = this._hasher; // Reset\n\n hasher.reset();\n hasher.update(this._iKey);\n }", "function removeOldEntries(){\n for(key in localStorage){\n if(key.indexOf(keyPrefix) === 0){\n var data = getSavedData(key);\n if(now() - data._autosaveTime > lifetime){\n localStorage.removeItem(key);\n\n log('Key ' + key + ' removed.');\n }\n }\n }\n}", "function generateNewKeySchedule(number_of_keys=10) {\n\n if (last_end_date) {\n start_date = last_end_date;\n } else {\n start_date = new Date();\n start_date = new Date(start_date.setTime(start_date.getTime() + 2 * 60000)); \n }\n \n fs.writeFileSync(constant.SECRET_KEYPATH + 'sk_schedule', \"\");\n fs.writeFileSync(constant.PUBLIC_KEYPATH + 'pk_schedule', \"\");\n\n for (var i = 0; i < number_of_keys; i++) {\n keypair = generateKeyPair();\n secret_key = keypair.secretKey;\n public_key = keypair.publicKey;\n\n\n /*\n start_date = new Date(start_date.setDate(start_date.getDate() + 1));\n validity = getValidityRange(start_date, start_date, 'day', 1);\n */\n //start_date = new Date(start_date.setTime(start_date.getTime() + 2 * 60000));\n validity = getValidityRange(start_date, start_date, 'minute', 2);\n\n fs.appendFileSync(constant.SECRET_KEYPATH + 'sk_schedule', new Date(validity.from) + \",\" + new Date(validity.until) + \",\" + buf2str(secret_key, 'base64') + '\\n');\n fs.appendFileSync(constant.PUBLIC_KEYPATH + 'pk_schedule', new Date(validity.from) + \",\" + new Date(validity.until) + \",\" + buf2str(public_key, 'base64') + '\\n');\n\n // add job to scheduler\n var new_job = scheduler.scheduleJob(new Date(validity.from), () => {\n getNextSignKey();\n });\n\n start_date = new Date(start_date.setTime(start_date.getTime() + 2 * 60000));\n }\n\n last_end_date = new Date(validity.until);\n\n // schedule job for creating next key schedule\n var new_job = scheduler.scheduleJob((new Date(validity.until)).getTime() - 40000, () => {\n generateNewKeySchedule(3);\n });\n\n}", "function resetFileContentCache() {\n FILE_CONTENT_CACHE.clear();\n}", "reset () {\n this._last = new Date().getTime()\n }", "function reset(){\n while(localStorage.length != 0){\n localStorage.removeItem(localStorage.key(0));\n }\n defaultSetMovie();\n playMovie(getRandomMovieUrl());\n // テーブル作成\n createTable();\n}", "function resetBudgetEntry() {\n getStorage().removeItem(storageKey)\n}", "reset() {\n this.map = new Map();\n this.size = 0;\n this.keys = [];\n this.cursor = -1;\n }", "function resetKeyGenerator() {\n n = 0;\n generate = function generate() {\n return \"\" + n++;\n };\n}", "function resetKeyGenerator() {\n n = 0;\n generate = function generate() {\n return \"\" + n++;\n };\n}", "function resetButton(event) {\n // Clear the cookie\n document.cookie = cookieName + \"=\" + \n \"; max-age=604800\" +\n \"; path=/\" +\n \"; domain=nih.gov\";\n // Reload the page\n window.location.reload();\n }", "function resetKey(ev){\n var confirm_reset = window.confirm(\"Are you sure you want to reset encryption key\");\n if(confirm_reset){\n var params = {};\n params.method = \"PUT\";\n params.url = \"section/admin/resetKey\";\n params.data = null;\n params.setHeader = false;\n console.log(params);\n ajaxRequest(params, mainPannelResponse);\n }\n }", "resetToCheckpoint() {\n\t\tthis.$$().resetDataToCheckpoint();\n\t}", "function reset_values() {\n account[0] = initial_deposit;\n account[1] = 0; // I will save my profit here \n}", "function resetBalanceUpdates() {\n for (var i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) != \"accountNumber\" && localStorage.key(i) != \"currentLang\") {\n console.log(\"Resetting balance for: \" + localStorage.key(i));\n localStorage.removeItem(localStorage.key(i));\n }\n }\n}", "function eraseForYears() {\n currentDate.setFullYear(yearHolder.textContent);\n currentDate.setMonth(0);\n monthHolder.textContent = monthNames[0];\n eraseDays();\n setUpCalendar(currentDate);\n}", "function resetIndex() {\n PropertiesService.getDocumentProperties().setProperty(\"last\", 1);\n}", "function eraseForMonths() {\n eraseDays();\n setUpCalendar(currentDate);\n}", "function resetCache() {\n console.log('resetCache');\n cache = {};\n }", "clear() {\n for (let i = 0; i < this.rounds; i++)\n for (let j = 0; j < 3; j++)\n this.keySchedule[i][j] = 0;\n }", "function reset() {\n for( x=0; x<0x600; x++ ){\n memory[x] = 0x00;\n }\n regA = regX = regY = 0;\n defaultCodePC = regPC = 0x600;\n regSP = 0x100;\n regP = 0x20;\n runForever = false;\n}", "reset() {\n Object.keys(this._cache).forEach((key) => {\n if (key !== \"0\") {\n let value = this._cache[key];\n this._cache[key] = {\n type: value.type,\n name: value.name,\n props: {\n transforms: []\n }\n };\n }\n });\n }", "function file_cache_cleanup() {\n\t\tlet threshold = new Date() - 14*86400000; // 14 days\n\t\tlet old_files = [];\n\t\tfor (var fname in wkof.file_cache.dir) {\n\t\t\tif (fname.match(/^wkof\\.settings\\./)) continue; // Don't flush settings files.\n\t\t\tlet fdate = new Date(wkof.file_cache.dir[fname].last_loaded);\n\t\t\tif (fdate < threshold) old_files.push(fname);\n\t\t}\n\t\tif (old_files.length === 0) return;\n\t\tconsole.log('Cleaning out '+old_files.length+' old file(s) from \"wkof.file_cache\":');\n\t\tfor (let fnum in old_files) {\n\t\t\tconsole.log(' '+(Number(fnum)+1)+': '+old_files[fnum]);\n\t\t\twkof.file_cache.delete(old_files[fnum]);\n\t\t}\n\t}", "_invalidateCache() {\n this._cxPackedKey = [];\n this._cxPacked = [];\n }", "function keyCounter() {\r\n if(localStorage.getItem('entryCount') == null || localStorage.getItem('entryCount') == 0) {\r\n // Reset counter\r\n console.log(\"No LocalStorage data found, resetting counter...\");\r\n localStorage.setItem('entryCount', 0);\r\n }\r\n else {\r\n // Loop through localstorage and write saved data to page\r\n console.log(\"LocalStorage data found, attempting to load...\");\r\n\r\n for(i=1;i<=localStorage.getItem('entryCount');i++) {\r\n if(localStorage.getItem(`${i}date`) == null) {\r\n // Skip if current entry no longer exists\r\n continue;\r\n } else if( !(i + 1 == localStorage.getItem('entryCount')) ) {\r\n // Update page\r\n pageUpdate(i + 1, false);\r\n } else if(i + 1 == localStorage.getItem('entryCount')) {\r\n // Update page, is most recent item\r\n pageUpdate(i + 1, true);\r\n }\r\n }\r\n }\r\n }", "function reset() { }", "function file_cache_flush() {\n\t\tfile_cache_dir_save(true /* immediately */);\n\t}", "function reset() {\n cache.reset();\n AJS.debug('server-users-supplier: Cache reset');\n }", "function reset() {\n cache.reset();\n AJS.debug('server-users-supplier: Cache reset');\n }", "reset() {\n this.dateMaps = this.getInitialDateClusterMaps();\n this.errorClusters.reset();\n this.errors = {};\n this.events = {};\n this.userMap.clear();\n }", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function reset() {\n frc = false;\n load(DEFAULT_POSITION);\n }", "function reset(){\n trainName = \"\";\n destination = \"\";\n startTime = \"\";\n frequency = 0;\n}", "function reset() {\n checkConfig();\n\n eventBus.off(events.INTERNAL_KEY_MESSAGE, onKeyMessage, this);\n eventBus.off(events.INTERNAL_KEY_STATUS_CHANGED, onKeyStatusChanged, this);\n\n setMediaElement(null);\n\n keySystem = undefined;//TODO-Refactor look at why undefined is needed for this. refactor\n\n if (protectionModel) {\n protectionModel.reset();\n protectionModel = null;\n }\n\n needkeyRetries.forEach( retryTimeout => clearTimeout(retryTimeout));\n needkeyRetries = [];\n\n mediaInfoArr = [];\n }", "function clearMonth(){\n\n let errorExists = false;\n\n pool.getConnection(function(err, connection){\n\n if(_assertConnectionError(err)){\n return;\n }\n \n const streamersReg = [];\n const streamersWhitelist = [];\n connection.query(\"SELECT * FROM list_of_streamers;\",\n function(error, results, fields){\n\n if(errorExists || _assertError(error, connection)){\n errorExists = true;\n return;\n }\n\n for(let row of results){\n streamersReg.push(sql.raw(row[\"channel_id\"] \n + _REGULAR_SUFFIX));\n streamersWhitelist.push(sql.raw(row[\"channel_id\"] \n + _WHITELIST_SUFFIX));\n }\n\n });\n\n connection.query(\"UPDATE ?, ? SET ?.month=0, ?.month=0;\", \n [streamersReg, streamersWhitelist, streamersReg, \n streamersWhitelist], function(error){\n \n if(errorExists || _assertError(error)){\n errorExists = true;\n return;\n }\n\n });\n\n if(!errorExists){\n connection.release();\n }\n\n });\n}", "function resetSettings() {\r\n\t\tvar keys = GM_listValues();\r\n\t\tfor (var i=0, key=null; key=keys[i]; i++) {\r\n\t\t\tGM_deleteValue(key);\r\n\t\t}\r\n\t}", "resetKeys(){\n for (let key of Object.keys(this.keyAssignment)) {\n // set property pressed to false for each key\n this.keyAssignment[key][2] = false;\n }\n }", "function resetMetaKeys() {\n for (let [key, value] of metaKeysState.entries()) {\n metaKeysState.get(key).selected = false;\n }\n}", "__removeOlderEntries() {\n const itemsToClear = Array.from(lastReadTimeForKey.keys()).slice(0, CACHE_ITEMS_TO_CLEAR_COUNT);\n itemsToClear.forEach((k)=>{\n cache.delete(k);\n lastReadTimeForKey.delete(k);\n });\n }", "function reset() {\n\n }", "function reset() {\n canRun = false\n // clear state for next run\n emitter.emit('reset', undefined, ...args)\n Object.assign(autosave, {\n run: fn,\n cancel: Function.prototype,\n runLater: autosave,\n pending: undefined,\n })\n }", "function changeKey(){\n console.log(key);\n let keyFreq = noteDict[key];\n for(let i=0; i < 8; i++) {\n matrixtofreqmap.delete(i);\n matrixtofreqmap.set(i,keyFreq * keyMultipliers[keyType][i]);\n oscillatorarray[i].frequency.value=matrixtofreqmap.get(i);\n }\n}", "clearGroupKey(refresh) {\n\t\tconst self = this;\n\n\t\t// For every user in room...\n\t\tMeteor.call('getUsersOfRoom', self.roomId, true, function(error, result) {\n\t\t\tresult.records.forEach(function(user) {\n\n\t\t\t\t// ...remove session key for this room\n\t\t\t\tMeteor.call('updateGroupE2EKey', self.roomId, user._id, null, function(error, result) {\n\t\t\t\t\tconsole.log(result);\n\t\t\t\t\tRocketChat.Notifications.notifyUser(user._id, 'e2e', 'clearGroupKey', { roomId: self.roomId, userId: self.userId });\n\t\t\t\t\tif (refresh) {\n\t\t\t\t\t\t// Generate new key.\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "resetBucket() {\n this.cacheBucket = '';\n }", "disableKeyBackup() {\n if (this.algorithm) {\n this.algorithm.free();\n }\n\n this.algorithm = undefined;\n this.backupInfo = undefined;\n this.baseApis.emit('crypto.keyBackupStatus', false);\n }", "function nextMonth(){\n if(data.calendar.month != 11 || data.calendar.year == 2018 || data.calendar.year == 2019){\n data.calendar.month++;\n }\n if(data.calendar.month >= 12){\n data.calendar.month = 0;\n data.calendar.year++;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "function reset() {\n save(null);\n }", "function reset()\r\n\t{\r\n\t\tself.manifest={};\r\n\t\tself.heading='Master';\r\n\t\tfetchAllManifest();\r\n\t}", "onBegin() {\n this.fileNames.clear();\n this.fileMappings = {};\n }", "function checkReset(daysToReset) {\n chrome.storage.local.get(['startDay'], function(get) {\n var startDay = get.startDay;\n var currDay = new Date().getDay();\n if (currDay - startDay >= daysToReset) {\n potatoDay();\n chrome.storage.local.get(['urlList'], function(result) {\n var urlList = result.urlList\n for (key in urlList) {\n urlList[key].intervalSeconds = 0;\n urlList[key].visited = 0;\n }\n chrome.storage.local.set({\"urlList\": urlList}, function() {});\n startDay = currDay;\n chrome.storage.local.set({\"startDay\": startDay}, function() {});\n });\n }\n });\n}", "function resetTpldate(trigger) {\n\t\ttpldate = {\n\t\t\tyear : (curYmd[0] + \"年\"),\n\t\t\tmonth : Months[curYmd[1] - 1],\n\t\t\tweeks : Weeks,\n\t\t\tdays: getDays4Month(curYmd[0]-0, curYmd[1]-1, curYmd[2], trigger)\n\t\t};\n\t}", "function resetPosition() {\n data2.forEach((value, key) => {\n putAtPosition(key, key);\n });\n}", "function next(){\n if(dateInfo.currentMonth!=11){\n dateInfo.currentMonth++;\n }\n else{\n dateInfo.currentYear++;\n dateInfo.currentMonth=0;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0; \n}", "function reset() {\n // noop\n }", "function resetMonthOptions() {\n for (var i = 0; i < 12; i++) {\n document.getElementById('urlMonth' + i).value = DEFAULT_IMAGE_URLS[i];\n }\n}", "function deleteApiKey() {\n document.cookie = \"apiKey=; expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n}", "function reset() {\r\n // noop\r\n }", "function savePassword(key, pass) {\n var d, newMonth;\n d = new Date();\n\n newMonth = d.getMonth() + 3;\n if (newMonth > 12) {\n newMonth -= 12;\n d.setYear(d.getYear() + 1);\n }\n d.setMonth(newMonth);\n actualBrowser.storage.local.set({\n \"key\": JSON.stringify(key)\n });\n actualBrowser.storage.local.set({\n \"password\": pass\n });\n}", "function clearReminders(userid = -1,uniquekey = -1) {\n var remindersets = fs.readFileSync('reminders.txt').toString().split('\\n'); // Read the reminders\n var time;\n var occurrence;\n var userids;\n var updated = false; \n if (uniquekey != -1) {\n var thetext = remindersarray[uniquekey][1];\n const theindex = remindersets.findIndex(element => element.split('Φ')[1] == thetext);\n if (theindex != -1) {\n occurence = remindersets[theindex][3];\n time = moment(remindersets[theindex][2]);\n userids = remindersets[theindex][0];\n remindersets.splice(theindex,1);\n updated = true;\n }\n }\n else {\n remindersets.forEach((element) => {\n if (element.split('Φ')[0] == userid) {\n occurence = remindersets[theindex][3];\n time = moment(remindersets[theindex][2]);\n userids = remindersets[theindex][0];\n remindersets.splice(theindex,1);\n updated = true;\n }\n });\n }\n if (updated) {\n fs.writeFile('reminders.txt', remindersets.join('\\n'), function (err) {\n if (err) console.log(err);\n console.log(`Updated reminders.txt for ${userids}. Removed a ${occurrence} occurrence at ${time.format('dddd, MMMM Do YYYY, h:mm:ss a')}.`);\n });\n }\n}", "reset() {\n this.flush();\n this.lastRun = 0;\n this.lag = 0;\n }", "function reset() {\n md = null;\n }", "function resetData() {\r\n if (window.localStorage.length == 0) { alert(\"You don't have any kittens to release. Press the 'Start Game' button to continue\") }\r\n else\r\n localStorage.clear();\r\n }", "invalidateFile(fileName) {\n this.metadataCache.delete(fileName);\n this.resolvedFilePaths.delete(fileName);\n const symbols = this.symbolFromFile.get(fileName);\n if (symbols) {\n this.symbolFromFile.delete(fileName);\n for (const symbol of symbols) {\n this.resolvedSymbols.delete(symbol);\n this.importAs.delete(symbol);\n this.symbolResourcePaths.delete(symbol);\n }\n }\n }", "invalidateFile(fileName) {\n this.metadataCache.delete(fileName);\n this.resolvedFilePaths.delete(fileName);\n const symbols = this.symbolFromFile.get(fileName);\n if (symbols) {\n this.symbolFromFile.delete(fileName);\n for (const symbol of symbols) {\n this.resolvedSymbols.delete(symbol);\n this.importAs.delete(symbol);\n this.symbolResourcePaths.delete(symbol);\n }\n }\n }", "function reset() {\n keyDownEvents = [];\n keyUpEvents = [];\n passwordField.value = '';\n enterKeyTriggered = false;\n }", "function fResetToFirstTime(o) {\n geDate.rawValue = \"\";\n oFirstTime.rawValue = 1;\n o.presence = \"hidden\";\n app.alert(\n \"Now save this form - next time the form is opened the date will default to that day\"\n );\n}", "function clearSchedule() {\n $('#clear-button').on('click', function() {\n scheduleObj = {};\n scheduleArr.length = 0;\n scheduleObj['date'] = date;\n scheduleArr.push(scheduleObj);\n\n localStorage.removeItem(date);\n $('.input-area').val('');\n\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n });\n }", "static clearOldNonces() {\n Object.keys(localStorage).forEach(key => {\n if (!key.startsWith(\"com.auth0.auth\")) {\n return;\n }\n localStorage.removeItem(key);\n });\n }", "function regenerateNewCache(){\n //special ordering for new so it is always the same, selecting\n //offset regions breaks otherwise\n database.sequelize.query(\"SELECT imdb_id, title, type FROM movies WHERE type = 'movie' ORDER BY NULLIF(regexp_replace(year, E'\\\\D', '', 'g'), '')::int DESC, \\\"createdAt\\\" DESC LIMIT 16 OFFSET \" + pageNumber * 16,\n {model: database.Movie}\n ).then(function(movies){\n cache.set(\"new_0\", JSON.stringify(movies), global.FontPageTTL, function(err, success){\n if(err){\n logger.error(\"CACHE_SET_FAILURE: new_0\");\n }else{\n logger.debug(\"CACHE_SET_SUCCESS: new_0\");\n }\n });\n });\n }", "function setFooter(file){\r\n\tvar withoutFooter = file.length-20;\r\n\tfile.set(sha1_hmac(new Uint8Array(file.buffer, 0, withoutFooter), HMAC_KEY), withoutFooter);\r\n}", "reset() {\n this.isFiring = false;\n this.y = 431;\n }", "function resetTimer(){\n\n time = 31;\n }", "function resetHMSM(currentDate) {\n currentDate.setHours(0);\n currentDate.setMinutes(0);\n currentDate.setSeconds(0);\n currentDate.setMilliseconds(0);\n return currentDate;\n }", "function reset() {\n clock.style.display = 'none';\n container.style.display = 'block';\n removeClass(calendar, 'datipi-circle-hidden');\n calendar.style.display = 'block';\n btnPreviousMonth.style.display = 'inline-block';\n btnNextMonth.style.display = 'inline-block';\n if (hours != null) {\n hours.setAttribute('style', '');\n hours.className = 'datipi-circle-selector datipi-hours';\n }\n if (minutes != null) {\n minutes.setAttribute('style', '');\n minutes.className = 'datipi-minutes datipi-circle-hidden';\n }\n initCalendar();\n }", "function recreateStoriesFile() {\r\n // deletes old file\r\n fs.unlink('stories.txt', function(err) {\r\n if (err) throw err;\r\n console.log('File successfully deleted!');\r\n });\r\n // iterate through hashtable with for each loop\r\n // where for each title (key) in the hashtable, we \r\n // add both the title and story (value) into a new file.\r\n for (let title of stories.keys()) {\r\n let story = stories.get(title);\r\n // the appendFile() method will create a new stories.txt file since the previous one was deleted.\r\n fs.appendFile('stories.txt', '\\n' + title + '\\n' + splitConstant + '\\n' + story + '\\n' + splitConstant, function(err) {\r\n if (err) {\r\n return console.error(err);\r\n }\r\n });\r\n }\r\n\r\n console.log('stories.txt file recreated!');\r\n}", "function resetFields() {\n fileFormRef.reset();\n setFilename(\"\");\n }", "reset() {\n this.cache = {};\n }", "clearKeystore() {\n throw new Error(\"Method not implemented.\");\n }", "function defaultMonthKeyFn(event) {\n return moment.utc(event.occurred_at).date(1).format('YYYYMMDD');\n }", "function generateKeysFile() {\n\tvar keys = JSON.stringify(rsaGenerateKeys());\n\tfs.writeFile(keysFile, keys, function(error) {\n\t\tif(error) {\n\t\t\tconsole.log(error);\n\t\t\tapp.exit(0);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(chalk.green(\"\\nGenerated Keys.\"));\n\t\t\tverifyKeys(keys);\n\t\t}\n\t});\n}", "expire(key) {\n const observer = this.documents.get(key);\n if (!observer) {\n return;\n }\n observer.dispose();\n this.documents.delete(key);\n }", "function resetPomoData() {\n currentPomoID = INVALID_POMOID;\n pomoData = [];\n updateTable();\n savePomoData();\n}", "function clearData() {\n for (var key in markers_map) {\n var marker = markers_map[key];\n var json = markers_dict[key];\n // if the data is over a minute old\n if (!isNotTooOld(json)) {\n deleteMarker(key, marker);\n }\n }\n}", "function clearFile() {\n fs.truncate('./development.properties', 0, function () { console.log('done') })\n}", "function setNextMonthData() {\n if (self.currentMonthIndex < 12) {\n self.currentMonthIndex++;\n } else {\n self.currentMonthIndex = 1;\n }\n\n for (var i = 0; i < self.budgetMonths.length; i++) {\n if (self.currentMonthIndex == self.budgetMonths[i].month_id) {\n self.currentMonthData = self.budgetMonths[i];\n self.currentMonth = self.budgetMonths[i].month;\n }\n }\n } // end setNextMonthData", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "function reset() {\n raw_data = \"\";\n data = [];\n frequency_object = {};\n frequency_total = 0;\n grouped = []\n}", "clearOldNonces() {\n try {\n Object.keys(localStorage).forEach(key => {\n if (!key.startsWith('com.auth0.auth')) {\n return;\n }\n localStorage.removeItem(key);\n });\n } catch (erorr) { /* */ }\n }", "function reset() {\n\nstart();\n\n}", "function reset(){\n window.localStorage.clear();\n document.location.reload(true);\n}", "function ResetImprestDocumentModal() {\n\t$(\"#ApplicationDocumentFile\").val(\"\");\n\tLadda.stopAll();\n}" ]
[ "0.58668953", "0.561359", "0.5587326", "0.5567813", "0.5566154", "0.5477541", "0.5417211", "0.54039294", "0.5378549", "0.53601503", "0.5350594", "0.53137445", "0.5281797", "0.5107134", "0.50998724", "0.508927", "0.5067068", "0.5057745", "0.5057745", "0.50276", "0.5025315", "0.50242776", "0.50233775", "0.5011807", "0.50096", "0.5002712", "0.49969858", "0.498933", "0.49800244", "0.49743584", "0.495681", "0.4950437", "0.49469757", "0.49318102", "0.49314722", "0.4930855", "0.4929768", "0.4929768", "0.49219525", "0.49212787", "0.49019146", "0.48914292", "0.48911792", "0.48792747", "0.4877385", "0.48751324", "0.48735762", "0.4869037", "0.48689467", "0.48640537", "0.48636347", "0.48615026", "0.48610342", "0.4846654", "0.48443717", "0.48415297", "0.48397332", "0.48348808", "0.48187444", "0.48108798", "0.48088464", "0.48087853", "0.48071876", "0.47928682", "0.47869107", "0.47748208", "0.4770566", "0.47648087", "0.4764287", "0.47546306", "0.47526616", "0.47522563", "0.47522563", "0.4751421", "0.47501704", "0.47463745", "0.47462326", "0.47452864", "0.47431985", "0.47360164", "0.47347903", "0.47346094", "0.47264108", "0.47197804", "0.47176498", "0.47174194", "0.47131628", "0.4710333", "0.47087863", "0.47075376", "0.47067836", "0.47040376", "0.46931088", "0.46929044", "0.4690646", "0.46890575", "0.46881", "0.4666958", "0.4662519", "0.46607077" ]
0.8331846
0
Global variable from html: stats phases port_plot_data_1 port_plot_data_2 ports_side_data ports_seg_data
function plot_phases(){ let data = []; let index = phases["index"]; let order = ["otg", "take_off", "landing", "climb", "descent", "hold", "cruise"]; for (let phase of order) { let fill = phase=="otg"?'tozeroy':'tonexty'; data.push({ y: phases[phase], x: index, name: phase, line: {shape: 'hv'}, fill: 'tozeroy', type: "scatter" }); } let layout = {height: 400, title: "Flight phases", xaxis: {title: "Time (s)"}, yaxis: {title: "Phase", range:[0,8]} }; Plotly.newPlot('plot_phases', data, layout, {displaylogo: false}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStats() {\n\tvar temp = event.data.replace(\"updateStats\", \"\");\n\ttemp = temp.split(\"#\");\n\tfor (var i = 0; i < temp.length; i++) {\n\t\ttemp[i] = temp[i].split(\";\");\n\t}\n\t// console.log(temp);\n\tdocument.getElementById('p1name').innerText = temp[0][0];\n\tdocument.getElementById('p2name').innerText = temp[1][0];\n\tdocument.getElementById('p3name').innerText = temp[2][0];\n\tdocument.getElementById('p4name').innerText = temp[3][0];\n\tdocument.getElementById('p1rank').innerText = temp[0][1];\n\tdocument.getElementById('p2rank').innerText = temp[1][1];\n\tdocument.getElementById('p3rank').innerText = temp[2][1];\n\tdocument.getElementById('p4rank').innerText = temp[3][1];\n\tdocument.getElementById('p1cards').innerText = temp[0][2];\n\tdocument.getElementById('p2cards').innerText = temp[1][2];\n\tdocument.getElementById('p3cards').innerText = temp[2][2];\n\tdocument.getElementById('p4cards').innerText = temp[3][2];\n\tdocument.getElementById('p1shields').innerText = temp[0][3];\n\tdocument.getElementById('p2shields').innerText = temp[1][3];\n\tdocument.getElementById('p3shields').innerText = temp[2][3];\n\tdocument.getElementById('p4shields').innerText = temp[3][3];\n}", "function myPlottingPar(){\n\tthis['ResQTL_trait'] = \"\", \n\tthis['ResQTL_qtl'] = \"\",\n\tthis['ResQTL_cohorts'] = [],\n\tthis['ResRel_cohorts'] = [],\n\tthis['ResRelbetweenC_cohort1'] = \"\",\n\tthis['ResRelbetweenC_cohort2'] = \"\",\n\tthis['ResgMean_cohorts'] = [],\n\tthis['ResgMean_pType'] = \"By Repeats\",\n\tthis['RespMean_cohorts'] = [],\n\tthis['RespMean_pType'] = \"By Repeats\",\n\tthis['ResRel_pType'] = \"By Repeats\",\n\tthis['ResAccBVE_cohorts'] = [],\n\tthis['ResAccBVE_pType'] = \"By Repeats\"\n}", "function parse_variables() {\n\n\t\t\t\twindow.W = W = parseFloat(localStorage.getItem('SPLITTER_W'));\n\t\t\t\twindow.B = B = parseFloat(localStorage.getItem('SPLITTER_B'));\n\t\t\t\twindow.Mf = Mf = parseFloat(localStorage.getItem('SPLITTER_MF'));\n\t\t\t\twindow.Mt = Mt = parseFloat(localStorage.getItem('SPLITTER_MT'));\t\t\t\t\n\n\t\t\t}", "function gps_informacionTabular(val) {\n informacion_tabular = val;\n lbl_play += \"-min\";\n lbl_pause += \"-min\";\n}", "static FormPlots() {\n netSP.plots.length = 0;\n for (let p = 0; p < netSP.encode.length; p++) {\n netSP.plots[p] = {\n quantities: {\n edgeLength: [],\n angle: [],\n },\n metrics: {\n // 'q90': 0,\n // 'Skewed length': 0,\n // 'Skewed angle': 0,\n // 'IQR': 0,\n 'Outlying vector':0,\n 'Outlying length': 0,\n 'Outlying angle': 0,\n 'Correlation': 0,\n // 'Neg correlation': 0,\n 'Entropy': 0,\n 'Intersection': 0,\n 'Translation': 0,\n 'Homogeneous': 0,\n },\n outliers: {\n length: [],\n angle: [],\n position: [],\n vector: [],\n },\n outliersList: {\n length: [],\n angle: [],\n },\n data: [],\n arrows: [],\n points: [],\n }\n }\n }", "function ajaxPiwikStats()\n{\n\t$(\"span[data-piwik-stats]\").each(function(index)\n\t{\n\t\tvar $dataGrabber = $(this);\n\t\t$dataGrabber.html('<i class=\"fa fa-refresh fa-spin\"></i>');\n\n\t\tvar $dataUrl = $(this).data('url');\n\t\tvar $dataSegment = $(this).data('segment');\n\t\tvar $piwikDayRange = $('#piwikDayRange input[name=\"piwikDays\"]:radio:checked').val();\n\n\t\t$.get($dataUrl, { segment: $dataSegment, dayRange: $piwikDayRange } )\n\t\t.done(function(data)\n\t\t{\n\t\t\t$dataGrabber.html(data);\n\t\t});\n\t});\n}", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function plotStatsnew() {\n// plot the storm climatology in x-y plotly plot\n \n// this create a slide bar at the bottom of the chart to zoom in on a time period \nvar selectorOptions = {\n buttons: [ {\n step: 'year',\n stepmode: 'todate',\n count: 1,\n label: 'YTD'\n }, {\n step: 'year',\n stepmode: 'backward',\n count: 10,\n label: '10y'\n }, {\n step: 'all',\n }],\n};\n\n// bring in climatology from flask ... this is computed on server side when\n// server is started to speed things up\n d3.json(`${www_addr}info`).then(function(data) {\n ts = [] // count of tropical storms per year\n hu = [] // count of hurricanes per year\n years = [] // all years in climatology\n all = [] // counts for tr + hu\n pie = [] // holds total counts of saffier-simpson cattegories for a pie chart\n stats = data\n type = 1; // 1 for line plot, 2 for pie\n data.sort((a, b) => (a.year > b.year) ? 1 : -1) // sort data by year\n data.forEach(function(stats){ // split stats into different categories\n if (stats.year > 1800) {\n years.push(stats.year.toString())\n ts.push(stats['0'])\n hu.push(stats.HU)\n all.push(stats.count)\n } else { // this assigns total counts for entire period of record\n pie.push(stats['1'])\n pie.push(stats['2'])\n pie.push(stats['3'])\n pie.push(stats['4'])\n pie.push(stats['5'])\n }\n })\n\n// these are the choice for the select box at the bottom of the climatology\n var choices = ['Hurricanes','Tropical Storms','All Storms','Storm Aggregate']\n\n function getCountryData(chosents) {\n// this function assigns the data to be plotted when the select box is changed\n console.log(\"choice get data\",chosents)\n if (chosents === \"Hurricanes\") {\n type=1\n return hu\n } else if (chosents === \"Tropical Storms\") {\n type=1\n return ts\n } else if (chosents === \"All Storms\") {\n type=1\n return all\n } else {\n type=2\n return pie \n }\n };\n\n // set the default value for the plot\n setBarPlot('Hurricanes');\n\n function setBarPlot(chosents) {\n// this function sets up the x-y plot for plotly\n currentData = getCountryData(chosents);\n if (type == 1) { // this is x-y plot for storm types by year\n var trace1 = {\n x: years,\n y: currentData,\n width: 400,\n height: 500,\n mode: 'lines+markers',\n marker: {\n size: 12,\n opacity: 0.5\n }\n }\n var layout = {\n xaxis: { rangeselector: selectorOptions,\n rangeslider: {}\n },\n title: `${chosents} per Year`,\n yaxis: {range: [0, 30]} \n };\n \n } else { // this is for pie chart counts for entere period of record by saffier-simpson scale\n var trace1 = {\n values: pie,\n labels: ['Cat 1', 'Cat 2', 'Cat 3','Cat 4','Cat 5'],\n marker: {\n colors: [\"#66ff33\",\"#ff99ff\",\"#ff9900\",\"#cc6600\",\"#ff0000\"]},\n type: 'pie',\n height: 500,\n width: 400\n } \n var layout = {\n height: 400,\n width: 400,\n title: `Total Storm Counts by Category for 1851-2018`, \n };\n\n\n }\n var data = [trace1];\n \n \n Plotly.newPlot('stats', data, layout); //plot data\n }; \n\n// assign the actual plot to the inner div so that select box can \n// be put in outer div\n var innerContainer = document.querySelector('#stats'),\n plotEl = innerContainer.querySelector('.plot'),\n countrySelector = innerContainer.querySelector('.stats');\n\n\n function assignOptions(textArray, selector) {\n// this sets the select box up to choose what to plot\n for (var i = 0; i < textArray.length; i++) {\n var currentOption = document.createElement('option');\n currentOption.text = textArray[i];\n selector.appendChild(currentOption);\n }\n }\n\n assignOptions(choices, countrySelector);\n\n function updateLine(){\n// this function allows us to update the line chart and makes this dynamic as it \n// is called by the event listener below\n setBarPlot(countrySelector.value);\n }\n// set up event listener on selector box to change the line plot/ pie chart\n countrySelector.addEventListener('change', updateLine, false);\n});\n\n \n}", "function getGeneralData(){\n\t\t// Idioma\n//\t\tfind(\"//script[@type='text/javascript']\", XPFirst).src.search(/\\/([^\\/]+)?3.js$/);\n\t\tfind(\"//img[contains(@src, 'plus.gif')]\", XPFirst).src.search(/\\/img\\/([^\\/]+)\\//);\n\t\tidioma = RegExp.$1;\n\n\t\t// Ruta al pack grafico\n\t\tfind(\"//link[@rel='stylesheet']\", XPFirst).href.search(/^(.*\\/)(.*)3.css$/);\n\t\tpack_grafico = RegExp.$1;\n\n\t\t// Identificador de aldea actual\n\t\tid_aldea = getIdAldea();\n\n\t\t// Identificador de usuario\n\t\tfind(\"//td[@class='menu']\", XPFirst).innerHTML.search(/spieler.php\\?uid=(\\d+)\"/);\n\t\tuid = RegExp.$1;\n\n\t\t// Nombre del servidor\n\t\tlocation.href.search(/http:\\/\\/(.*)\\//);\n\t\tserver = RegExp.$1;\n\n\t\t// Por cada tipo de recurso: cantidad actual almacenada, capacidad total del almacen / granero y produccion por segundo\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tactual[i] = get('l'+(i+1)).innerHTML.split(\"/\")[0];\n\t\t\ttotal[i] = get('l'+(i+1)).innerHTML.split(\"/\")[1];\n\t\t\tproduccion[i] = get('l'+(i+1)).title/3600;\n\t\t}\n\n\t\t// Plus\n\t\tif (find(\"//img[contains(@src, 'travian1.gif')]\", XPFirst)) plus = true; else plus = false;\n\t}", "function getPortsDiv(portName, portNumber, mac, receivePackets, transmitPackets, receiveBytes,\n\t\ttransmitBytes, receiveDrops, transmitDrops, receiveErrors, transmitErrors) {\n\tvar div = '<div class=\"col-sm-2 col-md-2\"><div class=\"thumbnail\"><img src=\"img/port.png\" alt=\"...\" height=\"60\" width=\"60\"><div class=\"caption\">';\n\tdiv += '<p align=\"center\">' + portName + ' ('+ portNumber +')</p></div>';\n\tdiv += 'MAC: ' + mac \n\t\t\t+ '<br /> Packet Rx: ' + receivePackets\n\t\t\t+ '<br /> Packet Tx: ' + transmitPackets\n\t\t\t+ '<br />Byte Rx: ' + receiveBytes\n\t\t\t+ '<br />Byte Tx: ' + transmitBytes\n\t\t\t+ '<br />Drop Rx: ' + receiveDrops\n\t\t\t+ '<br />Drop Tx: ' + transmitDrops\n\t\t\t+ '<br />Error Rx: ' + receiveErrors\n\t\t\t+ '<br />Error Tx: ' + transmitErrors\n\t\t\t+ '</div></div>';\n\treturn div;\n}", "function setGlobalVariables() {\n officeName = officeLoc[beach].name;\n beachID = officeLoc[beach].beachID;\n weatherID = officeLoc[beach].weatherID;\n officeLatCoord = officeLoc[beach].lat;\n officeLonCoord = officeLoc[beach].lon;\n transit = officeLoc[beach].transit;\n videoLetterboxed = officeLoc[beach].videoLetterboxed;\n measurements = homeOfficeInfo[0].measurements;\n\n if (measurements === english) {\n heightUnit = 'ft';\n surflineVar = 'e';\n tempUnit = 'f';\n } else if (measurements === metric) {\n heightUnit = 'm';\n surflineVar = 'm';\n tempUnit = 'c';\n }\n}", "function datasetSelected(expandedTab)\n{\n var dataset = expandedTab.titleBar.id;\n // Get the pretty-printed name of the dataset\n prettyDsName = expandedTab.titleBar.firstChild.nodeValue;\n // returns a table of variable names in HTML format\n downloadUrl('WMS.py', 'SERVICE=WMS&REQUEST=GetMetadata&item=variables&dataset=' + dataset,\n function(req) {\n var xmldoc = req.responseXML;\n // set the size of the panel to match the number of variables\n var panel = $(dataset + 'Content');\n var varList = xmldoc.getElementsByTagName('tr');\n panel.style.height = varList.length * 20 + 'px';\n panel.innerHTML = req.responseText;\n }\n );\n}", "function myPlottingData(){\n\tthis['ResQTL'] = \"\", \n\tthis['ResRel'] = \"\",\n\tthis['ResRelbetweenC'] = \"\",\n\tthis['ResgMean'] = \"\",\n\tthis['Summary'] = \"\",\n\tthis['RespMean'] = \"\",\n\tthis['ResAccBVE'] = \"\",\n\tthis['confidence'] = false,\n\tthis['legend'] = true\n}", "function changeOnPageStats()\n\t{\n\t\t\n\t\tstatData = $.ajax({\n type: \"GET\",\n\t\turl: \"get_Stat.php\",\n\t\tdata: \"start=\" + startNumber,\n\t\tdataType:\"String\",\n async: false,\n\t\tsuccess: function(data){\n\t\t \n },\n\t\t\terror: function(e){\n console.log(e.message);\n }\n\t\t}).responseText;\n\n\t\t// gets the string and converts each section into a useful stat for the page, and updates \n\t\tvar firstNumber = 0;\n\t\tvar commaIndex = 0;\n\t\t\n\t\t\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"speedStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"throttleStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"batteryStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"batteryTempStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"airTempStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\tdocument.getElementById(\"coolentTempStat\").innerHTML = statData.substring(firstNumber, commaIndex);\n\t\tstatData = statData.substring(commaIndex +1);\n\t\tcommaIndex=statData.search(\",\");\n\t\t\n\t\t\n\t\n\tvar str=jsonData.toString();\n\t\t\n\t startNumber = startNumber + 1;\n\t}", "function getReportUBP(prm, yearParam) {\n $.ajax({\n url: 'server',\n data: {\n report: 'ubp',\n year: prm,\n yearParam: yearParam\n },\n success: function (response) {\n $('#report_ubp').html(response);\n tab1.enabled = true;\n tab3.enabled = true;\n tab5.enabled = true;\n }\n });\n}", "function calcViewPort() {\n\t\t\tscreenWidth = $( document ).width();\n\t\t\t$timeout(function() {\n\t\t\t\tif(screenWidth <= 480) { //mobile\n\t\t\t\t\tvm.viewPort = 'Mobile';\n\t\t\t\t\t/*vm.baseArray = [];\n\t\t\t\t\tvm.baseArray = vm.sliderImagesForSmallScreens;*/\n\t\t\t\t} else if(screenWidth >= 481 && screenWidth <= 991) { //tablet\n\t\t\t\t\tvm.viewPort = 'Tablet';\n\t\t\t\t\t/*vm.baseArray = [];\n\t\t\t\t\tvm.baseArray = vm.sliderImagesForTabletScreens;*/\n\t\t\t\t} else if(screenWidth >= 992 && screenWidth <= 1199) { //small desktop\n\t\t\t\t\tvm.viewPort = 'Desktop';\n\t\t\t\t\t/*vm.baseArray = [];\n\t\t\t\t\tvm.baseArray = vm.sliderImagesForLargeScreens;*/\n\t\t\t\t} else if(screenWidth >= 1200) {\n\t\t\t\t\tvm.viewPort = 'extraLarge';\n\t\t\t\t\t/*vm.baseArray = [];\n\t\t\t\t\tvm.baseArray = vm.sliderImagesForExtraLargeScreens;*/\n\t\t\t\t}\n\t\t\t\t$scope.$apply();\n\t\t\t}, 200)\n\t\t\t\n\t\t}", "function var_init() {\n function makeCalcVars(sizeFeet) {\n $scope[\"lum_quant_\" + sizeFeet] = [];\n $scope[\"total_scrap_\" + sizeFeet] = [];\n $scope[\"total_cost_\" + sizeFeet] = [];\n }\n for (var i = 8; i <= 12; i += 2) {\n makeCalcVars(i);\n }\n $scope.summary_rows = [];\n }", "function showSwitchPortStats(id) {\n\tvar ports = null;\n\t$.ajax({\n\t\turl : sdnControllerURL\n\t\t\t\t// + \"/controller/nb/v2/statistics/default/port/node/OF/\"\n\t\t\t\t+ \"/restconf/operational/opendaylight-inventory:nodes/node/\"\n\t\t\t\t+ id,\n\t\ttype : \"GET\",\n\t\tasync : false,\n\t\tcontentType : \"application/json\",\n\t\tsuccess : function(data, textStatus, jqXHR) {\n\t\t\t// console.log(data.node[0]['node-connector']);\n\t\t\tports = data.node[0]['node-connector'];\n\t\t},\n\t\terror : function(jqXHR, textStatus, errorThrown) {\n\t\t\talert(\"Unable to fetch OpenDaylight Node Ports.\\nDid you supply the credentials correct?\");\n\t\t},\n\t\tbeforeSend : function(xhr) {\n\t\t\t// Default Base64 Encoding for (admin/admin)\n\t\t\txhr.setRequestHeader(\"Authorization\", base64EncodedPassword);\n\t\t}\n\t});\n\n\tif (ports != null && ports != undefined) {\n\t\t// Construct divs\n\t\tvar finalDiv = '<div class=\"col-lg-12\"><div class=\"panel panel-success\"><div class=\"panel-heading\">';\n\t\tfinalDiv += '<h4>' + id + ' - Port Statistics</h4>';\n\t\tfinalDiv += '</div><div class=\"panel-body\">';\n\t\tvar prefix = 'flow-node-inventory:';\n\t\t// For each port create a sub element in the final div\n\t\t$.each(ports, function(index, value) {\n\t\t\tvar portStats = value['opendaylight-port-statistics:flow-capable-node-connector-statistics'];\n\t\t\tvar div = getPortsDiv(\n\t\t\t\t// value.id,\n\t\t\t\tvalue[prefix + \"name\"],\n\t\t\t\tvalue[prefix + \"port-number\"],\n\t\t\t\tvalue[prefix + \"hardware-address\"],\n\t\t\t\tportStats.packets.received,\n\t\t\t\tportStats.packets.transmitted,\n\t\t\t\tportStats.bytes.received,\n\t\t\t\tportStats.bytes.transmitted,\n\t\t\t\tportStats['receive-drops'],\n\t\t\t\tportStats['transmit-drops'],\n\t\t\t\tportStats['receive-errors'],\n\t\t\t\tportStats['transmit-errors']\n\t\t\t);\n\t\t\tfinalDiv += div;\n\t\t});\n\n\t\tfinalDiv += '</div></div></div>';\n\t\t$(\"#portDiv\").append(finalDiv);\n\t\t$(\"#portDiv\").removeClass(\"hidden\").addClass(\"visible\");\n\t\t$(\"#portButton\").removeClass(\"visible\").addClass(\"hidden\");\n\n\t}\n\n}", "function renderShowResortAdmin(data,stats){\n $('#resorts_info_admin').html(\"<h3 id=admin_resort>\"+ \"ID: \" +data.id+ \" Name: \"+ data.name + \" Vertical: \" + data.vertical +\" Acres: \"+ data.acres + \" Station: \" + data.location + \" Users: \"+ stats +\"</h3>\");\n }", "function pm_config_obj(testRunId){\n this.ip=localStorage.getItem(testRunId+'_faz_ip');\n this.testRunId=testRunId;\n this.SysChIntId=0;\n this.SqdChIntId=0;\n this.FldChIntId=0;\n this.TopChIntId=0;\n\n\n this.create_config_page=function(){\n\n var tab_container=\"<div id='tabs'>\\\n <ul>\\\n <li><a href='#tabs-1'>Configuration</a></li>\\\n <li><a href='#tabs-2'>Start Test</a></li>\\\n </ul>\\\n <div id='tabs-2'>\\\n <div id='chart_wrapper'>\\\n <div id='ch_sysperf_w' class='perf_chart'>\\\n <h3>CPU and Memory Usage</h3>\\\n <button class='ch_btn' style='background-color:#FF3333' id='p_click_sys_stop' disabled>stop</button>\\\n <button class='ch_btn' style='background-color:lightgreen' id='p_click_sys'>start</button>\\\n <div id='ch_sysperf' ></div>\\\n </div>\\\n <div id='ch_systop_w' class='perf_chart'>\\\n <h3 >Key Daemon CPU Usage</h3>\\\n <button class='ch_btn' style='background-color:#FF3333' id='p_click_top_stop' disabled>stop</button>\\\n <button class='ch_btn' style='background-color:lightgreen' id='p_click_top'>start</button>\\\n <div id='ch_systop'></div>\\\n </div>\\\n <div id='ch_fld_w' class='perf_chart'>\\\n <h3 >FortiLogd log receiving rate</h3>\\\n <button class='ch_btn' style='background-color:#FF3333' id='p_click_fortilogd_stop' disabled>stop</button>\\\n <button class='ch_btn' style='background-color:lightgreen' id='p_click_fortilogd'>start</button>\\\n <div id='ch_fld' ></div>\\\n </div>\\\n <div id='ch_spd_w' class='perf_chart'>\\\n <h3 >Sqlplugind insert rate</h3>\\\n <button class='ch_btn' style='background-color:#FF3333' id='p_click_sqlplugind_stop' disabled>stop</button>\\\n <button class='ch_btn' style='background-color:lightgreen' id='p_click_sqlplugind'>start</button>\\\n <div id='ch_spd' ></div>\\\n </div>\\\n </div>\\\n </div>\\\n <div id='tabs-1'>\\\n <table> \\\n <tr>\\\n <td> IP Address: </td>\\\n <td> <input type='text' id='p_input_ip' name='model'> </td>\\\n <td> *Build Number: </td>\\\n <td> <input type='text' id='p_input_build' name='build'> </td>\\\n </tr>\\\n <tr>\\\n <td>User Name:</td>\\\n <td ><input type='text' id='p_input_u' name='username'></td>\\\n <td>Password:</td>\\\n <td ><input type='text' id='p_input_p' name='passwd'></td>\\\n </tr>\\\n <tr> <td>Device Model: </td>\\\n <td > \\\n <select id='p_select_model'> \\\n <option selected='selected'>VM64</option>\\\n <option>VM32</option>\\\n <option>100C</option> \\\n <option>200D</option> \\\n <option>400B</option> \\\n <option>400C</option> \\\n <option>1000B</option> \\\n <option>1000C</option>\\\n <option>2000A</option>\\\n <option>2000B</option>\\\n <option>4000A</option>\\\n <option>4000B</option>\\\n </select> \\\n <span id='p_span_model'><span>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td>Test Interval(Seconds)</td>\\\n <td ><input type='text' id='p_input_t' name='time'></td>\\\n </tr>\\\n <tr>\\\n <td><button id='p_btn_save_basic_config' value='Upgrade'>Save</button></td>\\\n </tr>\\\n </table>\\\n <hr class='grayhr'>\\\n </div>\\\n </div>\";\n\n\n $('#layout_center_content').append(tab_container);\n\n $('#p_input_m').val(localStorage.getItem(this.testRunId+'_faz_model'));\n $('#p_input_ip').val(localStorage.getItem(this.testRunId+'_faz_ip'));\n }\n\n// if (!jQuery.isEmptyObject(data))\n//below 3 for system cpu,mem usage chart\n\n this.runSysChart=function(interval){\n\n var self = this;\n var time_array = [];\n\n this_ip = localStorage.getItem(testRunId+'_faz_ip');\n this_username = localStorage.getItem(testRunId+'_faz_username');\n this_password= localStorage.getItem(testRunId+'_faz_password');\n\n var y_array = [];\n var y2_array=[];\n this.SysChIntId = setInterval(function(){\n myDate = new Date();\n time_array.push(myDate.getHours()+':'+myDate.getMinutes());\n // console.log(time_array);\n //get data here:\n $.get('getSystemStatus?ip='+this_ip+'&username='+this_username+'&passwd='+this_password,function(data){\n dict = JSON.parse(data);\n y_array.push(parseInt(dict.cpu));\n y2_array.push(parseInt(dict.mem));\n console.log(y_array);\n console.log(time_array);\n self.showSysChart(time_array,y_array,y2_array);\n });\n },interval)\n }\n this.clearSysChart = function(){\n clearInterval(this.SysChIntId);\n }\n this.showSysChart=function(x_axis,y_axis,y2_axis){\n //get data from local storage? or get from JSON?\n// var x_list = localStorage.getItem(this.testRunId+'ch1_time')\n// var y_list_cpu = localStorage.getItem(this.testRunId+'ch1_sys_cpu')\n// var y_list_mem=localStorage.getItem(this.testRunId+'ch2_sys_mem')\n //below for test:\n\n var x_list = x_axis;\n var y_list1 = y_axis;\n var y_list2 = y2_axis;\n // var y_list1 = [Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1)]\n //get\n\n //draw data:\n $('#ch_sysperf').wijlinechart({\n// header: {\n// text: \"CPU and Memory Usage\",\n//// textStyle: {fill: \"black\", \"font-size\": 12}\n// },\n axis: {\n y: {\n text: \"%\",\n min: 0, //Minimum value for axis\n max: 100, //Maximum value for axis\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n annoFormatString: 'n0', //Format values on axis as number with 0 decimal places. For example, 4.00 would be shown as 4\n tickMajor: { position: \"outside\" }\n },\n x: {\n text: \"\",\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n tickMajor: { position: \"outside\" }\n\n }\n },\n showChartLabels: false,\n hint: {\n //Display custom information in tooltip. If not set, the content will default to x and y data display values\n content: function () {\n //Check if multiple data points are on one axis entry. For example, multiple data entries for a single date.\n if ($.isArray(this)) {\n var content = \"\";\n //Multiple entries of data on this point, so we need to loop through them to create the tooltip content.\n for (var i = 0; i < this.length; i++) {\n content += this[i].lineSeries.label + '-- ' + this[i].y + '\\n';\n }\n return content;\n }\n else {\n //Only a single data point, so we return a formatted version of it. \"/n\" is a line break.\n return this.data.lineSeries.label +\n '--' + this.y ;\n }\n }\n },\n indicator: {\n visible: true\n },\n legend: {\n visible: true,\n compass: \"south\"\n\n },\n data: {\n //X axis values as Date objects. We are using a shared x value array for this chart with multiple y value arrays.\n x: x_list\n },\n seriesList: [\n {\n label: \"CPU\", //Label shown in legend\n legendEntry: true,\n data: {\n //Y axis values for 1st series\n y:y_list1\n }\n },\n {\n label: \"Memory\",\n legendEntry: true,\n data: {\n //Y axis values for 2nd series\n y: y_list2\n }\n\n }\n ],\n //Override width of lines for both series. More customization can be done, such as fill, stroke (color) etc.\n seriesStyles: [\n { \"stroke-width\": 2 },\n { \"stroke-width\": 2 }\n\n\n ],\n //Override width of lines for both series when hovered.\n seriesHoverStyles: [\n { \"stroke-width\": 3 },\n { \"stroke-width\": 3 }\n ]\n })\n }\n\n//below 2 for Top values of fortilogd,sqllod and sqlplugind usage chart\n this.runTopChart=function(interval){\n\n var self = this;\n var time_array = [];\n this_ip = localStorage.getItem(testRunId+'_faz_ip');\n this_username = localStorage.getItem(testRunId+'_faz_username');\n this_password= localStorage.getItem(testRunId+'_faz_password');\n var y_array = [];\n var y2_array=[];\n var y3_array=[];\n this.TopChIntId = setInterval(function(){\n myDate = new Date();\n time_array.push(myDate.getHours()+':'+myDate.getMinutes());\n // console.log(time_array);\n //get data here:\n $.get('getTop?ip='+this_ip+'&username='+this_username+'&passwd='+this_password,function(data){\n\n dict = JSON.parse(data);\n y_array.push(parseInt(dict.fortilogd));\n y2_array.push(parseInt(dict.sqllogd));\n y3_array.push(parseInt(dict.sqlplugind));\n console.log(y2_array);\n self.showTopChart(time_array,y_array,y2_array,y3_array);\n });\n },interval)\n }\n this.clearTopChart = function(){\n clearInterval(this.TopChIntId);\n }\n this.showTopChart=function(x_axis,y_axis,y2_axis,y3_axis){\n\n var x_list = x_axis;\n var y_list1 = y_axis;\n var y_list2 = y2_axis;\n var y_list3 = y3_axis;\n // var y_list1 = [Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1)]\n //get\n\n //draw data:\n $('#ch_systop').wijlinechart({\n\n axis: {\n y: {\n text: \"%\",\n min: 0, //Minimum value for axis\n max: 100, //Maximum value for axis\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n annoFormatString: 'n0', //Format values on axis as number with 0 decimal places. For example, 4.00 would be shown as 4\n tickMajor: { position: \"outside\" }\n },\n x: {\n text: \"time\",\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n tickMajor: { position: \"outside\" }\n }\n },\n showChartLabels: false,\n hint: {\n //Display custom information in tooltip. If not set, the content will default to x and y data display values\n content: function () {\n //Check if multiple data points are on one axis entry. For example, multiple data entries for a single date.\n if ($.isArray(this)) {\n var content = \"\";\n //Multiple entries of data on this point, so we need to loop through them to create the tooltip content.\n for (var i = 0; i < this.length; i++) {\n content += this[i].lineSeries.label + ': ' + (this[i].y ) + '\\n';\n }\n return content;\n }\n else {\n //Only a single data point, so we return a formatted version of it. \"/n\" is a line break.\n return this.data.lineSeries.label + '\\n' +\n //Format x as Short Month and long year (Jan 2010). Then format y value as calculared currency with no decimal ($1,983,000).\n Globalize.format(this.x, 'MMM yyyy') + '-- ' + this.y ;\n }\n }\n },\n indicator: {\n visible: true\n },\n legend: {\n visible: true,\n compass: \"south\"\n\n },\n data: {\n //X axis values as Date objects. We are using a shared x value array for this chart with multiple y value arrays.\n x: x_list\n },\n seriesList: [\n {\n label: \"Foritlogd\", //Label shown in legend\n legendEntry: true,\n data: {\n //Y axis values for 1st series\n y:y_list1\n }\n },\n {\n label: \"Sqllogd\",\n legendEntry: true,\n data: {\n //Y axis values for 2nd series\n y: y_list2\n }\n\n },\n {\n label: \"Sqlplugind\",\n legendEntry: true,\n data: {\n //Y axis values for 2nd series\n y: y_list3\n }\n\n }\n ],\n //Override width of lines for both series. More customization can be done, such as fill, stroke (color) etc.\n seriesStyles: [\n { \"stroke-width\": 2 },\n { \"stroke-width\": 2 },\n { \"stroke-width\": 2 }\n\n\n ],\n //Override width of lines for both series when hovered.\n seriesHoverStyles: [\n { \"stroke-width\": 3 },\n { \"stroke-width\": 3 },\n { \"stroke-width\": 3 }\n\n ]\n })\n\n }\n\n\n\n//below 2 for FortiLogd receive rate of Fortilogd speed chart\n this.runFldChart=function(interval){\n\n var self = this;\n var time_array = [];\n this_ip = localStorage.getItem(testRunId+'_faz_ip');\n this_username = localStorage.getItem(testRunId+'_faz_username');\n this_password= localStorage.getItem(testRunId+'_faz_password');\n var y_array = [];\n var y2_array=[];\n var y3_array=[];\n this.FldChIntId = setInterval(function(){\n myDate = new Date();\n time_array.push(myDate.getHours()+':'+myDate.getMinutes());\n // console.log(time_array);\n //get data here:\n $.get('getFortilogd?ip='+this_ip+'&username='+this_username+'&passwd='+this_password,function(data){\n\n result = JSON.parse(data);\n y_array.push(parseInt(result));\n\n console.log(y_array);\n self.showFldChart(time_array,y_array);\n });\n },interval)\n }\n this.clearFldChart = function(){\n clearInterval(this.FldChIntId);\n }\n this.showFldChart=function(x_axis,y_axis){\n\n var x_list = x_axis;\n var y_list1 = y_axis;\n\n // var y_list1 = [Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1)]\n //get\n\n //draw data:\n $('#ch_fld').wijlinechart({\n\n axis: {\n y: {\n text: \"logs\",\n// min: 0, //Minimum value for axis\n// max: 100, //Maximum value for axis\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n annoFormatString: 'n0', //Format values on axis as number with 0 decimal places. For example, 4.00 would be shown as 4\n tickMajor: { position: \"outside\" }\n },\n x: {\n text: \"time\",\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n tickMajor: { position: \"outside\" }\n }\n },\n showChartLabels: false,\n hint: {\n //Display custom information in tooltip. If not set, the content will default to x and y data display values\n content: function () {\n //Check if multiple data points are on one axis entry. For example, multiple data entries for a single date.\n if ($.isArray(this)) {\n var content = \"\";\n //Multiple entries of data on this point, so we need to loop through them to create the tooltip content.\n for (var i = 0; i < this.length; i++) {\n content += this[i].lineSeries.label + ': ' +(this[i].y ) + '\\n';\n }\n return content;\n }\n else {\n //Only a single data point, so we return a formatted version of it. \"/n\" is a line break.\n return this.data.lineSeries.label + '\\n' +\n //Format x as Short Month and long year (Jan 2010). Then format y value as calculared currency with no decimal ($1,983,000).\n Globalize.format(this.x, 'MMM yyyy') + ': ' + (this.y );\n }\n }\n },\n indicator: {\n visible: true\n },\n legend: {\n visible: true,\n compass: \"south\"\n\n },\n data: {\n //X axis values as Date objects. We are using a shared x value array for this chart with multiple y value arrays.\n x: x_list\n },\n seriesList: [\n {\n label: \"Receiving Rate\", //Label shown in legend\n legendEntry: true,\n data: {\n //Y axis values for 1st series\n y:y_list1\n }\n }\n\n ],\n //Override width of lines for both series. More customization can be done, such as fill, stroke (color) etc.\n seriesStyles: [\n { \"stroke-width\": 2 }\n ],\n //Override width of lines for both series when hovered.\n seriesHoverStyles: [\n { \"stroke-width\": 3 }\n ]\n })\n\n }\n\n\n\n\n\n//below 2 for Sqlplugind rate chart\n this.runSpdChart=function(interval){\n\n var self = this;\n var time_array = [];\n this_ip = localStorage.getItem(testRunId+'_faz_ip');\n this_username = localStorage.getItem(testRunId+'_faz_username');\n this_password= localStorage.getItem(testRunId+'_faz_password');\n var y_array = [];\n\n this.SqdChIntId = setInterval(function(){\n myDate = new Date();\n time_array.push(myDate.getHours()+':'+myDate.getMinutes());\n // console.log(time_array);\n //get data here:\n $.get('getSqlplugind?ip='+this_ip+'&username='+this_username+'&passwd='+this_password,function(data){\n console.log(data);\n result = JSON.parse(data);\n y_array.push(parseInt(result));\n console.log(y_array);\n self.showSqdChart(time_array,y_array);\n });\n },interval)\n }\n\n\n this.clearSpdChart = function(){\n clearInterval(this.SqdChIntId);\n }\n\n this.showSqdChart=function(x_axis,y_axis){\n\n var x_list = x_axis;\n var y_list1 = y_axis;\n\n // var y_list1 = [Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1),Math.floor((Math.random()*100)+1)]\n //get\n\n //draw data:\n $('#ch_spd').wijlinechart({\n\n axis: {\n y: {\n text: \"logs\",\n// min: 0, //Minimum value for axis\n// max: 100, //Maximum value for axis\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n annoFormatString: 'n0', //Format values on axis as number with 0 decimal places. For example, 4.00 would be shown as 4\n tickMajor: { position: \"outside\" }\n },\n x: {\n text: \"time\",\n autoMin: true, //Tell the chart not to automatically generate minimum value for axis\n autoMax: true, //Tell the chart not to automatically generate maximum value for axis\n tickMajor: { position: \"outside\" }\n }\n },\n showChartLabels: false,\n hint: {\n //Display custom information in tooltip. If not set, the content will default to x and y data display values\n content: function () {\n //Check if multiple data points are on one axis entry. For example, multiple data entries for a single date.\n if ($.isArray(this)) {\n var content = \"\";\n //Multiple entries of data on this point, so we need to loop through them to create the tooltip content.\n for (var i = 0; i < this.length; i++) {\n content += this[i].lineSeries.label + ': ' + Globalize.format(this[i].y * 1000, 'c0') + '\\n';\n }\n return content;\n }\n else {\n //Only a single data point, so we return a formatted version of it. \"/n\" is a line break.\n return this.data.lineSeries.label + '\\n' +\n //Format x as Short Month and long year (Jan 2010). Then format y value as calculared currency with no decimal ($1,983,000).\n Globalize.format(this.x, 'MMM yyyy') + ': ' + Globalize.format(this.y * 1000, 'c0');\n }\n }\n },\n indicator: {\n visible: true\n },\n legend: {\n visible: true,\n compass: \"south\"\n\n },\n data: {\n //X axis values as Date objects. We are using a shared x value array for this chart with multiple y value arrays.\n x: x_list\n },\n seriesList: [\n {\n label: \"Receiving Rate\", //Label shown in legend\n legendEntry: true,\n data: {\n //Y axis values for 1st series\n y:y_list1\n }\n }\n\n ],\n //Override width of lines for both series. More customization can be done, such as fill, stroke (color) etc.\n seriesStyles: [\n { \"stroke-width\": 2 }\n ],\n //Override width of lines for both series when hovered.\n seriesHoverStyles: [\n { \"stroke-width\": 3 }\n ]\n })\n\n }\n\n\n function toHHMMSS(secs)\n {\n var hours = Math.floor(secs / (60 * 60));\n\n var divisor_for_minutes = secs % (60 * 60);\n var minutes = Math.floor(divisor_for_minutes / 60);\n\n var divisor_for_seconds = divisor_for_minutes % 60;\n var seconds = Math.ceil(divisor_for_seconds);\n\n var obj = {\n \"h\": hours,\n \"m\": minutes,\n \"s\": seconds\n };\n return obj;\n }\n\n\n}", "function defineVariables(results) {\n\n companyName = results.price.shortName;\n marketCap = results.price.marketCap.fmt;\n industry = results.summaryProfile.industry;\n sector = results.summaryProfile.sector;\n website = results.summaryProfile.website;\n totalRevenue = results.financialData.totalRevenue.fmt;\n totalEBITDA = results.financialData.ebitda.fmt;\n grossMargin = results.financialData.grossMargins.fmt;\n totalCash = results.financialData.totalCash.fmt;\n totalDebt = results.financialData.totalDebt.fmt;\n debtTwoEquity = results.financialData.debtToEquity.fmt;\n\n // then update the spans with the captured values\n return updatePage();\n\n}", "function process_chart(process) {\n\tvar name = process.name;\n\tvar execution_time = parseInt(process.execution_time);\n\tvar arrival_time = parseInt(process.arrival_time);\n\tvar burst_time = parseInt(process.burst_time);\n\n\treturn '<li class=\"title\" title=\"\">'+name+'</li><li class=\"current\" title=\"'+execution_time+'\"><span class=\"bar\" data-number=\"'+burst_time+\n\t'\"></span><span class=\"number\">'+(burst_time+execution_time)+'</span></li>';\n}", "function plot() {\n\t$('#gen-label').text(`Generation ${genPlot}`); \n\tPlotly.newPlot('self-score-data', selfScoreData[genPlot], layout);\n\tPlotly.newPlot('rstp', rstpData[genPlot], {title: 'RSTP'});\n\tconsole.log('rstpData:');\n\tconsole.log(rstpData);\n}", "createPandaStats() {\n let pandaStats = $(`<small class='pcm-pandaStats'></small>`).appendTo($(`.${this.topMenuRow2}:first`));\n pandaStats.append(`<span class='pcm-span-off' id='pcm-collecting'></span> - <span id='pcm-collectingTotal'></span> `);\n let statArea = $(`<span class='pcm-statArea'></span>`).appendTo($(`.${this.topMenuRow2}:first`));\n statArea.append(`[ <span id='pcm-timerStats' class='toggle'></span> | <span id='pcm-jobFetchStats' class='toggle'></span> | `);\n statArea.append(`<span id='pcm-preStats' class='toggle'></span> | <span id='pcm-jobStats' class='toggle'></span> | <span id='pcm-earningsStats' class='toggle'></span> ]`);\n pandaStats = null; statArea = null;\n }", "function get_plot_info_on_page(worksheet){\n var parent = $(worksheet).find('.update-plot').parent();\n\n function variable_values(label){\n var result;\n if(parent.find('.'+label).find(\":selected\").attr(\"type\") == \"gene\"){\n result = { url_code : parent.find('[variable=\"'+ label + '\"] #search-term-select').find(\":selected\").val()};\n } else {\n result = { url_code: parent.find('.'+label).find(\":selected\").val()}\n }\n if (result.url_code == \"-- select a variable--\"){\n result.url_code = \"\";\n }\n return result;\n }\n\n var result = {\n worksheet_id : $(worksheet).find('.update-plot').attr(\"worksheet_id\"),\n plot_id : $(worksheet).find('.update-plot').attr(\"plot_id\"),\n selections : {\n x_axis : get_values($(worksheet).find('.x-axis-select').find(\":selected\")),\n y_axis : get_values($(worksheet).find('.y-axis-select').find(\":selected\")),\n color_by : get_simple_values(parent.find('#color_by')),\n gene_label: get_simple_values(parent.find('#gene_label'))\n },\n attrs : {\n type : parent.parentsUntil(\".worksheet-body\").find(\".plot_selection\").find(\":selected\").text(),\n x_axis : variable_values('x-axis-select'),\n y_axis : variable_values('y-axis-select'),\n color_by: {url_code: parent.find('#color_by').find(\":selected\").val()},\n cohorts: parent.find('[name=\"cohort-checkbox\"]:checked').map(function () {\n return {id: this.value, cohort_id: $(this).attr(\"cohort-id\")};\n }).get(),\n gene_label: parent.find('#gene_label').find(\":selected\").text()\n }\n }\n\n return result;\n }", "setPorts(port, multiviewPort) {\n this.data.port = port\n this.data.multiviewPort = multiviewPort\n this.save_session_data()\n }", "function DataView()\n{\ndocument.write(window.datatype + \" was submitted by: \" + window.author + \"<br />\");\nSplitPro(window.datatype);\nSplitMat(window.datatype);\n}", "function updatePageAnalyticsData(summaryData) {\n window.pageAnalyticsData = summaryData;\n lastRow = summaryData.rows.length-1;\n setPageStatInt(\"nodesLabel\", \"nodesValue\", \"Node Count\", \"\", summaryData.rows[lastRow][\"count_hostname\"]);\n setPageStatInt(\"cpuLabel\", \"cpuValue\", \"Avg Load\", \"%\", summaryData.rows[lastRow][\"avg_cpu\"]);\n}", "function setup(){\n // String IDs of the 3 SVG containers\n var svgIdList = [\"vis1\", \"vis2\", \"vis3\"];\n\n // Foreach SVG container in the HTML page, save their references and dimensions into the appropriate global list variables\n for (i = 0; i < 3; i++) {\n var svgTuple = grabSvgDimensions(svgIdList[i]);\n svg_list.push(svgTuple[0]);\n svg_width_list.push(svgTuple[1]);\n svg_height_list.push(svgTuple[2]);\n }\n\n loadData(\"Pokemon-Dataset.csv\");\n}", "function global_numbering(){\n all_pts.attr('indexing', 'global');\n all_pts_txt.attr('style', 'display:true;')\n .text(function(d,i){return i;})\n .attr('fill', txt_color.global)\n ;\n all_pts_circle.attr('stroke-opacity', '1').attr('fill', point_color.global);\n title.text('Numérotation Globale');\n}", "function onInputChange() {\n let data = parseString(document.getElementById('stat-page-textarea-1').value);\n let freqList = parseString(document.getElementById('stat-page-textarea-2').value);\n \n /* Error checking: \n * - Data not all same dimension\n * - Freq list not all integers */\n\n freqList = freqList.map(x => x[0]);\n\n const card1 = document.getElementById('stat-page-card-1'); // Stats\n const card2 = document.getElementById('stat-page-card-2'); // Graphs\n const card3 = document.getElementById('stat-page-card-3'); // Tests\n const card4 = document.getElementById('stat-page-card-4'); // Confidence intervals\n const card5 = document.getElementById('stat-page-card-5'); // Sorted\n\n \n let newhtml1 = '';\n let newhtml2 = '';\n\n for (let i = 0; i < data[0].length; i++) {\n /* Get each component of data */\n let _temp = [];\n for (let line of data)\n _temp.push(line[i]);\n\n let stats = computeBasicStats(_temp, freqList);\n\n /* Updates stat list */\n newhtml1 += `<p style=\"font-size: 16px; margin-top: 0\"><b>${i < 3 ? \n 'XYZ'[i] : 'Data ' + (i + 1)} Stats</b></p>${generateHTML(stats)}\\n<br>`;\n\n /* Confidence interval */\n let testStatZ = stats['σ (Pop.)'] / Math.sqrt(stats.n);\n let testStatT = stats['S<sub>x</sub> (Samp.)'] / Math.sqrt(stats.n);\n }\n card1.innerHTML = newhtml1;\n\n /* Graphs: Scatter, histogram, bargraph, normal prob plot */\n\n /* Sorted list */\n let sorted = data.sort((a, b) => a[0] - b[0]);\n card5.innerHTML = `<p style=\"font-size: 16px; margin-top: 0\">Sorted Array</p>\n ${sorted.map(x => x.length === 1 ? x[0] : `(${x.join(', ')})`).join(', ')}`;\n}", "function parseStatisticPage(pageText){\n\nvar pop = gval(\"ctl00_ContentPlaceHolder1_CAdvisor1_lblPopulation\",pageText);\nvar land = gval(\"ctl00_ContentPlaceHolder1_CAdvisor1_lblLand\",pageText);\nvar turns = gval(\"ctl00_lblTurns\",pageText);\nif (!pop || !land || !turns) {\n\tpop = -1;\n\tland = -1;\n\tturns = -1;\n}\nreturn { pop:pop,land:land,turns:turns};\n}", "function initPhaseLabels() {\n\n\t//var list = $('<div class=\"tl_phase_label_wrapper\">');\n\tvar output = '',\n\t\t\tlabels = '';\n\t\n\t$.each(phaseLabels, function(index, value) {\n\t\t\tlabels += '<div class=\"tl_phase_label tl_phase_' + index + '\"><h5>' + value[0] + '</h5><h6>' + value[1] + '</h6></div>';\n\t});\n\toutput = '<div class=\"tl_phase_label_wrapper\">' + labels + '</div>';\n\t\n\t$('.tl_phases').append( output );\n}", "get portId() {\n return this.data[3];\n }", "function calcuPort()\t// calcola il tempo di caricamento navi\n{ \t\t\t\n\t// Calculate loading times\t 0\t \t\t 5\t\t\t\t 10\t\t\t\t 15\t\t\t\t\t 20\t\t\t\t\t 25\t\t\t\t\t 30\t\t\t\t\t\t 35\t\t\t\t\t\t 40\n\tconst loadingspeed = new Array(10,30,60,93,129,169,213,261,315,373,437,508,586,672,766,869,983,1108,1246,1398,1565,1748,1950,2172,2416,2685,2980,3305,3663,4056,4489,4965,5488,6064,6698,7394,8161,9004,9931,10951,12073,13308);\n\t// calcola la velocità di caricamento\n\tvar speed = 0;\n\t$('#locations div.port').each(function()\n\t{\n\t\t\n\t\tvar lvlport = $(this).attr('class').replace(/\\D/g,'') *1\n\t\tif(lvlport <= 41) speed += loadingspeed[lvlport]\n\t\telse if (lvlport > 41) speed += loadingspeed[41]\n\t});\n\tif (speed == 0) speed = 10\n\t\n\treturn speed\n}", "function plotData(m) {\n d = [];\n var axis = y;\n if (m == \"apdex\") \n axis = apdex;\n else if (m == \"rpm\")\n axis = throughputScale; \n\n for (i = 0; i < $data.timeslices.length; i++) {\n d[i] = { time: x($data.timeslices[i].time), val: axis($data.timeslices[i][m]) };\n }\n return d;\n }", "function do_show_extra_info() {\n\t// {{{\n\n\tvar outtab = document.getElementById('tat_panel');\n\n\tvar tmpdiv;\n\n\tvar prefdiv;\n\tprefdiv = document.createElement(\"div\");\n\tprefdiv.setAttribute(\"id\", \"rbt_prefs\");\n\tprefdiv.innerHTML += \"<b>The Abyss Tuning</b> \" + user_script_version + \"&nbsp;\";\n\touttab.appendChild(prefdiv);\n\n\tbutton_toggle_config = document.createElement(\"button\");\n\tbutton_toggle_config.style.border = \"dotted grey 1px;\";\n\tbutton_toggle_config.innerHTML = \"Configuration\";\n\tprefdiv.appendChild(button_toggle_config);\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_config\");\n\ttmpdiv.style.display = (show_config) ? 'block' : 'none';\n\tprefdiv.appendChild(tmpdiv);\n\n\t\ttmpdiv.innerHTML = \"<hr><b>CONFIGURATION</b><br>\";\n\n\t\tfor (var i = 0; i < array_object.length; ++i) {\n\t\t\tvar tmpobj = array_object[i];\n\t\t\tvar button_toggle = document.createElement(\"button\");\n\t\t\tbutton_toggle.style.border = \"dotted grey 1px;\";\n\t\t\tbutton_toggle.innerHTML = tmpobj.button_name;\n\t\t\ttmpdiv.appendChild(button_toggle);\n\t\t\ttmpobj.toggle_button = button_toggle;\n\t\t}\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_toggle_extra_links = document.createElement(\"button\");\n\t\tbutton_toggle_extra_links.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_extra_links.innerHTML = \"Web links\";\n\t\ttmpdiv.appendChild(button_toggle_extra_links);\n\n\t\tbutton_toggle_route = document.createElement(\"button\");\n\t\tbutton_toggle_route.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_route.innerHTML = \"Route\";\n\t\ttmpdiv.appendChild(button_toggle_route);\n\n\t\tbutton_toggle_hud = document.createElement(\"button\");\n\t\tbutton_toggle_hud.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_hud.innerHTML = \"HUD\";\n\t\ttmpdiv.appendChild(button_toggle_hud);\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_toggle_num_coord = document.createElement(\"button\");\n\t\tbutton_toggle_num_coord.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_num_coord.innerHTML = \"Numerical coordinates on the map\";\n\t\ttmpdiv.appendChild(button_toggle_num_coord);\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_check_update = document.createElement(\"button\");\n\t\tbutton_check_update.style.border = \"dotted grey 1px;\";\n\t\tbutton_check_update.innerHTML = \"Check update online\";\n\t\ttmpdiv.appendChild(button_check_update);\n\n\t// Just a test container\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_test\");\n\touttab.appendChild(tmpdiv);\n\n\t// Just the container\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_check_update\");\n\touttab.appendChild(tmpdiv);\n\n\t// BUTTONS\n\tfor (var i = 0; i < array_object.length; ++i) {\n\t\tvar tmpobj = array_object[i];\n\t\ttmpdiv = document.createElement(\"div\");\n\t\ttmpdiv.setAttribute(\"id\", tmpobj.div_id);\n\t\touttab.appendChild(tmpdiv);\n\t\tsort_places(current_x, current_y, tmpobj.places);\n\t\ttmpdiv.innerHTML += \"<hr><b>\" + tmpobj.name_title + \"</b> - the \" + tmpobj.nearest + \" nearest within \" + tmpobj.dist_threshold + action_point_str +\"<br>\";\n\t\ttmpdiv.appendChild(show_nearest(tmpobj.places, tmpobj.nearest, tmpobj.dist_threshold));\n\t\ttmpdiv.style.display = (tmpobj.show) ? 'block' : 'none';\n\t}\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_extra_links\");\n\ttmpdiv.style.display = (show_extra_links) ? 'block' : 'none';\n\ttmpdiv.innerHTML += \"<hr><b>EXTRALINKS</b><br>\";\n\tfor (var i = 0; i < extra_links.length; ++i) {\n\t\ttmpdiv.innerHTML += \"<a href=\\\"\" + extra_links[i][1] + \"\\\">\"+extra_links[i][0]+\"</a><br>\";\n\t}\n\touttab.appendChild(tmpdiv);\n\n\n\tvar route_div = document.createElement(\"div\");\n\troute_div.setAttribute(\"id\", \"rbt_route\");\n\troute_div.style.display = (show_route) ? 'block' : 'none';\n\touttab.appendChild(route_div);\n\n\n\t// {{{ Destination selection - select menus generation\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_destination_selection\");\n\troute_div.appendChild(tmpdiv);\n\n\ttmpdiv.innerHTML += \"<hr><b>ROUTE</b><br>\" +\n\t\t\t\"You are at \" + streets_name[parseInt(current_x)] + \" (\" + current_x + \") x \" + current_y +\n\t\t\t\", where do you want to go&nbsp;?<br>\";\n\n\tvar tmpOption;\n\n\t// vertical streets\n\tvar dest_x = GM_getValue(\"destination_x\", -1);\n\tselect_dest_x = document.createElement(\"select\");\n\tselect_dest_x.name = \"select_dest_x\";\n\tselect_dest_x.id = \"select_dest_x\";\n\tselect_dest_x.style.width = \"15em\";\n\n\tfor (var i = 0.5; i <= 100; i+= 0.5) {\n\t\ttmpOption = document.createElement(\"option\");\n\t\ttmpOption.setAttribute(\"value\", i);\n\t\tif (i == parseInt(i) + 0.5) {\n\t\t\ttmpOption.innerHTML += streets_name[parseInt(i)] + \" East (\" + i + \")\";\n\t\t} else {\n\t\t\ttmpOption.innerHTML += streets_name[parseInt(i)] + \" (\" + i + \")\";\n\t\t}\n\t\tif (i == dest_x) {\n\t\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\n\t\t}\n\t\tselect_dest_x.appendChild(tmpOption);\n\t}\n\ttmpdiv.appendChild(select_dest_x);\n\n\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t// horizontal streets\n\tvar dest_y = GM_getValue(\"destination_y\", -1);\n\tselect_dest_y = document.createElement(\"select\");\n\tselect_dest_y.name = \"select_dest_y\";\n\tselect_dest_y.id = \"select_dest_y\";\n\tselect_dest_y.style.width = \"15em\";\n\n\tfor (var i = 0.5; i <= 100; i += 0.5) {\n\t\ttmpOption = document.createElement(\"option\");\n\t\ttmpOption.setAttribute(\"value\", \"\" + i);\n\t\tif (i == parseInt(i) + 0.5) {\n\t\t\ttmpOption.innerHTML += ordinal(parseInt(i)) + \" South \" + \" (\" + i + \")\";\n\t\t} else {\n\t\t\ttmpOption.innerHTML += ordinal(parseInt(i)) + \" (\" + i + \")\";\n\t\t}\n\t\tif (i == dest_y) {\n\t\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\n\t\t}\n\t\tselect_dest_y.appendChild(tmpOption);\n\t}\n\ttmpdiv.appendChild(select_dest_y);\n\n\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\troute_use_stations = GM_getValue(\"route_use_stations\", 1);\n\tselect_use_stations = document.createElement(\"select\");\n\tselect_use_stations.name = \"use_stations\";\n\tselect_use_stations.id = \"use_stations\";\n\n\ttmpOption = document.createElement(\"option\");\n\ttmpOption.setAttribute(\"value\", 0);\n\ttmpOption.innerHTML += (\"Do not use stations\");\n\tif (route_use_stations == 0) {\n\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\t}\n\tselect_use_stations.appendChild(tmpOption);\n\ttmpOption = document.createElement(\"option\");\n\ttmpOption.setAttribute(\"value\", 1);\n\ttmpOption.innerHTML += (\"Use stations\");\n\tif (route_use_stations == 1) {\n\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\t}\n\tselect_use_stations.appendChild(tmpOption);\n\n\ttmpdiv.appendChild(select_use_stations);\n\n\t// }}}\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_route_path\");\n\troute_div.appendChild(tmpdiv);\n\n\t// Update the display\n\tcommon_func(null, null);\n\n\t// Bind the event listeners - for the select items\n\tselect_dest_x.addEventListener('change', function(event) { common_func(event, this); } , true);\n\tselect_dest_y.addEventListener('change', function(event) { common_func(event, this); } , true);\n\tselect_use_stations.addEventListener('change', function(event) { common_func(event, this); } , true);\n\n\t// Bind the event listeners - for the button items\n\tbutton_toggle_config.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\n\t// BUTTONS\n\tfor (var i = 0; i < array_object.length; ++i) {\n\t\tvar tmpobj = array_object[i];\n\t\ttmpobj.toggle_button.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\t}\n\n\tbutton_toggle_extra_links.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\tbutton_toggle_route.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\tbutton_toggle_hud.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\n\tbutton_toggle_num_coord.addEventListener('click', function(event) { toggle_display_num_coord(event, this); }, true);\n\n\tbutton_check_update.addEventListener('click', function(event) { check_update(event, this); }, true);\n\n\treturn true;\n\t// }}}\n}", "function LoadDurationMappingAlgorithm(voices, voiceTotal) {\n if (voiceTotal == 1) {\n $('[id^=dMappingPanel1]').ready(function () {\n var $panel = $(this);\n var $Algorithm = $panel.find('[id^=dCompressType1]');// This locates the algorithm drop down menu.\n var $SelectedAlgorithm = $Algorithm.find(\"option:selected\");\n $SelectedAlgorithm.text(voices[voiceTotal - 1].durationMappingArrayAlgorithm);\n });\n }\n else if (voiceTotal == 2) {\n $('[id^=dMappingPanel2]').ready(function () {\n var $panel = $(this);\n var $Algorithm = $panel.find('[id^=dCompressType2]');// This locates the algorithm drop down menu.\n var $SelectedAlgorithm = $Algorithm.find(\"option:selected\");\n $SelectedAlgorithm.text(voices[voiceTotal - 1].durationMappingArrayAlgorithm);\n });\n }\n else if (voiceTotal == 3) {\n $('[id^=dMappingPanel3]').ready(function () {\n var $panel = $(this);\n var $Algorithm = $panel.find('[id^=dCompressType3]');// This locates the algorithm drop down menu.\n var $SelectedAlgorithm = $Algorithm.find(\"option:selected\");\n $SelectedAlgorithm.text(voices[voiceTotal - 1].durationMappingArrayAlgorithm);\n });\n }\n else if (voiceTotal == 4) {\n $('[id^=dMappingPanel4]').ready(function () {\n var $panel = $(this);\n var $Algorithm = $panel.find('[id^=dCompressType4]');// This locates the algorithm drop down menu.\n var $SelectedAlgorithm = $Algorithm.find(\"option:selected\");\n $SelectedAlgorithm.text(voices[voiceTotal - 1].durationMappingArrayAlgorithm);\n });\n }\n}", "function displayData() {\n //Queue text number update\n let queueNumber = data.queue.length;\n if (queueNumber < 10) {\n queueNumber = \"0\" + queueNumber;\n }\n queueP.textContent = queueNumber;\n\n //Serving text number update\n let servingNumber = data.serving.length;\n if (servingNumber < 10) {\n servingNumber = \"0\" + servingNumber;\n }\n servingP.textContent = servingNumber;\n\n //Performance text and graph update\n calcPerf();\n}", "function vars() {\n return ['titulo','autor'];\n}", "function getParameterDefinitions() {\n return [\n {name: 'version', caption: 'Version', type: 'text', initial: \"0.0\"},\n { \n name: 'output', \n caption: 'What to show :', \n type: 'choice', \n values: [0, 1, 2, 3, 4, 5, -1, 6, 7, 71, 8, 9, 10, 11, 12], \n initial: 71,\n captions: [\"-----\", // 0\n \"All printer assembly\", // 1\n \"Assembly, no walls\", // 2\n \"Gantry assembly\", // 3\n \"parts only\", // 4\n \"Walls and rods sizes\", // 5\n \"-----\", // nope\n \"Motor mount\", // 6\n \"Idler mount\", // 7\n \"Y rod support\", // 71\n \"Carriage Y\", // 8\n \"Z top\", // 9\n \"Z bottom\", // 10\n \"Z slide\", // 11\n \"Carriage X\" // 12\n ]\n },\n {\n name: 'debug',\n caption: 'Look inside (debug)',\n type: 'choice',\n values: [0, 1],\n initial: 1,\n captions: [\"No\", \"Yes\"]\n },\n {\n name: 'fn',\n caption: 'output resolution (16, 24, 32)',\n type: 'int',\n initial: 8\n },\n {\n name: 'area',\n caption: 'Print area (x,y,z):',\n type: 'text',\n initial: '200,200,150'\n },\n {\n name: 'position',\n caption: 'Position (x,y,z):',\n type: 'text',\n initial: '20,0,0'\n },\n {\n name: 'box_wall',\n caption: 'Box wood thickness:',\n type: 'int',\n initial: 10\n }, \n {\n name: 'idler',\n caption: 'Idler bearing',\n type: 'choice',\n values: [\"3x10x4\", \"4x10x4\", \"5x10x4\", \"608\"],\n initial: \"5x10x4\",\n captions: [\"3x10x4\", \"4x10x4\", \"5x10x4\", \"608\"]\n },\n {\n name: 'xy_rods_d',\n caption: 'X Y Rods diameter (6 or 8 ):',\n type: 'int',\n initial: 8\n },\n {\n name: 'z_rods_d',\n caption: 'Z Rods diameter (6,8,10,12):',\n type: 'int',\n initial: 8\n },\n {\n name: 'z_rods_option',\n caption: 'Z threaded rods:',\n type: 'choice',\n initial: 0,\n values:[0,1,2],\n captions: [\"false\", \"true\", \"true-2sides\"]\n }, \n {\n name: 'nema_size', \n caption: 'Motor size',\n type: 'choice',\n values: [\"nema14\",\"nema17\"],\n captions: [\"nema14\",\"nema17\"],\n initial: \"nema17\"\n }\n ]; \n}", "processExportVar() {\n if (this.isSimpleExportVar()) {\n this.processSimpleExportVar();\n } else {\n this.processComplexExportVar();\n }\n }", "function init()\n{\n extractCodedData();\n\n // Initialise main page hidden data period variables.\n var n = N_MATCHES - 1;\n var sD = MATCHES_ARRAY[0]['dateArray'][0];\n var sM = MATCHES_ARRAY[0]['dateArray'][1];\n var sY = MATCHES_ARRAY[0]['dateArray'][2];\n var fD = MATCHES_ARRAY[n]['dateArray'][0];\n var fM = MATCHES_ARRAY[n]['dateArray'][1];\n var fY = MATCHES_ARRAY[n]['dateArray'][2];\n setMainPageHiddenDataR_tabPeriodVars(sD, sM, sY, fD, fM, fY);\n\n // Initialise main page hidden data selected season name.\n document.getElementById('r_tabPeriodHiddenDataSeasonId').value = 'Select Season';\n\n selectR_tab('Period');\n selectS_tab('playerStats');\n}", "getP() {\r\n let p = [];\r\n let unparseP = this.#rawtext[2];\r\n for(let line of unparseP.split('\\n')) {\r\n if(line.split('\\t').length == 2) { p.push(parseFloat(line.split('\\t')[1])); }\r\n }\r\n\r\n this.processingTimes = p;\r\n }", "function do_header_conso_precinct(){\r\n //alert('pg:'+pg+' lctr:'+lctr);\r\n var dtl=\r\n '<div id=\"pg_repo_conso_precinct_'+pg+'\" style=\"width:100%;height:'+pg_height+'px;page-break-after:always;position:relative;font-size:12px;font-weight:bold;padding:10px;margin:0 auto;margin-top:0px;margin-bottom:10px;color:black;border:0px solid violet;background:white;\">'+ \r\n\r\n '<div style=\"width:100%;height:80px;font-size:14px;border:0px solid red;background:none;\">'+\r\n '<div style=\"width:100%;height:20px;text-align:left;font-weight:bold;\">PRECINCTS STATUS GROUP BY BARANGAY - CONSOLIDATED</div>'+\r\n '<div style=\"width:100%;height:20px;text-align:left;\">As of: '+vtime+', '+vdate+'</div>'+ \r\n '<div style=\"width:100%;height:20px;text-align:left;\">'+jformatNumber(tot_votes)+' of '+jformatNumber(tot_regVoters)+' Registered Voters</div>'+\r\n '</div>'+\r\n \r\n '<div style=\"width:100%;height:50px;margin-top:0px;font-size:14px;border:1px solid black;background:none;\">'+\r\n\r\n '<div style=\"float:left;height:100%;width:30%;padding:14px 0 0 0;border:1px solid black;text-align:center;\">BARANGAY NAME</div>'+\r\n\r\n '<div style=\"float:left;height:100%;width:30%;padding:0px;border:0px solid black;\">'+\r\n '<div style=\"height:50%;width:100%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">T O T A L S</div>'+\r\n '<div style=\"height:50%;width:100%;padding:0px;border:0px solid black;text-align:center;\">'+\r\n '<div style=\"float:left;height:100%;width:33%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">VOTERS</div>'+\r\n '<div style=\"float:left;height:100%;width:34%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">VOTES</div>'+\r\n '<div style=\"float:left;height:100%;width:33%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">CLUSTER</div>'+\r\n '</div>'+\r\n '</div>'+\r\n\r\n '<div style=\"float:left;height:100%;width:14%;padding:14px;border:1px solid black;text-align:center;\">PERC</div>'+\r\n\r\n '<div style=\"float:left;height:100%;width:26%;padding:0px;border:0px solid black;\">'+\r\n '<div style=\"height:50%;width:100%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">C L U S T E R</div>'+\r\n '<div style=\"height:50%;width:100%;padding:0px;border:0px solid black;text-align:center;\">'+\r\n '<div style=\"float:left;height:100%;width:30%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">OPEN</div>'+\r\n '<div style=\"float:left;height:100%;width:34%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">CLOSED</div>'+\r\n '<div style=\"float:left;height:100%;width:36%;padding:3px 0 0 0;border:1px solid black;text-align:center;\">STATUS</div>'+\r\n '</div>'+\r\n '</div>'+\r\n\r\n '</div>'+\r\n \r\n '<div style=\"width:100%;height:auto;margin-top:2px;font-size:14px;border:0px solid brown;\">'+dtl_line+'</div>'+\r\n\r\n '<div>';\r\n document.getElementById('main_repo_conso_precinct').innerHTML+=dtl; \r\n }", "function writeGameStats() {\n\tconst timeStat = $('.timeStat');\n\tconst clockTime = $('span.timer').html();\n\tconst movesStat = $('.movesStat');\n\tconst starsStat = $('.starsStat')\n\n\ttimeStat.html(`Time = ${clockTime}`);\n\tmovesStat.html(`Moves = ${moves}`);\n\tstarsStat.html(`Stars = ${stars}`);\n}", "showSysVSys() {\n const selectSys1 = document.getElementById('marot-sys-v-sys-1');\n const selectSys2 = document.getElementById('marot-sys-v-sys-2');\n this.system1 = selectSys1.value;\n this.system2 = selectSys2.value;\n const docsegs1 = this.getDocSegs(this.stats[this.system1] || {});\n const docsegs2 = this.getDocSegs(this.stats[this.system2] || {});\n /**\n * Find common segments.\n */\n let i1 = 0;\n let i2 = 0;\n const docsegs12 = [];\n while (i1 < docsegs1.length && i2 < docsegs2.length) {\n const ds1 = docsegs1[i1];\n const ds2 = docsegs2[i2];\n const sort = this.docsegsSorter(ds1, ds2);\n if (sort < 0) {\n i1++;\n } else if (sort > 0) {\n i2++;\n } else {\n docsegs12.push(ds1);\n i1++;\n i2++;\n }\n }\n document.getElementById('marot-sys-v-sys-xsegs').innerHTML =\n docsegs12.length;\n document.getElementById('marot-sys-v-sys-1-segs').innerHTML =\n docsegs1.length;\n document.getElementById('marot-sys-v-sys-2-segs').innerHTML =\n docsegs2.length;\n\n const sameSys = this.system1 == this.system2;\n\n for (const m of this.metricsVisible) {\n const metricKey = 'metric-' + m;\n /**\n * We draw up to 3 plots for a metric: system-1, system-2, and their diff.\n */\n const hists = [\n {\n docsegs: docsegs1,\n hide: !this.system1,\n sys: this.system1,\n color: 'lightgreen',\n sysCmp: '',\n colorCmp: '',\n id: 'marot-sys1-plot-' + m,\n },\n {\n docsegs: docsegs2,\n hide: sameSys,\n sys: this.system2,\n color: 'lightblue',\n sysCmp: '',\n colorCmp: '',\n id: 'marot-sys2-plot-' + m,\n },\n {\n docsegs: docsegs12,\n hide: sameSys,\n sys: this.system1,\n color: 'lightgreen',\n sysCmp: this.system2,\n colorCmp: 'lightblue',\n id: 'marot-sys-v-sys-plot-' + m,\n },\n ];\n for (const hist of hists) {\n const histElt = document.getElementById(hist.id);\n histElt.style.display = hist.hide ? 'none' : '';\n if (hist.hide) {\n continue;\n }\n const histBuilder = new MarotHistogram(m, hist.sys, hist.color,\n hist.sysCmp, hist.colorCmp);\n for (let i = 0; i < hist.docsegs.length; i++) {\n const doc = hist.docsegs[i][0];\n const docSegId = hist.docsegs[i][1];\n const aggregate1 = this.aggregateSegStats(\n [this.stats[hist.sys][doc][docSegId]]);\n if (!aggregate1.hasOwnProperty(metricKey)) {\n continue;\n }\n let score = aggregate1[metricKey];\n if (hist.sysCmp) {\n const aggregate2 = this.aggregateSegStats(\n [this.stats[hist.sysCmp][doc][docSegId]]);\n if (!aggregate2.hasOwnProperty(metricKey)) {\n continue;\n }\n score -= aggregate2[metricKey];\n }\n histBuilder.addSegment(doc, docSegId, score);\n }\n histBuilder.display(histElt);\n }\n }\n }", "nrqlChartData(platformUrlState) {\n const { duration } = platformUrlState.timeRange;\n const durationInMinutes = duration / 1000 / 60;\n return [\n {\n title: 'Page Views per City',\n nrql: `SELECT count(*) FROM PageView WHERE appName = 'Demo ASP.NET' SINCE 1 week ago FACET city`,\n chartType: 'pie'\n },\n {\n title: 'Response Time Distribution (ms)',\n nrql: `SELECT histogram(duration,20,20) FROM PageView SINCE yesterday`\n },\n {\n title: 'Engagement by Hour',\n nrql: `SELECT uniqueCount(session) FROM PageView SINCE 7 days ago FACET hourOf(timestamp)`,\n chartType: 'pie'\n },\n {\n title: 'Browsers',\n nrql: `SELECT percentage(uniqueCount(session), WHERE userAgentName = 'IE') AS '% of IE Users', percentage(uniqueCount(session), WHERE userAgentName = 'Chrome') AS '% of Chrome Users', percentage(uniqueCount(session), WHERE userAgentName = 'Firefox') AS '% of Firefox Users', percentage(uniqueCount(session), WHERE userAgentName = 'Safari') AS '% of Safari Users' FROM PageView SINCE 7 days ago`,\n chartType: 'billboard'\n }\n ];\n }", "function getPipe(){\n\treturn jQuery('.nes-screen')[0].getContext('2d').getImageData(0,40,214,1).data;\n}", "function addData() {\n // resets all info on the page\n resetTeamPage();\n // adds in images\n addImagesToPage();\n // adds in pit data\n addPitDataToPage();\n // adds in prescout data\n if (Object.keys(prescout_data).length !== 0) {\n addPrescoutDataToPage();\n }\n // adds in stand data\n addStandDataToPage();\n // adding average/mean/max to btn-div (non match-specific)\n addOverallStatsToPage();\n // adds in notes data\n addNotesToPage();\n // view data button functionality\n addDataToViewDataButton();\n // hides sensitive info if applicable\n displaySensitiveInfo();\n}", "function initData() {\n var data = {\n // DEBUG: this values will come from the server\n documentNumberEncoded: '2n9d', // document id in base36\n readerNumberEncoded: '4mkbm', // reader id in base36\n\n // tops:\n // list of the HTML nodes and their position in the rendered page, to be\n // used for finding the \"next\" paragraph when the user scrolls\n // it contains a reference to each DOM element and it's scroll position\n // relative to the top of the document\n // each element has { node: aRefToTheNode, top: relativeTop }\n topsMap: [],\n // element currently at the top of the viewport\n topsMapIdx: 0,\n topsMapElement: null,\n\n // used for recording the user action events\n scrollData: {}, // object with current reading position data\n // reference to the current top element\n // DEFINED BELOW: elementAtTop: this.$content[0],\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters\n _eat: null, // reference to a node\n get elementAtTop() {\n if( typeof( this._eat ) === 'object' ) {\n return this._eat;\n } else {\n // search for an element near the current scroll position\n var iMap = 0;\n while( this.topsMap[iMap].top >= window.scrollY ) {\n this._eat = this.topsMap[iMap].node;\n }\n return this._eat;\n }\n },\n set elementAtTop(newEat) { this._eat = newEat; },\n scrollTimer: null, // time between scroll action and recording (cancellable)\n\n // Contains each header's docpath indexed by the header id, and the offsetTop\n // Used when repositioning, to find the header id given the docPath of the\n // target element (its first 7 items), contains docPath and .offsetTop \n headerId: {}, // map from headers part of docpath to header id\n\n resizingTimer: null, // delay resize action until stable\n resizingTimerDelay: 777, // delay resize action until stable\n containerYOffset: 0 // top position of the container, used to calculate\n // absolute Y coordinates\n };\n return data;\n }", "function output5() {\n var element = document.getElementById(\"output\");\n element.innerHTML = \"/*CSS*/ <br />\"\n + \".scenario5 { <br />\"\n + g_tab + scenarioTransformValues + \"<br />\"\n + g_tab + scenarioDurationValues + \"<br />\"\n + g_tab + scenarioDelayValues + \"<br />\"\n + g_tab + scenarioTimFunValues + \"<br />\"\n + \"}<br />\"\n + \"@keyframes animation2D { <br />\"\n + d_tab + scenarioKeyfrom + \"<br />\"\n + d_tab + scenarioKey50 + \"<br />\"\n + d_tab + scenarioKeyto + \"<br />\"\n + g_tab + \"} <br />\";\n }", "function LoadDurationMappingUpperRange(voices, voiceTotal) {\n if (voiceTotal == 1) {\n $('[id^=dMappingPanel1]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dTo1]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayUpperBound);\n });\n }\n else if (voiceTotal == 2) {\n $('[id^=dMappingPanel2]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dTo2]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayUpperBound);\n });\n }\n else if (voiceTotal == 3) {\n $('[id^=dMappingPanel3]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dTo3]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayUpperBound);\n });\n }\n else if (voiceTotal == 4) {\n $('[id^=dMappingPanel4]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dTo4]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayUpperBound);\n });\n }\n}", "function parse(vcd,variableInteressante){\n\tclear();\n\t//~ Tableau contenant les lignes du vcd\n\tvar lignes = vcd.split('\\n');\n\t//~ Tableau contenant les mots d'une ligne\n\tvar mots=\"\";\n\t//~ Tableau contenant la liste des variables du vcd\n\tvar listeVariables = new Map();\n\t//~ Chaine représentant le module courant\n\tvar scope=\"\"; \n\t\n\t//~ ------- VARIABLE ------- ~//\n\tvar b = true;\n\tvar i = 0;\n\twhile(b==true){\n\t\tmots = lignes[i].split(' ');\n\t\tif(mots[0]==\"$enddefinitions\"){\n\t\t\tb=false;\n\t\t}\n\t\telse if(mots[0]==\"$scope\"){\n\t\t\tscope=scope+mots[2]+\".\";\n\t\t}\n\t\telse if(mots[0]==\"$upscope\"){\n\t\t\tscope = (scope.substring(0,scope.length-1));\n\t\t\tscope= scope.substring(0,scope.lastIndexOf(\".\"));\n\t\t\tif(scope.length>0){\n\t\t\t\tscope=scope+\".\";\n\t\t\t}\n\t\t}\n\t\telse if(mots[0]==\"$var\"){\n\t\t\tvar type = mots[1];\n\t\t\tvar length = mots[2];\n\t\t\tvar id = mots[3];\n\t\t\tif(length>1){\n\t\t\t\tvar name = mots[4].substring(0,mots[4].indexOf('['));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar name = mots[4];\n\t\t\t}\n\t\t\tvar nouvelleVariable = new Variable(type,length,id,scope,name);\n\t\t\tif((variableInteressante.indexOf(scope+name)!=-1 || variableInteressante.length==0)){\n\t\t\t\tlisteVariables.set(id,nouvelleVariable);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t\n\t\t}\n\t\ti++;\n\t}\n\t\n\t//~ ------- VALEURS ------- ~//\n\tvar temps=\"\";\n\tvar idVariable =\"\";\n\tvar valeurVariable =\"\";\n\tvar tableauTemps = new Array();\n\tfor(i;i<lignes.length;i++){\n\t\tmots = lignes[i].split(' ');\n\t\tif(mots[0].charAt(0)=='#'){\n\t\t\ttemps = mots[0].substring(1,mots[0].length);\n\t\t\ttableauTemps.push(temps);\n\t\t\tlisteVariables.forEach(function(value,key){\n\t\t\t\tcopyOldValue(listeVariables,key,temps);\n\t\t\t},listeVariables)\n\t\t}\n\t\telse if(mots[0].length==2){\n\t\t\tvaleurVariable=mots[0].charAt(0);\n\t\t\tidVariable=mots[0].charAt(1);\n\t\t\tif(listeVariables.has(idVariable)==true){\n\t\t\t\tchangeMapValue(listeVariables,idVariable,temps,valeurVariable);\n\t\t\t}\n\t\t}\n\t\telse if(mots[0].length>0){\n\t\t\tidVariable = mots[1];\n\t\t\tvaleurVariable = mots[0].substring(1,mots[0].length);\n\t\t\tif(listeVariables.has(idVariable)==true){\n\t\t\t\tchangeMapValue(listeVariables,idVariable,temps,valeurVariable);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn [listeVariables, tableauTemps];\n}", "function loadTab1(){\n\n\t//var width_local=$(\"#a11\").width();\n\t//alert(width_local);\n\tvar heigth_local=svgHeight;\n\t//console.log(\"currentPages=\"+currentPages);\n\t//console.log(\"totalNum=\"+totalNum);\n\n\t//#a11\n\tif(currentPages*4+1<=totalNum){\n\t\tstr=matching.filter(function(num){\n\t\t\tif (num.loc==(currentPages*4+0+1)){\n\t\t\t\treturn num;\n\t\t\t}\n\t\t})[0].name;\n\t\tif((isResized)||(str!=space[0])) {\n\t\t\t$( \"#a11\" ).css(\"border\",\"1px solid\");\n\t\t\tdrawArticlesNew('#a11', 0, width_a11, heigth_local, corpusStr.filter(function(element){\n\t\t\t\tif(element.name==str){\n\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t})[0]);\n\t\t\tspace[0]=str;\n\t\t}\n\t}\n\telse{\n\t\t$( \"#a11\" ).css(\"border\",\"0px solid\");\n\t\td3.select(\"#a11\").select(\"svg\").remove();\n\t\tspace[0]=\"\";\n\t}\n\t\n\t//#a12\n\tif(currentPages*4+2<=totalNum){\n\t\tstr=matching.filter(function(num){\n\t\t\tif (num.loc==(currentPages*4+1+1)){\n\t\t\t\treturn num;\n\t\t\t}\n\t\t})[0].name;\n\t\tif((isResized)||(str!=space[1])){\n\t\t\t$( \"#a12\" ).css(\"border\",\"1px solid\");\n\t\t\tdrawArticlesNew('#a12', 1, width_a12, heigth_local, corpusStr.filter(function(element){\n\t\t\t\tif(element.name==str){\n\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t})[0]);\n\t\t\tspace[1]=str;\n\t\t}\n\t}\n\telse {\n\t\t$( \"#a12\" ).css(\"border\",\"0px solid\");\n\t\td3.select(\"#a12\").select(\"svg\").remove();\n\t\tspace[1]=\"\";\n\t}\n\t\n\t//#a21\n\tif(currentPages*4+3<=totalNum){\n\t\t$( \"#a21\" ).css(\"border\",\"1px solid\");\n\t\tstr=matching.filter(function(num){\n\t\t\tif (num.loc==(currentPages*4+2+1)){\n\t\t\t\treturn num;\n\t\t\t}\n\t\t})[0].name;\n\t\tif((isResized)||(str!=space[2])){\n\t\t\t$( \"#a21\" ).css(\"border\",\"1px solid\");\n\t\t\tdrawArticlesNew('#a21', 2, width_a21, heigth_local, corpusStr.filter(function(element){\n\t\t\t\tif(element.name==str){\n\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t})[0]);\n\t\t\tspace[2]=str;\n\t\t}\n\t}\n\telse {\n\t\t$( \"#a21\" ).css(\"border\",\"0px solid\");\n\t\td3.select(\"#a21\").select(\"svg\").remove();\n\t\tspace[2]=\"\";\n\t}\n\t\n\t//#a22\n\tif(currentPages*4+4<=totalNum){\n\t\tstr=matching.filter(function(num){\n\t\t\tif (num.loc==(currentPages*4+3+1)){\n\t\t\t\treturn num;\n\t\t\t}\n\t\t})[0].name;\n\t\tif((isResized)||(str!=space[3])){\n\t\t\t$( \"#a22\" ).css(\"border\",\"1px solid\");\n\t\t\tdrawArticlesNew('#a22', 3, width_a22, heigth_local, corpusStr.filter(function(element){\n\t\t\t\tif(element.name==str){\n\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t})[0]);\n\t\t\tspace[3]=str;\n\t\t}\n\t}\n\telse {\n\t\t$( \"#a22\" ).css(\"border\",\"0px solid\");\n\t\td3.select(\"#a22\").select(\"svg\").remove();\n\t\tspace[3]=\"\";\n\t}\n\t\n\tif(isResized){\n\t\tisResized=false;\t\n\t}\n}", "function idu4PortStatisticsGraph(divId, interface_value) {\n var start_date = $(\"#odu_start_date\").val();\n var start_time = $(\"#odu_start_time\").val();\n var end_date = $(\"#odu_end_date\").val();\n var end_time = $(\"#odu_end_time\").val();\n $.ajax({\n type: \"post\",\n url: \"idu4_port_statistics_graph.py?ip_address=\" + idu4IpAddress + \"&start_date=\" + start_date + \"&start_time=\" + start_time + \"&end_date=\" + end_date + \"&end_time=\" + end_time + \"&interface_value=\" + interface_value + \"&limitFlag=\" + limitFlag,\n data: $(this).serialize(), // $(this).text?\n cache: false,\n success: function (result) {\n //alert(result)\n try {\n result = eval(\"(\" + result + \")\");\n } catch (err) {\n $().toastmessage('showErrorToast', \"UNMP Server has encountered an error. Please retry after some time.\");\n }\n if (result.success == 1 || result.success == \"1\") {\n $().toastmessage('showErrorToast', 'UNMP Server has encountered an error. Please retry after some time.');\n }\n else if (result.success == 2 || result.success == '2') {\n $().toastmessage('showErrorToast', 'UNMP database Server or Services not running so please contact your Administrator.');\n }\n else if (result.success == 3 || result.success == '3') {\n $().toastmessage('showErrorToast', 'UNMP database Server has encountered an error. Please retry after some time.');\n }\n else {\n\n portChart = new Highcharts.Chart({\n chart: {\n renderTo: divId,\n defaultSeriesType: 'line',\n marginRight: 10,\n marginBottom: 25\n },\n title: {\n text: 'Port Transfer Rate',\n x: -20 //center\n },\n subtitle: {\n text: ' ',\n x: -20\n },\n xAxis: {\n categories: result.time_stamp0\n },\n yAxis: {\n title: {\n text: 'Transfer Rate (Kbps)'\n },\n plotLines: [\n {\n value: 0,\n width: 1,\n color: '#808080'\n }\n ]\n },\n tooltip: {\n formatter: function () {\n return '<b>' + this.series.name + '</b><br/>' +\n '<b>' + this.x + '</b>' + ': ' + this.y + '(Kbps)';\n }\n },\n legend: {\n align: 'left',\n x: 11,\n verticalAlign: 'top',\n y: 1,\n floating: true,\n backgroundColor: '#FFFFFF',\n borderColor: '#CCC',\n borderWidth: 1,\n shadow: true\n },\n series: [\n {\n name: 'Tx',\n data: result.interface_tx\n },\n {\n name: 'Rx',\n data: result.interface_rx\n }\n ]\n });\n\n }\n $.yoDashboard.hideLoading(iduPortStatistics);\n },\n error: function (req, status, err) {\n }\n });\n return false; //always remamber this\n}", "function ShowStats($element) {\n switch ($element.data('health')) {\n case 150: $element.find('.DEFstats').text('DEF: +1')\n break;\n case 100: $element.find('.DEFstats').text('DEF: +0')\n break;\n case 50: $element.find('.DEFstats').text('DEF: -1')\n break;\n }\n switch ($element.data('counter')) {\n case 15: $element.find('.ATKstats').text('ATK: +1')\n break;\n case 10: $element.find('.ATKstats').text('ATK: +0')\n break;\n case 5: $element.find('.ATKstats').text('ATK: -1')\n break;\n }\n}", "function createPVCs() //----this application configuration----\r\n{\r\n //buildProcessVariableChart(id, title, timeLine, timeLineUnits, faceColor, leftVariable, minLeft, maxLeft, setPointLeft, right1Variable, minRight1, maxRight1, right2Variable, minRight2, maxRight2, scale, transX, transY)<br>\r\n buildProcessVariableChart(\"hwsPVC\", \"Heating Hot Water\",60,\"Minutes\",\"yellow\",\"HWS(\\u00B0F)\", 60, 220,160, null, null, null, null,null,null,.2,20,50);\r\n buildProcessVariableChart(\"fanPVC\", \"Fan Static Pressure\",60,\"Minutes\",\"#ffd700\",\"STP(in W.C.)\", 0, 5, 3.25, \"Fan(HZ)\", 60, 180, null, null, null, .3,10,150);\r\n buildProcessVariableChart(\"pumpPVC\", \"Hot Water Flow \",60,\"Minutes\",\"#adff2f\",\"HWS(\\u00B0F)\", 60, 220, 150, \"Flow(GPM)\", 0, 600, \"OAT(\\u00B0F)\",-20, 120,.4,20,290);\r\n}", "function updateOutputDataFooter() {\n console.log('updateOutputDataFooter');\n $('#output-data-footer').text('Total nodes: ' + gaOutputData.length);\n}", "function refresh_globals() {\n widget_data.global_div.innerHTML = '<h3 style=\"text-align:center;\">Global Variables</h3>';\n if(widget_data.globals !== undefined) {\n var details_div = document.createElement(\"div\");\n details_div.style.padding = \"5px\";\n Object.keys(widget_data.globals).forEach(function(key, index) {\n var p = document.createElement('p');\n p.innerHTML = `<b>${key}:</b> ${widget_data.globals[key]}`;\n details_div.appendChild(p);\n });\n widget_data.global_div.appendChild(details_div);\n }\n }", "function getVarsInfos($experiment_node,$system_node){\n\tvarsInfoArray = new Array();\n\t// Find the view name on root <system>\n\t$run_modules = $experiment_node.find('run');\n\t$run_modules.each(function(index,element){\n\t\t// Find <modules> tags inside the system node\n\t\t// corresponding to the module name\n\t\tmodule_name = $(element).attr('module');\n\t\tmodule_type = $(element).attr('type');\n\t\t\n\t\t// Check for system name\n\t\t\n\t\t// Generate the full quailifies name\n\t\t// Format: //ip/systemname\n\t\tsystemName = ($system_node.find('system')).attr('name');\n\t\tfullQualifiedSystemName = \"//\" + xml_source_ip + \"/\" + systemName;\n\t\t\n\t\t// Maybe a remote system??\n\t\tremote_system = null;\n\t\tif (module_type==\"remote\"){\n\t\t\t// Remote module !!!\n\t\t\tremote_system = $(this).attr('source');\n\t\t\tfullQualifiedSystemName = remote_system;\n\t\t\t// Find remote variables from remote system\n\t\t\tr_system = decodeRemoteSystem(remote_system);\n\t\t\tremote_system_id = r_system.id;\n\t\t\tremote_xml_source_ip = r_system.ip;\n\t\t\tremote_module_name = module_name;\n\t\t\t// Call the web service to get vars info from module\n\t\t\tloadSoapXMLLoaderWS('getXmlConfFile',{systemId:remote_system_id},getRemoteXmlConfFileSuccessFunction);\n\t\t}\n\t\t\n\t\t// All modules defined in system (local) !!!\n\t\t$modules = $system_node.find('module');\n\t\t$modules.each(function(index, element) {\n\t\t\tif ( $(element).attr('name') == module_name ){\n\t\t\t\t// Add all the vars to the array\n\t\t\t\t$vars = $(element).find('var');\n\t\t\t\t$vars.each(function(index, element) {\n\t\t\t\t\tvariable_json = $.xml2json(element);\n\t\t\t\t\tvariable = new Object();\n\t\t\t\t\tvariable.name = variable_json.name;\n\t\t\t\t\tvariable.description = variable_json.text;\n\t\t\t\t\tvariable.type = variable_json.type;\n\t\t\t\t\tvariable.max = variable_json.max;\n\t\t\t\t\tvariable.min = variable_json.min;\n\t\t\t\t\tvariable.initial = variable_json.initial;\n\t\t\t\t\tvariable.units = variable_json.units;\n\t\t\t\t\tvariable.moduleName = module_name;\n\t\t\t\t\tvariable.fullQualifiedSystemName = fullQualifiedSystemName;\n\t\t\t\t\tvarsInfoArray.push(variable);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\treturn varsInfoArray;\n}", "function graph_multiplesite_patient_number(sDivName,sBreakdownType,asInputFragments) {\ntry {\n\tif (sBreakdownType === undefined || sBreakdownType === null) throw (\"ERROR - sBreakdownType in function graph_patient_breakdown is null\");\n\tvar asBreakdownArray = [[]];\n\tvar iBreakdown = 0;\n\t// for loop to only pull out data from the breakdown type specified in sBreakdownType variable\n\t// for multiple sites make a data array for each site\n\tfor (var i = 0; i < asInputFragments.length; i++) {\n\t\tif (asInputFragments[i][1].toLowerCase().trim() === sBreakdownType.toLowerCase().trim()) {\n\t\t\t//console.log(\"IN> \" + i + \" = \" + asInputFragments[i][2]);\n\t\t\tasBreakdownArray[iBreakdown] = new Array (3);\n\t\t\tasBreakdownArray[iBreakdown][0] = asInputFragments[i][2]; // site\n\t\t\tasBreakdownArray[iBreakdown][1] = asInputFragments[i][3]; // text\n\t\t\tasBreakdownArray[iBreakdown][2] = asInputFragments[i][4]; // number\n\t\t\tiBreakdown++;\n\t\t} else {\n\t\t\t//console.log(\"OUT> \" + i + \" = \" + asInputFragments[i][0]); // items that were left out\n\t\t}\n\t}\n\t// function where the dataset arrays are created:\n\tvar c3values = new Array();\n\tfor (var i = 0; i < asBreakdownArray.length; i++) {\n\t\t//console.log(\"Element \" + i + \" = \" + asBreakdownArray[i][0] + \" \" + asBreakdownArray[i][2]);\n\t\tc3values[i] = new Array(2);\n\t\tc3values[i][0] = asBreakdownArray[i][0].trim() + \" \" + asBreakdownArray[i][1].trim();\n\t\tc3values[i][1] = Number(asBreakdownArray[i][2]);\n\t}\n // C3 that makes pie chart\n\tvar chart = c3.generate({\n\t\tbindto: '#' + sDivName,\n\t\tsize: { \n\t\t\twidth: 535,\n\t\t\theight: 146\n\t\t},\n\t\tdata: {\n\t\t\tcolumns: c3values,\n\t\t\ttype: 'pie',\n\t\t\t//labels: false\n\t\t},\n\t\tpie: {\n\t\t label: {\n format: d3.format('^g,') \n\t\t\t},\n\t\t},\n\t\tlegend: {\n\t\t\t//position: 'inset'\n\t\t\tposition: 'right',\n\t\t},\n\t\taxis: {\n\t\t\tx: {\n\t\t\t\ttype: 'category',\n\t\t\t\ttick: {\n\t\t\t\t\trotate: 25\n\t\t\t\t},\n\t\t\t\theight: 45\n\t\t\t},\n\t\t\ty: {\n\t\t\t\tlabel: {\n\t\t\t\t\ttext: 'Number of Patients',\n\t\t\t\t\t//position: 'outer-middle',\n\t\t\t\t\tposition: 'outer-bottom'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tbar: {\n\t\t\twidth: {\n\t\t\t\tratio: 0.75 // this makes bar width 75% of length between ticks\n\t\t\t}\n\t\t}\n\t});\n}\ncatch(err) {\n\tconsole.error(err);\n}\n}", "function run_allclip(name_video) {\n name_video_global = name_video\n document.getElementById('app').innerHTML= page2\n document.getElementById('video').innerHTML = data_allclip[name_video].link\n document.getElementById('subtitle_1').innerHTML= data_allclip[name_video].sub_1\n document.getElementById('subtitle_2').innerHTML= data_allclip[name_video].sub_2\n document.getElementById('box_like').innerHTML= data_allclip[name_video].box_like\n document.getElementById('recommend').innerHTML= data_allclip[name_video].video_next\n}", "function init() {\n d3.select(\"#more_info\").node().value = \"\";\n buildPlot(data);\n}", "initSlidesData() {\n const slideElements = document.getElementsByTagName(\"section\");\n let offset = 0;\n for (let i = 0; i < slideElements.length; i++) {\n const slide = slideElements[i];\n if (slide.hasAttribute(\"data-line\")) {\n const line = parseInt(slide.getAttribute(\"data-line\"), 10);\n const h = parseInt(slide.getAttribute(\"data-h\"), 10);\n const v = parseInt(slide.getAttribute(\"data-v\"), 10);\n this.slidesData.push({ line, h, v, offset });\n offset += 1;\n }\n }\n }", "function populateFooter(data) {\n const tabSelected = document.querySelector('.tab-selected');\n const footerText = document.getElementById('footer-text');\n\n if (tabSelected.innerHTML === 'Feedings') {\n footerText.innerHTML = `Daily Avg: ${avgFeedings} mls`;\n } else if (tabSelected.innerHTML === 'Weights') {\n footerText.innerHTML = `Avg Weight: ${parseFloat(avgWeights).toFixed(1)} g`;\n }\n}", "function getVars(varstring) {\n\n var doc = document;\n var ret = {};\n if (document.querySelectorAll('#gsft_main').length) //ui16\n doc = document.querySelector('#gsft_main').contentWindow.document;\n else if (document.querySelectorAll(\"[component-id]\").length && //polaris ui\n document.querySelector(\"[component-id]\").shadowRoot.querySelectorAll(\"#gsft_main\").length) {\n doc = document.querySelector(\"[component-id]\").shadowRoot.querySelector(\"#gsft_main\").contentWindow.document; \n }\n else if (document.querySelectorAll('div.tab-pane.active').length == 1) { //studio\n try{\n doc = document.querySelector('div.tab-pane.active iframe').contentWindow.document;\n ret.g_ck = doc.querySelector('input#sysparm_ck').value;\n }\n catch(ex){\n doc = document;\n }\n }\n\n if (varstring.indexOf('g_list') > -1)\n setGList(doc);\n\n\n var variables = varstring.replace(/ /g, \"\").split(\",\");\n var scriptContent = \"\";\n for (var i = 0; i < variables.length; i++) {\n var currVariable = variables[i];\n scriptContent += \"try{ if (typeof window.\" + currVariable + \" !== 'undefined') document.body.setAttribute('tmp_\" + currVariable.replace(/\\./g, \"\") + \"', window.\" + currVariable + \"); } catch(err){console.log(err);}\\n\"\n }\n\n var detail = { \n \"detail\" : {\n \"type\" : \"code\", \n \"content\" : scriptContent \n }\n };\n if (typeof cloneInto != 'undefined') detail = cloneInto(detail, document.defaultView); //required for ff\n var event = new CustomEvent('snuEvent', detail);\n doc.dispatchEvent(event);\n\n for (var i = 0; i < variables.length; i++) {\n var currVariable = variables[i];\n ret[currVariable.replace(/\\./g, \"\")] = doc.body.getAttribute(\"tmp_\" + currVariable.replace(/\\./g, \"\"));\n doc.body.removeAttribute(\"tmp_\" + currVariable.replace(/\\./g, \"\"));\n }\n return ret;\n}", "function updateSampleCountDisplay() {\n $('.message-nn1-true').html(NN1TrueDataArray.length);\n $('.message-nn1-false').html(NN1FalseDataArray.length);\n $('.message-nn2-true').html(NN2TrueDataArray.length);\n $('.message-nn2-false').html(NN2FalseDataArray.length);\n }", "function updatePageData(){\n // Update current step number\n $(\".kf-current-step\").each(function(index) {\n $(this).text(currentStep);\n });\n }", "function renderPStats() {\n\n var statsNames = ['Name: ', 'Race: ', 'Hit Points: ', 'AC: ', 'Gold: '];\n var statsValues = [player.name, player.race, player.hitPoints, player.armor, player.equipment];\n for (var i = 0; i < statsNames.length; i++) {\n var newP = document.createElement('p');\n newP.textContent = statsNames[i] + statsValues[i];\n statsSection.appendChild(newP);\n }\n}", "function nsInfo(error, data)\n{\n // Send the data from the ns-api to our response target.\n // Also include the input station name for display next to the clock.\n // Also include the train to emphasize\n data[0].StartStation=capitalizeFirstLetter(process.env.STATION_START);\n data[0].EmphasisStation=capitalizeFirstLetter(process.env.STATION_EMPHASIS);\n data[0].TimeDelta=process.env.TIME_DELTA;\n responseTarget.send(data);\n}", "function scaffolding(v) {\n\n if(typeof v !== \"undefined\") {\n \n d3.select(\"#tab1\")\n .data(v)\n .append(\"p\")\n .attr(\"id\",function(){\n return v[0].replace(/\\W/g, \"_\");\n })\n .text(v[0])\n .style('background-color', hexToRgba(selVarColor))\n .attr(\"data-container\", \"body\")\n .attr(\"data-toggle\", \"popover\")\n .attr(\"data-trigger\", \"hover\")\n .attr(\"data-placement\", \"right\")\n .attr(\"data-html\", \"true\")\n .attr(\"onmouseover\", \"$(this).popover('toggle');\")\n .attr(\"onmouseout\", \"$(this).popover('toggle');\")\n .attr(\"data-original-title\", \"Summary Statistics\")\n .on(\"click\", function(){\n d3.select(this)\n .style('background-color',function(d) {\n var myText = d3.select(this).text();\n var myColor = d3.select(this).style('background-color');\n var mySC = allNodes[findNodeIndex(myText)].strokeColor;\n \n zparams.zvars = []; //empty the zvars array\n if(d3.rgb(myColor).toString() === varColor.toString()) { // we are adding a var\n if(nodes.length==0) {\n nodes.push(findNode(myText));\n nodes[0].reflexive=true;\n }\n else {nodes.push(findNode(myText));}\n return hexToRgba(selVarColor);\n }\n else { // dropping a variable\n if(findNode(myText).subsethold[0] !== \"\") {return hexToRgba(selVarColor);} //can't drop one with subsethold[0] value\n \n nodes.splice(findNode(myText)[\"index\"], 1);\n spliceLinksForNode(findNode(myText));\n \n if(mySC==dvColor) {\n var dvIndex = zparams.zdv.indexOf(myText);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n //zparams.zdv=\"\";\n }\n else if(mySC==csColor) {\n var csIndex = zparams.zcross.indexOf(myText);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(mySC==timeColor) {\n var timeIndex = zparams.ztime.indexOf(myText);\n if (timeIndex > -1) { zparams.ztime.splice(dvIndex, 1); }\n }\n else if(mySC==nomColor) {\n var nomIndex = zparams.znom.indexOf(myText);\n if (nomIndex > -1) { zparams.znom.splice(dvIndex, 1); }\n }\n \n nodeReset(allNodes[findNodeIndex(myText)]);\n borderState();\n return varColor;\n }\n });\n fakeClick();\n });\n populatePopover(); // pipes in the summary stats\n \n // drop down menu for tranformation toolbar\n d3.select(\"#transSel\")\n .data(v)\n .append(\"option\")\n .text(function(d) {return d; });\n \n return;\n }\n \n d3.select(\"#transformations\")\n .append(\"input\")\n .attr(\"id\", \"tInput\")\n .attr(\"class\", \"form-control\")\n .attr(\"type\", \"text\")\n .attr(\"value\", \"R call: func(var)\");\n\n // the variable dropdown\n d3.select(\"#transformations\")\n .append(\"ul\")\n .attr(\"id\", \"transSel\")\n .style(\"display\", \"none\")\n .style(\"background-color\", varColor)\n .selectAll('li')\n .data([\"a\", \"b\"]) //set to variables in model space as they're added\n .enter()\n .append(\"li\")\n .text(function(d) {return d; });\n \n // the function dropdown\n d3.select(\"#transformations\")\n .append(\"ul\")\n .attr(\"id\", \"transList\")\n .style(\"display\", \"none\")\n .style(\"background-color\", varColor)\n .selectAll('li')\n .data(transformList)\n .enter()\n .append(\"li\")\n .text(function(d) {return d; });\n \n //jquery does this well\n $('#tInput').click(function() {\n var t = document.getElementById('transSel').style.display;\n if(t !== \"none\") { // if variable list is displayed when input is clicked...\n $('#transSel').fadeOut(100);\n return false;\n }\n var t1 = document.getElementById('transList').style.display;\n if(t1 !== \"none\") { // if function list is displayed when input is clicked...\n $('#transList').fadeOut(100);\n return false;\n }\n \n // highlight the text\n $(this).select();\n \n var pos = $('#tInput').offset();\n pos.top += $('#tInput').width();\n $('#transSel').fadeIn(100);\n return false;\n });\n \n $('#tInput').keyup(function(event) {\n var t = document.getElementById('transSel').style.display;\n var t1 = document.getElementById('transList').style.display;\n \n if(t !== \"none\") {\n $('#transSel').fadeOut(100);\n } else if(t1 !== \"none\") {\n $('#transList').fadeOut(100);\n }\n \n if(event.keyCode == 13){ // keyup on \"Enter\"\n var n = $('#tInput').val();\n var t = transParse(n=n);\n if(t === null) {return;}\n // console.log(t);\n // console.log(t.slice(0, t.length-1));\n // console.log(t[t.length-1]);\n transform(n=t.slice(0, t.length-1), t=t[t.length-1]);\n }\n });\n \n $('#transList li').click(function(event) {\n var tvar = $('#tInput').val();\n \n // if interact is selected, show variable list again\n if($(this).text() === \"interact(d,e)\") {\n $('#tInput').val(tvar.concat('*'));\n selInteract = true;\n $(this).parent().fadeOut(100);\n $('#transSel').fadeIn(100);\n event.stopPropagation();\n return;\n }\n \n var tfunc = $(this).text().replace(\"d\", \"_transvar0\");\n var tcall = $(this).text().replace(\"d\", tvar);\n $('#tInput').val(tcall);\n $(this).parent().fadeOut(100);\n event.stopPropagation();\n transform(n=tvar, t=tfunc);\n });\n \n \n d3.select(\"#tab1\").selectAll(\"p\")\n .data(valueKey)\n .enter()\n .append(\"p\")\n .attr(\"id\",function(d){\n return d.replace(/\\W/g, \"_\"); // replace non-alphanumerics for selection purposes\n }) // perhapse ensure this id is unique by adding '_' to the front?\n .text(function(d){return d;})\n .style('background-color',function(d) {\n if(findNodeIndex(d) > 2) {return varColor;}\n else {return hexToRgba(selVarColor);}\n })\n .attr(\"data-container\", \"body\")\n .attr(\"data-toggle\", \"popover\")\n .attr(\"data-trigger\", \"hover\")\n .attr(\"data-placement\", \"right\")\n .attr(\"data-html\", \"true\")\n .attr(\"onmouseover\", \"$(this).popover('toggle');\")\n .attr(\"onmouseout\", \"$(this).popover('toggle');\")\n .attr(\"data-original-title\", \"Summary Statistics\");\n \n populatePopover(); // pipes in the summary stats\n \n}", "function chartacterProperty() {\n $('#yuna').text(yuna.hp);\n $('#tidus').text(tidus.hp);\n $('#auron').text(auron.hp);\n $('#lulu').text(lulu.hp);\n }", "function load_reconfig_game_data(page_data) {\n $('#game_legend').append(page_data.id);\n $('#game_id').val(page_data.id);\n $('#name').val(page_data.name);\n $('#description').val(page_data.description);\n $('#pass').val(page_data.password);\n $('#press').val(page_data.press);\n $('#order_phase').val(page_data.order_phase);\n $('#retreat_phase').val(page_data.retreat_phase);\n $('#build_phase').val(page_data.build_phase);\n $('#waiting_time').val(page_data.waiting_time);\n $('#num_players').val(page_data.num_players);\n}", "parseStatsTop() {\r\n if (\"p2\" in this._datas_str[\"stats\"]) {\r\n this._top1_solo = this._datas_str[\"stats\"][\"p2\"][\"top1\"][\"value\"];\r\n this._top10_solo = this._datas_str[\"stats\"][\"p2\"][\"top10\"][\"value\"];\r\n this._top25_solo = this._datas_str[\"stats\"][\"p2\"][\"top25\"][\"value\"]; \r\n }\r\n if (\"p10\" in this._datas_str[\"stats\"]) {\r\n this._top1_duo = this._datas_str[\"stats\"][\"p10\"][\"top1\"][\"value\"];\r\n this._top5_duo = this._datas_str[\"stats\"][\"p10\"][\"top5\"][\"value\"];\r\n this._top12_duo = this._datas_str[\"stats\"][\"p10\"][\"top12\"][\"value\"]; \r\n }\r\n if (\"p9\" in this._datas_str[\"stats\"]) {\r\n this._top1_section = this._datas_str[\"stats\"][\"p9\"][\"top1\"][\"value\"];\r\n this._top3_section = this._datas_str[\"stats\"][\"p9\"][\"top3\"][\"value\"];\r\n this._top6_section = this._datas_str[\"stats\"][\"p9\"][\"top6\"][\"value\"]; \r\n }\r\n }", "function build_report_txt() {\n\n var txt = [];\n txt.push(\"Page Size Inspector Report\\n\");\n txt.push(\"URL: \"+ tab_url);\n txt.push(Date().toString() + \"\\n\");\n txt.push(build_line(\"REQUEST\", \"REQ\", \"BYTES\", \"CACHEREQ\", \"CACHEBYTES\"));\n\n // total\n var t = table_data.sections.total;\n txt.push(\"\\n\"+build_line(\"TOTAL\", t.reqtransf, t.kbtransf,\n t.reqcached, t.kbcached, \"_\"));\n\n // sections\n var sections = [\"Document\", \"Script\", \"Stylesheet\", \"Image\", \"XHR\",\n \"Font\", \"Other\"];\n const MAX_URL = 45;\n for (const sname of sections) {\n var num = table_data.sections[sname+\"count\"] || {};\n txt.push(\"\\n\"+build_line(sname, num.reqtransf, num.kbtransf,\n num.reqcached, num.kbcached, \"_\"));\n\n var sect = table_data.sections[sname] || [];\n for (const req of sect) {\n var prefix = req.size ? '-' : '+';\n var code = req.code != 200 ? req.code + ' ' : '';\n var url = sanitize_url(req.url, MAX_URL, true) || req.url_display;\n url = prefix + code + url;\n\n txt.push(build_line(url, 0, req.size, 0, req.sizecache));\n }\n }\n\n txt.push(\"\");\n\n var s = txt.join(\"\\n\");\n// deb(s);\n return s;\n}", "function Punto4(){\n\t\t\n\t\tvar host =document.location.host;\n\t var url = \"http://\" + host + \"/\" + getContext() + \"/stats/punto4\";//url de la funcion del PUNTO 1 DEL CONTROLLER\n\t\tvar processed_json = new Array(); \n\t\t\n $.getJSON(url, function(data) { \n \t\n \t$.each( data, function( key, value ) { \t\t\n \t\t processed_json.push([key,parseInt(value)]); \n \t});\n\t \n \t // ACA TODO LO QUE TENGO QUE HACER PARA GRAFICAR\n \t $('#container4').highcharts({\n chart: {\n type: \"column\"\n },\n title: {\n text: \"Horarios más solicitados\"\n },\n xAxis: {\n \ttype: 'category',\n labels: {\n rotation: -45,\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif'\n }\n }\n },\n yAxis: {\n title: {\n text: \"Mayor cantidad de solicitudes\"\n }\n },\n legend: {\n enabled: false\n },\n tooltip: {\n pointFormat: 'Cantidad de reservas: <b>{point.y}</b>'\n },\n series: [{\n data: processed_json // LA VARIABLE QUE CONTIENE TODAS LAS PELICULAS\n }]\n \n \n }); // FIN DE $('#container4') \t\n }); // FIN DE GETSJON \n\t}", "function updateSidePanelWithVars(){\n\n var x = document.getElementById(\"dispSysInfo\");\n clearNode(x);\n \n x.appendChild(document.createTextNode(\"Input Values\"));\n x.appendChild(document.createElement(\"br\")); \n for ( var key in inputDivs ){\n x.appendChild(document.createTextNode(inputDivs[key].varName + \" { \"));\n for ( var key2 in inputDivs[key].memFuncs ) {\n if ( isLastKey ( key2, inputDivs[key].memFuncs ) ) {\n x.appendChild(document.createTextNode(inputDivs[key].memFuncs[key2].funName)); \n } else {\n x.appendChild(document.createTextNode(inputDivs[key].memFuncs[key2].funName + \", \")); \n }\n \n } \n x.appendChild(document.createTextNode(\" }\"));\n x.appendChild(document.createElement(\"br\")); \n }\n x.appendChild(document.createElement(\"br\")); \n x.appendChild(document.createTextNode(\"Output Values\"));\n x.appendChild(document.createElement(\"br\")); \n for ( var key in outputDivs ){\n x.appendChild(document.createTextNode(outputDivs[key].varName + \" { \"));\n for ( var key2 in outputDivs[key].memFuncs ) {\n if ( isLastKey ( key2, outputDivs[key].memFuncs ) ) {\n x.appendChild(document.createTextNode(outputDivs[key].memFuncs[key2].funName)); \n \n } else {\n x.appendChild(document.createTextNode(outputDivs[key].memFuncs[key2].funName + \", \")); \n }\n }\n x.appendChild(document.createTextNode(\" }\"));\n x.appendChild(document.createElement(\"br\")); \n }\n\n}", "createCustomVis(cp_idx, tc_idx, varNames) {\n\t\tvar data = this.debugData.dataArray;\n\t\tvar varData = Array.from(this.debugData.localVarNames);\n\t\tvarData.push(\"@line no.\");\n\t\tvarData.push(\"@execution step\");\n\n\t\tvar padding = 20,\n\t\t\twidth = 300,\n\t\t\theight = 300;\n\n\t\tvar x = d3.scale.linear()\n\t\t .range([padding / 2, width - padding / 2]);\n\n\t\tvar y = d3.scale.linear()\n\t\t .range([height - padding / 2, padding / 2]);\n\n\t\tvar xAxis = d3.svg.axis()\n\t\t .scale(x)\n\t\t .orient(\"bottom\")\n\t\t .ticks(6);\n\n\t\tvar yAxis = d3.svg.axis()\n\t\t .scale(y)\n\t\t .orient(\"left\")\n\t\t .ticks(6);\n\n\t\tvar domainByVarName = {};\n\t\tvarNames.forEach(function (name) {\n\t\t\tvar tmpDomain = d3.extent(data, function(d) { return d[name]; });\n\t\t\tif (tmpDomain[0] === tmpDomain[1]) { // If there's only value in the domain, extend it\n\t\t\t\t\t\t\t\t\t\t\t\t // by including its -1 and +1 values\n\t\t\t\tdomainByVarName[name] = [tmpDomain[0] - 1, tmpDomain[1] + 1];\n\t\t\t} else {\n\t\t\t\tdomainByVarName[name] = tmpDomain;\n\t\t\t}\n\t\t});\n\n\t\t// Remove the old SVG\n\t\td3.select(\"#user-defined-vis-div-svg\" + cp_idx + \"-\" + tc_idx).remove();\n\n\t\t// Create a new one\n\t\tvar svg = d3.select(\"#user-defined-vis-div\" + cp_idx + \"-\" + tc_idx)\n\t\t\t\t .append(\"svg\")\n\t\t\t\t .attr(\"id\", () => { return \"user-defined-vis-div-svg\" + cp_idx + \"-\" + tc_idx; })\n\t\t\t\t\t.attr(\"width\", width + 2 * padding)\n\t\t\t\t\t.attr(\"height\", height + 2 * padding)\n\t\t\t\t\t.attr(\"transform\", function(d, i) { return \"translate(\" + padding + \",\" + padding +\")\"; });\n\n\t\t// Clear the previously-active brush, if any.\n\t\tfunction brushstart(p) {\n\t\t\tif (brushCell !== this) {\n\t\t\t\td3.select(brushCell).call(brush.clear());\t\t\n\t\t\t\tx.domain(domainByVarName[p.x]);\t\t\n\t\t\t\ty.domain(domainByVarName[p.y]);\t\t\n\t\t\t\tbrushCell = this;\t\t\n\t\t\t}\n\t\t}\n\n\t\tvar brush = d3.svg.brush()\t\t\n\t\t .x(x)\t\t\n\t\t .y(y)\t\t\n\t\t .on(\"brushstart\", brushstart)\n\t\t .on(\"brush\", (p) => { // Highlight the selected circles.\n\t\t\t\tvar e = brush.extent();\n\t\t\t\tvar brushedCircleLines = new Set();\n\t\t\t\tsvg.selectAll(\"circle\").classed(\"hidden\", function(d) {\n\t\t\t\t\tif (e[0][0] > d[p.x] || d[p.x] > e[1][0]\n\t\t\t\t\t|| e[0][1] > d[p.y] || d[p.y] > e[1][1]) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbrushedCircleLines.add(d[\"@line no.\"])\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\tthis.removeMouseupGutterHighlights();\n\t\t\t\tthis.highlightCodeLines(Array.from(brushedCircleLines));\n\t\t })\n\t\t .on(\"brushend\", () => { // If the brush is empty, select all circles.\n\t\t \tif (brush.empty()) {\n\t\t \t\tsvg.selectAll(\".hidden\").classed(\"hidden\", false);\n\t\t \t\tthis.removeMouseupGutterHighlights();\n\t\t \t\tthis.dehighlightPrevCodeLinesInDiffView();\n\t\t \t}\n\t\t });\n\n\t\tsvg.selectAll(\".x.axis\")\n\t\t\t.data([varNames[0]]) // x var\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t.attr(\"transform\", function(d, i) { return \"translate(0,\" + height + \")\"; })\n\t\t\t.each(function(d) { x.domain(domainByVarName[d]); d3.select(this).call(xAxis); });\n\n\t\tsvg.selectAll(\".y.axis\")\n\t\t\t.data([varNames[1]]) // y var\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"y axis\")\n\t\t\t.attr(\"transform\", function(d, i) { return \"translate(\" + padding + \",0)\"; })\n\t\t\t.each(function(d) { y.domain(domainByVarName[d]); d3.select(this).call(yAxis); });\n\n\t\tvar cell = svg.selectAll(\".cell\")\n\t\t\t.data(this.exclusiveCross(varNames, varNames))\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"cell\")\n\t\t\t.attr(\"transform\", function(d, i) { return \"translate(\" + padding + \",0)\"; })\n\n\t\tvar xVar = varNames[0];\n\t\tvar yVar = varNames[1];\n\t\tcell.call(brush); // add brushing\n\t\tcell.each(plot); // draw chart -- !important: this should be placed after the brush call\n\t\tcell.selectAll(\"circle\")\n\t\t .on(\"mouseover\", function() {\n\t\t \treturn tooltip.style(\"visibility\", \"visible\");\n\t\t })\n\t \t\t.on(\"mousemove\", (d) => {\n\t \t\t\tvar cell = d3.select(this);\n\t \t\t\tvar coordinates = d3.mouse(svg.node()); // position relative to the svg element\n\t \t\t\t\n\t \t\t\ttooltip.html(\"<p><strong>\" + xVar + \": \" + d[xVar] + \"</strong></p><p><strong>\" + yVar + \": \" + (d[yVar] + 1) + \"</strong></p>\");\n\n\t \t\t\tthis.removeMouseupGutterHighlights();\n\t \t\t\tthis.highlightCodeLines([d[\"@line no.\"]]);\n\n\t \t\t\treturn tooltip.style(\"top\", (coordinates[1] + 500) + \"px\")\n\t \t\t\t\t\t\t .style(\"left\", coordinates[0] + \"px\");\n\t \t\t})\n\t \t\t.on(\"mouseout\", () => {\n\t \t\t\tthis.removeMouseupGutterHighlights();\n\t \t\t\treturn tooltip.style(\"visibility\", \"hidden\");\n\t \t\t});\n\n\t\tvar svgContainer = d3.select(\"#user-defined-vis-div\" + cp_idx + \"-\" + tc_idx);\n\t\tvar tooltip = svgContainer.append(\"div\")\n\t\t\t\t\t\t\t \t\t.style(\"position\", \"absolute\")\n\t\t\t\t\t\t\t \t\t.style(\"z-index\", \"1001\")\n\t\t\t\t\t\t\t \t\t.style(\"visibility\", \"hidden\");\n\n\t\tvar brushCell;\n\n\t\tfunction plot(p) {\n\t\t\tvar cell = d3.select(this);\n\n\t\t\tx.domain(domainByVarName[p.x]);\n\t\t\ty.domain(domainByVarName[p.y]);\n\n\t\t\tcell.append(\"rect\")\n\t\t\t .attr(\"class\", \"frame\")\n\t\t\t .attr(\"x\", padding / 2)\n\t\t\t .attr(\"y\", padding / 2)\n\t\t\t .attr(\"width\", width - padding)\n\t\t\t .attr(\"height\", height - padding)\n\t\t\t .style(\"pointer-events\", \"none\");\n\n\t\t\tcell.selectAll(\"circle\")\n\t\t\t .data(data)\n\t\t\t .enter().append(\"circle\")\n\t\t\t .filter(function(d) { return d[p.x] && d[p.y]; })\n\t\t\t .attr(\"cx\", function(d) { return x(d[p.x]); })\n\t\t\t .attr(\"cy\", function(d) { return y(d[p.y]); })\n\t\t\t .attr(\"r\", 2)\n\t\t\t .style(\"fill\", d3.rgb(255,127,80,0.2));\n\t\t}\n\t}", "helpData() {\n console.log(\"2) finsemble.bootConfig timeout values\");\n console.log(\"\\tstartServiceTimeout value\", this.startServiceTimeout);\n console.log(\"\\tstartComponentTimeout value\", this.startComponentTimeout);\n console.log(\"\\tstartTaskTimeout value\", this.startTaskTimeout);\n console.log(\"\");\n console.log(\"3) Current boot stage:\", this.currentStage);\n console.log(\"\");\n console.log(`4) Lastest/current status of dependencyGraph for ${this.currentStage} stage`, this.dependencyGraphs[this.currentStage].getCurrentStatus());\n console.log(\"\");\n console.log(\"5) Dependency graphs by stage\", this.dependencyGraphs);\n console.log(\"\");\n console.log(\"6) Boot config data by stage\", this.bootConfigs);\n console.log(\"\");\n console.log(\"7) Active Checkpoint Engines\", this.checkpointEngines);\n console.log(\"\");\n console.log(\"8) Registered tasks\", this.registeredTasks);\n console.log(\"\");\n console.log(\"9) List of outstanding start timers\", this.startTimers);\n console.log(\"\");\n console.log(\"10) Dependency graphs display by stage\");\n this.outputDependencyGraphs(this.dependencyGraphs);\n console.log(\"\");\n }", "function demographics(selector) {\n var filter1 = data.metadata.filter(value => value.id == selector);\n var div = d3.select(\".panel-body\")\n div.html(\"\");\n div.append(\"p\").text(`ID: ${filter1[0].id}`)\n div.append(\"p\").text(`ETHNICITY: ${filter1[0].ethnicity}`)\n div.append(\"p\").text(`GENDER: ${filter1[0].gender}`)\n div.append(\"p\").text(`AGE: ${filter1[0].age}`)\n div.append(\"p\").text(`LOCATION: ${filter1[0].location}`)\n div.append(\"p\").text(`BELLY BUTTON TYPE: ${filter1[0].bbtype}`)\n div.append(\"p\").text(`WASHING FREQUENCY: ${filter1[0].wfreq}`)\n \n}", "function addDSParams(output){\n// incorrect in some cases:\n// var rho = output.slice(1,-1).split(\"\\\\n\")[2].split(\":\")[1].replace(/ /g,'');\n var rho = output.slice(1,-1).split(\"Value:\")[1].replace(/ /g,''); \n if (rho.slice(-1) === \"1\"){\n var is_int = true;\n } else if (rho.slice(-1) === \"2\"){\n var is_int = false;\n }\n var num_inputs = output.split(\",\").length;\n const div = $('<div>').attr({\"id\":\"dsinstru_div\",\"class\":\"form-group\"})\n $('#specify').append(div);\n $('#dsinstru_div').append(\"<p>rho=\"+rho);\n const param_div = $('<div>').attr({\"id\":\"dsparam_div\",\"class\":\"form-group\"})\n $('#specify').append(param_div);\n if (is_int){\n $('#dsparam_div').append(\"<p>Input Harish-Chandra parameters (all integers):</p>\");\n } else {\n $('#dsparam_div').append(\"<p>Input Harish-Chandra parameters (all half integers):</p>\");\n }\n for (var i=1;i<num_inputs;i++){\n $('#dsparam_div').append(\"<input type=\\\"float\\\" id=\"+i+\" maxlength=\\\"5\\\" size=\\\"4\\\">\");\n $('#dsparam_div').append(\", \");\n }\n $('#dsparam_div').append(\"<input type=\\\"float\\\" id=\"+num_inputs+\" maxlength=\\\"5\\\" size=\\\"4\\\">\");\n setOnchangeFuncs(num_inputs,\"clearElements([\\\"notice_choose_show\\\"]),displayNotice()\");\n}", "static renderGlobalView() {\n GestionPages.gestionPages(\"dashboard\");\n let contenu = `\n <h5><em>Production Dashboard</em></h5>\n <div id=\"dash\">\n <div id=\"stateorders\">\n <p>State of orders</p>\n </div>\n\n <div id=\"statemachines\">\n <p>State of Machines</p>\n </div>\n\n <div id=\"statistics\">\n <p>Statistics</p>\n </div>\n </div>`;\n document.querySelector(\"#dashboard\").innerHTML = contenu;\n\n //Display page \"state of orders\"\n $(\"#stateorders\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStateOrders();\n });\n\n //Display page \"state of machines\"\n $(\"#statemachines\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStateMachines();\n });\n\n //Display page \"statistics\"\n $(\"#statistics\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStatistics();\n });\n }", "function plotParamData(){\n\n var newData =[];\n var minTickSize = Math.ceil((dsEnd - dsStart)/msecDay/7);\n\n if( height_check.checked ){\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: { lineWidth: 3}\n });\n }\n else{\n // So that yaxis is always used...\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: {lineWidth: 0} \n });\n }\n if( st_check.checked){\n\n newData.push({label: \"stride time (sec)\",\n data: gaitData[1],\n yaxis: 2,\n color: pcolors[1], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"st_95_ub (sec)\",\n data: gaitData[8],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n\n newData.push({label: \"st_95_lb (sec)\",\n data: gaitData[9],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n }\n }\n if( sl_check.checked){\n\n newData.push({label: \"stride length (cm)\",\n data: gaitData[2],\n color: pcolors[2], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"sl_95_ub (cm)\",\n data: gaitData[6],\n color: pcolors[2], lines: {lineWidth: 1}});\n\n newData.push({label: \"sl_95_lb (cm)\",\n data: gaitData[7],\n color: pcolors[2], lines: {lineWidth: 1}});\n }\n }\n if( as_check.checked){\n\n newData.push( {label: \"average speed (cm/sec)\",\n data: gaitData[3],\n color: pcolors[3], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"as_95_ub (cm/sec)\",\n data: gaitData[4],\n color: pcolors[3], lines: {lineWidth: 1}});\n\n newData.push({label: \"as_95_lb (cm/sec)\",\n data: gaitData[5],\n color: pcolors[3], lines: {lineWidth: 1}}); \n }\n }\n\n newData.push({label: \"system down time\",\n data: gaitData[10], \n lines: {lineWidth: 1, fill: true, fillColor: \"rgba(100, 100, 100, 0.4)\"} });\n\n if( alert_check.checked ){\n newData.push({\n data: alertsToPlot,\n color: \"rgb(0,0,0)\",\n yaxis: 1,\n lines: {show: false},\n points: {show: true, radius: 4} });\n }\n\n paramGraph = $.plot($(\"#flot1\"),\n newData,\n\n { \n grid: {\n color: \"#000\",\n borderWidth: 0,\n hoverable: true\n },\n\n xaxis: {\n mode: \"time\",\n timeformat: \"%m/%d/%y\",\n minTickSize: [minTickSize,\"day\"],\n ticks: 7,\n min: dsStart,\n max: dsEnd\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10 \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1\n }],\n legend: {\n show: false\n },\n hooks: { draw : [draw_alerts] }\n }\n );\n\n $.plot($(\"#smallgraph\"),\n newData,\n {\n xaxis: {\n mode: \"time\",\n show:false\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10, show: false \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1, show: false\n }],\n legend:{\n show:false \n },\n grid:{\n color: \"#666\",\n borderWidth: 2\n },\n rangeselection:{\n color: pcolors[4], //\"#feb\",\n start: dsStart,\n end: dsEnd,\n enabled: true,\n callback: rangeselectionCallback\n }\n }\n );\n\n}", "insertPlotConfigHtml(){\n\t\tthis.plot_config_target.append(this.plotConfig.toTable());\n\t}", "function get_train_stats(filename){\n $.ajax({\n type: 'POST',\n url: filename,\n dataType: 'html',\n success:function(data)\n {\n var start = data.indexOf('tliczeubgteipb') - 10;\n var end = data.indexOf('iprzhbgrzobgbvreo', start + 1) - 5;\n $('#training-progression-information').html(data.slice(start, end));\n\n var start = data.indexOf('abcdgfdqpjfzeqssd') + 24;\n var end = data.indexOf('abcdgfduipjfzeqssd', start + 1) - 5;\n $('#gpu_cpu_gauge').html(data.slice(start, end));\n },\n error: function (xhr, status, error) {\n console.log(error);\n }\n });\n}", "function output2() {\n var element22 = document.getElementById(\"output\");\n element22.innerHTML = \"/*CSS*/ <br />\"\n + \".scenario2 { <br />\"\n + g_tab + \"transition-property: transform, opacity; <br />\"\n + g_tab + scenarioDurationValues + \"<br />\"\n + g_tab + scenarioDelayValues + \"<br />\"\n + g_tab + scenarioTimFunValues + \"<br />\"\n + g_tab + scenarioTransformValues + \"<br />\"\n + \" } <br />\";\n }", "function buildPage(flow, outcomes, demo, yearlyData){\n \n // code to buld the graphs that have static data(yearly outcomes, yearly flow)\n // object variable to separate out yearly outcome data\n var monthlyOutcomesgraph = {}\n yearlyData.years.forEach(function(year) {\n function monthlyDictFilter(d) {\n return (String(d[0]).split('-')[0] === year)\n }\n monthlyOutcomesgraph[year] = {\n 'percentPHmo': Object.entries(yearlyData.monthlyOutcomes.percentPHmo).filter(monthlyDictFilter).map(d => d[1]),\n 'exitAll': Object.entries(yearlyData.monthlyOutcomes.exitAll).filter(monthlyDictFilter).map(d => d[1]),\n 'exitPH': Object.entries(yearlyData.monthlyOutcomes.exitPH).filter(monthlyDictFilter).map(d => d[1])\n }\n });\n console.log('Data For Page Load Exit to PH Graph : ', monthlyOutcomesgraph['2015'].percentPHmo)\n \n //will use update functions to build responsive part of rows\n updateFlow(flow, '2018');\n updateOutcomes(outcomes, '2018');\n updateDemo(demo,'2018');\n buildYearlyBar(yearlyData);\n\n // PH chart\n d3.select('container').html\n phChart = Highcharts.chart('container', {\n // chart: {\n // type: 'bar'\n // },\n title: {\n text: 'Program enrollees with permanent housing upon program exit'\n },\n // Turn off Highcharts.com label/link \n credits: {\n enabled: false\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n },\n yAxis: {\n title: {\n text: ''\n },\n labels: {\n format: '{value}%',\n }\n },\n series: [{\n name: '2015',\n // data: [\n // // if want to add N per period as well format as:\n // // {y: series data,\n // // myData: outside data}\n // ]\n }, \n {\n name: '2016',\n // data: []\n },\n {\n name: '2017',\n // data: []\n }, {\n name: '2018',\n // data: []\n }, {\n name: '2019',\n // data: []\n },\n ],\n // Moves location of series names to be as close as possible to line\n legend: {\n layout: 'proximate',\n align: 'right'\n },\n tooltip: {\n // shared: true, //makes all data for that time point visible\n useHTML: true, //allows for more custom and complicated tooltip design\n // headerFormat: '{point.key}<table>',\n // pointFormat: '<tr><td style=\"color: {series.color}\">{series.name}: </td>' +\n // '<td style=\"text-align: right\"><b>{point.y} EUR</b></td></tr>',\n // footerFormat: '</table>',\n // valueDecimals: 2\n formatter: function () {\n return this.x + \" \" +this.series.name + \": <b>\" + this.y\n +\"%</b><br> \" + this.point.myData2 + \" out of \" + this.point.myData \n + \"<br>Exited to permanent housing\";\n }\n },\n });\n let years = []\n let keys = Object.keys(monthlyOutcomesgraph);\n years.push(keys)\n \n let phSeries = []\n years[0].forEach(year =>{ \n var toPush = []\n monthlyOutcomesgraph[year].percentPHmo.forEach((item, index) => {\n toPush.push({'y':item, 'myData':monthlyOutcomesgraph[year].exitAll[index],\n 'myData2':monthlyOutcomesgraph[year].exitPH[index]})\n });\n phSeries.push(toPush);\n });\n // Limit predicted monthly values \n phSeries[4].length = 8;\n\n phChart.series.forEach(year => { \n let index = year.index\n\n year.update({\n data: phSeries[index]\n }, true)\n })\n\n}", "function general(page){\n s.pageName='what-ever-you-want-static:'+page;\n s.prop1=s.pagename;\n s.server=window.location.hostname;\n s.charSet='UTF-8';\n s.channel=\"static-info\";\n s.pageType='';\n \n }", "function Punto7(){\n\t\t\n\t\tvar host =document.location.host;\n\t var url = \"http://\" + host + \"/\" + getContext() + \"/stats/punto7\";//url de la funcion del PUNTO 1 DEL CONTROLLER\n\t\tvar processed_json = new Array(); \n\t\t\n $.getJSON(url, function(data) { \n \t\n \t$.each( data, function( key, value ) { \t\t\n \t\t processed_json.push([key,parseInt(value)]); \n \t});\n\t \n \t // ACA TODO LO QUE TENGO QUE HACER PARA GRAFICAR\n \t $('#container7').highcharts({\n chart: {\n type: \"column\"\n },\n title: {\n text: \"Día de la semana con mayor cantidad de asistencia de menores\"\n },\n xAxis: {\n \ttype: 'category',\n labels: {\n rotation: -45,\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif'\n }\n }\n },\n yAxis: {\n title: {\n text: \"Semana\"\n }\n },\n legend: {\n enabled: false\n },\n tooltip: {\n pointFormat: 'Cantidad de personas: <b>{point.y}</b>'\n },\n series: [{\n data: processed_json // LA VARIABLE QUE CONTIENE TODAS LAS PELICULAS\n }]\n \n \n }); // FIN DE $('#container7') \t\n }); // FIN DE GETSJON \n\t}", "createVis(debugData, otherDebugData, cp_idx, tc_idx) {\n\t\t// Deep copy object arrays. Transform it to\n\t\t// be able to differentiate between the current\n\t\t// run's and the other run's data\n\t\tvar dataArr1 = debugData.dataArray.map((el, i) => {\n\t\t\treturn JSON.parse(JSON.stringify(el));\n\t\t});\n\t\tvar dataArr2 = otherDebugData.dataArray.map((el, i) => {\n\t\t\treturn JSON.parse(JSON.stringify(el));\n\t\t});\n\n\t\tvar data1 = dataArr1.map((el, i) => {\n\t\t\tif (el[\"@current\"] === undefined) el[\"@current\"] = true;\n\t\t\treturn el;\n\t\t});\n\t\tvar data2 = dataArr2.map((el, i) => {\n\t\t\tif (el[\"@current\"] === undefined) el[\"@current\"] = false;\n\t\t\treturn el;\n\t\t});\n\n\t\t// Trick to maintain the color saliency of rendering; if we have\n\t\t// the display of data of another run overlaid, we want to maintain\n\t\t// the color mapping of (blue: another run result, orange: this run result)\n\t\t//var data = data2.concat(data1);\n\t\tvar data = data2.concat(data1);\n\n\t\t// If the student changed the variable names...\n\t\tvar varDataSet1 = debugData.localVarNames;\n\t\tvar varDataSet2 = otherDebugData.localVarNames;\n\t\tvar varData = Array.from(new Set(function*() { yield* varDataSet1; yield* varDataSet2; }()));\n\t\tvarData.push(\"@line no.\");\n\t\tvarData.push(\"@execution step\");\n\n\t\tvar width = 780,\n\t\t\theight = 780,\n\t\t\tpadding = 20,\n\t\t size = (width - 2 * padding) / varData.length;\n\t\t\n\t\tvar x = d3.scale.linear()\n\t\t .range([padding / 2, size - padding / 2]);\n\n\t\tvar y = d3.scale.linear()\n\t\t .range([size - padding / 2, padding / 2]);\n\n\t\tvar xAxis = d3.svg.axis()\n\t\t .scale(x)\n\t\t .orient(\"bottom\")\n\t\t .ticks(6);\n\n\t\tvar yAxis = d3.svg.axis()\n\t\t .scale(y)\n\t\t .orient(\"left\")\n\t\t .ticks(6);\n\n\t\tvar color = d3.scale.category10();\n\n\t\tvar domainByVarName = {},\n\t\t\tvarNames = d3.values(varData),\n\t\t\tn = varData.length;\n\n\t\tvarData.forEach(function (name) {\n\t\t\tvar tmpDomain = d3.extent(data, function(d) { return d[name]; });\n\t\t\tif (tmpDomain[0] === tmpDomain[1]) { // If there's only value in the domain, extend it\n\t\t\t\t\t\t\t\t\t\t\t\t // by including its -1 and +1 values\n\t\t\t\tdomainByVarName[name] = [tmpDomain[0] - 1, tmpDomain[1] + 1];\n\t\t\t} else {\n\t\t\t\tdomainByVarName[name] = tmpDomain;\n\t\t\t}\n\t\t});\n\n\t\txAxis.tickSize(size * n);\n\t\tyAxis.tickSize(-size * n);\n\t\t\n\t\t// Remove the old SVG\n\t\td3.select(\"#cross-vis-div-svg\" + cp_idx + \"-\" + tc_idx).remove();\n\n\t\t// Create a new one\n\t\tvar svg = d3.select(\"#cross-vis-div\" + cp_idx + \"-\" + tc_idx)\n\t\t\t\t .append(\"svg\")\n\t\t\t\t .attr(\"id\", () => { return \"cross-vis-div-svg\" + cp_idx + \"-\" + tc_idx; })\n\t\t\t\t\t.attr(\"width\", width)\n\t\t\t\t\t.attr(\"height\", height)\n\t\t\t\t\t.append(\"g\")\n\t\t\t\t\t.attr(\"transform\", \"translate(\" + padding + \",\" + padding + \")\");\n\n\t\tvar brush = d3.svg.brush()\t\t\n\t\t .x(x)\t\t\n\t\t .y(y)\t\t\n\t\t .on(\"brushstart\", brushstart)\n\t\t .on(\"brush\", (p) => { // Highlight the selected circles.\n\t\t\t\tvar e = brush.extent();\n\t\t\t\tvar brushedCircleLines1 = new Set();\n\t\t\t\tvar brushedCircleLines2 = new Set();\n\t\t\t\tsvg.selectAll(\"circle\").classed(\"hidden\", function(d) {\n\t\t\t\t\t// NOTE: e[0][0] = x0, e[0][1] = y0, e[1][0] = x1, e[1][1] = y1,\n\t\t\t\t\t// where [x0, y0] is the top-left corner\n\t\t\t\t\t// and [x1, y1] is the bottom-right corner\n\t\t\t\t\tif (e[0][0] > d[p.x] || d[p.x] > e[1][0]\n\t\t\t\t\t|| e[0][1] > d[p.y] || d[p.y] > e[1][1]) {\n\t\t\t\t\t\t// Hide the circles\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\td[\"@current\"] ? brushedCircleLines1.add(d[\"@line no.\"])\n\t\t\t\t\t\t\t\t : brushedCircleLines2.add(d[\"@line no.\"]);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\tthis.removeMouseupGutterHighlights();\n\t\t\t\tthis.highlightCodeLines(Array.from(brushedCircleLines1));\n\t\t\t\tthis.highlightCodeLinesInDiffView(Array.from(brushedCircleLines2));\n\t\t })\n\t\t .on(\"brushend\", () => { // If the brush is empty, select all circles.\n\t\t \tif (brush.empty()) {\n\t\t \t\tsvg.selectAll(\".hidden\").classed(\"hidden\", false);\n\t\t \t\tthis.removeMouseupGutterHighlights();\n\t\t \t\tthis.dehighlightPrevCodeLinesInDiffView();\n\t\t \t}\n\t\t });\n\n\t\tsvg.selectAll(\".x.axis\")\n\t\t\t.data(varNames)\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t.attr(\"transform\", function(d,i) { return \"translate(\" + (n - i - 1) * size + \",0)\"; })\n\t\t\t.each(function(d) { x.domain(domainByVarName[d]); d3.select(this).call(xAxis); });\n\n\t\tsvg.selectAll(\".y.axis\")\n\t\t\t.data(varNames)\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"y axis\")\n\t\t\t.attr(\"transform\", function(d, i) { return \"translate(0,\" + i * size + \")\"; })\n\t\t\t.each(function(d) { y.domain(domainByVarName[d]); d3.select(this).call(yAxis); });\n\n\t\tvar cell = svg.selectAll(\".cell\")\n\t\t\t\t\t.data(this.cross(varNames, varNames))\n\t\t\t\t.enter().append(\"g\")\n\t\t\t\t\t.filter(function(d) { return d.i > d.j; })\n\t\t\t\t\t.attr(\"class\", \"cell\")\n\t\t\t\t\t.attr(\"transform\", function(d) { return \"translate(\" + (n - d.i - 1) * size + \",\" + d.j * size + \")\"; });\n\n\t\t// y axis labels\n\t\tcell.filter(function(d) { return (d.i - d.j) === 1; })\n\t\t\t.append(\"text\")\n\t\t\t.attr(\"x\", function(d, i) { return d.i * size + padding; })\n\t\t\t.attr(\"y\", function(d, i) { return size / 2; })\n\t\t\t.attr(\"dy\", \".71em\")\n\t\t\t.text(function(d) { return d.y; });\n\n\t\t// x axis labels\n\t\tcell.filter(function(d) { return (d.i - d.j) === 1; })\n\t\t\t.append(\"text\")\n\t\t\t.attr(\"x\", function(d, i) { return padding; })\n\t\t\t.attr(\"y\", function(d, i) { return (n - 1 - d.j) * size + padding; })\n\t\t\t.attr(\"dy\", \".71em\")\n\t\t\t.text(function(d) { return d.x; });\n\n\t\tcell.call(brush);\n\t\tcell.each(plot);\n\t\tcell.selectAll(\"circle\")\n\t\t .on(\"mouseover\", function() {\n\t\t \treturn tooltip.style(\"visibility\", \"visible\");\n\t\t })\n\t \t\t.on(\"mousemove\", (d) => {\n\t \t\t\tconsole.log(cell);\n\t \t\t\tvar cell = d3.select(this); // we replaced this with the outer context by using the (d) => {} function...\n\t \t\t\t//console.log(d);\n\t \t\t\t//console.log(cell.data()[0]);\n\t \t\t\t//console.log(cell.data());\n\t \t\t\t//var x = cell.data()[0].x;\n\t \t\t\t//var y = cell.data()[0].y;\n\n\t \t\t\t//var translate = d3.transform(cell.attr(\"transform\")).translate;\n\t \t\t\tvar coordinates = d3.mouse(svg.node()); // position relative to the svg element\n\t \t\t\t\n\t \t\t\ttooltip.html(\"<p><strong>Execution step\" + \": \" + d[\"@execution step\"] + \"</strong></p><p><strong>Code line: \" + d[\"@line no.\"] + \"</strong></p>\");\n\t \t\t\tthis.removeMouseupGutterHighlights();\n\t \t\t\td[\"@current\"] ? this.highlightCodeLines([d[\"@line no.\"]])\n\t \t\t\t\t\t\t : this.highlightCodeLinesInDiffView([d[\"@line no.\"]]);\n\n\t \t\t\treturn tooltip.style(\"top\", (coordinates[1] + 500) + \"px\")\n\t \t\t\t\t\t\t .style(\"left\", coordinates[0] + \"px\");\n\t \t\t})\n\t \t\t.on(\"mouseout\", () => {\n\t \t\t\tthis.removeMouseupGutterHighlights();\n\t \t\t\tthis.dehighlightPrevCodeLinesInDiffView();\n\t \t\t\treturn tooltip.style(\"visibility\", \"hidden\");\n\t \t\t});\n\n\t\tvar svgContainer = d3.select(\"#cross-vis-div\" + cp_idx + \"-\" + tc_idx);\n\t\tvar tooltip = svgContainer.append(\"div\")\n\t\t\t\t\t\t\t\t .style(\"position\", \"absolute\")\n\t\t\t\t\t\t\t\t .style(\"z-index\", \"1001\")\n\t\t\t\t\t\t\t\t .style(\"visibility\", \"hidden\");\n\n\t\tvar brushCell;\n\n\t\tfunction plot(p) {\n\t\t\tvar cell = d3.select(this);\n\n\t\t\tx.domain(domainByVarName[p.x]);\n\t\t\ty.domain(domainByVarName[p.y]);\n\n\t\t\tcell.append(\"rect\")\n\t\t\t .attr(\"class\", \"frame\")\n\t\t\t .attr(\"x\", padding / 2)\n\t\t\t .attr(\"y\", padding / 2)\n\t\t\t .attr(\"width\", size - padding)\n\t\t\t .attr(\"height\", size - padding)\n\t\t\t .style(\"pointer-events\", \"none\");\n\n\t\t\t// Cross for other data\n\t\t\tcell.selectAll(\"path\")\n\t\t\t .data(data)\n\t\t\t .enter().append(\"path\")\n\t\t\t .filter(function(d) { return (d[p.x] !== undefined) && (d[p.y] !== undefined) && !d[\"@current\"]; })\n\t\t\t \t.attr(\"d\", d3.svg.symbol()\n\t\t\t \t\t.size(function(d) { return 5 * 5; }) // size in square pixels\n\t\t\t \t\t.type(function(d) { return \"diamond\"; }))\n\t\t\t \t.attr(\"transform\", function(d) { return \"translate(\" + x(d[p.x]) + \",\" + y(d[p.y]) +\")\"; })\n\t\t\t .style(\"fill\", function(d) { return d3.rgb(82,209,255,0.2); });\n\n\t\t\t// Dot for current data\n\t\t\tcell.selectAll(\"circle\")\n\t\t\t .data(data)\n\t\t\t .enter().append(\"circle\")\n\t\t\t .filter(function(d) { return (d[p.x] !== undefined) && (d[p.y] !== undefined) && d[\"@current\"]; })\n\t\t\t .attr(\"cx\", function(d) { return x(d[p.x]); })\n\t\t\t .attr(\"cy\", function(d) { return y(d[p.y]); })\n\t\t\t .attr(\"r\", 2)\n\t\t\t .style(\"fill\", function(d) { return d3.rgb(255,127,80,0.2); });\n\t\t}\n\n\t\t// Clear the previously-active brush, if any.\n\t\tfunction brushstart(p) {\n\t\t\tif (brushCell !== this) {\t\t\n\t\t\t\td3.select(brushCell).call(brush.clear());\t\t\n\t\t\t\tx.domain(domainByVarName[p.x]);\t\t\n\t\t\t\ty.domain(domainByVarName[p.y]);\t\t\n\t\t\t\tbrushCell = this;\t\t\n\t\t\t}\t\t\n\t\t}\n\t}", "function getData() {\n var url = baseUrl + '.dods?';\n var selected = $('#variables :checkbox').filter(':checked');\n selected.each(function(i) {\n if (this.id == 'location.time_series.time') timeIndex = i;\n url += this.id + ',';\n });\n if (selected.length <= 1) return;\n\n // Get buoy id.\n for (var i=0; i<buoys.markers.length; i++) {\n var marker = buoys.markers[i];\n if (marker.icon.imageDiv.firstChild.getAttribute('src') == 'js/OpenLayers/img/marker.png') {\n var id = marker.metadata.id;\n break;\n }\n }\n\n url = url.replace(/,$/, '');\n //url += '&location.time>1.1e12'; // get only a couple of points for this demo.\n url += '&location._id=' + id;\n\n jsdap.loadData(url, plotData, '/proxy/');\n}", "function stats() {\n\t$('.stats').show(); // show STATS\n\tnt += 1;\n\t$('.stats p span').text(nt);\n}", "function updateOutputDataDisplay() {\n console.log('updateOutputDataDisplay');\n\n var s = '';\n for (var i = 0; i < gaOutputData.length; i++) {\n var obj = gaOutputData[i];\n s += (obj.value + '=' + obj.count + ', ');\n }\n\n $('#output-data').text(s);\n}", "function get_status() {\n var runningTotal = {},\n allPnames = [],\n color = \"\",\n list = \"\",\n tz = window.controller.options.tz-48;\n\n tz = ((tz>=0)?\"+\":\"-\")+pad((Math.abs(tz)/4>>0))+\":\"+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10);\n \n var header = \"<span id='clock-s' class='nobr'>\"+(new Date(window.controller.settings.devt*1000).toUTCString().slice(0,-4))+\"</span> GMT \"+tz;\n\n runningTotal.c = window.controller.settings.devt;\n\n var master = window.controller.options.mas,\n ptotal = 0;\n\n var open = {};\n $.each(window.controller.status, function (i, stn) {\n if (stn) open[i] = stn;\n });\n open = Object.keys(open).length;\n\n if (master && window.controller.status[master-1]) open--;\n\n $.each(window.controller.stations.snames,function(i, station) {\n var info = \"\";\n if (master == i+1) {\n station += \" (\"+_(\"Master\")+\")\";\n } else if (window.controller.settings.ps[i][0]) {\n var rem=window.controller.settings.ps[i][1];\n if (open > 1) {\n if (rem > ptotal) ptotal = rem;\n } else {\n ptotal+=rem;\n }\n var remm=rem/60>>0,\n rems=rem%60,\n pid = window.controller.settings.ps[i][0],\n pname = pidname(pid);\n if (window.controller.status[i] && (pid!=255&&pid!=99)) runningTotal[i] = rem;\n allPnames[i] = pname;\n info = \"<p class='rem'>\"+((window.controller.status[i]) ? _(\"Running\") : _(\"Scheduled\"))+\" \"+pname;\n if (pid!=255&&pid!=99) info += \" <span id='countdown-\"+i+\"' class='nobr'>(\"+(remm/10>>0)+(remm%10)+\":\"+(rems/10>>0)+(rems%10)+\" \"+_(\"remaining\")+\")</span>\";\n info += \"</p>\";\n }\n if (window.controller.status[i]) {\n color = \"green\";\n } else {\n color = \"red\";\n }\n list += \"<li class='\"+color+\"'><p class='sname'>\"+station+\"</p>\"+info+\"</li>\";\n i++;\n });\n\n var footer = \"\";\n var lrdur = window.controller.settings.lrun[2];\n\n if (lrdur !== 0) {\n var lrpid = window.controller.settings.lrun[1];\n var pname= pidname(lrpid);\n\n footer = '<p>'+pname+' '+_('last ran station')+' '+window.controller.stations.snames[window.controller.settings.lrun[0]]+' '+_('for')+' '+(lrdur/60>>0)+'m '+(lrdur%60)+'s on '+(new Date(window.controller.settings.lrun[3]*1000).toUTCString().slice(0,-4))+'</p>';\n }\n\n if (ptotal) {\n var scheduled = allPnames.length;\n if (!open && scheduled) runningTotal.d = window.controller.options.sdt;\n if (open == 1) ptotal += (scheduled-1)*window.controller.options.sdt;\n allPnames = allPnames.getUnique();\n var numProg = allPnames.length;\n allPnames = allPnames.join(\" \"+_(\"and\")+\" \");\n var pinfo = allPnames+\" \"+((numProg > 1) ? _(\"are\") : _(\"is\"))+\" \"+_(\"running\")+\" \";\n pinfo += \"<br><span id='countdown-p' class='nobr'>(\"+sec2hms(ptotal)+\" remaining)</span>\";\n runningTotal.p = ptotal;\n header += \"<br>\"+pinfo;\n }\n\n var status = $(\"#status_list\");\n status.html(list);\n $(\"#status_header\").html(header);\n $(\"#status_footer\").html(footer);\n if (status.hasClass(\"ui-listview\")) status.listview(\"refresh\");\n window.totals = runningTotal;\n if (window.interval_id !== undefined) clearInterval(window.interval_id);\n if (window.timeout_id !== undefined) clearTimeout(window.timeout_id);\n\n changePage(\"#status\");\n if (window.totals.d !== undefined) {\n delete window.totals.p;\n setTimeout(get_status,window.totals.d*1000);\n }\n update_timers(window.controller.options.sdt);\n}", "function pageInit(subject){\n topOTUBar(subject)\n topOTUBubble(subject)\n demographTable(subject)\n washingGauge(subject)\n}", "function ajaxService(url,data,contentGraph,panningEnable,inPopUp,nameLayout,tooltip) {\n $.ajax({\n url: url,\n type: 'GET',\n dataType: \"json\",\n data: data\n }).done(function(m) {\n // Updated\n showHelpText();\n setViewMore();\n // /////////\n console.log(\"done\");\n var currentX = 0;\n var nodes = m.elements.nodes;\n var count = {\n SO: 0,\n A: 0,\n P: 0,\n T: 0,\n I: 0,\n OC: 0,\n OP: 0\n };\n var totalWidth = {\n SO: 0,\n A: 0,\n P: 0,\n T: 0,\n I: 0,\n OC: 0,\n OP: 0\n };\n var nodeWidth = 150;\n var nodeMargin = 20;\n\n // For to count and set position\n for(var i = 0; i < nodes.length; i++) {\n if(nodes[i].data.type == \"SO\") {\n count.SO++;\n } else if(nodes[i].data.type == \"A\") {\n count.A++;\n } else if(nodes[i].data.type == \"P\") {\n count.P++;\n } else if(nodes[i].data.type == \"T\") {\n count.T++;\n } else if(nodes[i].data.type == \"I\") {\n count.I++;\n } else if(nodes[i].data.type == \"OC\") {\n count.OC++;\n } else if(nodes[i].data.type == \"OP\") {\n count.OP++;\n }\n }\n\n totalWidth.SO = count.SO * (nodeWidth + nodeMargin);\n totalWidth.A = count.A * (nodeWidth + nodeMargin);\n totalWidth.P = count.P * (nodeWidth + nodeMargin);\n totalWidth.T = count.T * (nodeWidth + nodeMargin);\n totalWidth.I = count.I * (nodeWidth + nodeMargin);\n totalWidth.OC = count.OC * (nodeWidth + nodeMargin);\n totalWidth.OP = count.OP * (nodeWidth + nodeMargin);\n // totalWidth.KO = (count.KO * (nodeWidth + nodeMargin)) + totalWidth.CoA;\n\n var widthTest = 0;\n if(totalWidth.T > totalWidth.OC) {\n widthTest = totalWidth.T;\n } else {\n widthTest = totalWidth.OC;\n }\n\n if(widthTest > totalWidth.I) {\n widthTest;\n } else {\n widthTest = totalWidth.I;\n }\n\n if(widthTest > totalWidth.P) {\n widthTest;\n } else {\n widthTest = totalWidth.P;\n }\n\n console.log(widthTest);\n currentX = -1 * (widthTest / 2);\n\n var move = {\n SO: -(totalWidth.SO / 2),\n A: -(widthTest / 2),\n P: -(widthTest / 2),\n T: -(widthTest / 2),\n I: -(widthTest / 2),\n OC: -(widthTest / 2),\n OP: 380\n };\n\n // console.log(totalWidth);\n // console.log(widthTest);\n // console.log(currentX);\n\n for(var i = 0; i < nodes.length; i++) {\n if(nodes[i].data.type == \"SO\") {\n move.SO = (move.SO + (nodeWidth + nodeMargin));\n nodes[i].position = {\n x: move.SO,\n y: 0\n };\n } else if(nodes[i].data.type == \"A\") {\n if(nodes[i + 1] && nodes[i + 1].data.type == \"P\") {\n\n } else {\n move.A = (move.A + (nodeWidth + nodeMargin));\n }\n\n nodes[i].position = {\n x: move.A,\n y: 200\n };\n // PROGRAM-----------------\n } else if(nodes[i].data.type == \"P\") {\n if(nodes[i + 1] && nodes[i + 1].data.type == \"P\") {\n currentX = (currentX + (nodeWidth + nodeMargin));\n move.P = currentX;\n move.I = move.P;\n move.OC = move.P;\n }\n if(nodes[i + 1] && nodes[i + 1].data.type == \"I\") {\n move.I=currentX;\n } else {\n move.I = move.I + (nodeWidth + nodeMargin);\n }\n nodes[i].position = {\n x: move.I,\n y: 200\n };\n // PROGRAM IMPACT-----------------\n } else if(nodes[i].data.type == \"I\") {\n if(nodes[i + 1] && nodes[i + 1].data.type == \"P\") {\n currentX = move.I + (nodeWidth + nodeMargin + 20);\n move.I = currentX;\n move.OC = currentX;\n } else if(nodes[i + 1] && nodes[i + 1].data.type == \"A\") {\n if(move.OC > move.I) {\n currentX = move.OC + (nodeWidth + nodeMargin + 20);\n } else {\n currentX = move.I + (nodeWidth + nodeMargin + 20);\n }\n move.I = currentX;\n } else {\n if(currentX > move.I) {\n currentX = currentX + (nodeWidth + nodeMargin + 20);\n move.I = currentX;\n } else {\n move.I = move.I + (nodeWidth + nodeMargin + 20);\n }\n // move.OC=currentX;\n }\n // console.log(move.KO);\n nodes[i].position = {\n x: move.I,\n y: 200\n };\n // RESEARCH TOPIC-----------------\n } else if(nodes[i].data.type == \"T\") {\n\n if(nodes[i + 1] && nodes[i + 1].data.type == \"OC\") {\n } else {\n move.OC = (move.OC + (nodeWidth + nodeMargin + 20));\n }\n if(nodes[i + 1] && nodes[i + 1].data.type == \"P\") {\n if(move.OC > move.I) {\n currentX = move.OC;\n } else {\n currentX = move.I;\n }\n move.I = currentX;\n } else if(nodes[i + 1] && nodes[i + 1].data.type == \"A\") {\n if(move.OC > move.I) {\n currentX = move.OC;\n } else {\n currentX = move.I;\n }\n move.I = currentX;\n }\n\n // console.log(move.KO);\n nodes[i].position = {\n x: move.OC,\n y: 300\n };\n // OUTCOME-----------------\n } else if(nodes[i].data.type == \"OC\") {\n move.OC = (move.OC + (nodeWidth + nodeMargin + 20));\n if(move.OC > move.I) {\n currentX = move.OC;\n } else {\n currentX = move.I;\n }\n if(nodes[i + 1] && nodes[i + 1].data.type == \"P\" || nodes[i + 1].data.type == \"I\") {\n if(move.OC > move.I) {\n currentX = move.OC;\n } else {\n currentX = move.I;\n }\n }\n\n // console.log(move.KO);\n nodes[i].position = {\n x: move.OC,\n y: 300\n };\n\n // OUTPUT-----------------\n } else if(nodes[i].data.type == \"OP\") {\n if(nodes[i + 1] && nodes[i + 1].data.type == \"OC\" || nodes[i + 1].data.type == \"T\") {\n currentX = move.OC + (nodeWidth + nodeMargin + 20);\n move.OP = 330;\n } else if(nodes[i + 1] && nodes[i + 1].data.type == \"P\" || nodes[i + 1].data.type == \"I\") {\n move.OP = 330;\n if(move.OC > move.I) {\n currentX = move.OC;\n } else {\n currentX = move.I;\n }\n }\n move.OP = (move.OP + 50);\n // console.log(move.KO);\n nodes[i].position = {\n x: move.OC,\n y: move.OP\n };\n }/*\n * else if(nodes[i].data.type == \"CoA\") { if(nodes[i + 1] && nodes[i + 1].data.type == \"KO\") { move.KO; } else {\n * move.KO = (move.KO + (nodeWidth + nodeMargin + 20)); } // console.log(move.KO); nodes[i].position = { x:\n * move.KO, y: 400 }; }\n */\n }\n\n createGraphic(m.elements, contentGraph, panningEnable, inPopUp, 'breadthfirst', tooltip, nodeWidth);\n });\n}", "function calculateGlobalValues() {\r\n _globalViewportW = verge.viewportW(), _globalViewportH = verge.viewportH(), _globalHalfViewportH = (_globalViewportH / 2).toFixed(0)\r\n}", "function loadDataUrl() {\r\n // The following regexp extracts the pattern dataurl=url from the page hash to enable loading timelines from arbitrary sources.\r\n var match = /dataurl=([^\\/]*)/g.exec(window.location.hash);\r\n if (match) {\r\n return unescape(match[1]);\r\n } else {\r\n switch (czDataSource) {\r\n case 'db':\r\n return \"Chronozoom.svc/get\";\r\n case 'relay':\r\n return \"ChronozoomRelay\";\r\n case 'dump':\r\n return \"ResponseDump.txt\";\r\n default:\r\n return null;\r\n }\r\n }\r\n}", "function glueMainPageData(data) {\n console.log(typeof data);\n life = data.Life;\n console.assert(life !== undefined, \"Life is undefined.\");\n resolutionUnit = data.ResolutionUnit;\n if(life.Notes == null){\n life.Notes = [];\n }\n lifeService.datifyLifeObject(life);\n console.log(\"life\");\n console.log(life);\n visibleNotes = life.Notes;\n //createMomentsFromDataAttrs(); // Done here in the beginning so only need to create Moments once (performance problems).\n updateLifeComponents();\n zoomLifeCalendar();\n refreshDragSelectObject();\n}", "function preprocess_data() { \n var data_sub = jsPsych.data.get().filter({ \"trial_type\": \"html-slider-response\" }); \n var data_sub = data_sub.filterCustom(function (trial) { return trial.q > 0 });\n var data_sub = data_sub.filterCustom(function (trial) { return trial.rt > 200 });\n return data_sub;\n}" ]
[ "0.5305533", "0.52872103", "0.51466143", "0.51402545", "0.49268374", "0.49146375", "0.48846808", "0.48846665", "0.48797426", "0.48766845", "0.48365775", "0.48317364", "0.48111144", "0.48028806", "0.4767581", "0.47230053", "0.4719395", "0.4690483", "0.46810418", "0.4678433", "0.46595508", "0.4638661", "0.46238086", "0.462232", "0.4621603", "0.461714", "0.46033823", "0.46025038", "0.4602416", "0.45774862", "0.4567944", "0.45655778", "0.4561168", "0.4559421", "0.45585853", "0.45525435", "0.454538", "0.45407796", "0.45386702", "0.45336682", "0.45230567", "0.45197693", "0.45181298", "0.4504064", "0.4503732", "0.4502676", "0.44996476", "0.4499484", "0.44993094", "0.44979137", "0.44965354", "0.44935367", "0.44885838", "0.4483075", "0.4481503", "0.4472739", "0.44715667", "0.44694167", "0.44682813", "0.44669837", "0.44610023", "0.4459037", "0.44563866", "0.44541475", "0.4452433", "0.44492552", "0.444901", "0.4446118", "0.44457912", "0.44448078", "0.44445768", "0.4435395", "0.44316983", "0.44293502", "0.44242278", "0.44240347", "0.44221446", "0.44206074", "0.44192383", "0.44183865", "0.44158563", "0.44144666", "0.44098437", "0.44093508", "0.4406014", "0.44056147", "0.43941873", "0.4392315", "0.43923", "0.43896478", "0.43839464", "0.4380314", "0.43783146", "0.43761176", "0.43746495", "0.43721494", "0.43715715", "0.43682158", "0.4367208", "0.43667293", "0.43658206" ]
0.0
-1
Complete initialization work that sould be done prior to DOMReady, like setting the page's zoom level.
function initializePreDomReady() { for (var i in settingsToLoad) { getSetting(settingsToLoad[i]); } var isEnabledForUrlPort = chrome.extension.connect({ name: "isEnabledForUrl" }); isEnabledForUrlPort.postMessage({ url: window.location.toString() }); var getZoomLevelPort = chrome.extension.connect({ name: "getZoomLevel" }); getZoomLevelPort.postMessage({ domain: window.location.host }); refreshCompletionKeys(); // Send the key to the key handler in the background page. keyPort = chrome.extension.connect({ name: "keyDown" }); if (navigator.userAgent.indexOf("Mac") != -1) platform = "Mac"; else if (navigator.userAgent.indexOf("Linux") != -1) platform = "Linux"; else platform = "Windows"; chrome.extension.onConnect.addListener(function(port, name) { if (port.name == "executePageCommand") { port.onMessage.addListener(function(args) { if (this[args.command]) { for (var i = 0; i < args.count; i++) { this[args.command].call(); } } refreshCompletionKeys(args.completionKeys); }); } else if (port.name == "getScrollPosition") { port.onMessage.addListener(function(args) { var scrollPort = chrome.extension.connect({ name: "returnScrollPosition" }); scrollPort.postMessage({ scrollX: window.scrollX, scrollY: window.scrollY, currentTab: args.currentTab }); }); } else if (port.name == "setScrollPosition") { port.onMessage.addListener(function(args) { if (args.scrollX > 0 || args.scrollY > 0) { window.scrollBy(args.scrollX, args.scrollY); } }); } else if (port.name == "returnCurrentTabUrl") { port.onMessage.addListener(function(args) { if (getCurrentUrlHandlers.length > 0) { getCurrentUrlHandlers.pop()(args.url); } }); } else if (port.name == "returnZoomLevel") { port.onMessage.addListener(function(args) { currentZoomLevel = args.zoomLevel; if (isEnabledForUrl) setPageZoomLevel(currentZoomLevel); }); } else if (port.name == "returnIsEnabledForUrl") { port.onMessage.addListener(function(args) { isEnabledForUrl = args.isEnabledForUrl; if (isEnabledForUrl) initializeWhenEnabled(); else if (HUD.isReady()) // Quickly hide any HUD we might already be showing, e.g. if we entered insertMode on page load. HUD.hide(); }); } else if (port.name == "returnSetting") { port.onMessage.addListener(setSetting); } else if (port.name == "refreshCompletionKeys") { port.onMessage.addListener(function (args) { refreshCompletionKeys(args.completionKeys); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function init() {\n documentReady(documentLoaded);\n}", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function initOnDomReady() {}", "function pageReady(){\n handleUTM();\n legacySupport();\n initModals();\n initScrollMonitor();\n initVideos();\n _window.on('resize', debounce(initVideos, 200))\n initSmartBanner();\n initTeleport();\n initMasks();\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function init(){\n $(\"html\").css({\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"margin\":\"0px\",\n \"padding\":\"0px\"\n });\n $(\"body\").css({\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"overflow\":\"hidden\",\n \"margin\":\"0px\",\n \"padding\":\"0px\"\n });\n setSizeForPages();\n $(window).resize(setSizeForPages);\n }", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "function initPage()\n\t{\n\t\tinitGlobalVars();\n\t\tinitDOM();\n\t\tinitEvents();\n\t}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function init () {\n win.SiteCanvas = PageInterface;\n on(win, 'message', onMessage);\n\n on(win, 'load', FrameInterface.calculateViewportDimensions);\n on(win, 'resize', FrameInterface.calculateViewportDimensions);\n }", "function pageDocReady () {\n\n}", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "function init(){\n\t\t//Add load listener\n\t\twindow.addEventListener('DOMContentLoaded',\tfunction() {\n\t\t\tfindElements();\n\t\t\taddScrollListeners();\n\t\t\tscrollInit();\n\n\t\t\tdocument.head.appendChild(animStyle);\n\n\t\t\t//Create a mutation observer to monitor changes in attributes and new values to make sure new/changed elements are animated properly\n\t\t\tobserver = new MutationObserver(domChanged);\n\t\t\tobserver.observe(document, { attributes: true, childList: true, subtree: true });\n\n\t\t\tconsole.log(\"JSA v. \" + version + \" initialized. Visit https://github.com/CamSOlson/jsa for documentation\");\n\n\t\t});\n\t}", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "function mkdfOnDocumentReady() {\n\t\tmkdfInitFullScreenSections();\n\t}", "function init() {\n cacheDom();\n loadImage();\n }", "function onInit() {\r\n\r\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\r\n\r\n }", "function initialize(){\r\n //<-window.onload\r\n setMap(); //->\r\n}", "function init() {\n setDomEvents();\n }", "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "function mkdfOnDocumentReady() {\n\t\tmkdfInitVerticalSplitSlider();\n\t}", "function initializePage() {\n handleGlobalEvent();\n handleSideBar();\n handleMessageBar();\n handleCollapsibleController();\n handleResetButton();\n handleDisabledSubmit();\n handleAjaxError();\n handleAjaxSetup();\n }", "function eltdfOnDocumentReady() {\n eltdfHeaderBehaviour();\n eltdfSideArea();\n eltdfSideAreaScroll();\n eltdfFullscreenMenu();\n eltdfInitDividedHeaderMenu();\n eltdfInitMobileNavigation();\n eltdfMobileHeaderBehavior();\n eltdfSetDropDownMenuPosition();\n eltdfDropDownMenu();\n eltdfSearch();\n eltdfVerticalMenu().init();\n }", "function initDomReadyState() {\r\n function fire() {\r\n if (!_mm.blackout) {\r\n if (!_boot[0]++) { // [0]fired\r\n var ary = _boot[1].concat(_boot[2]); // copy\r\n\r\n if (_debug) {\r\n stepby(ary);\r\n } else {\r\n try {\r\n stepby(ary);\r\n } catch(err) {}\r\n }\r\n _boot = [1, [], []]; // reset\r\n }\r\n }\r\n }\r\n // callback user-function and boot loader\r\n function stepby(ary) {\r\n var v, i = 0;\r\n\r\n while ( (v = ary[i++]) ) { v(); }\r\n (typeof _win.boot === \"function\") && _win.boot();\r\n }\r\n\r\n if (_ie) {\r\n _win.attachEvent(\"onload\", fire);\r\n (function peek() {\r\n try {\r\n _doc.firstChild.doScroll(\"up\"), fire();\r\n } catch(err) { setTimeout(peek, 16); }\r\n })();\r\n } else { // WebKit, Firefox, Opera\r\n _win.addEventListener(\"load\", fire, false);\r\n _doc.addEventListener(\"DOMContentLoaded\", fire, false);\r\n }\r\n}", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function onPageLoad()\n\t{\n\t\t//Set page size\n\t\tSetSize();\n\t\tloadPreferences();\n\t}", "function init() {\n cacheDom();\n loadImage();\n }", "function mapsLoaded() {\n $(init);\n}", "function setLoadlist() {\n getWindowHeight(); //get window height\n getWindowWidth(); //get window width\n setParallaxContainerDimensions(); //set parallax container height & width\n setParallaxImgDimensions(); //set parallax image element height & width\n getParallaxInfo(); //get parallax container and element information\n getWindowScrollPos(); //get current window scroll position\n\n if (typeof _onReady === 'function') {\n _onReady.call();\n }\n\n setParallaxScroll();\n }", "function init(){\n console.log(\"Page loaded and DOM is ready\");\n}", "function initialize(){\n //<-window.onload\n setMap(); //->\n}", "function init() {\n\tdocument.readyState === 'complete' ?\n\t\twirejs.bless(document) :\n\t\tsetTimeout(init, 1);\n}", "function ready() {\n\n\tif(!Modernizr.csstransforms3d) $('body').prepend('<div class=\"alert\"><div class=\"box\"><h2>Fatti un regalo.</h2><p>Questo sito usa tecnologie moderne non compatibili con il tuo vecchissimo browser.</p><p>Fatti un regalo, impiega due minuti a installare gratuitamente un browser recente, tipo <a href=\"http://www.google.it/intl/it/chrome/browser/\">Google Chrome</a>. Scoprirai che il web è molto più bello!</p></div></div>');\n\tloader.init();\n\t$('nav').addClass('hidden');\n\t//particles.init();\n\twork.init();\n\tnewhash.change(true);\n\textra();\n\tskillMng.init();\n\tcomponentForm.init();\n\tresponsiveNav();\n\tmaterial_click();\n\tcuul.init();\n\tdisableHover();\n\tscroll_down.init();\n}", "function page_loaded() {\n post_load_setup();\n}", "function initialize(){\n\n\t\t//sets all needed components, listeners, etc\n\t\tformatBodyPages();\n\t\tsetBodyTransitions();\n\n\t}", "function eltdfOnDocumentReady() {\n eltdfInitQuantityButtons();\n eltdfInitSelect2();\n\t eltdfInitPaginationFunctionality();\n\t eltdfReinitWooStickySidebarOnTabClick();\n eltdfInitSingleProductLightbox();\n\t eltdfInitSingleProductImageSwitchLogic();\n eltdfInitProductListCarousel();\n }", "function mkdfOnDocumentReady() {\n\t\tmkdfScrollingImage();\n\t}", "function salientPageBuilderElInit() {\r\n\t\t\t\t\tflexsliderInit();\r\n\t\t\t\t\tsetTimeout(flickityInit, 100);\r\n\t\t\t\t\ttwentytwentyInit();\r\n\t\t\t\t\tstandardCarouselInit();\r\n\t\t\t\t\tproductCarouselInit();\r\n\t\t\t\t\tclientsCarouselInit();\r\n\t\t\t\t\tcarouselfGrabbingClass();\r\n\t\t\t\t\tsetTimeout(tabbedInit, 60);\r\n\t\t\t\t\taccordionInit();\r\n\t\t\t\t\tlargeIconHover();\r\n\t\t\t\t\tnectarIconMatchColoring();\r\n\t\t\t\t\tcoloredButtons();\r\n\t\t\t\t\tteamMemberFullscreen();\r\n\t\t\t\t\tflipBoxInit();\r\n\t\t\t\t\towlCarouselInit();\r\n\t\t\t\t\tmouseParallaxInit();\r\n\t\t\t\t\tulCheckmarks();\r\n\t\t\t\t\tmorphingOutlinesInit();\r\n\t\t\t\t\tcascadingImageInit();\r\n\t\t\t\t\timageWithHotspotEvents();\r\n\t\t\t\t\tpricingTableHeight();\r\n\t\t\t\t\tpageSubmenuInit();\r\n\t\t\t\t\tnectarLiquidBGs();\r\n\t\t\t\t\tnectarTestimonialSliders();\r\n\t\t\t\t\tnectarTestimonialSlidersEvents();\r\n\t\t\t\t\trecentPostsTitleOnlyEqualHeight();\r\n\t\t\t\t\trecentPostsInit();\r\n\t\t\t\t\tparallaxItemHoverEffect();\r\n\t\t\t\t\tfsProjectSliderInit();\r\n\t\t\t\t\tpostMouseEvents();\r\n\t\t\t\t\tmasonryPortfolioInit();\r\n\t\t\t\t\tmasonryBlogInit();\r\n\t\t\t\t\tportfolioCustomColoring();\r\n\t\t\t\t\tsearchResultMasonryInit();\r\n\t\t\t\t\tstickySidebarInit();\r\n\t\t\t\t\tportfolioSidebarFollow();\r\n\t\t\t\t}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "function _init() {\n $(function() {\n $(window).resize(_checkWindowSize).resize();\n _sessionTimeoutWarning();\n });\n }", "function edgtfOnDocumentReady() {\n\t edgtfInitImageSlider();\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideArea();\n edgtfSideAreaScroll();\n edgtfFullscreenMenu();\n edgtfInitMobileNavigation();\n edgtfMobileHeaderBehavior();\n edgtfSetDropDownMenuPosition();\n edgtfDropDownMenu(); \n edgtfSearch();\n }", "function startup() {\n\tdocument.addEventListener('DOMContentLoaded', function() {\n loadmap();\n loadquestions();\n\t\t}, false);\n }", "function DOMReady() {\n }", "function pageLoaded() {\n\n\t\tvar elHeader = document.getElementsByTagName('header')[0];\n\n\t\telHeader.addEventListener(animationEvent, removeFOUT);\n\n\t\tfunction removeFOUT() {\n\n\t\t\tclassie.add(elHTML, 'ready');\n\t\t\telHeader.removeEventListener(animationEvent, removeFOUT);\n\n\t\t}\n\n\t}", "onPageReady () {}", "function qodefOnDocumentReady() {\n qodefInitQuantityButtons();\n qodefInitButtonLoading();\n qodefInitSelect2();\n\t qodefInitSingleProductLightbox();\n }", "function Initialize() {\r\n try {\r\n document.body.style.backgroundColor = \"#\" + UIColorToHexString(csInterface.hostEnvironment.appSkinInfo.panelBackgroundColor);\r\n Persistent(true);\r\n Register(true, gRegisteredEvents.toString());\r\n SetResultLabel(\"Initialize done\");\r\n SetResultTime();\r\n } catch (e) {\r\n JSLogIt(\"InitializeCallback catch: \" + e);\r\n }\r\n }", "function initializePage() {\r\n createCanvas();\r\n resetArray();\r\n setUpControls();\r\n drawCurrentState();\r\n addBox();\r\n // timer = setInterval(updateBox, 200);\r\n }", "function initializePage(){\n //GLOBALS pageHeight and sensitivity. Initialized in inputreader.js.\n //gotta fix this... this is terrible style.\n pageHeight = window.innerHeight + (svpArray.length * sensitivity) - 1;\n document.getElementById('container').style.height = pageHeight+\"px\";\n }", "function initializePage() {\n\tconsole.log(\"initializing\");\n}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headGeneralInformationLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\t$(\"#divLeft,#divHead,#divFoot\").addClass(\"notPrintable\");\r\n\t\t$(\"#startTime\").val(window.byd.DateUtil.lastWorkDate());\r\n\r\n\t\tajaxQueryReplacementCost(\"monthly\");\r\n \tajaxQueryReplacementCost(\"yearly\");\r\n \tajaxQueryCostDistribute();\r\n\t\tresetAll();\r\n\t}", "function onLoad() {\n document.documentElement.removeAttribute('viewBox');\n readFrames();\n sozi.events.fire('documentready');\n }", "function pageFullyLoaded () {}", "onload() {\n this.init();\n }", "function onLoad() {\n document.documentElement.removeAttribute(\"viewBox\");\n readFrames();\n sozi.events.fire(\"documentready\");\n }", "function init(){\n\t\t/*\n\t\t\tLet's sort out those settings\n\t\t*/\n\t\tif(options) settingsMerge(settings, options);\n\n\t\thtml\t= document.documentElement.outerHTML;\n\n\t\tif(html.match(/<\\/html>/gi)) {\n\t\t\twindow.stop();\n\t\t}\n\n\t\t/*\n\t\t\tInitialize test and run doScript as\n\t\t\tthe complete callback.\n\t\t*/\n\t\tdoTest(function() {\n\t\t\tdoScript();\n\t\t});\n\n\t}", "ready() {\n super.ready();\n\n const that = this;\n\n //a flag used to avoid animations on startup\n that._isInitializing = true;\n\n that._createLayout();\n that._setFocusable();\n\n delete that._isInitializing;\n }", "function qodeOnWindowLoad() {\n qodeInitElementorCoverBoxes();\n }", "function pageLoad(){\n $jQ('body').zIndex(); // jQuery UI Check\n window.onbeforeunload=function(){return '';}; // Hack to prevent any page.reload\n startCSSInfo();\n hackUserAgent();\n hackRemoveAnimations();\n hackDisableSubmit();\n hackActions();\n setNumScripts();\n setTimeStatus();\n setSystemColors();\n setVisibility();\n setUserActions();\n setAllVisibleElementsInfo();\n hackFrameScroll();\n}", "function initializePage() {\n\tconsole.log(\"initializePage\");\n\tclearInputs();\n\ttoggleInterest();\n}", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "function init() {\n\n if (!document.body)\n return;\n\n var body = document.body;\n var html = document.documentElement;\n var windowHeight = window.innerHeight;\n var scrollHeight = body.scrollHeight;\n\n // check compat mode for root element\n root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;\n activeElement = body;\n\n initTest();\n initDone = true;\n\n // Checks if this script is running in a frame\n if (top != self) {\n isFrame = true;\n }\n\n /**\n * This fixes a bug where the areas left and right to\n * the content does not trigger the onmousewheel event\n * on some pages. e.g.: html, body { height: 100% }\n */\n else if (scrollHeight > windowHeight &&\n (body.offsetHeight <= windowHeight ||\n html.offsetHeight <= windowHeight)) {\n\n html.style.height = 'auto';\n //setTimeout(refresh, 10);\n\n // clearfix\n if (root.offsetHeight <= windowHeight) {\n var underlay = document.createElement(\"div\");\n underlay.style.clear = \"both\";\n body.appendChild(underlay);\n }\n }\n\n // disable fixed background\n if (!options.fixedBackground && !isExcluded) {\n body.style.backgroundAttachment = \"scroll\";\n html.style.backgroundAttachment = \"scroll\";\n }\n }", "function onDocumentLoading(){\r\n $(\"#progressSpinner\").show();\r\n\r\n if(PendingFullScreen)\r\n setFullScreen(true);\r\n\r\n if(!slider && FlexPaperFullScreen){\r\n\t addSlider('zoomSliderFullScreen');\r\n fpToolbarLoadButtons();\r\n }\r\n}", "function init() {\n \n if (initDone || !document.body) return;\n \n initDone = true;\n \n var body = document.body;\n var html = document.documentElement;\n var windowHeight = window.innerHeight; \n var scrollHeight = body.scrollHeight;\n \n // check compat mode for root element\n root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;\n activeElement = body;\n \n initTest();\n \n // Checks if this script is running in a frame\n if (top != self) {\n isFrame = true;\n }\n \n /**\n * Safari 10 fixed it, Chrome fixed it in v45:\n * This fixes a bug where the areas left and right to \n * the content does not trigger the onmousewheel event\n * on some pages. e.g.: html, body { height: 100% }\n */\n else if (isOldSafari &&\n scrollHeight > windowHeight &&\n (body.offsetHeight <= windowHeight || \n html.offsetHeight <= windowHeight)) {\n \n var fullPageElem = document.createElement('div');\n fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +\n 'top:0; left:0; right:0; height:' + \n root.scrollHeight + 'px';\n document.body.appendChild(fullPageElem);\n \n // DOM changed (throttled) to fix height\n var pendingRefresh;\n refreshSize = function () {\n if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);\n pendingRefresh = setTimeout(function () {\n if (isExcluded) return; // could be running after cleanup\n fullPageElem.style.height = '0';\n fullPageElem.style.height = root.scrollHeight + 'px';\n pendingRefresh = null;\n }, 500); // act rarely to stay fast\n };\n \n setTimeout(refreshSize, 10);\n \n addEvent('resize', refreshSize);\n \n // TODO: attributeFilter?\n var config = {\n attributes: true, \n childList: true, \n characterData: false \n // subtree: true\n };\n \n observer = new MutationObserver(refreshSize);\n observer.observe(body, config);\n \n if (root.offsetHeight <= windowHeight) {\n var clearfix = document.createElement('div'); \n clearfix.style.clear = 'both';\n body.appendChild(clearfix);\n }\n }\n \n // disable fixed background\n if (!options.fixedBackground && !isExcluded) {\n body.style.backgroundAttachment = 'scroll';\n html.style.backgroundAttachment = 'scroll';\n }\n }", "function init() {\n \n if (initDone || !document.body) return;\n \n initDone = true;\n \n var body = document.body;\n var html = document.documentElement;\n var windowHeight = window.innerHeight; \n var scrollHeight = body.scrollHeight;\n \n // check compat mode for root element\n root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;\n activeElement = body;\n \n initTest();\n \n // Checks if this script is running in a frame\n if (top != self) {\n isFrame = true;\n }\n \n /**\n * Safari 10 fixed it, Chrome fixed it in v45:\n * This fixes a bug where the areas left and right to \n * the content does not trigger the onmousewheel event\n * on some pages. e.g.: html, body { height: 100% }\n */\n else if (isOldSafari &&\n scrollHeight > windowHeight &&\n (body.offsetHeight <= windowHeight || \n html.offsetHeight <= windowHeight)) {\n \n var fullPageElem = document.createElement('div');\n fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +\n 'top:0; left:0; right:0; height:' + \n root.scrollHeight + 'px';\n document.body.appendChild(fullPageElem);\n \n // DOM changed (throttled) to fix height\n var pendingRefresh;\n refreshSize = function () {\n if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);\n pendingRefresh = setTimeout(function () {\n if (isExcluded) return; // could be running after cleanup\n fullPageElem.style.height = '0';\n fullPageElem.style.height = root.scrollHeight + 'px';\n pendingRefresh = null;\n }, 500); // act rarely to stay fast\n };\n \n setTimeout(refreshSize, 10);\n \n addEvent('resize', refreshSize);\n \n // TODO: attributeFilter?\n var config = {\n attributes: true, \n childList: true, \n characterData: false \n // subtree: true\n };\n \n observer = new MutationObserver(refreshSize);\n observer.observe(body, config);\n \n if (root.offsetHeight <= windowHeight) {\n var clearfix = document.createElement('div'); \n clearfix.style.clear = 'both';\n body.appendChild(clearfix);\n }\n }\n \n // disable fixed background\n if (!options.fixedBackground && !isExcluded) {\n body.style.backgroundAttachment = 'scroll';\n html.style.backgroundAttachment = 'scroll';\n }\n }", "function initPage() {\n\n initHeader();\n\n initForm();\n\n initDatalist();\n}", "function initAfterReady () {\n _this.coverImage();\n _this.clipContainer();\n _this.onScroll(true);\n\n // save default user styles\n _this.$item.setAttribute('data-jarallax-original-styles', _this.$item.getAttribute('style'));\n\n // call onInit event\n if(_this.options.onInit) {\n _this.options.onInit.call(_this);\n }\n\n // timeout to fix IE blinking\n setTimeout(function () {\n if(_this.$item) {\n // remove default user background\n _this.css(_this.$item, {\n 'background-image' : 'none',\n 'background-attachment' : 'scroll',\n 'background-size' : 'auto'\n });\n }\n }, 0);\n }", "function init() {\n\n getCourses(program);\n getPreqs(courses);\n drawGraph();\n\n //set zoom view level\n zoomOut();\n\n //loading done\n $('#spin1').hide();\n}", "function initPage() {\n\tset_hidden_elements();\n}", "function init()\n{\n //initalize the application\n meDominance='';\n reset();\n //setFrameUrl('header','header.htm');\n //setFrameUrl('left','selectdomleft.htm');\n //setFrameUrl('right','selectdomright.htm');\n\n blnInitCalled=true;\n}", "function init() {\n if ($('.detail-page').length > 0) {\n renderLoader();\n setArticleParams();\n getArticle();\n bindEvents();\n }\n }", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "function init() {\n // Load and style highCharts library. https://www.highCharts.com/docs.\n highchartsExport( Highcharts );\n applyThemeTo( Highcharts );\n\n _containerDom = document.querySelector( '#chart-section' );\n _resultAlertDom = _containerDom.querySelector( '#chart-result-alert' );\n _failAlertDom = _containerDom.querySelector( '#chart-fail-alert' );\n _chartDom = _containerDom.querySelector( '#chart' );\n _dataLoadedDom = _containerDom.querySelector( '.data-enabled' );\n\n startLoading();\n }", "function initialize(options) {\n\n if (!supports2DTransforms && !supports3DTransforms) {\n document.body.setAttribute('class', 'no-transforms');\n\n // If the browser doesn't support core features we won't be\n // using JavaScript to control the presentation\n return;\n }\n\n // Force a layout when the whole page, incl fonts, has loaded\n window.addEventListener('load', layout, false);\n\n // Copy options over to our config object\n extend(config, options);\n\n // Hide the address bar in mobile browsers\n hideAddressBar();\n\n // Loads the dependencies and continues to #start() once done\n load();\n\n }", "function init() {\n setupCamera(); // get the camera happening\n makeScene(); // lights, textures, materials, objects\n setupRenderer(); // the main renderer\n addToWebPage(renderer); // add the WebGL to the web page\n\n\twindow.addEventListener( 'resize', onWindowResize, false );\n document.addEventListener( 'mousedown', onDocumentMouseDown, false );\n document.addEventListener('keypress', onDocumentKeyPressed, false); \n}", "function initialize(){//init when a new page load\r\n\t $('#info_dom').append('<li id=\"iRoot\"><ul></ul></li>');\r\n\t init_models();\r\n\t // init_interaction_area();\r\n\t //info_window_create();\r\n\t // $('#resource_tabs').tabs();\r\n\t // resources_window_create();\r\n\t init_interaction_actions();\r\n\t init_page_actions();\r\n}", "initialize() {\n this._initializeButtons();\n this._initializeLock();\n this._initializeWindowsTransparency();\n this.settings.initialize();\n\n this.updateWindowHeight();\n }", "function setReady() {\n debug.log( arguments.callee.name );\n // Hacky-hacky for Linkinus 2.2 / iOS.\n location.href = 'linkinus-style://styleDidFinishLoading';\n \n scroller.setReady();\n overlay.setReady();\n \n //spam(); // Uncomment for scroll debugging.\n}", "function init() {\n\t\t\t\n\t\t\t// Is there any point in continuing?\n\t\t\tif (allElments.length == 0) {\n\t\t\t\tdebug('page contains no elements');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Replace images\n\t\t\treplaceImgboxes();\n\t\t\t\n\t\t\t// Listen for window resize events\n\t\t\t$(window).on('resize', windowResizeImgbox);\n\n\t\t\t// Add mouse listeners if we are in edit mode\n\t\t\tif (settings.command == 'edit') {\n\t\t\t\tdebug('settings.command:edit');\n\t\t\t\t$(allElments).on('click', editClick);\n\t\t\t\t$(allElments).on('mousemove', editMousemove);\n\t\t\t}\n\t\t}", "pageReady() {}", "function pageLoaded() {\n svgweb.addOnLoad(createSVGObject);\n}", "function init() {\n\n // setup canvas\n canvas = document.getElementById(canvas_id);\n context = canvas.getContext('2d');\n\n // render user controls\n if (controlsRendered === false) {\n self.renderControls();\n controlsRendered = true;\n }\n\n // add page controls\n window.addEventListener('keydown', self.navigation, false);\n window.addEventListener('hashchange', checkHash, false);\n }", "function initPage() {\n\t\n\tvar postNonSkelInit = function() {\n\t\twindow.addEventListener('blur', attachFocusListener, false); // link147928272\n\t\tifNotFocusedDoOnBlur();\n\t};\n\t\n\tnsInitPage(postNonSkelInit); ///// non-skel\n}", "onPageLoaded() {\n window.clearTimeout(this.animationTimeout_);\n window.clearTimeout(this.loadingTimeout_);\n this.setUIStep(AssistantLoadingUIState.LOADED);\n }", "function setUpPage() {\n createEventListeners();\n populateFigures();\n}", "function initPage() {\r\n\t// Resize windows\r\n\tresizeMainWindow();\r\n\t// Perform actions upcon page resize\r\n\twindow.onresize = function() {\r\n\t\t// Nothing yet\r\n\t}\r\n\t// Allow collapsing of left-hand menu\r\n\tif ($('#west').length) {\r\n\t\t$('#westpad').bind('mousedown',function(){\r\n\t\t\t$(\"#west\").toggle();\r\n\t\t});\t\r\n\t}\r\n\t// Add fade mouseover for \"Edit instruments\" link on project menu\r\n\t$(\"#menuLnkEditInstr\").hover(function() {\r\n\t\t$(this).removeClass('opacity50');\r\n\t\tif (isIE) $(\"#menuLnkEditInstr img\").removeClass('opacity50');\r\n\t}, function() {\r\n\t\t$(this).addClass('opacity50');\r\n\t\tif (isIE) $(\"#menuLnkEditInstr img\").addClass('opacity50');\r\n\t});\r\n\t// Add fade mouseover for \"Choose other record\" link on project menu\r\n\t$(\"#menuLnkChooseOtherRec\").hover(function() {\r\n\t\t$(this).removeClass('opacity50');\r\n\t}, function() {\r\n\t\t$(this).addClass('opacity50');\r\n\t});\t\r\n\t// Put focus on main window for initial scrolling (only works in IE)\r\n\tif ($('#center').length) document.getElementById('center').focus();\r\n}", "constructor() {\n let ready = new Promise(resolve => {\n if (document.readyState != \"loading\") return resolve();\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n });\n ready.then(this.init.bind(this));\n }", "function onPageLoad() {\n // winResize();\n // winScroll();\n }", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function initialize() {\n\t\tvar isTouch = setIsTouch();\n\t\tvar device = setDevice();\n var os = setOS();\n\n\t\t$(document).ready(function(){\n\t\t\tsetBodyDataAttr('isTouch', isTouch);\n\t\t\tsetBodyDataAttr('device', device);\n setBodyDataAttr('os', os);\n\t\t});\n\t}", "function init() {\n\t\n\tlastOrientation = {};\n\twindow.addEventListener('resize', doLayout, false);\n\tdocument.body.addEventListener('mousemove', onMouseMove, false);\n\tdocument.body.addEventListener('mousedown', onMouseDown, false);\n\tdocument.body.addEventListener('mouseup', onMouseUp, false);\n\tdocument.body.addEventListener('touchmove', onTouchMove, false);\n\tdocument.body.addEventListener('touchstart', onTouchDown, false);\n\tdocument.body.addEventListener('touchend', onTouchUp, false);\n\twindow.addEventListener('deviceorientation', deviceOrientationTest, false);\n\tlastMouse = {x:0, y:0};\n\tlastTouch = {x:0, y:0};\n\tmouseDownInsideball = false;\n\ttouchDownInsideball = false;\n\tdoLayout(document);\n}" ]
[ "0.7400017", "0.7186406", "0.70748883", "0.70723736", "0.70716417", "0.6862576", "0.6858729", "0.67703164", "0.66767764", "0.6649554", "0.66261065", "0.6603607", "0.6601508", "0.6596948", "0.65893227", "0.65818423", "0.65741175", "0.6574037", "0.65695924", "0.6562088", "0.653786", "0.6519028", "0.65006447", "0.6498617", "0.6471961", "0.64701355", "0.6446626", "0.6427393", "0.64200926", "0.6416694", "0.6413088", "0.64119714", "0.63977104", "0.63970125", "0.6382496", "0.63813037", "0.6373162", "0.6369134", "0.63603216", "0.6359071", "0.63531744", "0.63513356", "0.6351266", "0.6344309", "0.6335886", "0.63309216", "0.63285047", "0.63253564", "0.63201606", "0.6306556", "0.6303797", "0.62988716", "0.62891674", "0.62809217", "0.6276306", "0.62732327", "0.6262904", "0.6260505", "0.62603885", "0.62568027", "0.62547565", "0.62511367", "0.62503284", "0.623977", "0.62388295", "0.6236412", "0.6233517", "0.6215596", "0.62119484", "0.6207239", "0.61971587", "0.6189452", "0.6188509", "0.6185864", "0.6185864", "0.6177292", "0.6170798", "0.6164106", "0.61586136", "0.61581665", "0.61547524", "0.61506623", "0.61486745", "0.6145698", "0.6139933", "0.6125451", "0.6120848", "0.61206394", "0.61201996", "0.61172676", "0.6116786", "0.6109121", "0.6090594", "0.6090547", "0.60868096", "0.6077809", "0.6077473", "0.6071224", "0.60619205", "0.6040669", "0.60375595" ]
0.0
-1
This is called once the background page has told us that Vimium should be enabled for the current URL.
function initializeWhenEnabled() { document.addEventListener("keydown", onKeydown, true); document.addEventListener("focus", onFocusCapturePhase, true); document.addEventListener("blur", onBlurCapturePhase, true); enterInsertModeIfElementIsFocused(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monitorCurrentPage() {\n $('#monitor_page').addClass('inprogress');\n chrome.tabs.getSelected(null, function(tab) {\n initializePageModePickerPopup(tab);\n _gaq.push(['_trackEvent', tab.url, 'add']);\n\n chrome.tabs.getAllInWindow(null, function(tabs){\n var found = false;\n for (var i = 0; i < tabs.length; i++) {\n if(tabs[i].url == chrome.extension.getURL(\"options.htm\")) \n {\n found = true;\n break;\n }\n }\n \n if (found == false)\n {\n chrome.tabs.create({url: \"options.htm\", active: false});\n }\n addPage({url: tab.url, name: tab.title}, function() {\n BG.takeSnapshot(tab.url);\n });\n});\n \n });\n}", "function valleyGirlIfy(){\n\tvalleyGirlIfied = true;\n\tchrome.browserAction.setIcon({path:\"activelogo.png\"});\n\tchrome.tabs.executeScript(null, {file: \"async.js\"}, function() {\n\t\tchrome.tabs.executeScript(null, {file: \"content.js\"});\n\t});\n\tchrome.tabs.query({active:true, windowType:\"normal\", currentWindow: true}, function(t){\n\t\tcurTabID = t[0].id;\n\t\tVGedTabs[curTabID] = true;\n\t\tchrome.runtime.onConnect.addListener(function(port){\n\t\t\tport.postMessage({vgTabId: curTabID});\n\t\t});\n\t});\n}", "function loaded() {\n var cur_tab_url = chrome.extension.getBackgroundPage().CurrentTabUrl();\n if (/https:/.test(cur_tab_url)) {\n document.getElementById(\"not_ready_alert\").innerHTML =\n \"You can't grab snippets from secure webpages.\";\n } else if (!/http:/.test(cur_tab_url)) {\n document.getElementById(\"not_ready_alert\").innerHTML =\n \"You can't grab snippets from this page.\";\n } else { // http\n checkReadyness();\n }\n\n if (chrome.extension.getBackgroundPage().isFirstActivationOrNewRelease()) {\n document.getElementById('standard_actions').style.display = 'none';\n document.getElementById('update_notifications').style.display = '';\n }\n}", "function update() {\r\n var XSS_blocker = chrome.extension.getBackgroundPage().XSS_blocker;\r\n document.getElementById('XSS_toggle').value = XSS_blocker ? 'Disable' : 'Enable';\r\n var Ad_blocker = chrome.extension.getBackgroundPage().Ad_blocker;\r\n document.getElementById('Ad_toggle').value = Ad_blocker ? 'Disable' : 'Enable';\r\n }", "function update_is_hudl(url) {\n\n var is_hudl = is_page_hudl(url);\n\n chrome.storage.local.set({'is_hudl': is_hudl}, function () {\n });\n}", "function enable_background() {\n\n //Adds device listener to keep app open in the background (stop the connection from dying)\n document.addEventListener('deviceready', function () {\n\n cordova.plugins.backgroundMode.setDefaults({\n title: \"iNetKey+\",\n text: \"Tap to Open\",\n icon: 'icon',\n color: \"2980b9\",\n resume: true,\n hidden: true,\n bigText: false\n });\n\n cordova.plugins.backgroundMode.setEnabled(true);\n cordova.plugins.backgroundMode.overrideBackButton();\n\n ready = true;\n }, false);\n\n document.addEventListener('pause', function () {\n stopAnimation();\n }, false);\n\n document.addEventListener('resume', function () {\n startAnimation();\n }, false);\n}", "function vlcOnPageStartLoad()\n{\n //preventMaavaron();\n //skipMaavaron();\n //vlcVideoLinksToProxy();\n}", "function enable()\n {\n browser.bookmarks.onRemoved.addListener(update_in_active_tabs);\n browser.tabs.onActivated.addListener(on_tab_activated);\n browser.tabs.onUpdated.addListener(on_tab_updated);\n browser.tabs.onRemoved.addListener(on_tab_removed);\n\n update_in_active_tabs();\n }", "function handleActivated(activeInfo) {\r\n chrome.tabs.query({ active: true, currentWindow: true}, function(tabs) {\r\n setIcon(tabs[0].url);\r\n //https://stackoverflow.com/questions/6451693/chrome-extension-how-to-get-current-webpage-url-from-background-html\r\n \r\n});\r\n}", "function hackUserAgent(){\n if (navigator.userAgent.search('Firefox')!==-1)\n active='mouseup.webcrawler';\n}", "function loadStopCallBack() {\n\tif (inAppBrowserRef != undefined) {\n \t$(\"#websiteReference\").text(\"Reload the Vivit Website (make this a link or button or something\");\n \tinAppBrowserRef.insertCSS({ code: \"body{font-size: 25px;\" });\n \tinAppBrowserRef.show();\n\t}\n}", "function _handleGoLiveCommand() {\n if (LiveDevelopment.status > 0) {\n LiveDevelopment.close();\n // TODO Ty: when checkmark support lands, remove checkmark\n } else {\n LiveDevelopment.open();\n // TODO Ty: when checkmark support lands, add checkmark\n }\n }", "function updatePage() {\n chrome.storage.local.get('enabled', function (data) {\n console.log('content.get', data);\n toggleState(data.enabled);\n });\n}", "function disableAutoUrlDetect() {\n\t\t\tsetEditorCommandState(\"AutoUrlDetect\", false);\n\t\t}", "function disableAutoUrlDetect() {\n\t\t\tsetEditorCommandState(\"AutoUrlDetect\", false);\n\t\t}", "function disableAutoUrlDetect() {\n\t\t\tsetEditorCommandState(\"AutoUrlDetect\", false);\n\t\t}", "function initializeOnDomReady() {\n if (isEnabledForUrl)\n enterInsertModeIfElementIsFocused();\n // Tell the background page we're in the dom ready state.\n chrome.extension.connect({ name: \"domReady\" });\n}", "function enableUiTrackingMode(){\n console.log('enableUiTrackingMode'); \n $(\"#browserActionStateDisplay\").show();\n $(\"#toggleStateButton\").show();\n $(\"#toggleTabCategory\").show();\n $(\"#toggleTrackButton\").html(\n \"Stop Tracking\" \n );\n}", "function handleBackground() {\n $('#statusDiv').text('status: in background ');\n}", "function enableWebsitePreview() {\n $scope.websitePreviewEnabled = true;\n }", "function registerBackgroundTabDetection() {\n\t if (WINDOW && WINDOW.document) {\n\t WINDOW.document.addEventListener('visibilitychange', () => {\n\t const activeTransaction = getActiveTransaction() ;\n\t if (WINDOW.document.hidden && activeTransaction) {\n\t const statusType = 'cancelled';\n\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n\t logger.log(\n\t `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n\t );\n\t // We should not set status if it is already set, this prevent important statuses like\n\t // error or data loss from being overwritten on transaction.\n\t if (!activeTransaction.status) {\n\t activeTransaction.setStatus(statusType);\n\t }\n\t activeTransaction.setTag('visibilitychange', 'document.hidden');\n\t activeTransaction.finish();\n\t }\n\t });\n\t } else {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n\t logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n\t }\n\t}", "async function updateExecution() {\n const options = await loadOptions();\n const currentUrl = window.location.href;\n\n if (\n !isUrlAccepted(\n currentUrl,\n options.enabledSites,\n options.disabledSites\n )\n ) {\n interrupt();\n } else {\n start(options);\n }\n }", "function backgroundInit() {\n storage( 'currentTab', null );\n // When Chrome displays any tab, show the pageAction\n // icon in that tab's addressbar.\n var handleTabEvents = function( tab ) {\n storage( 'currentTab', tab.id || tab );\n chrome.pageAction.show( tab.id || tab );\n isAuthenticated( {\n 'isAuthed': function () { clearPopup(); },\n 'notAuthed': function () { setPopup(); },\n 'error': function () { setPopup(); }\n } );\n };\n chrome.tabs.onSelectionChanged.addListener( handleTabEvents );\n chrome.tabs.onUpdated.addListener( handleTabEvents );\n chrome.tabs.getSelected( null, handleTabEvents );\n\n var handleClickEvents = function( response, tab ) {\n animatedIcon.stop();\n switch ( response.status ) {\n case STATUS_CREATED:\n chrome.pageAction.setIcon( {\n \"tabId\": tab.id,\n \"path\": \"success.png\"\n } );\n break;\n case STATUS_BADREQUEST:\n case STATUS_ERROR:\n case STATUS_FORBIDDEN:\n default:\n chrome.pageAction.setIcon( {\n \"tabId\": tab.id,\n \"path\": \"failure.png\"\n } );\n break;\n }\n };\n chrome.pageAction.onClicked.addListener( function ( tab ) {\n var response = sendURL( tab, handleClickEvents );\n } );\n\n // Listen for messages from the injected content script\n chrome.extension.onRequest.addListener(\n function( request, sender, sendResponse ) {\n if ( request.action === \"sendToInstapaper\" ) {\n sendURL( sender.tab, handleClickEvents );\n }\n sendResponse( {} );\n }\n );\n }", "function checkReadyness() {\n var ready_status = chrome.extension.getBackgroundPage().CurrentTabReadiness();\n if (ready_status == \"unknown\") {\n document.getElementById(\"not_ready_alert\").innerHTML =\n \"Please reload the page.\";\n ready = false;\n setTimeout(\"checkReadyness()\", 100);\n } else if (ready_status == \"ready\") {\n ready = true;\n document.getElementById(\"snip_button\").className = \"action\";\n document.getElementById(\"snip_text\").innerHTML = \"Click to Snip!\";\n document.getElementById(\"not_ready_alert\").style.display = \"none\";\n } else { // loading\n document.getElementById(\"not_ready_alert\").innerHTML =\n \"Waiting for page to complete loading...\";\n ready = false;\n setTimeout(\"checkReadyness()\", 100);\n }\n}", "function call_requirements() {\n\tvar a = document.location.search.substring(1).split('&');\n\tfor (var i in a) {\n\t\tvar b = a[i].split('=');\n\t\tquery[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n\t}\n\n\tnavigator.getMedia = (navigator.getUserMedia || // use the proper vendor prefix\n\t\tnavigator.webkitGetUserMedia ||\n\t\tnavigator.mozGetUserMedia ||\n\t\tnavigator.msGetUserMedia);\n\n\tif (!navigator.getMedia) {\n\t\t//error\n\t}\n\telse {\n\t\tnavigator.getMedia({ video: true, audio: false }, function (mediaStream) {\n\t\t\tvar video = document.getElementsByTagName('video')[0];\n\t\t\tvideo.srcObject = mediaStream;\n\t\t\tvideo.play();\n\n\t\t\tsetInterval(setBrightness, 1000);\n\n\t\t}, function () {\n\t\t\t//denied\n\t\t});\n\t}\n\n\twindow.addEventListener('scroll', function () {\n\t\tvar vert = Math.max(0, window.pageYOffset + $(\".navbar\").height() - $(\"#posDiv\").position().top);\n\t\t$(\"#movyDiv\").css({ top: vert, left: 0, position: 'absolute' });\n\t}, false);\n\n\tif (interactive) {\n\t\t// $(\"#shortInstructions\").css(\"display\", \"inline\");\n\t\t// $(\"#longInstructions\").css(\"display\", \"none\");\n\t\t$(\"#shortInstructions\").attr('style', 'display:inline');\n\t\t$(\"#longInstructions\").attr('style', 'display:none');\n\t\tsetCurrentInstruction();\n\t\t// console.log(\"hide\")\n\t}\n\telse {\n\t\t// $(\"#shortInstructions\").css(\"display\", \"none\");\n\t\t// $(\"#longInstructions\").css(\"display\", \"inline\");\n\t\t$(\"#shortInstructions\").attr('style', 'display:none');\n\t\t$(\"#longInstructions\").attr('style', 'display:inline');\n\t\t// console.log(\"show\")\n\n\t}\n}", "function activateExtension() {\n Privly.options.setInjectionEnabled(true);\n updateActivateStatus(true);\n}", "checkPage() {\r\n chrome.runtime.sendMessage({ \"domain\": `*://${window.location.hostname}/*` });\r\n }", "function nav(url) \r\n\t{\r\n chrome.tabs.getSelected(null, function(tab)\r\n\t\t{\r\n chrome.tabs.update(tab.id, {url: url});\r\n });\r\n }", "function autoDetection() {\n //$.notify(\"in autodection()\");\n var currentUrl = window.location.href;\n $.ajax({\n type: 'GET',\n async: true,\n crossDomain: true,\n headers: { 'Cache-Control': 'no-cache'},\n url: currentUrl,\n dataType: 'html',\n error: function () {\n cacheBrowsing();\n }\n });\n}", "function registerBackgroundTabDetection() {\n if (global && global.document) {\n global.document.addEventListener('visibilitychange', function () {\n var activeTransaction = utils_2.getActiveTransaction();\n if (global.document.hidden && activeTransaction) {\n utils_1.logger.log(\"[Tracing] Transaction: \" + spanstatus_1.SpanStatus.Cancelled + \" -> since tab moved to the background, op: \" + activeTransaction.op);\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!activeTransaction.status) {\n activeTransaction.setStatus(spanstatus_1.SpanStatus.Cancelled);\n }\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.setTag(constants_1.FINISH_REASON_TAG, constants_1.IDLE_TRANSACTION_FINISH_REASONS[2]);\n activeTransaction.finish();\n }\n });\n }\n else {\n utils_1.logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}", "backgroundModeToggle() {\n\t/* If already enabled, disable, change button HTML, notify user */\n\tif (cordova.plugins.backgroundMode.isEnabled()) {\n\t cordova.plugins.backgroundMode.disable();\n\t bgButton.innerHTML = \"Enable Background Mode\";\n\t let toast = Toast.create({\n message: \"Background Mode Disabled\",\n duration: 2000,\n position: 'bottom',\n showCloseButton: true\n\t });\n this.nav.present(toast);\n\t}\n\t/* Otherwise already disabled, so enable, change button HTML, notify user */\n\telse {\n\t cordova.plugins.backgroundMode.enable();\n\t bgButton.innerHTML = \"Disable Background Mode\";\n\t let toast = Toast.create({\n message: \"Background Mode Enabled\",\n duration: 2000,\n position: 'bottom',\n showCloseButton: true\n });\n this.nav.present(toast);\n\n\t}\n }", "function toggle() {\n if (ready) {\n chrome.extension.getBackgroundPage().toggle();\n window.close();\n }\n}", "function userCSP_backOrForwardBtnClicked () {\n console.log (\"\\n\\n Back or Forward Button pressed\");\n console.log (\"\\n Current URL = \"+tabs.activeTab.url); \n gBrowser.addTabsProgressListener(userCSP_progressListener);\n} // end of userCSP_backOrForwardBtnClicked() function", "function displaySettings (settings) {\n document.querySelector(\"input[name=status]\").checked = settings.status\n document.querySelector(\"input[name=images]\").checked = settings.images\n document.querySelector(\"input[name=bgimages]\").checked = settings.bgImages\n document.querySelector(\"input[name=videos]\").checked = settings.videos\n document.querySelector(\"input[name=iframes]\").checked = settings.iframes\n document.querySelector(\"input[name=bluramt]\").value = settings.blurAmt\n document.querySelector(\"span[name=bluramttext]\").innerHTML = settings.blurAmt + \"px\"\n document.querySelector(\"input[name=grayscale]\").checked = settings.grayscale\n\n\n browser.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n var url = new URL(tabs[0].url)\n currentDomain = url.hostname\n\n var isWhitelisted = settings.ignoredDomains.indexOf(currentDomain) !== -1;\n\n document.querySelector('#current-domain').innerHTML = currentDomain;\n document.querySelector('#btn-whitelist-add').style.display = isWhitelisted ? 'none' : 'initial';\n document.querySelector('#btn-whitelist-remove').style.display = isWhitelisted ? 'initial' : 'none';\n });\n}", "function registerBackgroundTabDetection() {\n if (WINDOW && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n const activeTransaction = getActiveTransaction() ;\n if (WINDOW.document.hidden && activeTransaction) {\n const statusType = 'cancelled';\n\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.log(\n `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n );\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!activeTransaction.status) {\n activeTransaction.setStatus(statusType);\n }\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.finish();\n }\n });\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n }", "function applyPrefs()\n {\n // Show/hide page action on all tabs\n browser.tabs.query( {}, tabs => {\n for (let tab of tabs)\n {\n if (prefs.showPageAction)\n browser.pageAction.show( tab.id );\n else\n browser.pageAction.hide( tab.id );\n }\n });\n\n // Create menu for current tab\n browser.tabs.query( {active:true, currentWindow:true}, tabs => {\n digglerBuildMenu( tabs[0].url );\n });\n }", "function initializePreDomReady() {\n for (var i in settingsToLoad) { getSetting(settingsToLoad[i]); }\n\n var isEnabledForUrlPort = chrome.extension.connect({ name: \"isEnabledForUrl\" });\n isEnabledForUrlPort.postMessage({ url: window.location.toString() });\n\n var getZoomLevelPort = chrome.extension.connect({ name: \"getZoomLevel\" });\n getZoomLevelPort.postMessage({ domain: window.location.host });\n\n refreshCompletionKeys();\n\n // Send the key to the key handler in the background page.\n keyPort = chrome.extension.connect({ name: \"keyDown\" });\n\n if (navigator.userAgent.indexOf(\"Mac\") != -1)\n platform = \"Mac\";\n else if (navigator.userAgent.indexOf(\"Linux\") != -1)\n platform = \"Linux\";\n else\n platform = \"Windows\";\n\n chrome.extension.onConnect.addListener(function(port, name) {\n if (port.name == \"executePageCommand\") {\n port.onMessage.addListener(function(args) {\n if (this[args.command]) {\n for (var i = 0; i < args.count; i++) { this[args.command].call(); }\n }\n\n refreshCompletionKeys(args.completionKeys);\n });\n }\n else if (port.name == \"getScrollPosition\") {\n port.onMessage.addListener(function(args) {\n var scrollPort = chrome.extension.connect({ name: \"returnScrollPosition\" });\n scrollPort.postMessage({\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n currentTab: args.currentTab\n });\n });\n } else if (port.name == \"setScrollPosition\") {\n port.onMessage.addListener(function(args) {\n if (args.scrollX > 0 || args.scrollY > 0) { window.scrollBy(args.scrollX, args.scrollY); }\n });\n } else if (port.name == \"returnCurrentTabUrl\") {\n port.onMessage.addListener(function(args) {\n if (getCurrentUrlHandlers.length > 0) { getCurrentUrlHandlers.pop()(args.url); }\n });\n } else if (port.name == \"returnZoomLevel\") {\n port.onMessage.addListener(function(args) {\n currentZoomLevel = args.zoomLevel;\n if (isEnabledForUrl)\n setPageZoomLevel(currentZoomLevel);\n });\n } else if (port.name == \"returnIsEnabledForUrl\") {\n port.onMessage.addListener(function(args) {\n isEnabledForUrl = args.isEnabledForUrl;\n if (isEnabledForUrl)\n initializeWhenEnabled();\n else if (HUD.isReady())\n // Quickly hide any HUD we might already be showing, e.g. if we entered insertMode on page load.\n HUD.hide();\n });\n } else if (port.name == \"returnSetting\") {\n port.onMessage.addListener(setSetting);\n } else if (port.name == \"refreshCompletionKeys\") {\n port.onMessage.addListener(function (args) {\n refreshCompletionKeys(args.completionKeys);\n });\n }\n });\n}", "function startUp() {\n window.statusBar = document.getElementById(\"status\");\n document.getElementById(\"load\").innerHTML = \"Your browser loaded this page on: \" + Date() + \"<br />This page was last modified on: \" + document.lastModified;\n document.getElementById(\"content\").removeAttribute(\"hidden\");\n preGame();\n}", "function registerBackgroundTabDetection() {\n if (types.WINDOW && types.WINDOW.document) {\n types.WINDOW.document.addEventListener('visibilitychange', () => {\n const activeTransaction = utils.getActiveTransaction() ;\n if (types.WINDOW.document.hidden && activeTransaction) {\n const statusType = 'cancelled';\n\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n utils$1.logger.log(\n `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n );\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!activeTransaction.status) {\n activeTransaction.setStatus(statusType);\n }\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.finish();\n }\n });\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n utils$1.logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}", "function checkCurrentUrlAdded(){\n\t\n\tgetCurrentUrl(function(currentUrl){\n\t\t\n\t\tif(domains.indexOf(currentUrl)==-1){\n\t\t\tdocument.getElementById(\"add_url_btn\").classList.remove(\"disabled\");\n\t\t}\n\t\telse{\n\t\t\tdocument.getElementById(\"add_url_btn\").classList.add(\"disabled\");\n\t\t}\n\t\t\n\t\t\n\t});\n}", "function showHostsAndSettingsMode() {\r\n console.log('entering show hosts and settings mode.');\r\n $('#backIcon').hide();\r\n $('#quitCurrentApp').hide();\r\n $(\".mdl-layout__header\").show();\r\n $(\"#main-content\").children().not(\"#listener, #loadingSpinner, #naclSpinner\").show();\r\n $(\"#game-grid\").hide();\r\n $(\"#main-content\").removeClass(\"fullscreen\");\r\n $(\"#listener\").removeClass(\"fullscreen\");\r\n $(\"body\").css('backgroundColor', 'white');\r\n // We're no longer in a host-specific screen. Null host, and add it back to the polling list\r\n if(api) {\r\n beginBackgroundPollingOfHost(api);\r\n api = null; // and null api\r\n }\r\n}", "function backgroundIMGCheck() {\n if(localStorage.getItem(\"BackgroundImage\") === \"Enabled\") {\n setBGIMG(true);\n } else {\n setBGIMG(false);\n }\n }", "function handlePageChange() {\n if ((/.*watch\\?.+list=.+/u).test(location)) {\n autoPauseThisVideo = false;\n } else {\n autoPauseThisVideo = config.autoPauseVideo;\n }\n clearTimeout(markAsSeenTimeout);\n toggleGuide = false;\n // Forces some images to reload...\n window.dispatchEvent(new Event(\"resize\"));\n // If we are on the start page (or feed pages).\n if ((/^(\\/?|((\\/feed\\/)(trending|subscriptions|history)\\/?))?$/iu).test(location.pathname)) {\n setYTStyleSheet(bodyStyleStartpage);\n } else if ((/^\\/?watch$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStyleVideo);\n watchpage();\n } else if ((/^\\/?results$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStyleSearch);\n } else if ((/^\\/?playlist$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStylePlaylist);\n } else {\n setYTStyleSheet(bodyStyleDefault);\n }\n if (player.isPeekPlayerActive()) {\n player.showNativePlayer();\n }\n\n if (1 < location.pathname.length) {\n shownative();\n if ((/^\\/?watch$/u).test(location.pathname)) {\n toggleGuide = true;\n }\n } else {\n hidenative();\n }\n}", "function nav(url) {\n console.log(\"Navigating to: \" + url);\n chrome.tabs.getSelected(null, function(tab) {\n chrome.tabs.update(tab.id, {url: url});\n });\n }", "function pageLoad(){\n $jQ('body').zIndex(); // jQuery UI Check\n window.onbeforeunload=function(){return '';}; // Hack to prevent any page.reload\n startCSSInfo();\n hackUserAgent();\n hackRemoveAnimations();\n hackDisableSubmit();\n hackActions();\n setNumScripts();\n setTimeStatus();\n setSystemColors();\n setVisibility();\n setUserActions();\n setAllVisibleElementsInfo();\n hackFrameScroll();\n}", "function activarBackGround(){\n\tif(!cordova.plugins.backgroundMode.isEnabled()){cordova.plugins.backgroundMode.enable();}\n\tcordova.plugins.backgroundMode.setDefaults({\n title: \"DeviceTrack\",\n ticker: \"Sincronizado\",\n text: \"Sincronizado\",\n\tsilent: true\n})\n\tcordova.plugins.backgroundMode.configure({\n title: \"DeviceTrack\",\n ticker: \"Sincronizado\",\n text: \"Sincronizado\",\n\tsilent: true\n})\n}", "function enableUiNonTrackingMode(){\n console.log('enableUiNonTrackingMode'); \n $(\"#browserActionStateDisplay\").hide();\n $(\"#toggleStateButton\").hide();\n $(\"#toggleTabCategory\").hide();\n $(\"#toggleTrackButton\").html(\n \"Start Tracking\" \n );\n}", "function toggleEnabledForCurrentDomain() {\n var isCurrentDomainBlacklisted = !getEnabledForDomainCheckbox().checked;\n\n chrome.tabs.query({\n 'active': true,\n 'currentWindow': true\n }, function (tabs) {\n var tab = tabs[0];\n var domain = domainFromURL(tab.url);\n toggleEnabledForDomain(domain);\n });\n}", "backgroundSetup() {\n browser.storage.onChanged.addListener((dict, area) => {\n if (area !== \"sync\" || !('id' in dict))\n return\n\n // Only handle messages from other IDs.\n let sender = this.decode(dict.id.newValue)\n if (sender[0] === this.id)\n return\n\n let changes = {}\n for (let path in dict)\n changes[path] = dict[path].newValue\n this.onSync(changes)\n })\n\n let extUrl = browser.extension.getURL(\"/\")\n let rewriteUserAgentHeader = e => {\n // console.log(e)\n let initiator = e.initiator || e.originUrl\n if (e.tabId === -1 && initiator && extUrl && (initiator + \"/\").startsWith(extUrl)) {\n let hdrs = [], ua = null\n for (var header of e.requestHeaders) {\n let name = header.name.toLowerCase()\n if (name === \"x-fc-user-agent\") {\n ua = header\n } else if (name !== \"user-agent\") {\n hdrs.push(header)\n }\n }\n\n if (ua !== null) {\n hdrs.push({name: 'User-Agent', value: ua.value})\n return {requestHeaders: hdrs}\n }\n }\n return {requestHeaders: e.requestHeaders}\n }\n\n browser.browserAction.onClicked.addListener(tab => {\n browser.tabs.create({url: homepage})\n })\n\n browser.webRequest.onBeforeSendHeaders.addListener(rewriteUserAgentHeader,\n {urls: [\"<all_urls>\"], types: [\"xmlhttprequest\"]}, [\"blocking\", \"requestHeaders\"])\n\n browser.tabs.query({url: homepage}).then(tabs => {\n tabs.map(x => browser.tabs.reload(x.id))})\n }", "function highlighter(){\n \"use strict\";\n\n var url;\n\n if (supress_highlighter || not_ready_highlighter){\n //Do not fire, only change the supressor\n supress_highlighter = false;\n } else {\n url = document.getElementById(\"classFrame\").contentWindow.location.href;\n filehighlight(url,problems);\n }\n}", "function userIsActive() {\n\t\t\tsettings.userActivityEvents = false;\n\t\t\t$document.off( '.wp-heartbeat-active' );\n\n\t\t\t$('iframe').each( function( i, frame ) {\n\t\t\t\tif ( isLocalFrame( frame ) ) {\n\t\t\t\t\t$( frame.contentWindow ).off( '.wp-heartbeat-active' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfocused();\n\t\t}", "open() {\r\n browser.url('');\r\n browser.pause(3000);\r\n // browser.windowHandleMaximize();\r\n // browser.pause(3000);\r\n }", "function ath(){\n (function(a, b, c) {\n if (c in b && b[c]) {\n var d, e = a.location,\n f = /^(a|html)$/i;\n a.addEventListener(\"click\", function(a) {\n d = a.target;\n while (!f.test(d.nodeName)) d = d.parentNode;\n \"href\" in d && (d.href.indexOf(\"http\") || ~d.href.indexOf(e.host)) && (a.preventDefault(), e.href = d.href)\n }, !1);\n $('.add-to-home').addClass('disabled');\n $('body').addClass('is-on-homescreen');\n }\n })(document, window.navigator, \"standalone\")\n }", "function runOnloadIfWidgetsEnabled () {\n\t\t\n\t}", "__init13() {this._handleVisibilityChange = () => {\n if (WINDOW$1.document.visibilityState === 'visible') {\n this._doChangeToForegroundTasks();\n } else {\n this._doChangeToBackgroundTasks();\n }\n };}", "function _processEnabled() {\n\t\t// update context menu text\n\t\tvar label = JSON.parse(localStorage.enabled) ? 'Disable' : 'Enable';\n\t\t_updateBadgeText();\n\t\tchrome.contextMenus.update('ENABLE_MENU', {title: label}, function() {\n\t\t\tif (chrome.runtime.lastError) {\n\t\t\t\tconsole.log(chrome.runtime.lastError.message);\n\t\t\t}\n\t\t});\n\t}", "function _beginLivePreview() {\n LiveDevelopment.open();\n }", "function openMyPage(requestDetails){\n\n var url = requestDetails.url;\n console.log(\"Debug: openMyPage: \" + url);\n\n if (url === \"https://testsfocus.com/\"){\n browser.tabs.update({\n \"url\": \"/tests.html\"\n });\n return {\"cancel\": true};\n }\n \n if(shouldBlockSite(url)){\n\n console.log(\"Debug: openMyPage: Blocked site: \" + url);\n\n browser.tabs.update({\n \"url\": \"/focus.html\"\n });\n\n lastBlockedPage = url;\n\n return {\"cancel\": true};\n }\n}", "function allowDesktopBGVidLoad () {\n\n\t// Check if .bgvideo is on the page, if not don't run this function\n\tif ($(\".bgvid\").length > 0){\n\n\t\t// If screen resolution is Greater then 600 create source element\n\t\tif ( $(window).width() > 600) { \n\t\t\t     \n\n\t\t\t// Add source 1 from array on Splash.php\n\t\t\tvar source = document.createElement('source');\n\t\t\t\tsource.src = sourceArray[0].source;\n\t\t\t\tsource.type = sourceArray[0].type;\n\n\t\t\t// Add source 2 from array on Splash.php\n\t\t\tvar source2 = document.createElement('source');\n\t\t\t\tsource2.src = sourceArray[1].source;\n\t\t\t\tsource2.type = sourceArray[1].type;\n\n\t\t\t// Append source elements to HTML5 bg video tag\n\t\t\tdocument.getElementById(\"bgvid\").appendChild(source);\n\t\t\tdocument.getElementById(\"bgvid\").appendChild(source2);\n\n\t\t}\n\t}\n}", "onBeforeLoadPage() {\n\t\t//TODO: Override this as needed;\n\t\treturn true;\n\t}", "onBeforeLoadPage() {\n\t\t//TODO: Override this as needed;\n\t\treturn true;\n\t}", "function actualAvailable(url)\r\n\t{\r\n\t\tuzuolaida.confirm('Yra aktualesnių šio dokumento redakcijų.',\r\n\t\t\t'Peržvelgti',\r\n\t\t\tfunction(){\r\n\t\t\t\tlocation.href = url;\r\n\t\t\t\treturn true;\r\n\t\t\t},\r\n\t\t\t'Ignoruoti',\r\n\t\t\tfunction(){}\r\n\t\t);\r\n\t}", "function alwaysRunOnload () {\n\t\n\t}", "function updateSettings(){\n document.documentElement.style.setProperty(`--accent`, settings.accentColor);\n document.documentElement.style.setProperty(`--bg-color`, settings.bgColor );\n if(settings.bgHidden == 'false'){\n document.documentElement.style.setProperty(`--bg-image`, `url(${settings.bgImage})` );\n }else{\n document.documentElement.style.setProperty(`--bg-image`, `url('')` );\n\n }\n\n}", "after() {\n // try to open into the already existing tab\n openBrowser(urls.localUrlForBrowser)\n }", "async open(url){\n\t\ttry{\n\t\t\tawait this.chrome.Page.navigate({url:url})\n\t\t\tthis.logDev('Page open')\n\t\t\tawait this.chrome.Page.loadEventFired()\n\t\t\tthis.logDev('Page loaded')\n\t\t\tconst js = \"window.scrollTo(0,0)\"\n\t\t\tconst result = await this.chrome.Runtime.evaluate({expression: js,userGesture:true})\n let syn = await this.readFile(path.resolve(__dirname,'./lib/syn.js'))\n await this.chrome.Runtime.evaluate({expression: syn,userGesture:true})\n let jQuery = await this.readFile(path.resolve(__dirname,'./lib/jquery.min.js'))\n await this.chrome.Runtime.evaluate({expression: jQuery,userGesture:true})\n\t\t\tthis.logDev('Scroll to 0,0')\n\t\t\treturn {statut:true}\n\t\t}catch(err){\n\t\t\tthis.logDev(err)\n\t\t\treturn {statut:false,message:`${err.message}`}\n\t\t}\n\t}", "function backgroundColourCheck() {\n if(localStorage.getItem(\"BackgroundColour\") === \"Enabled\") {\n setBGColour(true);\n } else {\n setBGColour(false);\n }\n }", "async function ScrSettingsMadeVisible() {\n \tconsole.log(\"In ScrSettingsMadeVisible\");\n}", "function useIntent() {\n\n tryWebkitApproach();\n // window.location = g_intent;\n }", "startQuantum() {\n const { tabId } = chrome.devtools.inspectedWindow;\n chrome.runtime.sendMessage({\n name: 'startQuantum',\n target: 'content',\n tabId,\n });\n\n this.setState({\n startQuantum: true,\n });\n }", "function enableVidemoAPI(){\n container.find('iframe[src*=\"player.vimeo.com/\"]').each(function(){\n var sign = getUrlParamSign($(this).attr('src'));\n $(this).attr('src', $(this).attr('src') + sign + 'api=1');\n });\n }", "function enableVidemoAPI(){\n container.find('iframe[src*=\"player.vimeo.com/\"]').each(function(){\n var sign = getUrlParamSign($(this).attr('src'));\n $(this).attr('src', $(this).attr('src') + sign + 'api=1');\n });\n }", "async function init() {\n let options = await loadOptions();\n\n // Watch navigation, to enable/disable content script depending on URL changes.\n // NOTE: This is the only reliable method that I could find, which works for SPA as well.\n // For example, content scripts cannot monkey patch history.pushState because of XRay vision, which prohibits the use of modules like `url-listener`\n browser.webNavigation.onHistoryStateUpdated.addListener(async () => {\n const activeTabs = await browser.tabs.query({\n currentWindow: true,\n active: true\n });\n\n activeTabs.forEach(tab => {\n browser.tabs.sendMessage(tab.id, 'hyper-gwent/history-changed');\n });\n });\n\n updateBrowserActionIcon(options);\n\n browser.tabs.onActivated.addListener(() => {\n updateBrowserActionIcon(options);\n });\n\n browser.tabs.onUpdated.addListener(() => {\n updateBrowserActionIcon(options);\n });\n\n browser.storage.onChanged.addListener(async () => {\n options = await loadOptions();\n updateBrowserActionIcon(options);\n });\n}", "function onScriptStart() {\n setYTStyleSheet(bodyStyleLoading);\n // Early configuration for settings that cannot wait until configuration is loaded.\n config.timeToMarkAsSeen = localStorage.getItem(\"YTBSP_timeToMarkAsSeen\");\n config.autoPauseVideo = \"0\" !== localStorage.getItem(\"YTBSP_autoPauseVideo\");\n}", "function activateTab(contentPath){\n if(contentPath == 'view/HomeView.php'){\n $('#home').load('view/header_img.html');\n $('#myNavbar').removeClass('white');\n $('#home').show();\n }else{\n $('#home').hide();\n $('#myNavbar').addClass('white');\n }\n\n $('#mainContent').load(window.location.pathname == '/audiocity' ? '/audiocity/'+ contentPath : contentPath).hide().fadeIn(500);\n rewriteURL(contentPath);\n $('html,body').scrollTop(0);\n}", "function addBackground() {\n document.body.style.background = 'url(\"https://images.saymedia-content.com/.image/c_limit%2Ccs_srgb%2Cq_auto:eco%2Cw_400/MTc0MDE0OTk4MzEyMzk2NjY3/asteroids-by-atari-classic-video-games-reviewed.webp\")';\n localStorage.setItem('background', 'on');\n}", "static isBackgroundPage(win) {\r\n let h = win.location.href;\r\n let isPage = (\r\n this.isExtensionUri(h) &&\r\n (h.indexOf(C.PAGE.BACKGROUND) !== -1)\r\n );\r\n\r\n return isPage;\r\n }", "function setIcon(myURL){\r\n\t//--------UPDATE THE URL THE JAVASCRIPT IS LOOKING FOR so that it only work for your client ID--------//\r\n\t//var urlCheck = new RegExp(\"^https:\\/\\/berea.askadmissions.net\\/admin\\/\");\r\n\t//--------Once updated, remove or comment our the line below.--------//\r\n\tvar urlCheck = new RegExp(\"^https:\\/\\/.+.askadmissions.net\\/admin\\/\");\r\n var askadmissions = urlCheck.test(myURL);\r\n \t\r\n\tif( askadmissions === true){\r\n\t\tchrome.browserAction.setIcon({path: \"icons/icon_48.png\"});\r\n\t\tchrome.browserAction.setPopup({popup: \"\"});\r\n\t\taskadmissionsPage = true;\r\n\t}else{\r\n\t\tchrome.browserAction.setIcon({path: \"icons/icon_48(gray).png\"});\r\n\t\taskadmissionsPage = false;\r\n\t\tchrome.browserAction.setPopup({popup: \"/fail.html\"});\r\n\t}\r\n}", "function _enable() {\n \n // Get toolbar\n var toolbar = $(\"#main-window-toolbar\");\n \n // If toolbar not active, activate\n if (!toolbar.hasClass(\"active\")) {\n toolbar.addClass(\"active\");\n }\n \n // Set enabled\n _isEnabled = true;\n PreferencesStorage.setValue(\"enabled\", _isEnabled);\n \n // If primary\n if (_isPrimary) {\n _displayNotification();\n }\n \n }", "function updatePageFromCurrentDomain() {\n console.log('loadCurrentDomainSettings');\n chrome.tabs.query({ //This method output active URL \n 'active': true,\n 'currentWindow': true\n }, function (tabs) {\n var tab = tabs[0];\n var domain = domainFromURL(tab.url);\n updatePageWithDomain(domain);\n });\n}", "function enterDesktopJS() {\n window.console && console.log(\"desktop breakpoint active\");\n // Turn off mobile main nav button\n $(\".btn-menu\").off();\n\n // enable main nav menu \n $(\"ul.sf-menu\").superfish();\n\n /* Disable trigger and remove style from submenu */\n if ($(\".sub-navigation-block\").length) {\n var pulli = $('#pull-i');\n menui = $('ul.sub-navigation');\n $(pulli).off();\n if (menui.is(':hidden')) {\n menui.removeAttr('style');\n }\n }\n\n // switch owl slider mobile image to desktop\n $.each($(\"#hero #owl-single-carousel .owl-item img\"), function (e) {\n var desktopImage = $(this).attr(\"data-dt-src\");\n $(this).attr(\"src\", desktopImage);\n });\n }", "function InitializeSection() { \n\t// only allow this window to be open when in the PX frameset or opened by PX???\n\t\n\t// if \"linksdisabled\" is in the URL string, disable all links\n//\tif (location.href.search(/linksdisabled/) > -1) {\n\t\t// ...\n\t\t\n//\t} else {\n\t\tInitializePopInWindow_ebook();\n\t\tDrawSuppLinks();\n//\t}\n}", "function stepMenu(runtime, step) {\n // Set VR Indicator\n var vr_indicator = document.getElementById('vr_logo');\n if (vr_indicator)\n vr_indicator.style.visibility = IsVRActive() ? 'Visible' : 'Hidden';\n\n}", "open() {\n super.open('/') //provide your additional URL if any. this will append to the baseUrl to form complete URL\n browser.pause(1000);\n }", "function BackgroundPage() {\n this._plugin = document.getElementById(\"save-plugin\");\n this._initMessages();\n this._mapping = new FileMapping();\n chrome.extension.onRequest.addListener(this._onRequest.bind(this));\n window.addEventListener(\"storage\", this._onStorageUpdated.bind(this), false);\n}", "showAddressBar() {\n return __awaiter(this, void 0, void 0, function* () {\n yield browserWindow.expandBrowserBar();\n return true;\n });\n }", "function init() {\n\n // Poll open tabs and set a timer such that, if after half a second we find any tabs that need reloading,\n // we display the options page which will suggest a tab reload\n pollTabVersions();\n setTimeout(function() {\n if (tabVersions.current.length != tabVersions.counted) {\n chrome.tabs.create({'url': 'options.html'});\n }\n }, 500);\n\n // Listen for mark, jump, and last messages from content scripts\n chrome.extension.onMessage.addListener(\n function(request, sender, sendResponse) {\n if (request.action == \"mark\") {\n chrome.tabs.query({active: true, currentWindow: true}, function(tab) {\n keymap[request.key] = tab[0].id;\n msg('Tab Monkey', 'Marking this tab as #' + String.fromCharCode(request.key));\n });\n }\n else if (request.action == \"jump\") {\n if (request.key in keymap) {\n chrome.tabs.update(keymap[request.key], {active: true});\n }\n }\n else if (request.action == \"last\") {\n if (prevTab) {\n chrome.tabs.update(prevTab, {active: true});\n }\n }\n });\n\n // Listen for tab changes and record for future switches\n chrome.tabs.onSelectionChanged.addListener(function(newTab) {\n if (prevTab == null) {\n prevTab = newTab;\n }\n\n if (currentTab == null) {\n currentTab = newTab;\n } else {\n prevTab = currentTab;\n currentTab = newTab;\n }\n });\n\n}", "disableBrowserContextmenu() {\n return false;\n }", "function startSettings() {\n alert('I don\\'t do anything yet.');\n }", "function pageSetup() {\n // Repopulate when the key combination is pressed.\n chrome.commands.onCommand.addListener(delayPopulate);\n\n document.getElementById(\"signin\").onclick = signIn;\n document.getElementById(\"signout\").onclick = signOut;\n document.getElementById(\"signup\").onclick = signUp;\n document.getElementById(\"removedomains\").onclick = disableSelectedDomains;\n document.getElementById(\"removetrustedsources\").onclick = removeTrustedDomains;\n document.getElementById(\"removeuntrustedsources\").onclick = removeUntrustedDomains;\n document.getElementById(\"togglecurrentdomain\").onclick = toggleCurrentDomainHighlighting;\n document.getElementById(\"domains\").onchange = enableRemoveButtonsIfNecessary;\n document.getElementById(\"trustedsources\").onchange = enableRemoveButtonsIfNecessary;\n document.getElementById(\"untrustedsources\").onchange = enableRemoveButtonsIfNecessary;\n document.getElementById(\"toggletrustcurrentdomain\").onclick = toggleCurrentDomainTrusted;\n document.getElementById(\"toggleuntrustcurrentdomain\").onclick = toggleCurrentDomainUntrusted;\n\n $('#highlightstate').change(function(event) {\n var state = parseInt($(event.target).val());\n updateHighlightingStateUI(state);\n chrome.storage.sync.get(\"USER\", function (obj) {\n var user = obj['USER'];\n if ('username' in user) {\n saveNewHighlightingState(state, user[USER_KEY]);\n }\n });\n });\n\n // http://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box\n $(\"#password,#username\").keyup(function(event) {\n if(event.keyCode == 13) $(\"#signin\").click();\n });\n}", "function start(aOK) {\n if (aOK) {\n window.addEventListener(\"afterscriptexecute\", process, true);\n document.addEventListener(\"DOMContentLoaded\", contentLoad, false);\n }\n log += \"\\n* The userscript is\" + (aOK ? \" \" : \" NOT \") + \"running.\\n\";\n GM_getValue(\"debug\", false) && GM_log(log);\n GM_setValue(\"debug\", GM_getValue(\"debug\", false));\n}", "function pageLoad() {\n // console.log('pageLoad');\n\n const blank = window.location.hash.endsWith('-blank');\n if (!blank) {\n setupMenu();\n }\n\n setupImageControls();\n loadSavedDiagram();\n\n if (!blank) {\n updateMenu();\n setMenuPosition();\n setControlsPosition();\n\n document.getElementById('offline').style\n .display = (navigator.onLine ? 'none' : 'block');\n window.addEventListener('offline', appOffline);\n window.addEventListener('online', appOnline);\n }\n}", "function enablePageIcon(tab) {\n chrome.pageAction.setIcon({\n tabId: tab.id,\n path: \"images/icons/sunjer_active.png\"\n });\n chrome.pageAction.setTitle({\n tabId: tab.id,\n title: \"Click to stop editing using sunjer\"\n });\n}", "function updateState () {\n if (!chrome.tabs) return;\n\n let iconState = 'active';\n\n if (!isExtensionEnabled) {\n iconState = 'disabled';\n } else if (httpNowhereOn) {\n iconState = 'blocking';\n }\n\n chrome.browserAction.setTitle({\n title: 'HTTPS Everywhere' + ((iconState === 'active') ? '' : ' (' + iconState + ')')\n });\n\n chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {\n if (!tabs || tabs.length === 0) {\n return;\n }\n const tabUrl = new URL(tabs[0].url);\n\n if (disabledList.has(tabUrl.host) || iconState == \"disabled\") {\n if ('setIcon' in chrome.browserAction) {\n chrome.browserAction.setIcon({\n path: {\n 38: 'images/icons/icon-disabled-38.png'\n }\n });\n }\n } else {\n\n if ('setIcon' in chrome.browserAction) {\n chrome.browserAction.setIcon({\n path: {\n 38: 'images/icons/icon-' + iconState + '-38.png'\n }\n });\n }\n }\n });\n}", "function coreInitLoadPage() {\n if (typeof $(\"body\").attr(\"control\") !== \"undefined\")\n WEBUI.MAINPAGE = $(\"body\")[$(\"body\").attr(\"control\").split(\".\")[1]]();\n }", "function onLoadWork() {\n chrome.send('requestVersionInfo');\n const includeVariationsCmd = location.search.includes(\"show-variations-cmd\");\n cr.sendWithPromise('requestVariationInfo', includeVariationsCmd)\n .then(handleVariationInfo);\n cr.sendWithPromise('requestPluginInfo').then(handlePluginInfo);\n cr.sendWithPromise('requestPathInfo').then(handlePathInfo);\n\n if (cr.isChromeOS) {\n $('arc_holder').hidden = true;\n chrome.chromeosInfoPrivate.get(['customizationId'], returnCustomizationId);\n }\n if ($('sanitizer').textContent !== '') {\n $('sanitizer-section').hidden = false;\n }\n}", "allowAllCookies() {\n //Set allow cookie\n const expires = this.cookieExpireDate();\n document.cookie = 'cookieconsent_status=allow;' + expires + ';path=/';\n console.log('All scripts for this website have been activated in this browser.');\n //get initial plugin category settings - just activated values from yaml\n window.location.reload();\n }", "notifyWhitelistChanged () {\n chrome.runtime.sendMessage({'whitelistChanged': true})\n }", "function updateButtonsState() {\n // Enable/Disable the Monitor This Page button.\n chrome.tabs.getSelected(null, function(tab) {\n isPageMonitored(tab.url, function(monitored) {\n if (monitored || !tab.url.match(/^https?:/)) {\n $('#monitor_page').unbind('click').addClass('inactive');\n $('#monitor_page img').attr('src', 'img/monitor_inactive.png');\n var message = monitored ? 'page_monitored' : 'monitor';\n $('#monitor_page span').text(chrome.i18n.getMessage(message));\n } else {\n // $('#monitor_page').click(monitorCurrentPage).removeClass('inactive');\n $('#monitor_page img').attr('src', 'img/monitor.png');\n $('#monitor_page span').text(chrome.i18n.getMessage('monitor'));\n }\n });\n });\n\n // Enable/Disable the View All button.\n if ($('#notifications .notification').length) {\n $('#view_all').removeClass('inactive');\n $('#view_all img').attr('src', 'img/view_all.png');\n \n } else {\n $('#view_all').addClass('inactive');\n $('#view_all img').attr('src', 'img/view_all_inactive.png');\n }\n \n\n // Enable/disable the Check All Now button.\n getAllPageURLs(function(urls) {\n getAllUpdatedPages(function(updated_urls) {\n if (urls.length == 0) {\n $('#check_now').addClass('inactive');\n $('#check_now img').attr('src', 'img/refresh_inactive.png');\n } else {\n $('#check_now').removeClass('inactive');\n $('#check_now img').attr('src', 'img/refresh.png');\n }\n });\n });\n initializePageCheck();\n}", "initListener() {\n let _this = this;\n\n _this.browser.runtime.onMessage.addListener((request, sender) => {\n if (!request.hasOwnProperty('key') || request.key !== 'e107-dev') {\n return;\n }\n\n let url = request.url;\n let tab = sender.tab;\n\n // @see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/cookies/getAll\n _this.browser.cookies.getAll({\"url\": url}, cookies => {\n let isE107 = Utils.isE107(cookies);\n let hasDebugCookie = Utils.debugModeIsOn(cookies);\n\n if (isE107) {\n let domain = UrlParser.getDomainFromUrl(url);\n let debugMode = UrlParser.getDebugParam(url, false);\n\n _this.getDebugMode(domain, false, mode => {\n // If URL contains debug mode.\n if (debugMode !== false && debugMode !== '') {\n // If debug mode is off: remove it from local storage.\n if (debugMode === '[debug=-]') {\n _this.removeDebugMode(domain);\n }\n // Update debug mode in local storage.\n else {\n _this.setDebugMode(domain, debugMode);\n }\n }\n // If URL does not contain debug mode.\n else {\n // URL does not contain debug mode, but we have stored value.\n if (mode !== false && mode !== '') {\n // Redirect only if there is no debug cookie set.\n if (!hasDebugCookie) {\n _this.config.get('autoAdjust', false, state => {\n if (state === true) {\n _this.rewriteUrl(tab, mode);\n }\n });\n }\n }\n // URL does not contain debug mode, and no stored value.\n else {\n // Do nothing.\n }\n }\n });\n }\n });\n });\n }", "function handleStartup() { //Read from local storage\r\n restoreOptions();\r\n enableGoogle();\r\n enableWikipedia();\r\n enableBing();\r\n enableDuckDuckGo();\r\n enableYahoo();\r\n enableBaidu();\r\n enableYoutube();\r\n enableWolframAlpha();\r\n enableYandex();\r\n enableReddit();\r\n enableImdb();\r\n enableDictionarydotcom();\r\n enableThesaurusdotcom();\r\n enableStackOverflow();\r\n enableGitHub();\r\n enableAmazon();\r\n enableEbay();\r\n enableTwitter();\r\n console.log('Twitter enabled on startup');\r\n enableFacebookPeopleSearch();\r\n}" ]
[ "0.60860986", "0.56952417", "0.5682569", "0.5679797", "0.56595945", "0.5634489", "0.5613012", "0.5492859", "0.54903316", "0.54325545", "0.5382275", "0.5376455", "0.5355305", "0.53291947", "0.53291947", "0.53291947", "0.5315835", "0.5305605", "0.528541", "0.52752507", "0.5262371", "0.5254384", "0.5251235", "0.5240472", "0.52391195", "0.52366686", "0.52205884", "0.52201545", "0.5210655", "0.5208159", "0.5204036", "0.5195396", "0.5192887", "0.51902777", "0.51858664", "0.51764286", "0.51732016", "0.5171405", "0.51710916", "0.5156629", "0.5154829", "0.5142477", "0.5134476", "0.5133391", "0.51055944", "0.5101002", "0.51008964", "0.50976795", "0.5094975", "0.5087083", "0.5067432", "0.5067031", "0.5064897", "0.5052235", "0.5046125", "0.5045358", "0.5041071", "0.50387084", "0.5035648", "0.5028945", "0.5028945", "0.50282234", "0.50242823", "0.50015295", "0.49963814", "0.499627", "0.49907294", "0.49902534", "0.49842176", "0.49839196", "0.49819404", "0.49819404", "0.49619067", "0.49597025", "0.49550936", "0.49501714", "0.49419054", "0.49270064", "0.49185854", "0.491828", "0.49130633", "0.49127397", "0.49119303", "0.4911299", "0.49102008", "0.4910071", "0.49056694", "0.4900669", "0.4899518", "0.48947272", "0.48936617", "0.48917595", "0.48870137", "0.4884326", "0.4877291", "0.48742744", "0.48717856", "0.48713878", "0.4870747", "0.48633483", "0.48538423" ]
0.0
-1
Initialization tasks that must wait for the document to be ready.
function initializeOnDomReady() { if (isEnabledForUrl) enterInsertModeIfElementIsFocused(); // Tell the background page we're in the dom ready state. chrome.extension.connect({ name: "domReady" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "function initOnDomReady() {}", "constructor() {\n let ready = new Promise(resolve => {\n if (document.readyState != \"loading\") return resolve();\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n });\n ready.then(this.init.bind(this));\n }", "async function initializePage() {\n loadProjectsContainer();\n loadCalisthenicsContainer();\n loadCommentsContainer();\n}", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "async init() {\n for (let xmlFile of XMLFiles) {\n console.log(xmlFile);\n await this.processXmlFile(xmlFile);\n }\n\n await this.importPeople();\n\n //this.populateMenu();\n\n this.maybeShowWork();\n this.maybeShowAgent();\n\n this.createWorksPage();\n\n }", "init() {\n this.tags = this.getSectionTagsOnThePage();\n\n /**\n * Check if no tags found then table of content is not needed\n */\n if (this.tags.length === 0) {\n return;\n }\n\n /**\n * Initialize table of content element\n */\n this.createTableOfContent();\n this.addTableOfContent();\n\n /**\n * Calculate bounds for each tag and watch active section\n */\n this.calculateBounds();\n this.watchActiveSection();\n }", "function init() {\n console.log(\"Document Ready\");\n\n createPets();\n totalNumPets();\n totalPrice();\n petsByType();\n displayPets();\n displayOfficeInfo();\n}", "function pageReady(){\n handleUTM();\n legacySupport();\n initModals();\n initScrollMonitor();\n initVideos();\n _window.on('resize', debounce(initVideos, 200))\n initSmartBanner();\n initTeleport();\n initMasks();\n }", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function init() {\n documentReady(documentLoaded);\n}", "function eltdfOnDocumentReady() {\n eltdfInitQuantityButtons();\n eltdfInitSelect2();\n\t eltdfInitPaginationFunctionality();\n\t eltdfReinitWooStickySidebarOnTabClick();\n eltdfInitSingleProductLightbox();\n\t eltdfInitSingleProductImageSwitchLogic();\n eltdfInitProductListCarousel();\n }", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionInfo, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionKey, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function performInitAjaxes() {\n fetchOrganizations();\n fetchFieldTypes();\n fetchDataTypes();\n }", "function initialize(){\n\n\t\t//sets all needed components, listeners, etc\n\t\tformatBodyPages();\n\t\tsetBodyTransitions();\n\n\t}", "function domReady() {\n // Make sure body exists, at least, in case IE gets a little overzealous (jQuery ticket #5443).\n if (!doc.body) {\n // let's not get nasty by setting a timeout too small.. (loop mania guaranteed if assets are queued)\n win.clearTimeout(api.readyTimeout);\n api.readyTimeout = win.setTimeout(domReady, 50);\n return;\n }\n\n if (!isDomReady) {\n isDomReady = true;\n\n init();\n each(domWaiters, function (fn) {\n one(fn);\n });\n }\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function init(){\n console.log(\"Page loaded and DOM is ready\");\n}", "async function initialize() {\n await initializeHeader();\n await insertItems();\n}", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function initialize() {\n // publishReview();\n // reportingBar();\n addExpandAllComments()\n // reportEveryone()\n makeAllCommentsHideable()\n addStatusSelect();\n if (document.querySelector('#files') != null) {\n var filesCompleted = loadData()[getPullRequestId()][\"files\"];\n var fileHeaders = document.querySelectorAll('.file-header:not(.footer)')\n addCompleteAction(filesCompleted, fileHeaders);\n importFooters(fileHeaders)\n\n hideCompletedFiles(filesCompleted, fileHeaders);\n }\n}", "async _init() {\n // load the container from DOM, and check it\n const loaded = this._loadContainer(this._options.container);\n\n if (!loaded) return;\n\n // init html templates\n this._initContainer();\n this._initControls();\n this._renderControls();\n\n // init listeners\n this._initListeners();\n\n // first data load\n await this._fetchCards(this._maxDisplayedCards);\n this._loadCurrentPage();\n }", "function qodefOnDocumentReady() {\n qodefInitQuantityButtons();\n qodefInitButtonLoading();\n qodefInitSelect2();\n\t qodefInitSingleProductLightbox();\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if ( !doc.body ) {\n return setTimeout( domReady, 1 );\n }\n // Remember that the DOM is ready\n isReady = true;\n // If there are functions bound, to execute\n domReadyCallback();\n // Execute all of them\n }\n} // /ready()", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n}", "function pageDocReady () {\n\n}", "function ready() {\n if (!isReady) {\n triggerEvent(document, \"ready\");\n isReady = true;\n }\n }", "async function init() {\n try {\n products = await getData(); // API\n setupPage(products, dropdownMenu, features);\n } catch (error) {\n console.log(\"Error: \" + error.message);\n }\n}", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function init() {\n StoredTagsMngr.checkForTagsNotBeingUsed();\n initStorage();\n createTagsInStarsPage();\n initDOM();\n}", "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n}", "function qodeOnDocumentReady() {\n \tqodeInitNewsShortcodesFilter();\n qodeNewsInitFitVids();\n qodeInitSelfHostedVideoAudioPlayer();\n qodeSelfHostedVideoSize();\n }", "function eltdfOnDocumentReady() {\n eltdfHeaderBehaviour();\n eltdfSideArea();\n eltdfSideAreaScroll();\n eltdfFullscreenMenu();\n eltdfInitDividedHeaderMenu();\n eltdfInitMobileNavigation();\n eltdfMobileHeaderBehavior();\n eltdfSetDropDownMenuPosition();\n eltdfDropDownMenu();\n eltdfSearch();\n eltdfVerticalMenu().init();\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function ready() {\r\n if (!readyFired) {\r\n // this must be set to true before we start calling callbacks\r\n readyFired = true;\r\n for (var i = 0; i < readyList.length; i++) {\r\n // if a callback here happens to add new ready handlers,\r\n // the docReady() function will see that it already fired\r\n // and will schedule the callback to run right after\r\n // this event loop finishes so all handlers will still execute\r\n // in order and no new ones will be added to the readyList\r\n // while we are processing the list\r\n readyList[i].fn.call(window, readyList[i].ctx);\r\n }\r\n // allow any closures held by these functions to free\r\n readyList = [];\r\n }\r\n }", "function qodefOnDocumentReady() {\n qodefThemeRegistration.init();\n\t qodefInitDemosMasonry.init();\n\t qodefInitDemoImportPopup.init();\n }", "function init() {\r\n\t// Get the template views from the server to better separate views from model\r\n\t// They're loaded before the document is actually ready for better performance\r\n\tvar signInTemplate = $(\"<div>\").load(\"templates/signIn.html\");\r\n\tvar signUpTemplate = $(\"<div>\").load(\"templates/signUp.html\");\r\n\r\n\t// Get the properties according to the URL's \"lan\" parameter\r\n\tloadProperties(language);\r\n\r\n\t$(document).ready(function() {\r\n\t\t// Populate the templates according to the configuration and URL data\r\n\t\tpopulateBasePage();\r\n\t\tsignInTemplate = populateSignInTemplate(signInTemplate);\r\n\t\tsignUpTemplate = populateSignUpTemplate(signUpTemplate);\r\n\r\n\t\t// Put the templates in the document\r\n\t\t$(\"#wrap\").append(signInTemplate);\r\n\t\t$(\"#wrap\").append(signUpTemplate);\r\n\r\n\t\t// Prepare the modals to close when the required conditions are met\r\n\t\tprepareModals();\r\n\t});\r\n}", "function init() {\n autoScroll();\n countDown();\n fetchWeather();\n fetchDestinations();\n formValidation();\n }", "function init() {\n retrieveNodes();\n }", "static ready() { }", "function initialize() {\n qNumber = 0;\n setStartDOM();\n }", "function DOMReady() {\n }", "function whenReady(callback, doc) {\n doc = doc || rootDocument;\n // if document is loading, wait and try again\n whenDocumentReady(function() {\n watchImportsLoad(callback, doc);\n }, doc);\n}", "function whenReady(callback, doc) {\n doc = doc || rootDocument;\n // if document is loading, wait and try again\n whenDocumentReady(function() {\n watchImportsLoad(callback, doc);\n }, doc);\n}", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "async init () {\n // Debug\n debug('✳️ #' + this.id + ' %c[' + this.type + '] [' + this.context + ']', 'color:grey')\n\n /**\n * HTMLElement blocks collection.\n *\n * @type {Array}\n */\n this.blockElements = [...this.rootElement.querySelectorAll(`.${this.getService('Config').pageBlockClass}`)]\n\n /**\n * @type {Number}\n */\n this.blockLength = this.blockElements.length\n\n if (this.blockLength) {\n await this.initBlocks()\n }\n\n this.initEvents()\n }", "ready() {\n this.isReady = true;\n if (this.onLoad) {\n this.onLoad.call();\n }\n }", "function prepareDocument() {\r\n \t\r\n \tvar head = document.head || document.getElementsByTagName('head')[0],\r\n \tbody = document.body || document.getElementsByTagName('body')[0];\r\n \r\n // style\r\n var styleTag = document.createElement('style');\r\n \t\tstyleTag.type = 'text/css';\r\n \t\r\n\t\tif (styleTag.styleSheet) { styleTag.styleSheet.cssText = _customCSS; }\r\n\t\telse { styleTag.appendChild(document.createTextNode(_customCSS)); }\r\n\t\t\r\n\t\thead.appendChild(styleTag);\r\n\r\n\t\t// spinner\r\n \tvar spinnerDiv = document.createElement('div'); \t\r\n \t\tspinnerDiv.id = 'coreloader';\r\n\r\n \tbody.appendChild(spinnerDiv);\r\n\t\t\r\n \t// attach the Spinner\r\n\t\t_spinner = new Spinner(_spinnerOptions[0]).spin(spinnerDiv);\r\n\t\t_spinner.elm = spinnerDiv;\r\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if(!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if(readyList) {\n for(var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideArea();\n edgtfSideAreaScroll();\n edgtfFullscreenMenu();\n edgtfInitMobileNavigation();\n edgtfMobileHeaderBehavior();\n edgtfSetDropDownMenuPosition();\n edgtfDropDownMenu(); \n edgtfSearch();\n }", "async function init() {\n await getData();\n //display the page buttons\n paginationEl.style.display = \"flex\";\n //hide the spinner\n spinnerEl.classList.add(\"hidden\");\n\n //render the current page\n changePage(1);\n}", "function init() {\n\t\tloadPosts();\n\t\tloadPages();\n\t\tloadCategories();\n\t\tloadTags();\n\t}", "function init() {\n\tdocument.readyState === 'complete' ?\n\t\twirejs.bless(document) :\n\t\tsetTimeout(init, 1);\n}", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // be sure document.body is there\n if (!document.body) {\n return setTimeout(domReady, 13);\n }\n\n // clean up loading event\n if (document.removeEventListener) {\n document.removeEventListener(\"DOMContentLoaded\", domReady, false);\n } else {\n window.removeEventListener(\"load\", domReady, false);\n }\n\n // Remember that the DOM is ready\n isReady = true;\n\n // execute the defined callback\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n readyList.length = 0;\n }\n}", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "_init() {\r\n app.whenReady().then(() => {\r\n this.setLoadingWindow();\r\n this.setWindowMain();\r\n });\r\n this.beforeCloseFunctions();\r\n }", "function whenImportsReady(callback, doc) {\r\n doc = doc || mainDoc;\r\n // if document is loading, wait and try again\r\n whenDocumentReady(function() {\r\n watchImportsLoad(callback, doc);\r\n }, doc);\r\n}", "function ready(fn) {\n\t\t\tif (!isReady) {\n\n\t\t\t\t// Make sure body exists, at least, in case IE gets a\n\t\t\t\t// little overzealous (ticket #5443).\n\t\t\t\tif (!doc.body) {\n\t\t\t\t\treturn defer(ready);\n\t\t\t\t}\n\n\t\t\t\t// Remember that the DOM is ready\n\t\t\t\tisReady = true;\n\n\t\t\t\t// Execute all callbacks\n\t\t\t\twhile (fn = callbacks.shift()) {\n\t\t\t\t\tdefer(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "async init() {\n // Initiate classes and wait for async operations here.\n\n this.emit(Application.events.APP_READY);\n }", "init() {\n this.initDOMListeners();\n }", "async function setup() {\n makePageForEpisodes(allEpisodes); // make the page for all the episodes when the page is load\n createSelectElementForEpisode(allEpisodes); // create the select element when the page is load\n createSearchBar(); // create a search bar function when the page is load\n addTheShowSelectElement(getShows); // create the select element for the Show element\n}", "function init() {\n\t\t\t\n\t\t\t// Is there any point in continuing?\n\t\t\tif (allElments.length == 0) {\n\t\t\t\tdebug('page contains no elements');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Replace images\n\t\t\treplaceImgboxes();\n\t\t\t\n\t\t\t// Listen for window resize events\n\t\t\t$(window).on('resize', windowResizeImgbox);\n\n\t\t\t// Add mouse listeners if we are in edit mode\n\t\t\tif (settings.command == 'edit') {\n\t\t\t\tdebug('settings.command:edit');\n\t\t\t\t$(allElments).on('click', editClick);\n\t\t\t\t$(allElments).on('mousemove', editMousemove);\n\t\t\t}\n\t\t}", "function initializeDocument() {\n\t\tconverterLabel.append(temperatureInput);\n\t\tconverterDocument.append(converterLabel);\n\t\tconverterLabel.after(documentSpaceBreak);\n\t\tdocumentSpaceBreak.after(converterResult);\n\t\tdocumentSpaceBreak.after(fahrenheitToCelsiusBtn);\n\t\tdocumentSpaceBreak.after(celsiusToFahrenheitBtn);\n\t\tdocument.querySelector('h3').after(converterDocument);\n\t\treturn;\n\t}", "async function init() {\n await createPost({\n title: 'Post Three',\n body: 'This is post three'\n });\n getPosts();\n // So we're waiting for createPost() to be done before moving on to getPosts();\n}", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "function eltdfOnDocumentReady() {\n eltdfQuestionHint();\n eltdfQuestionCheck();\n eltdfQuestionChange();\n eltdfQuestionAnswerChange();\n }", "async onLoad() {}", "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function init() {\n setDomEvents();\n }", "function init () {\r\n\t\tconsole.log('all is loaded.');\r\n\t}", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "function mkdfOnDocumentReady() {\n mkdfCompareHolder();\n mkdfCompareHolderScroll();\n mkdfHandleAddToCompare();\n }", "function init() {\n fetchInstructors();\n setEvents();\n }", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "async function setupAndStart() {\n $(`<table id='jeopardy'>`).appendTo('body');\n showLoadingView()\n let categories = await getCategories();\n hideLoadingView()\n fillTable(categories);\n}", "function domReady() {\r\n\t\t// Make sure that the DOM is not already loaded\r\n\t\tif(!isReady) {\r\n\t\t\t// Remember that the DOM is ready\r\n\t\t\tisReady = true;\r\n \r\n\t if(readyList) {\r\n\t for(var fn = 0; fn < readyList.length; fn++) {\r\n\t readyList[fn].call(window, []);\r\n\t }\r\n \r\n\t readyList = [];\r\n\t }\r\n\t\t}\r\n\t}", "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function init() {\n populateFeautured();\n populateFaq();\n id(\"logo\").addEventListener(\"click\", function() {\n directView(\"featured-view\");\n });\n id(\"men\").addEventListener(\"click\", populateMain);\n id(\"women\").addEventListener(\"click\", populateMain);\n id(\"sale\").addEventListener(\"click\", populateMain);\n id(\"all\").addEventListener(\"click\", populateMain);\n id(\"cart\").addEventListener(\"click\", function() {\n directView(\"cart-view\");\n });\n id(\"contact-us\").addEventListener(\"click\", contactView);\n id(\"faq\").addEventListener(\"click\", faqView);\n id(\"submit-btn\").addEventListener(\"click\", function(event) {\n event.preventDefault();\n storeFeedback();\n });\n }", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "async initElement() {\n await this.initPaymentRequest();\n await this.initPaymentRequestListeners();\n await this.initPaymentRequestButton();\n }", "function onload(){\r\n // Task 4: Detect when the button is clicked.\r\n // console.log(\"button-pressed\") when it does\r\n // You may want to modify the html file.\r\n\r\n // Task 5: Detect the content of the button press\r\n // call sendMessage() with that message, and wait for the response.\r\n\r\n\r\n // Task 6: If the response is \"OK\", then \r\n // clear the contents of the text area.\r\n // AND call renderMessage\r\n // the username should be MY_USER_NAME\r\n // GOTO: Task 7\r\n\r\n\r\n // This should run AFTER index is loaded.\r\n console.log(\"document loaded\");\r\n}", "ready() {\n super.ready();\n\n const that = this;\n\n //a flag used to avoid animations on startup\n that._isInitializing = true;\n\n that._createLayout();\n that._setFocusable();\n\n delete that._isInitializing;\n }", "setAsReady() {\n this.logger.debug('Page is ready to use');\n this.controller.store();\n }", "async function setupAndStart() {\n showLoadingView();\n $(\"table\").empty();\n categories = [];\n await fillTable();\n hideLoadingView()\n}", "function initialize() {\n\tinitializeListeners();\n\tload();\n}" ]
[ "0.7358949", "0.69637525", "0.68384737", "0.67911154", "0.6759726", "0.6733014", "0.6672722", "0.6662465", "0.66331744", "0.6573661", "0.65724915", "0.6566025", "0.65472597", "0.65230215", "0.6488674", "0.6473985", "0.64668196", "0.6442883", "0.64143026", "0.63960403", "0.6394038", "0.63903934", "0.63778716", "0.63734245", "0.6310689", "0.63032925", "0.6302719", "0.6298001", "0.6284765", "0.6280142", "0.62438637", "0.6219414", "0.62179303", "0.6207717", "0.6205882", "0.6202398", "0.6195329", "0.61937636", "0.6179423", "0.61683524", "0.61665696", "0.61665696", "0.61648685", "0.61648685", "0.616278", "0.61586404", "0.61575663", "0.6152255", "0.6150252", "0.61479974", "0.6143617", "0.61414915", "0.61402667", "0.61402667", "0.6126801", "0.6100585", "0.60851926", "0.6079592", "0.6067496", "0.60627526", "0.60627526", "0.60599124", "0.60468316", "0.6045472", "0.60440445", "0.60425806", "0.6041142", "0.6034625", "0.6017996", "0.60073483", "0.60021377", "0.5998403", "0.59928125", "0.59898037", "0.5981871", "0.59818596", "0.5979646", "0.597692", "0.5969238", "0.5967815", "0.59576374", "0.59544295", "0.59430075", "0.5939869", "0.59397495", "0.5937816", "0.59350044", "0.5922886", "0.5918845", "0.5910356", "0.5908506", "0.5907383", "0.59070385", "0.5906495", "0.59002244", "0.5898697", "0.5897107", "0.58952826", "0.58916694", "0.5884314", "0.58794034" ]
0.0
-1
Checks the currently focused element of the document and will enter insert mode if that element is focusable.
function enterInsertModeIfElementIsFocused() { // Enter insert mode automatically if there's already a text box focused. // TODO(philc): Consider using document.activeElement here instead. var focusNode = window.getSelection().focusNode; var focusOffset = window.getSelection().focusOffset; if (focusNode && focusOffset && focusNode.children.length > focusOffset && isInputOrText(focusNode.children[focusOffset])) enterInsertMode(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (!node.contains(document.activeElement)) {\n node.focus();\n }", "hasFocus() {\n if (ie) {\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && this.dom.contains(node)) {\n if (node.contentEditable == \"false\")\n return false;\n node = node.parentElement;\n }\n return true;\n }\n return this.root.activeElement == this.dom;\n }", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "get hasFocus() {\n var _a;\n // Safari return false for hasFocus when the context menu is open\n // or closing, which leads us to ignore selection changes from the\n // context menu because it looks like the editor isn't focused.\n // This kludges around that.\n return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === void 0 ? void 0 : _a.lastContextMenu) > Date.now() - 3e4) &&\n this.root.activeElement == this.contentDOM;\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch ( err ) { }\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {\n }\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "_containsFocus() {\n const element = this._elementRef.nativeElement;\n const activeElement = this._document.activeElement;\n return element === activeElement || element.contains(activeElement);\n }", "haxactiveElementChanged(el, val) {\n // flag for HAX to not trigger active on changes\n let container = this.shadowRoot.querySelector(\".tag-content\");\n if (val) {\n container.setAttribute(\"contenteditable\", true);\n } else {\n container.removeAttribute(\"contenteditable\");\n this.tag = container.innerText;\n }\n return false;\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {\n }\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch ( err ) { }\n }", "saveFocus(){\n\t\tthis.previouslyFocussedElement = document.activeElement || null;\n\t}", "function safeActiveElement() { // 4899\n\ttry { // 4900\n\t\treturn document.activeElement; // 4901\n\t} catch ( err ) { } // 4902\n} // 4903", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {\n }\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {\n }\n }", "_onFocus() {\n this.setState({ focused: this._containsDOMElement(document.activeElement) })\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch ( err ) {}\n }", "storeFocusedElement() {\n this.prevFocused = $(document.activeElement);\n }", "function onEditableFocus() {\n\t\t// Gecko does not support 'DOMFocusIn' event on which we unlock selection\n\t\t// in selection.js to prevent selection locking when entering nested editables.\n\t\tif ( CKEDITOR.env.gecko )\n\t\t\tthis.editor.unlockSelection();\n\n\t\t// We don't need to force selectionCheck on Webkit, because on Webkit\n\t\t// we do that on DOMFocusIn in selection.js.\n\t\tif ( !CKEDITOR.env.webkit ) {\n\t\t\tthis.editor.forceNextSelectionCheck();\n\t\t\tthis.editor.selectionChange( 1 );\n\t\t}\n\t}", "function adjustCurrentMode()\n{\n var isEditable = Dom.isEditable(document.activeElement);\n if (isEditable && Mode.isNormalMode()) {\n Mode.changeMode(ModeList.INSERT_MODE);\n }\n if (!isEditable && Mode.isInsertMode()) {\n Mode.changeMode(ModeList.NORMAL_MODE);\n }\n}", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) { }\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }", "function safeActiveElement() {\n /*eslint-disable no-empty */\n try {\n return document.activeElement;\n } catch (ex) {}\n /*eslint-enable no-empty */\n }", "function isFocusable(element) { return isInputOrText(element) || element.tagName == \"EMBED\"; }", "function checkFocusIn(e) {\n // In Firefox when you Tab out of an iframe the Document is briefly focused.\n if (container.contains(e.target) || e.target instanceof Document) {\n return;\n }\n e.stopImmediatePropagation();\n tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());\n }", "function safeActiveElement() {\n \ttry {\n \t\treturn document.activeElement;\n \t} catch ( err ) { }\n }", "async isFocused() {\n await this._stabilize();\n return webdriver.WebElement.equals(this.element(), this.element().getDriver().switchTo().activeElement());\n }", "function safeActiveElement() {\r\n\t\ttry {\r\n\t\t\treturn document.activeElement;\r\n\t\t} catch (err) { }\r\n\t}", "function safeActiveElement() {\n\t\t\ttry {\n\t\t\t\treturn document.activeElement;\n\t\t\t} catch ( err ) { }\n\t\t}", "function getActiveElement() /*?DOMElement*/{try{return document.activeElement||document.body;}catch(e){return document.body;}}", "_containsFocus() {\n if (this._body) {\n const focusedElement = this._document.activeElement;\n const bodyElement = this._body.nativeElement;\n return focusedElement === bodyElement || bodyElement.contains(focusedElement);\n }\n return false;\n }", "function safeActiveElement() {\n try {\n return document.activeElement;\n } catch ( err ) { }\n}", "function getActiveElement() /*?DOMElement*/{try{return document.activeElement || document.body;}catch(e) {return document.body;}}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch ( err ) { }\n\t}", "_containsFocus() {\n if (!this._document || !this._elementRef) {\n return false;\n }\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }", "_isFocusWithinDrawer() {\n var _a;\n const activeEl = (_a = this._doc) === null || _a === void 0 ? void 0 : _a.activeElement;\n return !!activeEl && this._elementRef.nativeElement.contains(activeEl);\n }", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch (err) {}\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch (err) {}\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch (err) {}\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch (err) {}\n\t}", "function safeActiveElement() {\n\t\ttry {\n\t\t\treturn document.activeElement;\n\t\t} catch (err) {}\n\t}", "function safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}", "function safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}", "function safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}", "function safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}", "function safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}" ]
[ "0.6649512", "0.64950323", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6274966", "0.62441874", "0.6206417", "0.620398", "0.6192266", "0.6175595", "0.6147924", "0.6128395", "0.6114575", "0.61063015", "0.60964894", "0.60964894", "0.60948193", "0.6088541", "0.60832244", "0.6081669", "0.6075615", "0.607128", "0.60698825", "0.60698825", "0.60698825", "0.60698825", "0.60698825", "0.60698825", "0.60698825", "0.60698825", "0.60656893", "0.60656893", "0.60656893", "0.60656893", "0.60656893", "0.6065638", "0.602005", "0.6018416", "0.59978026", "0.59932506", "0.5992853", "0.5992417", "0.5988013", "0.5979975", "0.5971322", "0.59690297", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.59636426", "0.5954017", "0.5952429", "0.5932551", "0.5932551", "0.5932551", "0.5932551", "0.5932551", "0.5916107", "0.5916107", "0.5916107", "0.5916107", "0.5916107" ]
0.8227385
0
Asks the background page to persist the zoom level for the given domain to localStorage.
function saveZoomLevel(domain, zoomLevel) { if (!saveZoomLevelPort) saveZoomLevelPort = chrome.extension.connect({ name: "saveZoomLevel" }); saveZoomLevelPort.postMessage({ domain: domain, zoomLevel: zoomLevel }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreOptions(){\r\n chrome.storage.local.get({\r\n zoomFactor: 1.0\r\n }, function(items){\r\n document.getElementById('zoom-factor').value = parseFloat(items.zoomFactor.toFixed(2));\r\n document.getElementById(\"zoom-percentage\").innerHTML = Math.round(items.zoomFactor * 100);\r\n });\r\n}", "function storeLevel(level) {\n document.cookie = userLevel + \"=\" + level + \";path=/\";\n}", "function updateLocalStorage(){\n\tchrome.storage.local.get(\"bl_country_domain\", function (bl_domain_array) {\n\t\tvar bl_data = bl_domain_array.bl_country_domain;\n\t\tlocalStorage.bl_country_domain = bl_data;\n\t\tvar bl_restricted_domains = getAllDomains(bl_data, []);\n\t\t\n\t\tlocalStorage.blRestrictedDomains = bl_restricted_domains;\n\t\tconsole.log(\"all bl restricted domains=> \"+bl_restricted_domains);\n\t});\n\n\tchrome.storage.local.get(\"wl_country_domain\", function (wl_domain_array){\n\t\tvar wl_data = wl_domain_array.wl_country_domain;\n\t\tlocalStorage.wl_country_domain = wl_data;\n\t\tvar wl_restricted_domains = getAllDomains(wl_data, []);\n\n\t\tlocalStorage.wlRestrictedDomains = wl_restricted_domains;\n\t\tconsole.log(\"all wl restricted domains=> \"+wl_restricted_domains);\n\t});\n}", "function saveSettings() {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tlocalStorage.fixIncome = document.getElementById(\"fixIncome\").value;\n\t\tlocalStorage.fixCost = document.getElementById(\"fixCost\").value;\n\t\tlocalStorage.fixSaving = document.getElementById(\"fixSaving\").value;\n\t\tlocalStorage.interval = document.getElementById(\"interval\").selectedIndex + 1;\n\t} else {\n\t\talert(\"Ihr Browser unterstützt LocalStage nicht!!!\");\n\t}\n}", "function setlevel(){\nvar level = localStorage.getItem(\"age\");\nvar time;\nif (level >= 6 && level <= 8){\n time = 1242; // 20 minutes\n}else if (level >= 9 && level <= 12) {\n time = 1122; // 18 minutes\n}else{\n time = 1062; // 17 minutes\n}\nlocalStorage.setItem(\"theTime\", time);\n}", "function useStorage(){\n \t\tconsole.log('-- Use local storage');\n\n \t\tfor (var level in GameJam.levels) {\n \t\t\tGameJam.levels[level].time = localStorage.getItem(level);\n \t\t\tif (GameJam.levels[level].time >= GameJam.levels[level].stars[0]) {\n \t\t\t\tGameJam.levels[level].unlocked = true;\n \t\t\t\tvar nextLevel = 'level' + (parseInt(level.replace(/level/g, '')) + 1);\n \t\t\t\tGameJam.levels[nextLevel].unlocked = true;\n \t\t\t}\n \t\t}\n \t}", "function saveMapState() {\n localStorageService.set(cacheId, {\n 'lat': vm.mapCenter.lat,\n 'lng': vm.mapCenter.lng,\n 'zoom': vm.mapCenter.zoom\n });\n }", "function saveAddress(){\n localStorage['address'] = document.getElementById('searchTextField').value; //get address\n localStorage['distanceLimit'] = document.getElementById(\"distanceField\").value; //get slider value for max distance\n console.log(\"saved data to local storage. Address:\"+ localStorage['address'] +\" Max distance:\"+ localStorage['distanceLimit']); //just checking\n geoCoder();\n restart();\n}", "function storeDefaults() {\n if (typeof(Storage) != \"undefined\") {\n var current_pages = document.getElementById('num-pages').value;\n var current_copies = document.getElementById('num-copies').value;\n\n if (isNaN(current_pages) || isNaN(current_copies)) {\n current_pages = 100;\n current_copies = 1000;\n }\n\n localStorage.last_pages_adv = current_pages;\n localStorage.last_copies_adv = current_copies;\n }\n else {\n //Does not support\n document.getElementById('exp-input').innerHTML += \"<p>Storage not supported</p>\";\n }\n}", "function popupExtensionSaveWindowSize() {\n let storage = chrome.storage.local;\n let storageKey = \"_settings_v0.1_\";\n storage.get(storageKey, function(result) {\n let mappings = result[storageKey];\n\n // only save the popup window\n if (mappings == null || mappings[window.location.host] == null) {\n return\n } else {\n mappings[window.location.host] = {\n \"height\": window.innerHeight,\n \"width\": window.innerWidth\n };\n }\n\n // save settings\n let obj = Object();\n obj[storageKey] = mappings;\n storage.set(obj);\n });\n }", "_saveSize(width, height) {\n\t\t\t\tlocalStorage.setItem('width', width);\n\t\t\t\tlocalStorage.setItem('height', height);\n\t\t\t}", "function save_options() {\r\n console.debug(\"options restore_options function\");\r\n var select = document.getElementById(\"color\");\r\n var color = select.children[select.selectedIndex].value;\r\n localStorage[\"settings.latitude\"] = \"\" ;\r\n localStorage[\"settings.longitude\"] = \"\";\r\n \r\n localStorage[\"latitude\"] = \"\";\r\n localStorage[\"longitude\"] = \"\";\r\n // Update status to let user know options were saved.\r\n // var status = document.getElementById(\"status\");\r\n // status.innerHTML = \"Options Saved.\";\r\n // setTimeout(function() {\r\n // status.innerHTML = \"\";\r\n // }, 750);\r\n}", "function populateStorage(){\n \t\tconsole.log('-- Populate local storage');\n\n \t\tfor (var level in GameJam.levels) {\n \t\t\tlocalStorage.setItem(level, GameJam.levels[level].time);\n \t\t}\n \t}", "function setHost() {\r\n window.localStorage.setItem(\"type\", \"host\");\r\n}", "function saveDistance(dist) {\n localStorage.setItem(\"distance\", dist);\n }", "function saveToStorage(){\n\tchrome.storage.sync.set(settings);\n}", "function storeAgeSelect(userAgeSelect) {\n\tlocalStorage.setItem(\"age\", JSON.stringify(userAgeSelect));\n}", "function scoreStore(){\n localStorage.setItem($url, $currentScreen);\n }", "function storeNewKey(domain){\n\n\t// Turn hostname into a proper name by removing subdomains\n\tvar site = psl.get(domain);\n\n\t// Get the current values of domains/passwords\n\tchrome.storage.local.get(\"domains\", function(data){\n\n\t\t// Save the domain\n\t\tif(data.domains == undefined) data.domains = [];\n\t\tdata.domains.push(site);\n\n\t\t// Now write back the data\n\t\tchrome.storage.local.set(data, null);\n\n\t\t// Return success\n\t\treturn 1;\n\t});\n\n\t// Return failed\n\treturn 0;\n}", "function saveSettings() {\r\n \"use strict\";\r\n localStorage.setItem('TrimpzSettings', JSON.stringify(trimpzSettings));\r\n}", "function save() {\n if (document.getElementById('workSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n } else if (document.getElementById('shortBreakSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n } else if (document.getElementById('longBreakSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n }\n\n valueWork = document.getElementById('workSettings').value;\n valueShort = document.getElementById('shortBreakSettings').value;\n valueLong = document.getElementById('longBreakSettings').value;\n valueSound = document.getElementById('volume-slider').value;\n document.getElementById('clock').innerHTML = `${valueWork}:00`;\n\n localStorage.setItem('workSettings', `${valueWork}`);\n localStorage.setItem('shortBreakSettings', `${valueShort}`);\n localStorage.setItem('longBreakSettings', `${valueLong}`);\n localStorage.setItem('volume-slider', `${valueSound}`);\n}", "function saveSettingsValues() {\n browser.storage.local.set({delayBeforeClean: document.getElementById(\"delayBeforeCleanInput\").value});\n\n browser.storage.local.set({activeMode: document.getElementById(\"activeModeSwitch\").checked});\n\n browser.storage.local.set({statLoggingSetting: document.getElementById(\"statLoggingSwitch\").checked});\n\n browser.storage.local.set({showNumberOfCookiesInIconSetting: document.getElementById(\"showNumberOfCookiesInIconSwitch\").checked});\n\n browser.storage.local.set({notifyCookieCleanUpSetting: document.getElementById(\"notifyCookieCleanUpSwitch\").checked});\n\n browser.storage.local.set({contextualIdentitiesEnabledSetting: document.getElementById(\"contextualIdentitiesEnabledSwitch\").checked});\n\n page.onStartUp();\n}", "function save_options() {\n var wpm = document.getElementById('wpmSetting').value;\n var chunkSize = document.getElementById('chunkSizeSetting').value;\n\n chrome.storage.local.set({\n 'rapidReadWPM': wpm,\n 'rapidReadChunkSize': chunkSize\n }, function(){\n\n \twindow.location = \"popup.html\";\n });\n\n}", "function storeScores() {\n localStorage.setItem(\"storage\", JSON.stringify(scoreStorage));\n}", "function saveLocation() {\n centre = map.getCenter();\n lat=centre.lat();\n lng=centre.lng();\n loc = \"\" + lat + \",\" + lng;\n setCookie( \"WepocoLatLng\", loc, 20 );\n zoom = map.getZoom();\n setCookie( \"WepocoZoom\", \"\" + zoom, 20 );\n return;\n}", "function saveLocation() {\n centre = map.getCenter();\n lat=centre.lat();\n lng=centre.lng();\n loc = \"\" + lat + \",\" + lng;\n setCookie( \"WepocoLatLng\", loc, 20 );\n zoom = map.getZoom();\n setCookie( \"WepocoZoom\", \"\" + zoom, 20 );\n return;\n}", "function updateLocalStorage() {\n\t\t// Ensure they have local storage\n\t\tif(typeof(localStorage) == 'undefined') return;\n\n\t\t// Grab the stored maps\n\t\tldb.get('maps', function(storedMaps) {\n\t\t\tif(storedMaps == null) {\n\t\t\t\tstoredMaps = {};\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tstoredMaps = JSON.parse(storedMaps);\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstoredMaps = {};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store our map\n\t\t\tstoredMaps[window.activeMap.name] = {\n\t\t\t\tData: window.activeMap.Data,\n\t\t\t\tInfo: window.activeMap.Info\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\t// Store into local storage\n\t\t\t\tldb.set('maps', JSON.stringify(storedMaps));\n\t\t\t} catch(e) {\n\t\t\t\talertify.error(window.getTranslation(\n\t\t\t\t\t'trErrorSaveMapLocal',\n\t\t\t\t\t'FAILED TO SAVE MAP LOCALLY!'\n\t\t\t\t));\n\t\t\t\talertify.error(e.message);\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "schemeToLocalStorage() {\n if (typeof window.localStorage !== \"undefined\") {\n window.localStorage.setItem(this.localStorageKey, this.scheme);\n }\n }", "function setLocaleStorage(name, value){\n localStorage.setItem(name, JSON.stringify(value));\n}", "function storeSizeSelect(userSizeSelect) {\n\tlocalStorage.setItem(\"size\", JSON.stringify(userSizeSelect));\n}", "function saveOptions() {\n\tlocalStorage[\"default_folder_id\"] = $('#folder_list :selected').val();\n\tlocalStorage[\"dial_columns\"] = $('#dial_columns :selected').val();\n\tlocalStorage[\"dial_width\"] = $('#dial_width :selected').val();\n\tsaveCheckbox('drag_and_drop');\n\tsaveCheckbox('force_http');\n\tsaveCheckbox('show_advanced');\n\tsaveCheckbox('show_new_entry');\n\tsaveCheckbox('show_folder_list');\n\tsaveCheckbox('show_subfolder_icons');\n\tlocalStorage[\"thumbnail_url\"] = $('#thumbnail_url').val();\n\n\twindow.location = \"newtab.html\";\n}", "function save_options() {\n var host = document.getElementById(\"host\").value;\n var host2 = document.getElementById(\"host2\").value;\n var user = document.getElementById(\"user\").value;\n var pass = document.getElementById(\"password\").value;\n \n //ensure trailing slash\n if( host.charAt( host.length - 1 ) !== \"/\" )\n\thost = host + \"/\";\n if( host2.charAt( host2.length - 1 ) !== \"/\" )\n\thost2 = host2 + \"/\";\n localStorage[\"host\"] = host;\n localStorage[\"host2\"] = host2;\n localStorage[\"user\"] = user;\n localStorage[\"pass\"] = pass;\n \n document.getElementById(\"status\").innerHTML = \"saved\";\n \n restore_options();\n}", "function save() {\r\n localStorage.setItem('en', JSON.stringify(en));\r\n localStorage.setItem('level', JSON.stringify(level));\r\n}", "function loadMapZoom(zoomGet) {\n\t\t//use GET variable (permalink)\n\t\tvar zoom = zoomGet;\n\t\tif (!zoom) {\n\t\t\t//if GET is not set, use cookie\n\t\t\tzoom = readCookie(prefNames[this.zoomIdx]);\n\t\t}\n\t\t//if neither GET nor cookie have been set -> use default which is set automatically\n\n\t\t//save the zoom level in the permaInfo array\n\t\tpermaInfo[this.zoomIdx] = escape(zoom) || 13;\n\t\treturn zoom;\n\t}", "function us_saveValue(name, value) {\r\n\tif (isGM) {\r\n\t\tGM_setValue(name, value);\r\n\t} else {\r\n\t\tlocalStorage.setItem(name, value);\r\n\t}\r\n}", "function savepage(){\r\n var mylog=window.localStorage.getItem('z')\r\nreturn mylog;\r\n}", "function storeContent14() {\n var savedContent14 = content14.val(); \n localStorage.setItem(\"2:00pm\", savedContent14);\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function update_Prefs() {\r\n let prefs = {\r\n //string aString: document.getElementById(\"aNumber\").value\r\n //integer aNumber: parseInt(document.getElementById(\"aNumber\").value, 10)\r\n //boolean aboolean: document.getElementById(\"aboolean\").checked\r\n\r\n localOnly: document.getElementById(\"localOnly\").checked,\r\n spf_slider: document.getElementById(\"spf_slider\").value,\r\n tz_slider: document.getElementById(\"tz_slider\").value,\r\n bl_slider: document.getElementById(\"bl_slider\").value,\r\n origin_slider: document.getElementById(\"origin_slider\").value,\r\n api_slider: document.getElementById(\"api_slider\").value,\r\n needed_score_slider: document.getElementById(\"needed_score_slider\").value\r\n };\r\n browser.storage.local.set({\"Prefs\": prefs});\r\n}", "function saveSetting() {\n try {\n var data = {\n language: $(\"#select-script-language-id\").val()\n };\n browser.storage.local.set(data);\n } catch (e) {\n console.log(e);\n }\n}", "function saveToStorage(){\n console.debug('saving settings', self);\n\n try {\n localStorage.setItem(self.name, JSON.stringify(self.data));\n } catch (e) {\n }\n }", "function originCity() {\r\n localStorage.setItem('origin', document.getElementById(\"originCity\").value);\r\n}", "function syncToStorage() {\n\tvar settings_object = {};\n\tObject.keys(localStorage).forEach(function(key) {\n\t\tsettings_object[key] = localStorage[key];\n\t});\n\tchrome.storage.sync.set(settings_object);\n}", "function saveSettings() {\n\n chrome.storage.local.set({\n\n words: wordArray,\n pages: pagesArray\n\n }, function() {\n\n \t//**********************************\n\t// OPTIONS SAVED INTO LOCAL STORAGE\n\t//**********************************\n\n });\n\n}", "function setStorage(data)\n\t\t \t{\n\t\t \t\tvar data = JSON.stringify(data);\n\t\t \t\t//alert(\"SAVED\");\n\t\t \t\tlocalStorage.setItem('data',data);\n\t\t \t}", "function initDomStorage(value) {\n window.localStorage.setItem('foo', 'local-' + value);\n window.sessionStorage.setItem('bar', 'session-' + value);\n}", "function save_options() {\n\n chrome.storage.sync.set({ settings:\n {\n targethost: document.getElementById('targethost').value,\n targetport: document.getElementById('targetport').value,\n targetproto: document.getElementById('targetproto').value,\n targetuser: document.getElementById('targetuser').value,\n targetpasswd: document.getElementById('targetpasswd').value\n }\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = ' Saved.';\n\n //reload background script\n chrome.extension.getBackgroundPage().window.location.reload();\n \n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function saveSettings() {\n\tlocalStorage.mylanguagesetting = \"en\"\n }", "function updateCountryStorage() {\n localStorage.setItem(\"countries\", JSON.stringify(countries));\n }", "function setScores(){\n var view ={\n score: secondsRemaining,\n initials: highscoreInput.value,\n }\n localStorage.setItem('individual', JSON.stringify(view))\n\n}", "function saveSettings(){\n\t//Get the user settings\n\tgetSettings();\n\n\t//Create a variable with all user settings\n\tvar settings = {\n\t\tcountry: country,\n\t\tincludeOldResults: String(includeOldResults),\n\t\tsearchStrings: searchStrings,\n\t\tlocations: locations,\n\t\tradiuses: radiuses,\n\t}\n\n\t//Save the user settings to the local storage\n\tlocalStorage.setItem(\"settings\",JSON.stringify(settings));\n\n\tconsole.log(\"Settings saved\");\n\tconsole.log(JSON.stringify(settings));\n}", "function saveOptions() {\n var dictionaries = JSON.parse(window.localStorage.getItem('dictionaries'));\n\n // Saves custom dictionries to local storage(if any).\n if (tempCusDictionaries.length > 0) {\n if (dictionaries) {\n dictionaries = dictionaries.concat(tempCusDictionaries);\n window.localStorage.setItem('dictionaries', JSON.stringify(dictionaries));\n } else {\n window.localStorage.setItem('dictionaries', JSON.stringify(tempCusDictionaries));\n }\n tempCusDictionaries.splice(0, tempCusDictionaries.length);\n }\n\n showUserMessages('save_status', 0.5, 'saveStatus');\n// $('save_button').disabled = true;\n}", "function save_options(evt) {\n evt.preventDefault();\n\n chrome.storage.local.get(STANDALONE_SETTINGS_STORAGE_KEY, res => {\n var previousMode = res[STANDALONE_SETTINGS_STORAGE_KEY];\n var userSelectedValue = document.querySelector('input[name=\"standalone\"]:checked').value;\n if (userSelectedValue) {\n var isStandalone = userSelectedValue === 'true';\n var hasSwitchedExtensionMode = previousMode && previousMode !== isStandalone;\n chrome.storage.local.set({\n 'options.standalone': isStandalone,\n 'hasSwitchedExtensionMode': hasSwitchedExtensionMode,\n }, () => chrome.runtime.reload());\n }\n })\n\n}", "function updateZoomlevel()\n{\n\tThisZoom = map.getZoom();\n\tdocument.getElementById(\"gm_zoomlevel\").value = ThisZoom;\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function setPlayerQuality() {\n localStorage.setItem(YT_PLAYER_QUALITY, `{\"data\":\"${config.playerQuality}\",\"expiration\":${window.moment().add(1, \"months\").valueOf()},\"creation\":${window.moment().valueOf()}}`);\n}", "function setStorage() \r\n\t{\r\n if (typeof(Storage) !== \"undefined\")\r\n\t\t{\r\n if (remember)\r\n\t\t\t{\r\n localStorage.setItem(\"member\", 'true');\r\n if (publicAddr)\r\n localStorage.setItem(\"address\", publicAddr);\r\n } else\r\n\t\t\t{\r\n localStorage.removeItem('member');\r\n localStorage.removeItem('address');\r\n }\r\n } \r\n }", "function save() {\t\n\tlet checkbox1 = document.querySelector(\".checkbox-one\");\n localStorage.setItem(\"checkbox-one\", checkbox1.checked);\t\n let checkbox2 = document.querySelector(\".checkbox-two\");\n localStorage.setItem(\"checkbox-two\", checkbox2.checked);\t\n let select = document.querySelector('#timezone');\n localStorage.setItem(\"timezone\", select.value);\n\n}", "function storeSettings() {\n check();\n browser.storage.local.set(f2j(form));\n}", "function setStorage(key, value) \n{\n\tif(typeof(window.localStorage) != 'undefined'){ \n\t\twindow.localStorage.setItem(key,value); \n\t} \n}", "updateStoredSettings(obj, level) {\n if (window.localStorage) {\n window.localStorage.setItem(`SNAKE_SETTINGS_${level}`, JSON.stringify(obj));\n }\n }", "function saveMapSize()\r\n {\r\n\tvar myVal;\r\n\ttry\r\n\t{\r\n\t\tif (parseInt(document.getElementById(\"my_map_size\").value) > 15)\r\n\t\t{\r\n\t\t\tvar myVal = 15;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmyVal = document.getElementById(\"my_map_size\").value;\r\n\t\t}\r\n\t}\r\n\tcatch (ex) {myVal = 15;}\r\n\t\r\n\tGM_setValue(\"map_size\",myVal);\r\n\tmapResize(GM_getValue(\"map_size\",10));\r\n }", "function save_options() {\n// var select = document.getElementById(\"color\");\n// var color = select.children[select.selectedIndex].value;\n// localStorage[\"favorite_color\"] = color;\n \t\n \tfor( i in pOptions){\n \t\tif(typeof(pOptions[i].def)=='boolean')\n \t\t\tlocalStorage[i] = document.getElementById(i).checked;\n \t\telse\n \t\t\tlocalStorage[i] = document.getElementById(i).value;\n \t}\n\t\n\t\n\t//localStorage[\"hqthumbs\"] = document.getElementById(\"hqthumbs\").checked;\n\t//localStorage[\"showCurrentTab\"] = document.getElementById(\"showCurrentTab\").checked;\n\t//localStorage[\"maxhistory\"] = document.getElementById(\"maxhistory\").value;\n\t\n\t\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n Cr.empty(status).appendChild(Cr.txt(\"Options Saved.\"));\n setTimeout(function() {\n Cr.empty(status);\n }, 750);\n \n chrome.runtime.sendMessage({greeting: \"reloadprefs\"}, function(response) { });\n}", "function storeWindowSize(windowname) {\n var width = window.innerWidth || (window.document.documentElement.clientWidth || window.document.body.clientWidth);\n var height = window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);\n\n var expires = new Date();\n // Expires in 10 days\n expires = new Date(expires.getTime() + 1000*60*60*24*10);\n\n document.cookie = windowname+'Width='+width+'; expires='+expires.toGMTString()+'; path=/';\n document.cookie = windowname+'Height='+height+'; expires='+expires.toGMTString()+'; path=/';\n}", "function coordsGet(domain) {\n \n $.getJSON(domain + \"/scott-server-test/locate.php?map\", function (data) {\n \n var fix = parseFloat(data['x']).toFixed(10);\n var fiy = parseFloat(data['y']).toFixed(10);\n localStorage['mapx'] = fix;\n localStorage['mapy'] = fiy;\n console.log(localStorage['mapx']);\n console.log(localStorage['mapy']);\n // document.getElementById('mapx').innerHTML = fix;\n // document.getElementById('mapy').innerHTML = fiy;\n });\n}", "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "onDomainClick(domain) {\n if (domain.rowid === this.currentDomain) {\n this.currentDomain = null;\n } else {\n this.currentDomain = domain.rowid;\n }\n\n localStorage.setItem('currentDomain', this.currentDomain);\n this.loadSelections();\n }", "function saveHenosisState()\n{\n var windowWidth = $(window).width();\n var windowHeight = $(window).height();\n writeCookie(\"windowWidth\", windowWidth, 30); // 30 minutes\n writeCookie(\"windowHeight\", windowHeight, 30); // 30 minutes\n writeCookie(\"henosisCX\", document.getElementById(\"henosis\").getAttribute(\"cx\"), 30); // 30 minutes\n writeCookie(\"henosisCY\", document.getElementById(\"henosis\").getAttribute(\"cy\"), 30); // 30 minutes\n}", "function restore_options() {\n var url = localStorage[\"url\"];\n if (url) {\n var input_url = document.getElementById(\"url\");\n input_url.value = url;\n }\n\n var c2d = localStorage[\"c2d\"];\n if (c2d == \"true\") {\n var input_c2d = document.getElementById(\"clicktodial\");\n input_c2d.checked = \"checked\";\n }\n}", "function local_setValue(name, value) { name=\"GMxs_\"+name; if ( ! value && value !=0 ) { localStorage.removeItem(name); return; }\n var str=JSON.stringify(value); localStorage.setItem(name, str );\n }", "function saveSettingsLocalStorage(){\n settingsObject = {email: emailSwitch.checked, profile: profileSwitch.checked, timezone: timezoneSelect.selectedIndex}; \n localStorage.setItem('settings', JSON.stringify(settingsObject));\n \n}", "function trySettingLocationFromStorage() {\n let lastKnownLat = localStorage.getItem('lastKnownLat');\n let lastKnownLng = localStorage.getItem('lastKnownLng');\n let lastKnownZoom = localStorage.getItem('lastKnownZoom');\n\n let haveLastKnownLocation = (lastKnownLat && lastKnownLng && lastKnownZoom);\n\n if (haveLastKnownLocation) {\n mapCenter = [lastKnownLat, lastKnownLng];\n mapZoom = lastKnownZoom;\n window.history.replaceState({}, \"\", \"@\" + Number(lastKnownLat).toFixed(7) + \",\" + Number(lastKnownLng).toFixed(7) + \",\" + Number(lastKnownZoom) + \"z\");\n }\n // If every other map initalization option has failed, load the default location\n else setDefaultLocation();\n}", "function persistLocalStorage() {\n _localStorage.setItem(_name, this.toJSON());\n }", "function storeContent17() {\n var savedContent17 = content17.val(); \n localStorage.setItem(\"5:00pm\", savedContent17);\n}", "function onChangeStorage(args) {\n onChange(document.getElementById('storage'), args.value, 'GB');\n }", "function loadCookies()\n{\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++)\n {\n var c = cookies[i];\n while (c.charAt(0) == ' ')\n c = c.substring(1);\n\n var val = parseInt(c.substring(5, c.length));\n if (val == NaN)\n val = 0;\n\n if (c.indexOf(\"offX\") == 0)\n xOffset = val;\n else if (c.indexOf(\"offY\") == 0)\n yOffset = val;\n else if (c.indexOf(\"zoom\") == 0)\n {\n if (val == 0)\n val = 800;\n zoomValue = val;\n }\n else if (c.indexOf(\"selX\") == 0)\n inputX = val;\n else if (c.indexOf(\"selY\") == 0)\n inputY = val;\n else\n {\n var checked = document.querySelector('input[name=\"color\"]:checked');\n if (checked != null)\n checked.removeAttribute(\"checked\");\n var selColor = document.getElementById(c.substring(5, c.length));\n if (selColor != null)\n selColor.setAttribute(\"checked\", \"\");\n }\n }\n updateZoom(false);\n}", "function saveScores() \n{\n var savedScores = JSON.parse(localStorage.getItem(\"score\")) || [];\n\n var initials = playerInitials.value;\n var userInfo = {\n initials: initials,\n score: score\n }\n savedScores.push(userInfo);\n localStorage.setItem(\"score\", JSON.stringify(savedScores))\n window.location.href=\"highscores.html\";\n}", "function restore_options() {\n chrome.storage.sync.get({\n definitionsCheckbox: 0,\n examplesCheckbox: 0,\n windowWidth: 1024,\n windowHeight: 768\n }, function (items) {\n document.getElementById('definitionsCheckbox').checked = items.definitionsCheckbox;\n document.getElementById('examplesCheckbox').checked = items.examplesCheckbox;\n document.getElementById('windowWidth').value = items.windowWidth;\n document.getElementById('windowHeight').value = items.windowHeight;\n });\n}", "function save(amount, apr, years, yearlyTaxes) {\n if (window.localStorage) { // Only do this if the browser supports it\n /* localStorage.loan_amount = amount;\n localStorage.loan_apr = apr;\n localStorage.loan_years = years;\n localStorage.loan_taxes = yearlyTaxes;*/\n }\n}", "function storeContent16() {\n var savedContent16 = content16.val(); \n localStorage.setItem(\"4:00pm\", savedContent16);\n}", "function saveExtSettings() {\n var settings = {\n \"showFoldersInList\": showFoldersInList,\n \"showSortDataInList\": showSortDataInList,\n \"numberOfFiles\": numberOfFiles,\n \"zoomFactor\": zoomFactor,\n \"orderBy\": orderBy\n };\n localStorage.setItem('perpectiveGridSettings', JSON.stringify(settings));\n }", "function saveSetting (szKey, szValue)\n{\n if(typeof(Storage) !== \"undefined\")\n {\n localStorage.setItem (szKey, szValue);\n }\n else\n alert ('Sorry! No Web Storage support..');\n}", "function getLevel() {\n var level = localStorage.getItem('level');\n if(!level) {\n level = 1;\n localStorage.setItem('level', level);\n } else {\n level = parseInt(level, 10);\n }\n return level;\n }", "function saveLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n localStorage.favoritePresets = JSON.stringify(favoritePresetID);\n console.log(\"Saving Parameter [localStorage.favoritePresets]:\");\n console.log(localStorage.favoritePresets);\n\n localStorage.currentAddress = address;\n console.log(\"Saving Parameter [localStorage.currentAddress]:\");\n console.log(localStorage.currentAddress);\n}", "function saveToStorage(saveID, data) {\n localStorage[saveID] = /*window.*/JSON.stringify(data); //this is the memory of the user's device\n}", "function storeData(){\r\n localStorage.setItem(\"selections\", JSON.stringify(selections));\r\n}", "function savePreferences(){\r\n\t\r\n\t\tvar bgColor = $(\"#txtBGColor\").val();\r\n\t\tvar color = $(\"#txtFontColor\").val();\r\n\t\tvar fontSize = $(\"#txtFontSize\").val();\r\n\t\tvar target = selectedTarget;\r\n\t\tvar userPreferText = {'color':color, 'fontSize':fontSize};\r\n\t\tvar userPreferBg = {'bgColor':bgColor};\r\n\t\t\r\n\t\tif( 'localStorage' in window && window['localStorage'] != null )\r\n\t\t{\r\n\t\t\tswitch(target.attr(\"class\")){\r\n\t\t\t\tcase \"city\":{\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_Bg', JSON.stringify(userPreferBg));\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_city', JSON.stringify(userPreferText));\r\n\t\t\t\t\t\tapplyPreferences();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(e){\r\n\t\t\t\t\t\tif( e == QUOTA_EXCEEDED_ERR )\r\n\t\t\t\t\t\t\tconsole.log(\"You are out of local storage\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tconsole.log(\"Some error\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"time\":{\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_Bg', JSON.stringify(userPreferBg));\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_time', JSON.stringify(userPreferText));\r\n\t\t\t\t\t\tapplyPreferences();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(e){\r\n\t\t\t\t\t\tif( e == QUOTA_EXCEEDED_ERR )\r\n\t\t\t\t\t\t\tconsole.log(\"You are out of local storage\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tconsole.log(\"Some error\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdefault:{ //\"oneAns\"\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_Bg', JSON.stringify(userPreferBg));\r\n\t\t\t\t\t\tlocalStorage.setItem('AppPrefer_details', JSON.stringify(userPreferText));\r\n\t\t\t\t\t\tapplyPreferences();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(e){\r\n\t\t\t\t\t\tif( e == QUOTA_EXCEEDED_ERR )\r\n\t\t\t\t\t\t\tconsole.log(\"You are out of local storage\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tconsole.log(\"Some error\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tconsole.log(\"This browser does NOT support local storage\");\r\n\t\t}\r\n\t}", "function saveSettings() {\n localStorage.setItem(\"emailToggle\", emailToggleButton.checked);\n localStorage.setItem(\"privacyToggle\", privacyToggleButton.checked);\n localStorage.setItem(\"timezone\", select.value);\n}", "function restore_options() {\n var host = localStorage[\"host\"];\n var host2 = localStorage[\"host2\"] || \"\";\n var user = localStorage[\"user\"];\n var pass = localStorage[\"pass\"];\n \n document.getElementById(\"host\").value = host;\n document.getElementById(\"host2\").value = host2;\n document.getElementById(\"user\").value = user;\n document.getElementById(\"password\").value = pass;\n}", "function populateStorage() {\r\n // run detection with inverted expression\r\n if (!localStorageSupport) {\r\n // change value to inform visitor of no session storage support\r\n storageQuotaMsg.innerHTML = 'Sorry. No HTML5 session storage support here.';\r\n } else {\r\n try {\r\n localStorage.setItem('bgcolor', document.getElementById('bgcolor').value);\r\n localStorage.setItem('fontfamily', document.getElementById('font').value);\r\n localStorage.setItem('image', document.getElementById('image').value);\r\n localStorage.setItem(\r\n 'fontcolor',\r\n document.querySelector('#fontcolor').value\r\n );\r\n localStorage.setItem('note', document.querySelector('#textArea').value);\r\n setStyles();\r\n } catch (domException) {\r\n domException = new DOMException();\r\n if (\r\n domException.name === 'QUOTA_EXCEEDED_ERR' ||\r\n domException.name === 'NS_ERROR_DOM_QUOTA_REACHED'\r\n ) {\r\n storageQuotaMsg.innerHTML = 'Local Storage Quota Exceeded!';\r\n }\r\n }\r\n }\r\n}", "function save_options() {\n let sheetIdValue = document.getElementById('sheet_id').value;\n\tlet baseUrlValue = document.getElementById('base_url').value;\n\tconst debugModeValue = document.getElementById(\"debug_mode\").checked;\n\n\tbaseUrlValue = baseUrlValue\n .replace(/(^\\w+:|^)\\/\\//, \"\")\n .replace(/\\/+$/, \"\");\n\n\tsheetIdValue = sheetIdValue.trim();\t\n\n\tbrowser.storage.sync.set({ sheetIdValue, baseUrlValue, debugModeValue }).then( () => {\n\t\tvar status = document.getElementById('status');\n\t\tstatus.textContent = 'Options saved...';\n\t\tsetTimeout(function () {\n\t\t\tstatus.textContent = '';\n\t\t}, 750);\n\t})\n\n}", "function savelocal() {\n\n var userdata, email, gsdate, username, mylang;\n\n username = document.getElementById(\"username\").value;\n email = document.getElementById(\"email\").value;\n gsdate = formatDate(new Date());\n mylang = localStorage.getObject('mylang');\n\n //construct the json array for user data and add to local storage\n gsdata = {'username': username, 'email': email, 'gsdate': gsdate, 'mylang': mylang, 'answers':[-1]};\n gsdata = getinputs(gsdata,1,25,\"g\");\n localStorage.setObject('gsdata', gsdata); \n calcResults();\n //now that everything is saved, check the connection\n checkConnection( \"cgovscore\");\n}", "static save(settings) { window.localStorage.setItem('settings', JSON.stringify(settings)); }", "function setLevel(l) {\n storage.level = l;\n console.log(\"SETTING LEVEL\"+l);\n }", "function setStorage(profil) {\n if(profil == 1) {\n localStorage.setItem(\"lectureVocale\", true);\n localStorage.setItem(\"controleVocal\", true);\n localStorage.setItem(\"affichageImages\", false);\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n }\n else if(profil == 2) {\n localStorage.setItem(\"lectureVocale\", false);\n localStorage.setItem(\"controleVocal\", false);\n localStorage.setItem(\"affichageImages\", true);\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n localStorage.setItem(\"fontFamily\", $(\"#selectFontFamily\").val());\n localStorage.setItem(\"fontColor\", $(\"#selectFontColor\").val());\n }\n else {\n localStorage.setItem(\"lectureVocale\", $('#lectureVocale').is(':checked'));\n localStorage.setItem(\"controleVocal\", $('#controleVocal').is(':checked'));\n localStorage.setItem(\"affichageImages\", $('#affichageImages').is(':checked'));\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n localStorage.setItem(\"fontFamily\", $(\"#selectFontFamily\").val());\n localStorage.setItem(\"fontColor\", $(\"#selectFontColor\").val());\n }\n}", "function addLocalStorage(){\n\tconsole.log(\"Saving to local storage...\");\n var stockTabsHolder = $('#stockTabsHolder').html();\n\tvar pageHTML = $(\"#resultsDiv0\"+cloudSaveIndex).html();\n\n\tif(window.localStorage) {\n localStorage.setItem(\"tabData\", stockTabsHolder);\n\t\tlocalStorage.setItem(\"pageData\"+cloudSaveIndex, pageHTML);\n\t\tlocalStorage.setItem(\"pageIndex\",mainIndex);\n\t} else {\n \t\tconsole.log('Local storage not supported');\n\t}\n\n\t//update Cloud Index\n cloudSaveIndex = updateIndex(cloudSaveIndex);\n\n} //end addLocalStorage", "function storeContent15() {\n var savedContent15 = content15.val(); \n localStorage.setItem(\"3:00pm\", savedContent15);\n}", "function storeSettings(){\n localStorage.setItem('settings', JSON.stringify(settings));\n}", "function save()\r\n{\r\n var rows = document.getElementById(\"rows\").value;\r\n var cols = document.getElementById(\"cols\").value;\r\n var algoSelect = document.getElementById(\"algoSelect\").value;\r\n\r\n localStorage.rows = rows;\r\n localStorage.cols = cols;\r\n localStorage.algoSelect = algoSelect;\r\n}", "function updateLocalStorage(key, value, pageSpecific) {\r\n\tvar lsString = localStorage.getItem('state');\r\n\tvar object = lsString ? JSON.parse(lsString) : {};\r\n\tif(pageSpecific) {\r\n\t\tvar path = window.location.pathname;\r\n\t\tif(object[path]) {\r\n\t\t\tobject[path][key] = value;\t\r\n\t\t} else {\r\n\t\t\tobject[path] = {};\r\n\t\t\tobject[path][key] = value;\r\n\t\t}\r\n\t} else {\r\n\t\tobject[key] = value;\t\r\n\t}\r\n\tobject.valid = timeLimit();\r\n\tlocalStorage.setItem('state', JSON.stringify(object));\r\n}" ]
[ "0.6347569", "0.60518104", "0.589043", "0.5695572", "0.56647485", "0.5611295", "0.5580931", "0.5572764", "0.5561502", "0.5559303", "0.5553714", "0.55410075", "0.54979324", "0.5477195", "0.5449793", "0.54494435", "0.5441498", "0.5437589", "0.54327095", "0.5404099", "0.5399655", "0.53860766", "0.53656554", "0.5363967", "0.53549576", "0.53549576", "0.5349629", "0.5331857", "0.53244025", "0.53117174", "0.53100324", "0.53081214", "0.52979034", "0.52940327", "0.5289948", "0.5282359", "0.52696794", "0.5268154", "0.5266336", "0.5261788", "0.5249383", "0.5243091", "0.52416116", "0.52391535", "0.5229822", "0.5226091", "0.5225545", "0.52214247", "0.52069974", "0.5205822", "0.5204873", "0.51929206", "0.51846105", "0.51788056", "0.5178187", "0.5172161", "0.5169163", "0.516847", "0.51622486", "0.51592064", "0.5158819", "0.51528597", "0.5150201", "0.5142879", "0.5136619", "0.5134078", "0.51310474", "0.51297766", "0.5118512", "0.5117255", "0.51145446", "0.5110925", "0.51059866", "0.51059335", "0.51039916", "0.51033825", "0.510134", "0.5097533", "0.50897616", "0.50882894", "0.5082813", "0.5077554", "0.506911", "0.5067112", "0.5066752", "0.50650495", "0.5064712", "0.5064055", "0.5062263", "0.50582796", "0.50562483", "0.5055507", "0.505", "0.50470185", "0.5045645", "0.50422484", "0.50383455", "0.503781", "0.5037487", "0.5032366" ]
0.7473462
0
Zoom in increments of 20%; this matches chrome's CMD+ and CMD keystrokes. Set the zoom style on documentElement because document.body does not exist prepage load.
function setPageZoomLevel(zoomLevel, showUINotification) { document.documentElement.style.zoom = zoomLevel + "%"; if (document.body) HUD.updatePageZoomLevel(zoomLevel); if (showUINotification) HUD.showForDuration("Zoom: " + currentZoomLevel + "%", 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function Zoom() {\n var winHeight = $(window).height();\n var zoom = 1;\n var bodyMaxHeight = 1331;\n zoom = winHeight/bodyMaxHeight;\n /* Firefox */\n var winWidth = $(window).width();\n var widthFirefox = winWidth/zoom;\n var winWidths = $(window).height();\n if(navigator.userAgent.indexOf(\"Firefox\") != -1) {\n $('#Zoom').css({\n '-moz-transform': 'scale('+zoom+')', /* Firefox */\n 'transform-origin': '0 0',\n 'width': widthFirefox,\n });\n } else {\n $('#Zoom').css({\n 'zoom': zoom,\n });\n }\n }", "function setupZooming() {\n var main = document.querySelector(\"main\");\n function setZoom() {\n document.body.setAttribute(\"style\", \"zoom:\" + Math.min(window.innerHeight / main.offsetHeight, window.innerWidth / main.offsetWidth));\n } \n setZoom();\n window.onresize = setZoom;\n }", "function zoom(){\n\t//var biggie = document.getElementById(\"biggie\"); not needed per same as above\n\tbiggie.style.fontSize = \"150%\";\n\n\t}", "function setZoom() {\n if(zoom == 2.0) {\n\t\tzoom = 1.0;\n\t} else {\n\t\tzoom = 2.0;\n\t}\n}", "function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\r\n var sign = dy < 0 ? -1 : +1\r\n dy = Math.pow(Math.abs(dy), 1.4) * sign\r\n\r\n if (timeWindow + dy > 10 * 1000) {\r\n timeWindow += dy\r\n } else {\r\n timeWindow = 10 * 1000\r\n }\r\n }\r\n step()\r\n }", "function setZoom(e) {\n // Scaling ratio\n if (window.gsc) {\n window.gsc *= Math.pow(0.9, e.wheelDelta / - 120 || e.detail / 2 || 0);\n window.desired_gsc = window.gsc;\n }\n }", "function zoomActual()\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(_options.defaultZoom));\n\t}", "function manualZoom(zoom) {\n let scale = zoom / 100,\n translation = zoomObj.translate(),\n origZoom = zoomObj.scale(),\n unscaledOffsetX = (translation[0] + ((windowWidth * origZoom) - windowWidth) / 2) / origZoom,\n unscaledOffsetY = (translation[1] + ((windowHeight * origZoom) - windowHeight) / 2) / origZoom,\n translateX = unscaledOffsetX * scale - ((scale * windowWidth) - windowWidth) / 2,\n translateY = unscaledOffsetY * scale - ((scale * windowHeight) - windowHeight) / 2;\n\n svgGroup.attr(\"transform\", \"translate(\" + [translateX + (marginLeft * scale), translateY + ((windowHeight / 2 - rootH / 2 - startNodeOffsetY) * scale)] + \")scale(\" + scale + \")\");\n zoomObj.scale(scale);\n zoomObj.translate([translateX, translateY]);\n }", "function increaseZoom() {\n var increaseZoomOriginalSize = 1.1;\n mainDiagram.commandHandler.increaseZoom(increaseZoomOriginalSize);\n}", "static set niceMouseDeltaZoom(value) {}", "function zoom(event) {\n event.preventDefault();\n scale += event.deltaY * -0.001;\n scale = Math.min(Math.max(.5, scale), 2);\n wheel.style.transform = `scale(${scale})`;\n }", "function zoomFig() {\n var propertyWidth = 960;\n var propertyHeight = 600;\n var winLeft = ((screen.width - propertyWidth) / 2);\n var winTop = ((screen.height - propertyHeight) / 2);\n var winOptions = \"width=960,height=600\";\n winOptions += \",left=\" + winLeft;\n winOptions += \",top=\" + winTop;\n var zoomWindow = window.open(\"zoom.htm\", \"zoomwin\", winOptions);\n zoomWindow.focus();\n}", "function zoom(event) {\n   event.preventDefault();\n \n   scale += event.deltaY * -0.01;\n \n   // Restrict scale\n   scale = Math.min(Math.max(.125, scale), 4);\n \n   // Apply scale transform\n   el.style.transform = `scale(${scale})`;\n }", "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "function setZoom() {\n zoom = d3.zoom()\n \t.scaleExtent([defaultZoom.k * zoomScreenSizeMulti, 2 * zoomScreenSizeMulti])\n \t.on(\"zoom\", handleZoom);\n d3.select(\"svg\")\n .call(zoom);\n d3.select(\"svg g\")\n .attr(\"transform\", currentZoom);\n}", "function resetZoom() {\n window.gsc = 0.9;\n window.desired_gsc = 0.9;\n }", "function zoomTo(value)\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(value));\n\t}", "function initZoom() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.settings(\"zoomingRatio\")\n });\n}", "function zoom(factor){ \n\tconsole.log(\"\\n\\nzooming by \" + factor)\n\tconsole.log(\"current scale \" + scale)\n\tif(!isNaN(factor)){ \n\t\tscale *= factor \n\n\t\t\n\t\tsvgScale.setAttribute('transform', 'scale(' + scale + ')') \n\t\tresetTranslation()\n\t}\n}", "function enableZoom() {\n $head.find('meta[name=viewport]').remove();\n $head.prepend('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=1\" />');\n }", "function zoom(factor) {\n // TODO:\n // Some bug here when decreasing the spacing\n\n var time = getTime(0.5);\n\n if (scale * factor >= 2048 || scale * factor <= (1 / 128)) return;\n\n scale *= factor;\n\n rescale();\n setTime(time);\n refresh();\n}", "function Browser_SetScale(html, newScale)\n{\n\t//this ie9 or worst?\n\tif (window.__BROWSER_TYPE == __BROWSER_IE && window.__BROWSER_IE9_OR_LESS)\n\t{\n\t\t//use zoom\n\t\thtml.style.zoom = newScale;\n\t}\n\telse\n\t{\n\t\t//scalling to to 1?\n\t\tif (newScale == 1)\n\t\t{\n\t\t\t//reset the transform\n\t\t\thtml.style.transform = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//set transform\n\t\t\thtml.style.transform = \"scale(\" + newScale + \")\";\n\t\t\thtml.style.transformOrigin = \"left top\";\n\t\t}\n\t}\n}", "zoomIn() {\n this.zoom *= 1.25;\n }", "function setZoom(){\n const screenWidth = window.innerWidth;\n\n if (screenWidth > 1000){\n return 6;\n } else if (screenWidth < 1000 && screenWidth > 400) {\n return 5;\n } else if (screenWidth < 400) {\n return 4;\n }\n}", "function zoom(){\n\t//NOT YET\n\t/*var rect = canvas.getBoundingClientRect();\n var mx = panX + (panX - rect.left) / zooms;\n var my = panY + (panY - rect.top) / zooms;\n zooms = document.getElementById(\"za\");\n panX = mx - ((panX - rect.left) / zooms);\n panY = my - ((panY - rect.top) / zooms);\n */\n zooms = document.getElementById(\"za\").value; \n mx = ((panX + (a-1)/zooms) - panX) / 2;\n panX -= mx;\n my = ((panY + (b-1)/zooms) - panY) / 2;\n panY -= mx;\n \n show();\n abortRun();\n startRun();\n}", "function setZoom(value) {\n\t\t$zoomSliderFull.css(\"width\", value);\n\t\t$zoomCursor.css(\"left\", parseInt($zoomBar.css(\"left\")) + value - parseInt($zoomCursor.css(\"width\"))/2);\n\t\tjimDevice.setZoom((value/2 + 50) /100);\n\t}", "evZooms(env) {\n for (var i = 0; i < this.selectors.length; i++) {\n var zval = CartoCSS.Tree.Zoom.all;\n for (var z = 0; z < this.selectors[i].zoom.length; z++) {\n zval = this.selectors[i].zoom[z].ev(env).zoom;\n }\n this.selectors[i].zoom = zval;\n }\n }", "function adjustForZoomDelayed() {\n clearTimeout(zoomTimeout);\n zoomTimeout = setTimeout(\"adjustForZoom()\", 10);\n}", "function doZoom(increment) {\n var newZoom = increment === undefined ? d3.event.scale : zoomScale(currentZoom + increment);\n if (currentZoom == newZoom)\n return; // no zoom change\n\n // See what is the current graph window size\n var s = getViewportSize();\n var width = s.w < WIDTH ? s.w : WIDTH;\n var height = s.h < HEIGHT ? s.h : HEIGHT;\n\n // Compute the new offset, so that the graph center does not move\n var zoomRatio = newZoom / currentZoom;\n\n var anchorx = width / 2,\n anchory = height / 2;\n\n var rawx = (anchorx - currentOffset.x) / currentZoom,\n rawy = (anchory - currentOffset.y) / currentZoom,\n\n newOffset = {\n x: currentOffset.x + rawx * (currentZoom - newZoom),\n y: currentOffset.y + rawy * (currentZoom - newZoom)\n };\n\n // Reposition the graph\n repositionGraph(newOffset, newZoom, \"zoom\");\n}", "function AdjustZoomLevel() {\n\tcurrentZoomLevel = map.getZoom();\n}", "setZoom(zoom){\n this.zoom = zoom;\n }", "function zoomIn()\n\t{\n\t\t_3dApp.script(_scriptGen.defaultZoomIn());\n\t}", "function ZoomButton() {\n\tif(gridZoom == 10) {\n\t\tgridZoom = 3;\n\t}\n\telse {\n\t\tgridZoom = 10;\n\t\tUpdateGraphicsZoomMap();\n\t}\n\tUpdateTileMap();\n\tUpdateNoteGrid();\n}", "onPdfZoomChange() {\r\n // If we are already changing the browser zoom level in response to a\r\n // previous extension-initiated zoom-level change, ignore this zoom change.\r\n // Once the browser zoom level is changed, we check whether the extension's\r\n // zoom level matches the most recently sent zoom level.\r\n if (this.changingBrowserZoom_)\r\n return;\r\n\r\n let zoom = this.viewport_.zoom;\r\n if (this.floatingPointEquals(this.browserZoom_, zoom))\r\n return;\r\n\r\n this.changingBrowserZoom_ = this.setBrowserZoomFunction_(zoom).then(\r\n function() {\r\n this.browserZoom_ = zoom;\r\n this.changingBrowserZoom_ = null;\r\n\r\n // The extension's zoom level may have changed while the browser zoom\r\n // change was in progress. We call back into onPdfZoomChange to ensure the\r\n // browser zoom is up to date.\r\n this.onPdfZoomChange();\r\n }.bind(this));\r\n }", "get zoom () {\n return parseInt(this.getAttribute('zoom'), 10);\n }", "setRelativeZoom(factor) {\n this.simcirWorkspace.zoom(true, factor);\n }", "zoomIn () {}", "function handleZoom() {\n hotkeys('command+=, command+-', function (event, handler) {\n switch (handler.key) {\n case \"command+=\":\n terminalMargin += .15;\n terminalFontSize += .2;\n break;\n case \"command+-\":\n terminalMargin -= .15;\n terminalFontSize -= .2;\n break;\n }\n $('#terminalFont').text('.terminal-output, .cmd {font-size:' + terminalFontSize + 'px;}');\n $('#terminalMargin').text('.terminal div {margin-bottom:' + terminalMargin + 'px;}');\n });\n}", "function zoom() {\n this\n .on(\"mousedown.zoom\", mousedown)\n .on(\"mousewheel.zoom\", mousewheel)\n .on(\"mousemove.zoom\", mousemove)\n .on(\"DOMMouseScroll.zoom\", mousewheel)\n .on(\"dblclick.zoom\", dblclick)\n .on(\"touchstart.zoom\", touchstart)\n .on(\"touchmove.zoom\", touchmove)\n .on(\"touchend.zoom\", touchstart);\n }", "refreshZoom() {}", "function zoom(value) {\n return value * zoomLevel;\n}", "function wheelZoom(e){\n var evt=window.event || e;//equalize event object\n var delta=evt.detail? evt.detail*(-120) : evt.wheelDelta; //delta returns +120 when wheel is scrolled up, -120 when scrolled down\n //console.log(\"Wheel Zoom\");\n //console.log(zoom);\n\n if(typeof(delta) === 'number'){\n zoom = zoom + parseInt(delta/12);\n }\n // console.log(zoom);\n\n if(zoom < 80){\n zoom = 80;\n }\n if(zoom > 400){\n zoom = 400;\n }\n if (evt.preventDefault) {//disable default wheel action of scrolling page\n evt.preventDefault();\n }else{\n return false;\n }\n setMatrix();\n drawWorld();\n}", "function zoom(event) {\n event.preventDefault();\n \n scale += event.deltaY * -0.01;\n \n // Restrict scale\n scale = Math.min(Math.max(.5, scale), 4);\n \n // Apply scale transform\n busImage.style.transform = `scale(${scale})`;\n }", "function setCurrentZoom(){ \n var limit = getLimits();\n var countriesWidth = limit[\"maxX\"] - limit[\"minX\"];\n var canvasWidth=getCanvasSize(0);\n var canvasHeight=getCanvasSize(1);\n var zoomX=canvasWidth/countriesWidth;\n \n var countriesHeight = limit[\"maxY\"] - limit[\"minY\"];\n var zoomY=canvasHeight/countriesHeight;\n \n currentZoom = Math.min(zoomX, zoomY)*0.90;\n \n zoomLimits[0] = currentZoom;\n zoomLimits[1] = currentZoom*2048;\n offsetInit = [(canvasWidth-(limit[\"maxX\"]+limit[\"minX\"]))/2, (canvasHeight-(limit[\"maxY\"]+limit[\"minY\"]))/2]\n }", "function changeZoomTo() {\n var x = document.getElementById(\"percent\").value;\n current_zoom = x / 100;\n $panzoom.panzoom(\"zoom\", current_zoom, {\n\tanimate : true,\n\tsilent : true\n });\n instance.setZoom(current_zoom);\n $panzoom.panzoom(\"pan\", -130, -60, {\n\trelative : true,\n\tanimation : true\n });\n $(\"#editor\").offset({\n\ttop : $setTop,\n\tleft : $setLeft\n });\n}", "function zoomIn() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.ratio / c.settings(\"zoomingRatio\")\n });\n}", "function zoomSliderChange(event) {\n let scale = event.target.value / 10;\n canvasControl.setZoomScaler(scale);\n}", "function resetZoom() {\n\tdocument.querySelector('meta[name=\"viewport\"]').setAttribute(\"content\", \"user-scalable=yes\")\n\twindow.myLine.resetZoom();\n\tdocument.querySelector('meta[name=\"viewport\"]').setAttribute(\"content\", \"user-scalable=no\")\n}", "#updateZoom() {\n\n const size = this.#getSize();\n \n var zoom = -this.#diffwheel;\n zoom /= size.y;\n zoom *= this.zoompower;\n \n const ray = this.raycaster.ray.direction;\n\n this.camera.position.x += zoom * ray.x;\n this.camera.position.y += zoom * ray.y;\n this.camera.position.z += zoom * ray.z;\n\n this.#diffwheel = 0;\n }", "setInitialZoom() {\n let me = $(this);\n if (parseFloat(me.find(\"svg\").attr(\"width\")) != 0) {\n let initialZoom = $('.cntBody').width() / parseFloat(me.find(\"svg\").attr(\"width\"));\n me.find(\".sliderZoom\").val(initialZoom);\n me.find(\".sliderZoom\").change();\n }\n }", "function zoomin() { \r\n var GFG = document.getElementById(\"cat\"); \r\n var currWidth = GFG.clientWidth; \r\n GFG.style.width = (currWidth + 100) + \"px\"; \r\n }", "resetZoom() {\n this.simcirWorkspace.zoom(false, 1);\n }", "function test1() {\n addWebview('https://github.com');\n setZoom(1.4);\n}", "function zoom(factor){\n var newZoom = currentZoom * factor;\n if (newZoom >= zoomLimits[0] && newZoom <= zoomLimits[1]){\n currentZoom = newZoom;\n offset[0]*=factor;\n offset[1]*=factor;\n initPosition=[0, 0];\n move(0, 0);\n draw();\n }\n }", "set zoomLevel(level) {\n this.zoomTo(Number(level));\n }", "function zoom(canvasarray, zoomlevel, currentscale) {\r\n\tfor(i = 0; i < canvasarray.layers.length; i++) {\r\n\t\tvar zoom = document.getElementById(canvasarray.layers[i].id);\t\t//to make it work with all browsers\r\n\t\tzoom.style.transform = \"scale(\" currentscale+zoomlevel + \")\";\r\n\t\tzoom.style.[\"-o-transform\"] = \"scale(\" currentscale+zoomlevel + \")\";\r\n\t\tzoom.style.[\"webkit-transform\"] = \"scale(\" currentscale+zoomlevel + \")\";\r\n\t\tzoom.style.[\"-moz-transform\"] = \"scale(\" currentscale+zoomlevel + \")\";\r\n\t}\r\n}", "function ZoomPicture(){\r\n if($(PikaElmt).attr(\"Zoom\") === \"1\"){\r\n $(PikaElmt).animate({width: \"400vw\"}, 600);\r\n $(PikaElmt).attr(\"Zoom\", \"2\");\r\n }else if($(PikaElmt).attr(\"Zoom\") === \"2\"){\r\n $(PikaElmt).animate({width: \"99vw\"}, 400);\r\n $(PikaElmt).attr(\"Zoom\", \"0\");\r\n }else {\r\n $(PikaElmt).animate({width: \"150vw\"}, 600);\r\n $(PikaElmt).attr(\"Zoom\", \"1\");\r\n }\r\n}", "function zoom(event) \r\n {\r\n\r\n let delta = Math.sign(event.deltaY);\r\n\r\n if (delta > 0)\r\n {\r\n if (width <= 240)\r\n width += scale;\r\n\r\n if (height <= 260)\r\n height += scale;\r\n }\r\n\r\n if (delta < 0)\r\n {\r\n if (width >= 40)\r\n width -= scale;\r\n\r\n if (height >= 60)\r\n height -= scale;\r\n }\r\n\r\n\r\n lens.style.width = width + \"px\";\r\n lens.style.height = height + \"px\";\r\n }", "function onDocumentMouseWheel(event) {\n \n\n if (event.deltaY < 0) { \n camera.zoom *= 1.25;\n };\n \n if (event.deltaY > 0) { \n if (camera.zoom > 0.1)\n camera.zoom /= 1.25;\n };\n camera.updateProjectionMatrix();\n\n}", "function updateZoomlevel()\n{\n\tThisZoom = map.getZoom();\n\tdocument.getElementById(\"gm_zoomlevel\").value = ThisZoom;\n}", "function triggerRepaint() {\n setTimeout(() => document.body.style.transform = \"scale(1)\", 0)\n setTimeout(() => document.body.style.transform = \"\", 16)\n setTimeout(() => document.body.style.transform = \"scale(1)\", 160)\n setTimeout(() => document.body.style.transform = \"\", 176)\n setTimeout(() => document.body.style.transform = \"scale(1)\", 320)\n setTimeout(() => document.body.style.transform = \"\", 336)\n}", "function move_screen()\r\n{\r\n\tzoomClicked = true;\r\n\tzoomCount++;\r\n\r\n}", "function resize() {\n\n var sx = document.body.clientWidth / window.innerWidth;\n var sy = document.body.clientHeight / window.innerHeight;\n var transform = \"scale(\" + ( 1 / Math.max(sx, sy ) ) + \")\";\n document.body.style.MozTransform = transform;\n document.body.style.WebkitTransform = transform;\n document.body.style.OTransform = transform;\n document.body.style.msTransform = transform;\n document.body.style.transform = transform;\n\n}", "function scaleBrowser() {\n // Scale session viewport for current window\n const tab = browser.querySelector('.browser');\n const browserDim = browser.getBoundingClientRect();\n const width = (browserDim.width - 80) / session.viewport.width;\n const height = (browserDim.height - 80) / session.viewport.height;\n const scale = Math.min(width, height).toFixed(2);\n tab.style.setProperty('transform', `scale(${scale})`);\n\n const tabDim = tab.getBoundingClientRect();\n tab.style.setProperty('top', `${((browserDim.height - tabDim.height) / 2).toFixed(2)}px`);\n tab.style.setProperty('left', `${((browserDim.width - tabDim.width) / 2).toFixed(2)}px`);\n}", "function zoom(e) { \r\n\t\t\r\n\t//get canvas position and add it to current mouse position\t\r\n\t\r\n\tvar obj = document.getElementById('canvas');\r\n\t\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\t\r\n\tif (obj.offsetParent) {\r\n\t\tdo {\r\n\t\t\tleft += obj.offsetLeft;\r\n\t\t\ttop += obj.offsetTop;\r\n\t\t} while (obj = obj.offsetParent);\t\r\n\t}\r\n \r\n\tmouseX = e.clientX - canvas.offsetLeft;\r\n\tmouseY = e.clientY - canvas.offsetTop;\r\n\t\r\n\t\r\n\t// re-calculate the new max and min values for the real and imaginary axii\r\n\t\r\n\tvar xZoom = mouseX / CANVAS_WIDTH;\r\n\tvar yZoom = mouseY / CANVAS_HEIGHT;\r\n\t\r\n\tvar rangeRe = MaxRe - MinRe;\r\n\tvar centerRe = MinRe + rangeRe * xZoom;\r\n\t\r\n\tMinRe = centerRe - rangeRe/4;\r\n\tMaxRe = centerRe + rangeRe/4;\r\n\t\r\n\tvar rangeIm = MaxIm + Math.abs(MinIm);\r\n\tvar centerIm = MinIm +( (1.0 - yZoom)*rangeIm);\r\n\t\r\n\tMinIm = centerIm - rangeIm/4;\r\n\tMaxIm = MinIm+(MaxRe-MinRe)*CANVAS_HEIGHT/CANVAS_WIDTH;\r\n\t\r\n\tRe_factor = (MaxRe-MinRe)/(CANVAS_WIDTH-1);\r\n\tIm_factor = (MaxIm-MinIm)/(CANVAS_HEIGHT-1);\r\n\t\r\n\tdrawJulia();\t\t// re-draw the set\r\n\t\r\n}", "onWindowResize() {\n let zoom = this.zoom;\n if (zoom == 'auto') {\n let wZoom = Math.max(1, Math.floor(window.innerWidth / ((this.targetWidth) ? this.targetWidth : window.innerWidth)));\n let hZoom = Math.max(1, Math.floor(window.innerHeight / ((this.targetHeight) ? this.targetHeight : window.innerHeight)));\n zoom = Math.min(wZoom, hZoom);\n }\n let w = Math.ceil(window.innerWidth / zoom);\n let h = Math.ceil(window.innerHeight / zoom);\n this.setSize(w, h, zoom);\n }", "function listening_zoom(){\n\t\t\t\t\t\tWindow_information[\"visual_width\"] =aux_function()[4]\n \tWindow_information[\"visual_height\"] =aux_function()[5]\n var know_change = (Window_information[\"visual_width\"]/2) - (Window_information[\"browser_width\"]/2)\n debug[\"checking device width\"][1] ? console.log(Window_information[\"visual_width\"]) : \"\"\n if(know_change != $(\".html_page\").offset()[\"left\"]){\n $(\".html_page\").offset({\n left: know_change\n })\n }\n\n }", "function zoomFactor_Changed(value) {\n var ss = $(\"#spreadSheet\").wijspread(\"spread\");\n var sheet = ss.getActiveSheet();\n sheet.zoom(value);\n}", "zoomMap() {\n PaintGraph.Pixels.zoomExtent(this.props.map, this.props.bbox)\n window.refreshTiles()\n window.updateTiles()\n }", "function zoomIn() {\n _zoomLevel = _krpano().get('view.fov') - 20;\n _krpano().call('zoomto(' + _zoomLevel + ',smooth())');\n _krpano().set('view.fov', _zoomLevel);\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n const speed = 2;\n if (Date.now() - lastUpdate > mspf) {\n let e = window.event || e; // old IE support\n let delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n cameraDistance += delta * speed;\n cameraDistance = Math.min(Math.max(cameraDistance, cameraMinDistance), cameraMaxDistance);\n cameraPosition = vec4(cameraDistance, 0., 0., 0.);\n upPosition = add(cameraPosition, vec4(0., 1., 0., 0.));\n\n requestAnimFrame(render);\n lastUpdate = Date.now();\n }\n}", "function zoom() {\n var translate = d3.event.translate,\n scale = d3.event.scale;\n svg.attr(\"transform\", \"translate(\" + translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom(scale,isZ)\n{\n\tif(!isZ)\n\t{\n\t\tscale=scale.clamp(0.10,10);\t\n\t\tviewBox.z/=scale;\t\t\n\t}\t\n\tvar oldw=viewBox.w;\n\tvar oldh=viewBox.h;\t\n\tif(isZ)\n\t{\n\t\tviewBox.z=scale;\n\t\t\n\t}\n\tviewBox.z=viewBox.z.clamp(viewBox.zMin,viewBox.zMax);\n\tviewBox.w=DEFWIDTH*viewBox.z;\t\n\tviewBox.h=viewBox.w;\t\n\t\n\t\n\tviewBox.x-=(viewBox.w-oldw)/2;\n\tviewBox.y-=(viewBox.h-oldh)/2;\t\n\t\n\tupdateViewBox();\n\tif(!isZ)\n\t{\n\t\tupdateZoomSlider();\n\t}\n}", "function scrollWheel(e)\n{\n if (e.deltaY < 0)\n zoomValue = Math.min(zoomValue + 100, 1600);\n else if (e.deltaY > 0)\n zoomValue = Math.max(zoomValue - 100, 300);\n\n if (e.deltaY != 0)\n updateZoom();\n}", "function TextualZoomControl() {\n }", "function zoom() {\n svgGroup.attr(\"transform\", `translate(${d3.event.translate})scale(${d3.event.scale})`);\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function rezoomMap(zoom) {\n\tMAP_ZOOM = zoom;\n\t\n\treinitMap();\n}", "function zoom() {\n //console.log(\"zoom\");\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\r\n zoomlevel = $(\"#myRange\").eq(0).val()\r\n recalc()\r\n}", "function doZoom( increment ) {\n newZoom = increment === undefined ? d3.event.scale \n\t\t\t\t\t: zoomScale(currentZoom+increment);\n if( currentZoom == newZoom )\n\treturn;\t// no zoom change\n\n // See if we cross the 'show' threshold in either direction\n if( currentZoom<SHOW_THRESHOLD && newZoom>=SHOW_THRESHOLD )\n\tsvg.selectAll(\"g.label\").classed('on',true);\n else if( currentZoom>=SHOW_THRESHOLD && newZoom<SHOW_THRESHOLD )\n\tsvg.selectAll(\"g.label\").classed('on',false);\n\n // See what is the current graph window size\n s = getViewportSize();\n width = s.w<WIDTH ? s.w : WIDTH;\n height = s.h<HEIGHT ? s.h : HEIGHT;\n\n // Compute the new offset, so that the graph center does not move\n zoomRatio = newZoom/currentZoom;\n newOffset = { x : currentOffset.x*zoomRatio + width/2*(1-zoomRatio),\n\t\t y : currentOffset.y*zoomRatio + height/2*(1-zoomRatio) };\n\n // Reposition the graph\n repositionGraph( newOffset, newZoom, \"zoom\" );\n }", "function ZoomableView() { }", "function updateZoom(delta) {\n const newZoomLevel = zoomLevel + delta;\n if (newZoomLevel < 0 || newZoomLevel >= zooms.length) {\n return;\n }\n\n zoomLevel = newZoomLevel;\n updateUiCallback();\n}", "function smoothZoom(map, n, c, s) {\n if (g_zoomTimer) {\n window.clearTimeout(g_zoomTimer);\n }\n var ln = c;\n //console.log('[DEV] zoom() %s', cnt);\n if (ln == n) {\n if (ln == 18) {\n infoWindowOnZoomFinished();\n }\n return;\n } else if (s == 'out') {\n map.setZoom(n);\n return;\n } else {\n g_zoomTimer = window.setTimeout(function() {\n smoothZoom(map, n, c + 1, s);\n map.setZoom(ln);\n }, 87); // 87ms\n }\n //console.log('[DEV] dir %s, cnt %s max %s',s, c, n);\n}", "function updateZoom(x)\n{\n var oldVal = parseInt(zoomValueLabel.innerHTML);\n if (x != false)\n {\n xOffset = (xOffset / oldVal * zoomValue) >> 0;\n yOffset = (yOffset / oldVal * zoomValue) >> 0;\n }\n zoomValueLabel.innerHTML = zoomValue;\n fillCanvas();\n}", "function setZoom(zoomIn){\n \tvar zoom = ol.animation.zoom({\n \tresolution: map.getView().getResolution()\n });\n map.beforeRender(zoom);\n if(zoomIn){\n \tview.setZoom(view.getZoom()+1);\n }else{\n \tview.setZoom(view.getZoom()-1);\n } \n}", "function remCalibrate() {\n\t//document.documentElement.style.fontSize = window.innerWidth/100 + 'px';\n\t var aspect_ratio = (window.innerHeight/window.innerWidth)/0.75\n var vwh = window.innerWidth/100\n var rem = Math.max(8,Math.min(24,vwh*aspect_ratio))\n\n document.documentElement.style.fontSize = rem + 'px';\n}", "function ControllerZoomLevel(e) {\r\n 'use strict';\r\n var sel = this.parentNode.zoomsel;\r\n magzoom = sel.selectedIndex;\r\n checkZoomLevel(magzoom, this.parentNode);\r\n zoomImage(sel.options[sel.selectedIndex].value, this.parentNode.canvas);\r\n}", "function setRemUnit() {\n var rem = docEl.clientWidth / 10\n docEl.style.fontSize = rem + 'px'\n }", "handleZoom (newZoomLevel, focalPoint)\n {\n // If the zoom level provided is invalid, return false\n if (!this.isValidOption('zoomLevel', newZoomLevel))\n return false;\n\n // While zooming, don't update scroll offsets based on the scaled version of diva-inner\n this.viewerState.viewportObject.removeEventListener('scroll', this.boundScrollFunction);\n\n // If no focal point was given, zoom on the center of the viewport\n if (!focalPoint)\n {\n const viewport = this.viewerState.viewport;\n const currentRegion = this.viewerState.renderer.layout.getPageRegion(this.settings.currentPageIndex);\n\n focalPoint = {\n anchorPage: this.settings.currentPageIndex,\n offset: {\n left: (viewport.width / 2) - (currentRegion.left - viewport.left),\n top: (viewport.height / 2) - (currentRegion.top - viewport.top)\n }\n };\n }\n\n const pageRegion = this.viewerState.renderer.layout.getPageRegion(focalPoint.anchorPage);\n\n // calculate distance from cursor coordinates to center of viewport\n const focalXToCenter = (pageRegion.left + focalPoint.offset.left) -\n (this.settings.viewport.left + (this.settings.viewport.width / 2));\n const focalYToCenter = (pageRegion.top + focalPoint.offset.top) -\n (this.settings.viewport.top + (this.settings.viewport.height / 2));\n\n const getPositionForZoomLevel = function (zoomLevel, initZoom)\n {\n const zoomRatio = Math.pow(2, zoomLevel - initZoom);\n\n //TODO(jeromepl): Calculate position from page top left to viewport top left\n // calculate horizontal/verticalOffset: distance from viewport center to page upper left corner\n const horizontalOffset = (focalPoint.offset.left * zoomRatio) - focalXToCenter;\n const verticalOffset = (focalPoint.offset.top * zoomRatio) - focalYToCenter;\n\n return {\n zoomLevel: zoomLevel,\n anchorPage: focalPoint.anchorPage,\n verticalOffset: verticalOffset,\n horizontalOffset: horizontalOffset\n };\n };\n\n this.viewerState.options.zoomLevel = newZoomLevel;\n let initialZoomLevel = this.viewerState.oldZoomLevel;\n this.viewerState.oldZoomLevel = this.settings.zoomLevel;\n const endPosition = getPositionForZoomLevel(newZoomLevel, initialZoomLevel);\n this.viewerState.options.goDirectlyTo = endPosition.anchorPage;\n this.viewerState.verticalOffset = endPosition.verticalOffset;\n this.viewerState.horizontalOffset = endPosition.horizontalOffset;\n\n this.viewerState.renderer.transitionViewportPosition({\n duration: this.settings.zoomDuration,\n parameters: {\n zoomLevel: {\n from: initialZoomLevel,\n to: newZoomLevel\n }\n },\n getPosition: (parameters) =>\n {\n return getPositionForZoomLevel(parameters.zoomLevel, initialZoomLevel);\n },\n onEnd: (info) =>\n {\n this.viewerState.viewportObject.addEventListener('scroll', this.boundScrollFunction);\n\n if (info.interrupted)\n this.viewerState.oldZoomLevel = newZoomLevel;\n }\n });\n\n // Send off the zoom level did change event.\n this.publish(\"ZoomLevelDidChange\", newZoomLevel);\n\n return true;\n }", "function zoomBoard() {\r\n\tvar lbounds = paper.project.activeLayer.bounds;\r\n\tvar vbounds = {\r\n\t\twidth: canvas.width,\r\n\t\theight: canvas.height\r\n\t};\r\n\r\n\tvar zoomFactorW = (vbounds.width * 0.9) / 480;\r\n\tvar zoomFactorH = (vbounds.height * 0.9) / 320;\r\n\r\n\tzoomFactorW <= zoomFactorH ? paper.view.zoom = zoomFactorW : paper.view.zoom = zoomFactorH;\r\n\t\r\n\t//lbounds.width <= lbounds.height ? (vbounds.width * 0.9) / 480 : (vbounds.height * 0.9) / 320;\r\n\t//paper.view.zoom = zoomFactor;\r\n}", "function setZoom(bbox) {\n var scale = Math.min(elWidth / bbox.width, elHeight / bbox.height);\n scale = Math.min(scale, scale0 * maxZoom);\n var translate = [elWidth / 2 - scale * (bbox.x + bbox.width / 2),\n elHeight / 2 - scale * (bbox.y + bbox.height / 2)];\n // testrect.attr(bbox);\n return zoom.scale(scale).translate(translate);\n }" ]
[ "0.7327614", "0.7327614", "0.7226405", "0.7171419", "0.6890248", "0.6853931", "0.67065376", "0.6682666", "0.65893877", "0.6543071", "0.653001", "0.6487431", "0.6479684", "0.6447626", "0.6445381", "0.6366776", "0.63504165", "0.6331688", "0.6328432", "0.6309554", "0.6305625", "0.62866044", "0.62544626", "0.6234248", "0.62222886", "0.62091595", "0.62044317", "0.62008125", "0.6144768", "0.61396354", "0.61083686", "0.61078125", "0.6096811", "0.60947955", "0.6086394", "0.60784626", "0.60770714", "0.60710067", "0.60662574", "0.60296494", "0.602302", "0.6019416", "0.6010036", "0.6007249", "0.59886295", "0.59796405", "0.59763026", "0.5971162", "0.59303045", "0.592863", "0.5913049", "0.5908744", "0.58911073", "0.58878314", "0.5883697", "0.58774716", "0.5874243", "0.58591586", "0.58487105", "0.5793652", "0.5783167", "0.57780874", "0.5772903", "0.5771191", "0.5768232", "0.57627696", "0.5757605", "0.5755865", "0.57308704", "0.5725918", "0.57157224", "0.57086664", "0.57044727", "0.57044727", "0.57044727", "0.57044727", "0.57044727", "0.5699025", "0.56939155", "0.568282", "0.5676279", "0.5671504", "0.56711096", "0.5664664", "0.56612074", "0.56565905", "0.56446", "0.5628369", "0.56125194", "0.56088674", "0.5608307", "0.56072533", "0.5606643", "0.56063706", "0.56028664", "0.55926234", "0.558305", "0.55775034", "0.5577298", "0.55730724" ]
0.63762826
15
Sends everything except i & ESC to the handler in background_page. i & ESC are special because they control insert mode which is local state to the page. The key will be are either a single ascii letter or a keymodifier pair, e.g. for control a. Note that some keys will only register keydown events and not keystroke events, e.g. ESC.
function onKeydown(event) { var keyChar = ""; if (linkHintsModeActivated) return; // Ignore modifier keys by themselves. if (event.keyCode > 31) { var keyIdentifier = event.keyIdentifier; // On Windows, the keyIdentifiers for non-letter keys are incorrect. See // https://bugs.webkit.org/show_bug.cgi?id=19906 for more details. if (platform == "Windows" || platform == "Linux") keyIdentifier = keyIdentifierCorrectionMap[keyIdentifier] || keyIdentifier; unicodeKeyInHex = "0x" + keyIdentifier.substring(2); keyChar = String.fromCharCode(parseInt(unicodeKeyInHex)).toLowerCase(); // Enter insert mode when the user enables the native find interface. if (keyChar == "f" && !event.shiftKey && ((platform == "Mac" && event.metaKey) || (platform != "Mac" && event.ctrlKey))) { enterInsertMode(); return; } if (event.shiftKey) keyChar = keyChar.toUpperCase(); if (event.ctrlKey) keyChar = "<c-" + keyChar + ">"; if (event.metaKey) keyChar = null; } if (insertMode && event.keyCode == keyCodes.ESC) { // Note that we can't programmatically blur out of Flash embeds from Javascript. if (event.srcElement.tagName != "EMBED") { // Remove focus so the user can't just get himself back into insert mode by typing in the same input box. if (isInputOrText(event.srcElement)) { event.srcElement.blur(); } exitInsertMode(); } } else if (findMode) { if (event.keyCode == keyCodes.ESC) exitFindMode(); else if (keyChar) { handleKeyCharForFindMode(keyChar); // Don't let the space scroll us if we're searching. if (event.keyCode == keyCodes.space) event.preventDefault(); } // Don't let backspace take us back in history. else if (event.keyCode == keyCodes.backspace || event.keyCode == keyCodes.deleteKey) { handleDeleteForFindMode(); event.preventDefault(); } else if (event.keyCode == keyCodes.enter) handleEnterForFindMode(); } else if (!insertMode && !findMode && keyChar) { if (currentCompletionKeys.indexOf(keyChar) != -1) { event.preventDefault(); event.stopPropagation(); } keyPort.postMessage(keyChar); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionScreenKeyHandler(key) \n{\n switch (key)\n {\n case \"Escape\":\n game.context = '0';\n game.levelNumber = 0;\n break;\n \n case \"ArrowLeft\":\n if (game.levelNumber > 0) game.levelNumber--;\n break;\n\n case \"ArrowRight\":\n if (game.levelNumber < showPage.length - 1) game.levelNumber++;\n break;\n }\n}", "function SetKeyHandler(event)\n{\n var key = event.charCode || event.keyCode || 0;\n var page = GetState(\"page\");\n \n switch(page)\n {\n case \"movies\" : SetMainKeyHandler(key, event);\n break;\n \n case \"tvshows\": SetMainKeyHandler(key, event);\n break;\n \n case \"music\" : SetMainKeyHandler(key, event);\n break; \n \n case \"system\" : SetSystemKeyHandler(key, event);\n break; \n \n case \"popup\" : SetPopupKeyHandler(key);\n break;\n }\n}", "function onKeyDown(e) {\n // do not handle key events when not in input mode\n if (!imode) {\n return;\n }\n\n // only handle special keys here\n specialKey(e);\n }", "function usualKeys(e) {\n\t\t\tview.put(String.fromCharCode(e.which));\n\t\t\treturn false;\n\t\t}", "function DoKeyDown (e) {\n\tif (e.keyCode == 8)\n\t{\n\t\t//Backspace - prevent going back a page\n\t\te.preventDefault();\n\t}\n\tTrackKeyOn(e.keyCode);\n\t/*if (e.keyCode == 87)\n\t{\n\t\tTrackKeyOn(\"w\");\n\t\twKey = true;\n\t\treturn;\n\t}*/\n\t//Debug(e.keyCode);\n}", "function DoKeyDown (e) {\n\tif (e.keyCode === 8)\n\t{\n\t\t//Backspace - prevent going back a page\n\t\te.preventDefault();\n\t}\n\telse if (e.keyCode === 87)\n\t{\n\t\twKey = true;\n\t}\n\telse if (e.keyCode === 65)\n\t{\n\t\taKey = true;\n\t}\n\telse if (e.keyCode === 83)\n\t{\n\t\tsKey = true;\n\t}\n\telse if (e.keyCode === 68)\n\t{\n\t\tdKey = true;\n\t}\n\t\n\t//console.log(e.keyCode);\n}", "function sendRealKeyboardEvent() {\r\n page.sendEvent('keypress', page.event.key.Space);\r\n page.sendEvent('keypress', page.event.key.Backspace);\r\n}", "handleNonLetterKeys(e) {\n\n switch (e.keyCode) {\n case 37: //left arrow\n case 38: //up arrow\n case 39: //right arrow\n case 40: //down arrow\n break;\n case 16: //shift\n break;\n case 9: //tab\n break;\n }\n }", "function hotKeys (event) {\r\n\r\n // Get details of the event dependent upon browser\r\n event = (event) ? event : ((window.event) ? event : null);\r\n eventKey = event;\r\n // We have found the event.\r\n if (event) {\r\n\r\n // Hotkeys require that either the control key or the alt key is being held down\r\n if (event.keyCode > 111 && event.keyCode < 123) {\r\n\r\n var actionCode = event.keyCode; //save the current press PF?\r\n\r\n // Now scan through the user-defined array to see if character has been defined.\r\n for (var i = 0; i < keyActions.length; i++) {\r\n\r\n // See if the next array element contains the Hotkey character\r\n if (keyActions[i].character == actionCode) {\r\n\r\n // Yes - pick up the action from the table\r\n var action;\r\n\r\n // If the action is a hyperlink, create JavaScript instruction in an anonymous function\r\n if (keyActions[i].actionType.toLowerCase() == \"link\") {\r\n action = new Function ('location.href =\"' + keyActions[i].param + '\"');\r\n }\r\n\r\n // If the action is JavaScript, embed it in an anonymous function\r\n else if (keyActions[i].actionType.toLowerCase() == \"code\") {\r\n action = new Function (keyActions[i].param);\r\n }\r\n\r\n // Error - unrecognised action.\r\n else {\r\n alert ('Hotkey Function Error: Action should be \"link\" or \"code\"');\r\n break;\r\n }\r\n\r\n // At last perform the required action from within an anonymous function.\r\n action ();\r\n\r\n // Hotkey actioned - exit from the for loop.\r\n break;\r\n }\r\n }\r\n }else if( (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 97 && event.keyCode <= 113) || (event.keyCode >= 48 && event.keyCode <= 57)){\r\n\t\talterado = true;\r\n\t}\r\n }\r\n return true;\r\n}", "function key_pressed(ev){\n\n\te = ev || window.event;\n\t\n\tif (e.keyCode) code = e.keyCode;\n\telse if (e.which) code = e.which;\n\t\n\t/*\n\t* if being dragged, the Escape key (27) drop all the files back to their original location\n\t*/\n\n\tif(drag_manager.drag_flag){\n\n\t\tif(code==27){\n\n\t\t\tscreen_refresh_no_ajax();\n\n\t\t}\n\n\t}\n\n\tdrag_manager.active_key=code;\n\n}", "function handleKeyDown(event) {\n wgl.listOfPressedKeys[event.keyCode] = true;\n // console.log(\"keydown - keyCode=%d, charCode=%d\", event.keyCode, event.charCode);\n }", "function onKeyDown(e){\n switch(e.keyCode){\n case 38: // up arrow\n e.preventDefault();\n prevSlide();\n break;\n case 40: // down arrow\n e.preventDefault();\n nextSlide();\n break;\n case 27: // escape\n e.preventDefault();\n gotoStart();\n break;\n }\n }", "function handleKeys(e){\n\tswitch (e.keyCode){\n\t\tcase 67: \t\t\t// 'c'\n\t\t\tcomposeWindowOpener();\n\t\t\tbreak;\n\t\tcase 88: \t\t\t// 'x'\n\t\t\tselectEmail();\n\t\t\tbreak;\n\t\tcase 38: \t\t\t// 'up'\n\t\tcase 74: \t\t\t// 'j'\n\t\t\trowSelector(-1);\n\t\t\tbreak;\n\t\tcase 40: \t\t\t// 'down'\n\t\tcase 75: \t\t\t// 'k'\n\t\t\trowSelector(1);\n\t\t\tbreak;\n\t\tcase 46: \t\t\t// 'del'\n\t\t\tcloseAd_keyEvent();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"not listening to keyCode\",e.keyCode);\n\t}\n}", "function _enable_keyboard_navigation() {\r\n $(document).keydown(_keyboard_action);\r\n }", "onKey(event) {\n let code;\n code = event.charCode || event.keyCode;\n\n if (event.type === 'keydown' && code === 27) {\n //topmost modal only\n if (this.chrome.parentNode === document.body) {\n this.close('onEscKey');\n }\n }\n }", "function onKeyDown(e) {\r\n\r\n // escape on problem keys\r\n for (var i = 0; i < hardIgnoreKeys.length; i++) {\r\n if (e.key === hardIgnoreKeys[i]) {\r\n return;\r\n }\r\n }\r\n\r\n console.log(e.key);\r\n if (!keyIntervals[e.key]) {\r\n keyIntervals[e.key] = window.setInterval(function() {whenKeyDown(e.key)}, keydowntime);\r\n // might need this line to handle immediate key down->up\r\n whenKeyDown(e.key);\r\n }\r\n}", "_init() {\n\t\twindow.onkeydown = e => {\n\t\t\tfor(let i in this._keys) {\n\t\t\t\tif(this._keys[i].keyCode === e.keyCode) {\n\t\t\t\t\tthis._keys[i].isActive = true;\n\n\t\t\t\t\tif(this._keys[i].action !== null)\n\t\t\t\t\t\tthis._keys[i].action(e);\n\t\t\t\t}\n\t\t\t\telse continue;\n\t\t\t}\n\n\t\t\tif(this._debugEnable)\n\t\t\t\tconsole.log(e);\n\t\t}\n\n\t\twindow.onkeyup = e => {\n\t\t\tfor(let i in this._keys) {\n\t\t\t\tif(this._keys[i].keyCode === e.keyCode)\n\t\t\t\t\tthis._keys[i].isActive = false;\n\t\t\t\telse continue;\n\t\t\t}\n\t\t}\n\t}", "function shortcut(e) {\r\n if (e.keyCode == 85 && !uiLoaded) {\r\n loadUI();\r\n }\r\n if (e.keyCode == 76 && uiLoaded) {\r\n $(\"#output\").html(\"\");\r\n }\r\n }", "function setupCmdCtrlKeys() {\n document.onkeydown = function (e) {\n if (state.siteKey && (e.ctrlKey || e.metaKey) && e.keyCode === 83) {\n saveFile();\n return false;\n }\n };\n }", "function onKeydown(e) {\r\n if (e.altKey || e.metaKey) {\r\n return;\r\n }\r\n switch ((window.event) ? e.keyCode : e.which) {\r\n case KeyEvent.DOM_VK_RIGHT:\r\n case KeyEvent.DOM_VK_D:\r\n case KeyEvent.DOM_VK_NUMPAD6:\r\n if (e.shiftKey)\r\n onLastPage();\r\n else\r\n onNextPage();\r\n return false;\r\n break;\r\n case KeyEvent.DOM_VK_LEFT:\r\n case KeyEvent.DOM_VK_A:\r\n case KeyEvent.DOM_VK_NUMPAD4:\r\n if (e.shiftKey)\r\n onFirstPage();\r\n else\r\n onPreviousPage();\r\n return false;\r\n break;\r\n case KeyEvent.DOM_VK_R:\r\n case KeyEvent.DOM_VK_NUMPAD5:\r\n case KeyEvent.DOM_VK_NPAD5KEY:\r\n window.location.reload();\r\n return false;\r\n break;\r\n case KeyEvent.DOM_VK_ESCAPE:\r\n if (isFullscreen) {\r\n onToggleFullscreen();\r\n return false;\r\n }\r\n return;\r\n break;\r\n }\r\n }", "function getKeyWithESCChars(pGetKeyMode)\n{\n var getKeyMode = K_NONE;\n if (typeof(pGetKeyMode) == \"number\")\n getKeyMode = pGetKeyMode;\n\n var userInput = console.getkey(getKeyMode);\n if (userInput == KEY_ESC) {\n switch (console.inkey(K_NOECHO|K_NOSPIN, 2)) {\n case '[':\n switch (console.inkey(K_NOECHO|K_NOSPIN, 2)) {\n case 'V':\n userInput = KEY_PAGE_UP;\n break;\n case 'U':\n userInput = KEY_PAGE_DOWN;\n break;\n }\n break;\n case 'O':\n switch (console.inkey(K_NOECHO|K_NOSPIN, 2)) {\n case 'P':\n userInput = \"\\1F1\";\n break;\n case 'Q':\n userInput = \"\\1F2\";\n break;\n case 'R':\n userInput = \"\\1F3\";\n break;\n case 'S':\n userInput = \"\\1F4\";\n break;\n case 't':\n userInput = \"\\1F5\";\n break;\n }\n default:\n break;\n }\n }\n\n return userInput;\n}", "handleControlShiftDownKey() {\n this.extendToParagraphEnd();\n this.checkForCursorVisibility();\n }", "[_addHotkeyListener] () {\n document.addEventListener('keyup', event => {\n if (this[_editMode]) {\n const $info = this[_infoText];\n const $main = this[_main];\n const $settings = this[_settings];\n const code = event.keyCode;\n const editClass = this.selector.get('className', 'edit');\n const find = this[_reservedKeys].find(key => key === code);\n\n switch (true) {\n case code === 27:\n this[_editMode] = false;\n $info.innerHTML = '';\n $main.classList.remove(editClass);\n $settings.classList.remove(editClass);\n break;\n case find !== undefined:\n $info.innerHTML = 'Key is used or reserved';\n break;\n default:\n this[_replaceHotkey](event);\n $main.classList.remove(editClass);\n $settings.classList.remove(editClass);\n }\n } else {\n Object.values(this[_config].params).forEach(item => {\n if (item.code === event.keyCode) {\n item.callback();\n }\n });\n }\n });\n }", "setupKeyhandler() {\n $(window).keydown(function(event) {\n switch(event.which) {\n case 37: // left\n UTILS.emitEvent(EVENTS.KEY_LEFT);\n event.preventDefault();\n break;\n case 39: // right\n UTILS.emitEvent(EVENTS.KEY_RIGHT);\n event.preventDefault();\n break;\n case 38: // up\n UTILS.emitEvent(EVENTS.KEY_UP);\n event.preventDefault();\n break;\n case 40: // down\n UTILS.emitEvent(EVENTS.KEY_DOWN);\n event.preventDefault();\n break;\n case 13: // enter for reset\n location.reload(true);\n break;\n }\n });\n }", "function fIEPKeyDown() {\n var key_f5 = 116;\n var key_esc = 27;\n var key_back = 8;\n var key_enter = 13;\n var sOrigen = '';\n if (key_f5 == event.keyCode) {\n parent.document.PagActual.location.href = self.document.location.href;\n location.reload();\n parent.document.PagActual.focus();\n event.keyCode = 0;\n return false;\n } else if (event.altKey && (event.keyCode == 37 || event.keyCode == 39)) {\n return false; \t\t //CTRL+C CTRL+V CTRL+X CTRL+E\n } else if (event.ctrlKey && (event.keyCode == 67 || event.keyCode == 86 || event.keyCode == 88 || event.keyCode == 69)) {\n return true;\n } else if (event.ctrlKey && (event.keyCode != 17)) {\n event.keyCode = 0;\n return false;\n } else if (event.ctrlKey && (event.keyCode == 78 || event.keyCode == 82)) {\n return false; // Ctrl+H // Ctrl+Q\n } else if (event.ctrlKey && (event.keyCode == 72 || event.keyCode == 81)) {\n return false;\n } else if (event.keyCode == 122) {\n event.keyCode = 0;\n return false;\n } else if (event.keyCode == 114) {\n event.keyCode = 0;\n return false;\n } // window.event.keyCode == 505???\n\n sOrigen = event.srcElement.type;\n if (sOrigen == undefined)\n sOrigen = '';\n else\n sOrigen = sOrigen.toLowerCase();\n\n if (key_back == event.keyCode) {\n switch (sOrigen) {\n case 'text':\n case 'textarea':\n case 'password':\n if (event.srcElement.readOnly) {\n event.keyCode = 0;\n return false;\n }\n break;\n default:\n //\"select-one\", undefined\n event.keyCode = 0;\n return false;\n }\n /*\t\t} else if (key_esc==event.keyCode) {\n switch(sOrigen) {\n case 'select-one':\n var sObj=event.srcElement.id;\n if (document.forms.length==1) {\n var oObj=eval(\"document.forms[0].\" + sObj);\n oObj.selectedIndex=-1;\n }\n } */\n }\n}", "function preOnKeyDown(event) {\n if (!event)\n event = getEvent(event);\n disableCtrlKey(event);\n if (event.keyCode == 0)\n return false;\n\n // if (event.keyCode == \"9\") {\n // var o = event.srcElement;\n // if (o.id == \"lkpMaterialCode\") {\n // alert(el(\"lkpMaterialCode\").tabIndex + \"|\" + el(\"txtLength\").tabIndex + \"|\" + el(\"lkpUnitCode\").tabIndex);\n // }\n // }\n switch (event.keyCode) {\n case 112: // F1\n {\n event.keyCode = 0;\n event.returnValue = false;\n }\n case 113: // F2\n case 114: // F3\n case 115: // F4\n case 116: // F5\n case 117: // F6\n case 121: // F10\n case 122, 27: // F11, Esc\n {\n if (action == \"ModalWindow\") {\n ppsc().closeModalWindow();\n }\n else {\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n }\n }\n }\n }\n\n if (event.altKey && event.keyCode == 37) {\n alert('The key you are trying to use is invalid in this context.');\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n if (event.altKey && event.keyCode == 115 || event.ctrlKey && event.keyCode == 115) {\n alert('The key you are trying to use is invalid in this context.');\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n //To block the Refresh, New Window, Zoom\n if (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82 || event.keyCode == 107 || event.keyCode == 109)) {\n return;\n }\n\n //Backspace is only allowed in textarea and input text and password\n if (event.keyCode == 8) {\n var obj = event.srcElement || event.target;\n if (obj.type == \"text\" || obj.type == \"textarea\" || obj.type == \"password\" || obj.tagName == \"DIV\") {\n if (obj.readOnly == true)\n return false;\n else\n return true;\n }\n return false;\n }\n\n if (event.keyCode == 13 && action == \"ModalWindow\") {\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n}", "keyPressed({keyPressed, keyCode}){\n console.log('keypressed, keycode', keyPressed, keyCode);\n if(keyCode === 70){ //f\n requestFullScreen();\n return;\n }\n if(keyCode === 80){ //p\n requestPointerLock();\n return;\n }\n let key = keyCode + '';\n this.keysCurrentlyPressed[key] = {keyPressed, keyCode, clock:new Clock()};\n }", "function activateESC() {\r\n if (settings.enableESC) {\r\n $(window).bind('keydown', function(e) {\r\n if (e.keyCode === 27) {\r\n disableSlick();\r\n if (settings.setCookie) {\r\n setSlickCookie();\r\n }\r\n }\r\n });\r\n }\r\n }", "type ( keyText, modifiers ) {\n modifiers = modifiers || [];\n\n webContents.sendInputEvent({\n type: 'keyDown',\n keyCode: keyText,\n modifiers: modifiers,\n });\n webContents.sendInputEvent({\n type: 'char',\n keyCode: keyText,\n modifiers: modifiers,\n });\n webContents.sendInputEvent({\n type: 'keyUp',\n keyCode: keyText,\n modifiers: modifiers,\n });\n }", "function addKeyPressHandler() {\r\n 'use strict';\r\n document.body.addEventListener('keyup', function (event) {\r\n event.preventDefault();\r\n console.log(event.keyCode);\r\n\r\n // 7.1.3 - Listening for the keypress event\r\n if (event.keyCode === ESC_KEY) {\r\n hideDetails();\r\n }\r\n });\r\n}", "function keydown(e){\n e= e || window.event\n var propagate= true\n var ele= e.target || e.srcElement\n if(ele.nodeType == 3) ele= ele.parentNode\n var code= e.keyCode || e.which\n var input= (ele.tagName == 'INPUT' || ele.tagName == 'TEXTAREA')\n if(code >= 112 && code <= 123){ // F1-12\n shortcut_call(code-112)\n propagate= false\n } else if(code == 32 && !input){ // space\n el('bar').select()\n propagate= false\n } else if(ele.id == 'bar'){ // up and down\n if(code == 38) backCmd()\n else if(code == 40) nextCmd()}\n if(!propagate){\n e.cancelBubble= true; e.returnValue= false\n if(e.stopPropagation)\n {e.stopPropagation(); e.preventDefault()}\n return false}}", "function onKeyPress (e) {\r\n\r\n var code = e.keyCode;\r\n\r\n switch (code){\r\n \r\n case 35: //End\r\n go( slidesSize );\r\n break;\r\n \r\n case 36: //Home\r\n rewind();\r\n break;\r\n\r\n case 37://Left Arrow\r\n case 33://PageUp\r\n case 37://Backspace\r\n e.preventDefault();\r\n prev();\r\n break;\r\n\r\n case 39://Right Arrow\r\n case 34://PageDown\r\n case 32://Space bar\r\n e.preventDefault();\r\n next();\r\n break;\r\n\r\n case 13://Return\r\n fullScreen();\r\n break;\r\n case 122://F11\r\n e.preventDefault();\r\n fullScreen();\r\n break;\r\n\r\n }\r\n }", "function Browser_DecodeKeyEvent(event)\n{\n\t// Initialize key stroke.\n\tvar keyStroke = \"\";\n\n\t// Checks for modifiers key.\n\tif (event.shiftKey || event.shiftLeft)\n\t\tkeyStroke += \"Shift,\";\n\tif (event.ctrlKey || event.ctrlLeft)\n\t\tkeyStroke += \"Control,\";\n\tif (event.altKey || event.altLeft)\n\t\tkeyStroke += \"Alt,\";\n\tif (window.__BROWSER_WINDOW_DOWN)\n\t\tkeyStroke += \"Window,\";\n\n\t// Check for platform key code.\n\tswitch (event.keyCode)\n\t{\n\t\tcase 0x01: keyStroke += \"LButton\"; break;\n\t\tcase 0x02: keyStroke += \"RButton\"; break;\n\t\tcase 0x03: keyStroke += \"Cancel\"; break;\n\t\tcase 0x04: keyStroke += \"MButton\"; break;\n\t\tcase 0x08: keyStroke += \"BACKSPACE\"; break;\n\t\tcase 0x09: keyStroke += \"Tab\"; break;\n\t\tcase 0x0c: keyStroke += \"Clear\"; break;\n\t\tcase 0x0d: keyStroke += \"Enter\"; break;\n\t\tcase 0x10: keyStroke += \"Shift\"; break;\n\t\tcase 0x11: keyStroke += \"Control\"; break;\n\t\tcase 0x12: keyStroke += \"Alt\"; break;\n\t\tcase 0x13: keyStroke += \"PAUSE\"; break;\n\t\tcase 0x14: keyStroke += \"CapsLock\"; break;\n\t\tcase 0x1b: keyStroke += \"Escape\"; break;\n\t\tcase 0x20: keyStroke += \"SPACEBAR\"; break;\n\t\tcase 0x21: keyStroke += \"PgUp\"; break;\n\t\tcase 0x22: keyStroke += \"PgDown\"; break;\n\t\tcase 0x23: keyStroke += \"End\"; break;\n\t\tcase 0x24: keyStroke += \"Home\"; break;\n\t\tcase 0x25: keyStroke += \"Left\"; break;\n\t\tcase 0x26: keyStroke += \"Up\"; break;\n\t\tcase 0x27: keyStroke += \"Right\"; break;\n\t\tcase 0x28: keyStroke += \"Down\"; break;\n\t\tcase 0x29: keyStroke += \"Select\"; break;\n\t\tcase 0x2a: keyStroke += \"PrintScreen\"; break;\n\t\tcase 0x2b: keyStroke += \"Execute\"; break;\n\t\tcase 0x2c: keyStroke += \"Snapshot\"; break;\n\t\tcase 0x2d: keyStroke += \"Insert\"; break;\n\t\tcase 0x2e: keyStroke += \"Delete\"; break;\n\t\tcase 0x2f: keyStroke += \"Help\"; break;\n\t\tcase 0x30: keyStroke += \"0\"; break;\n\t\tcase 0x31: keyStroke += \"1\"; break;\n\t\tcase 0x32: keyStroke += \"2\"; break;\n\t\tcase 0x33: keyStroke += \"3\"; break;\n\t\tcase 0x34: keyStroke += \"4\"; break;\n\t\tcase 0x35: keyStroke += \"5\"; break;\n\t\tcase 0x36: keyStroke += \"6\"; break;\n\t\tcase 0x37: keyStroke += \"7\"; break;\n\t\tcase 0x38: keyStroke += \"8\"; break;\n\t\tcase 0x39: keyStroke += \"9\"; break;\n\t\tcase 0x41: keyStroke += \"A\"; break;\n\t\tcase 0x42: keyStroke += \"B\"; break;\n\t\tcase 0x43: keyStroke += \"C\"; break;\n\t\tcase 0x44: keyStroke += \"D\"; break;\n\t\tcase 0x45: keyStroke += \"E\"; break;\n\t\tcase 0x46: keyStroke += \"F\"; break;\n\t\tcase 0x47: keyStroke += \"G\"; break;\n\t\tcase 0x48: keyStroke += \"H\"; break;\n\t\tcase 0x49: keyStroke += \"I\"; break;\n\t\tcase 0x4a: keyStroke += \"J\"; break;\n\t\tcase 0x4b: keyStroke += \"K\"; break;\n\t\tcase 0x4c: keyStroke += \"L\"; break;\n\t\tcase 0x4d: keyStroke += \"M\"; break;\n\t\tcase 0x4e: keyStroke += \"N\"; break;\n\t\tcase 0x4f: keyStroke += \"O\"; break;\n\t\tcase 0x50: keyStroke += \"P\"; break;\n\t\tcase 0x51: keyStroke += \"Q\"; break;\n\t\tcase 0x52: keyStroke += \"R\"; break;\n\t\tcase 0x53: keyStroke += \"S\"; break;\n\t\tcase 0x54: keyStroke += \"T\"; break;\n\t\tcase 0x55: keyStroke += \"U\"; break;\n\t\tcase 0x56: keyStroke += \"V\"; break;\n\t\tcase 0x57: keyStroke += \"W\"; break;\n\t\tcase 0x58: keyStroke += \"X\"; break;\n\t\tcase 0x59: keyStroke += \"Y\"; break;\n\t\tcase 0x5a: keyStroke += \"Z\"; break;\n\t\tcase 0x5b: keyStroke += \"LWin\"; break;\n\t\tcase 0x5c: keyStroke += \"RWin\"; break;\n\t\tcase 0x5d: keyStroke += \"Apps\"; break;\n\t\tcase 0x60: keyStroke += \"0\"; break;\n\t\tcase 0x61: keyStroke += \"1\"; break;\n\t\tcase 0x62: keyStroke += \"2\"; break;\n\t\tcase 0x63: keyStroke += \"3\"; break;\n\t\tcase 0x64: keyStroke += \"4\"; break;\n\t\tcase 0x65: keyStroke += \"5\"; break;\n\t\tcase 0x66: keyStroke += \"6\"; break;\n\t\tcase 0x67: keyStroke += \"7\"; break;\n\t\tcase 0x68: keyStroke += \"8\"; break;\n\t\tcase 0x69: keyStroke += \"9\"; break;\n\t\tcase 0x6a: keyStroke += \"Multiply\"; break;\n\t\tcase 0x6b: keyStroke += \"Add\"; break;\n\t\tcase 0x6c: keyStroke += \"Separator\"; break;\n\t\tcase 0x6d: keyStroke += \"Subtract\"; break;\n\t\tcase 0x6e: keyStroke += \"Decimal\"; break;\n\t\tcase 0x6f: keyStroke += \"Divide\"; break;\n\t\tcase 0x70: keyStroke += \"F1\"; break;\n\t\tcase 0x71: keyStroke += \"F2\"; break;\n\t\tcase 0x72: keyStroke += \"F3\"; break;\n\t\tcase 0x73: keyStroke += \"F4\"; break;\n\t\tcase 0x74: keyStroke += \"F5\"; break;\n\t\tcase 0x75: keyStroke += \"F6\"; break;\n\t\tcase 0x76: keyStroke += \"F7\"; break;\n\t\tcase 0x77: keyStroke += \"F8\"; break;\n\t\tcase 0x78: keyStroke += \"F9\"; break;\n\t\tcase 0x79: keyStroke += \"F10\"; break;\n\t\tcase 0x7a: keyStroke += \"F11\"; break;\n\t\tcase 0x7b: keyStroke += \"F12\"; break;\n\t\tcase 0x7c: keyStroke += \"F13\"; break;\n\t\tcase 0x7d: keyStroke += \"F14\"; break;\n\t\tcase 0x7e: keyStroke += \"F15\"; break;\n\t\tcase 0x7f: keyStroke += \"F16\"; break;\n\t\tcase 0x80: keyStroke += \"F17\"; break;\n\t\tcase 0x81: keyStroke += \"F18\"; break;\n\t\tcase 0x82: keyStroke += \"F19\"; break;\n\t\tcase 0x83: keyStroke += \"F20\"; break;\n\t\tcase 0x84: keyStroke += \"F21\"; break;\n\t\tcase 0x85: keyStroke += \"F22\"; break;\n\t\tcase 0x86: keyStroke += \"F23\"; break;\n\t\tcase 0x87: keyStroke += \"F24\"; break;\n\t\tcase 0x90: keyStroke += \"NumLock\"; break;\n\t\tcase 0x91: keyStroke += \"ScrollLock\"; break;\n\t\tcase 0xba: keyStroke += \"OEM_1\"; break;\n\t\tcase 0xbb: keyStroke += \"OEM_Plus\"; break;\n\t\tcase 0xbc: keyStroke += \"OEM_Comma\"; break;\n\t\tcase 0xbd: keyStroke += \"OEM_Minus\"; break;\n\t\tcase 0xbe: keyStroke += \"OEM_Period\"; break;\n\t\tcase 0xbf: keyStroke += \"OEM_2\"; break;\n\t\tcase 0xc0: keyStroke += \"OEM_3\"; break;\n\t\tcase 0xdb: keyStroke += \"OEM_4\"; break;\n\t\tcase 0xdc: keyStroke += \"OEM_5\"; break;\n\t\tcase 0xdd: keyStroke += \"OEM_6\"; break;\n\t\tcase 0xde: keyStroke += \"OEM_7\"; break;\n\t\tcase 0xdf: keyStroke += \"OEM_8\"; break;\n\t\tcase 0xe5: keyStroke += \"ProcessKey\"; break;\n\t}\n\n\t// Returns the key stroke.\n\treturn keyStroke;\n}", "function KeyAscii(e) {\r\n\t return (document.all) ? e.keyCode : e.which;\r\n }", "function KeyAscii(e) {\r\n\t return (document.all) ? e.keyCode : e.which;\r\n }", "function setUpShortcutKeys() {\n\n //bind keys to main window\n $(document).keyup(function(e){\n\n //console.log(e.which);\n\n //show next image on x key\n if (e.which == 88 ) {\n $(\"#nextImg\").click();\n //alert( \"x pressed\" );\n return false;\n }\n\n //show previous image on z key\n if (e.which == 90) {\n $(\"#prevImg\").click();\n //alert( \"z pressed\" );\n return false;\n }\n\n if (e.which == 67) {\n clearSelectedThumbs();\n return false;\n }\n\n });\n\n\n }", "function onKeyPress(e) {\n var code = 'which' in e ? e.which : e.keyCode;\n\n // do not handle key presses if not in input mode\n if (!imode) {\n return;\n }\n\n // code should be zero if non-printing; filter out <enter> since it is\n // non-printing for our application\n if (code != 0 && code != KEYCODES.ENTER) {\n // insert character it into the input line text variable and also\n // update the span's elements for display\n var before = itext.substr(0,ipos) + String.fromCharCode(code); // insert before cursor\n var after = itext.substr(ipos,itext.length - ipos);\n itext = before + after;\n ispanBefore.data = before;\n ispanAfter.data = after.substr(1); // skip cursor character\n ipos += 1;\n }\n }", "function handleKeyDown(event) {\n currentlyPressedKeys[event.keyCode] = true;\n }", "function keepKeys(ev) {\n\tif (document.layers) { \n\t\tkeys += String.fromCharCode(ev.which); \n\t\twindow.status = 'Key pressed: ' + String.fromCharCode(ev.which);\n\t\t} \n\telse { \n\t\tkeys += String.fromCharCode(event.keyCode); \n\t\twindow.status = 'Key pressed: ' + String.fromCharCode(event.keyCode);\t\t\n\t\t}\n\t}", "handleControlDownKey() {\n this.moveToNextParagraph();\n this.checkForCursorVisibility();\n }", "function whenIType(keys) {\n var boundKeyCombos = [];\n var executor = _jquery2.default.Callbacks();\n\n function keypressHandler(e) {\n if (!_dialog.popup.current && executor) {\n executor.fire(e);\n }\n }\n\n function defaultPreventionHandler(e) {\n e.preventDefault();\n }\n\n // Bind an arbitrary set of keys by calling bindKeyCombo on each triggering key combo.\n // A string like \"abc 123\" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.\n function bindKeys(keys) {\n var keyCombos = keys && keys.split ? _jquery2.default.trim(keys).split(' ') : [keys];\n\n keyCombos.forEach(function (keyCombo) {\n bindKeyCombo(keyCombo);\n });\n }\n\n function hasUnprintables(keysArr) {\n // a bit of a heuristic, but works for everything we have. Only the unprintable characters are represented with > 1-character names.\n var i = keysArr.length;\n while (i--) {\n if (keysArr[i].length > 1 && keysArr[i] !== 'space') {\n return true;\n }\n }\n return false;\n }\n\n // bind a single key combo to this handler\n // A string like \"abc 123\" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.\n function bindKeyCombo(keyCombo) {\n var keysArr = keyCombo instanceof Array ? keyCombo : keyComboArrayFromString(keyCombo.toString());\n var eventType = hasUnprintables(keysArr) ? 'keydown' : 'keypress';\n\n boundKeyCombos.push(keysArr);\n (0, _jquery2.default)(document).bind(eventType, keysArr, keypressHandler);\n\n // Override browser/plugins\n (0, _jquery2.default)(document).bind(eventType + ' keyup', keysArr, defaultPreventionHandler);\n }\n\n // parse out an array of (modifier+key) presses from a single string\n // e.g. \"12ctrl+3\" becomes [ \"1\", \"2\", \"ctrl+3\" ]\n function keyComboArrayFromString(keyString) {\n var keysArr = [];\n var currModifiers = '';\n\n while (keyString.length) {\n var modifierMatch = keyString.match(/^(ctrl|meta|shift|alt)\\+/i);\n var multiCharMatch = keyString.match(multiCharRegex);\n\n if (modifierMatch) {\n currModifiers += modifierMatch[0];\n keyString = keyString.substring(modifierMatch[0].length);\n } else if (multiCharMatch) {\n keysArr.push(currModifiers + multiCharMatch[0]);\n keyString = keyString.substring(multiCharMatch[0].length);\n currModifiers = '';\n } else {\n keysArr.push(currModifiers + keyString[0]);\n keyString = keyString.substring(1);\n currModifiers = '';\n }\n }\n\n return keysArr;\n }\n\n function addShortcutsToTitle(selector) {\n var elem = (0, _jquery2.default)(selector);\n var title = elem.attr('title') || '';\n var keyCombos = boundKeyCombos.slice();\n var existingCombos = elem.data('boundKeyCombos') || [];\n var shortcutInstructions = elem.data('kbShortcutAppended') || '';\n var isFirst = !shortcutInstructions;\n var originalTitle = isFirst ? title : title.substring(0, title.length - shortcutInstructions.length);\n\n while (keyCombos.length) {\n var keyCombo = keyCombos.shift();\n var comboAlreadyExists = existingCombos.some(function (existingCombo) {\n return _underscore2.default.isEqual(keyCombo, existingCombo);\n });\n if (!comboAlreadyExists) {\n shortcutInstructions = appendKeyComboInstructions(keyCombo.slice(), shortcutInstructions, isFirst);\n isFirst = false;\n }\n }\n\n if (isMac) {\n shortcutInstructions = shortcutInstructions.replace(/Meta/ig, '\\u2318') //Apple cmd key\n .replace(/Shift/ig, '\\u21E7'); //Apple Shift symbol\n }\n\n elem.attr('title', originalTitle + shortcutInstructions);\n elem.data('kbShortcutAppended', shortcutInstructions);\n elem.data('boundKeyCombos', existingCombos.concat(boundKeyCombos));\n }\n\n function removeShortcutsFromTitle(selector) {\n var elem = (0, _jquery2.default)(selector);\n var shortcuts = elem.data('kbShortcutAppended');\n\n if (!shortcuts) {\n return;\n }\n\n var title = elem.attr('title');\n elem.attr('title', title.replace(shortcuts, ''));\n elem.removeData('kbShortcutAppended');\n elem.removeData('boundKeyCombos');\n }\n\n //\n function appendKeyComboInstructions(keyCombo, title, isFirst) {\n if (isFirst) {\n title += ' (' + AJS.I18n.getText('aui.keyboard.shortcut.type.x', keyCombo.shift());\n } else {\n title = title.replace(/\\)$/, '');\n title += AJS.I18n.getText('aui.keyboard.shortcut.or.x', keyCombo.shift());\n }\n\n keyCombo.forEach(function (key) {\n title += ' ' + AJS.I18n.getText('aui.keyboard.shortcut.then.x', key);\n });\n title += ')';\n\n return title;\n }\n\n bindKeys(keys);\n\n return whenIType.makeShortcut({\n executor: executor,\n bindKeys: bindKeys,\n addShortcutsToTitle: addShortcutsToTitle,\n removeShortcutsFromTitle: removeShortcutsFromTitle,\n keypressHandler: keypressHandler,\n defaultPreventionHandler: defaultPreventionHandler\n });\n}", "attachKeyHandler(domElement) {\n var term = this;\n\n // character encodings for special characters (when no modifying \n // characters are pressed)\n const normalKeyMap = {\n Backspace : \"\\x7f\",\n Delete : \"\\x1b[3~\",\n Escape : \"\\x1b\",\n Tab : \"\\t\",\n Enter : \"\\r\",\n ArrowUp : \"\\x1b[A\",\n ArrowDown : \"\\x1b[B\",\n ArrowRight : \"\\x1b[C\",\n ArrowLeft : \"\\x1b[D\",\n PageUp : \"\\x1b[5~\",\n PageDown : \"\\x1b[6~\",\n Home : \"\\x1b[H\",\n End : \"\\x1b[F\",\n Insert : \"\\x1b[2~\",\n F1 : \"\\x1bOP\",\n F2 : \"\\x1bOQ\",\n F3 : \"\\x1bOR\",\n F4 : \"\\x1bOS\",\n F5 : \"\\x1b[15~\",\n F6 : \"\\x1b[17~\",\n F7 : \"\\x1b[18~\",\n F8 : \"\\x1b[19~\",\n F9 : \"\\x1b[20~\",\n F10 : \"\\x1b[21~\",\n F11 : \"\\x1b[23~\",\n F12 : \"\\x1b[24~\",\n };\n\n const handlerFunction = function(event) {\n event.preventDefault();\n var seq = \"\";\n\n if (event.key.length == 1 && !event.ctrlKey && !event.altKey) {\n // use the event key for non-special characters without modifier\n // keys\n seq = event.key;\n }\n else if (!event.ctrlKey && !event.altKey && !event.shiftKey) {\n // use the normal key map for special characters when no\n // modifier characters are down\n if (normalKeyMap[event.key]) {\n seq = normalKeyMap[event.key];\n }\n }\n else if (event.ctrlKey && !event.altKey) {\n if (event.key == '=') { // Zoom in handler\n term.redimension(\n terminal.fontSize * 1.2,\n terminal.pixWidth + 10,\n terminal.pixHeight + 10\n );\n return;\n }\n else if (event.key == '-') { // Zoom out handler\n term.redimension(\n terminal.fontSize / 1.2,\n terminal.pixWidth + 10,\n terminal.pixHeight + 10,\n );\n return;\n }\n else if (event.key == 'r' && event.ctrlKey) {\n // get rid of this if you want ctrl-r functionality\n // ctrl-shift-r still works\n }\n else if (event.key.length == 1) { // basic ASCII control codes\n var ascii = event.key.charCodeAt(0);\n\n if (ascii >= 0x40 && ascii <= 0x5F) {\n seq = String.fromCharCode(ascii - 0x40);\n }\n else if (ascii >= 0x61 && ascii <= 0x7A) {\n seq = String.fromCharCode(ascii - 0x60);\n }\n }\n }\n \n terminal.sendKeyboard(seq);\n }\n\n domElement.addEventListener('keydown', handlerFunction, true);\n }", "onKeyDown(event) {\n const { escape } = this.props;\n\n if (event.keyCode === 27 && escape) {\n this.onClose();\n }\n\n if (SCROLLING_KEYS[event.keyCode]) {\n event.preventDefault();\n return false;\n }\n }", "function controlDown(e)\r\n\t\t{\r\n\t\t\tif (e.keyCode in keyMap)\r\n\t\t\t{\r\n\t\t\t\tkeyMap[e.keyCode] = true;\r\n\t\t\t}\t\r\n\t\t}", "keyHandler(event){\n switch(event.which){\n // previous slide\n case 33: // pgup\n case 37: // left\n event.preventDefault();\n this.previous();\n break;\n\n // next slide\n case 32: // spacebar\n case 34: // pgdn\n case 39: // right\n event.preventDefault();\n this.next()\n break;\n\n // autoplay\n case 65: // a\n event.preventDefault();\n this.toggleAutoplay();\n break;\n\n // fullscreen\n case 70: // f\n event.preventDefault();\n this.fullscreen();\n break;\n\n // goto home slide\n case 72: // h\n event.preventDefault();\n this.goto(1);\n break;\n\n // play / pause\n case 80: // p\n event.preventDefault();\n this.playAudio();\n break;\n\n // transcript / table of contents\n case 84: // t\n event.preventDefault();\n this.toggleTranscript();\n break;\n }\n }", "handleControlShiftUpKey() {\n this.extendToParagraphStart();\n this.checkForCursorVisibility();\n }", "function ui_keys(){\n init();\n\tuiEvent.key(arguments[0], arguments[1]);\n}", "function keyHandler(event) {\n // Apparently we still see Firefox shortcuts like control-T for a new tab - \n // checking for modifiers lets us ignore those\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return false;\n } \n \n // We also don't want to interfere with regular user typing\n if (event.target && event.target.nodeName) {\n var targetNodeName = event.target.nodeName.toLowerCase();\n if (targetNodeName == \"textarea\" ||\n (targetNodeName == \"input\" && event.target.type &&\n event.target.type.toLowerCase() == \"text\")) {\n return false;\n }\n }\n \n var k = String.fromCharCode(event.charCode).toLowerCase();\n \n if (k in ACTIONS) {\n //the parameter indicates whether the user held 'shift' \n //while pressing the key\n ACTIONS[k][2](event.charCode < 97);\n return true;\n }\n return false;\n}", "function keyHandling(){\n\twindow.kill = false;\n\twindow.addEventListener(\"keydown\", function(e){//console.log(e.keyCode);\n\t\tif(e.keyCode == 18 && !window.kill){window.kill = true;}\n\t});\n\twindow.addEventListener(\"keyup\", function(e){window.kill = false;});\n}", "function setPianoKeyHandlers() {\n\tfor (let i = 0; i < pianoKeys.length; i += 1) {\n\t\tpianoKeys[i].addEventListener('click', () => selectHandler(i));\n\t}\n\tdocument.addEventListener('keydown', (event) => {\n\t\tswitch (event.code) {\n\t\t\tcase 'KeyS': return selectHandler(0);\n\t\t\tcase 'KeyE': return selectHandler(1);\n\t\t\tcase 'KeyD': return selectHandler(2);\n\t\t\tcase 'KeyR': return selectHandler(3);\n\t\t\tcase 'KeyF': return selectHandler(4);\n\t\t\tcase 'KeyJ': return selectHandler(5);\n\t\t\tcase 'KeyI': return selectHandler(6);\n\t\t\tcase 'KeyK': return selectHandler(7);\n\t\t\tcase 'KeyO': return selectHandler(8);\n\t\t\tcase 'KeyL': return selectHandler(9);\n\t\t\tcase 'KeyP': return selectHandler(10);\n\t\t\tcase 'Semicolon': return selectHandler(11);\n\t\t\tcase 'Space': return submitHandler();\n\t\t}\n\t});\n}", "function specialKey(e) {\n var code = 'which' in e ? e.which : e.keyCode;\n\n if (code == KEYCODES.ENTER) {\n e.preventDefault();\n imodeCb(endInputMode());\n\n return true;\n }\n else if (code == KEYCODES.LEFT) {\n // move the cursor left one position (if possible)\n if (ipos > 0) {\n ipos -= 1;\n\n // update cursor: the cursor will always assume a character from\n // the input text\n var before = itext.substr(0,ipos);\n var after = itext.substr(ipos,itext.length - ipos);\n ispanBefore.data = before;\n ispanAfter.data = after.substr(1);\n cursorText.data = after[0];\n }\n\n return true;\n }\n else if (code == KEYCODES.RIGHT) {\n // move the cursor right one position (if possible); the cursor may\n // sit at the first invalid position after the input text (where text\n // may be appended to the line)\n if (ipos < itext.length) {\n ipos += 1;\n\n // update cursor: the cursor may be in an invalid position, in\n // which case the space character MUST be set to its text node\n var before = itext.substr(0,ipos);\n var after = itext.substr(ipos,itext.length - ipos);\n ispanBefore.data = before;\n ispanAfter.data = after.substr(1);\n cursorText.data = ipos >= itext.length ? ' ' : after[0];\n }\n\n return true;\n }\n else if (code == KEYCODES.UP || code == KEYCODES.DOWN) {\n // no action as of now\n e.preventDefault();\n\n return true;\n }\n else if (code == KEYCODES.BACKSPACE) {\n // move the cursor back a position and remove the character at that\n // position\n if (ipos > 0) {\n ipos -= 1;\n\n var before = itext.substr(0,ipos);\n var after = itext.substr(ipos+1,itext.length - ipos);\n ispanBefore.data = before;\n ispanAfter.data = after.substr(1);\n itext = before + after;\n cursorText.data = ipos >= itext.length ? ' ' : after[0];\n }\n\n // prevent the browser from being stupid and navigating back\n e.preventDefault();\n\n return true;\n }\n else if (code == KEYCODES.HOME) {\n // place cursor at the beginning of a line\n ipos = 0;\n ispanBefore.data = \"\";\n ispanAfter.data = itext.substr(1);\n cursorText.data = itext[0];\n\n return true;\n }\n else if (code == KEYCODES.END) {\n // place cursor at the end of a line\n ipos = itext.length;\n ispanBefore.data = itext;\n ispanAfter.data = \"\";\n cursorText.data = \" \";\n\n return true;\n }\n\n return false;\n }", "_onKeyDown(event) {\n switch (event.keyCode) {\n case 87: // w\n case 38: // up\n this.keys.forward = true;\n break;\n case 65: // a\n case 37: //left\n this.keys.left = true;\n break;\n case 83: // s\n case 40: //down\n this.keys.backward = true;\n break;\n case 68: // d\n case 39: //right\n this.keys.right = true;\n break;\n case 32: // SPACE\n this.keys.space = true;\n break;\n case 16: // SHIFT\n this.keys.run = true;\n break;\n }\n }", "function handleKey(code,isDown){\n switch(code){\n case 32: keyShoot = isDown; break;\n case 37: keyLeft = isDown; break;\n case 38:\n keyUp = isDown;\n document.getElementById(\"instructions\").classList.add(\"hidden\");\n break;\n case 39: keyRight = isDown; break;\n }\n }", "function addKeyNavigation() {\n $(document).bind('keydown', checkKey);\n }", "function blockSomeKeys() {\n function keypress(e) {\n if (e.which >= 33 && e.which <= 40) {\n e.preventDefault();\n return false;\n }\n return true;\n }\n window.onkeydown = keypress;\n }", "function onKeyPress(e) {\n const pressed = e.keyCode;\n\n switch(pressed) {\n case 82: // R\n handleRestart();\n break;\n case 83: // S\n handleStartMenu();\n break;\n case 27:\n // Esc\n handlePause();\n break;\n }\n}", "function handleKeyDown(event) {\r\n // storing the pressed state for individual key\r\n currentlyPressedKeys[event.keyCode] = true;\r\n}", "function handler(event)\n {\n if(codes.hasOwnProperty(event.keyCode))\n {\n //if the event is keydown, set down to true, else set to false\n var down = event.type == 'keydown';\n pressed[codes[event.keyCode]] = down;\n\n //we dont want the key press to scroll the broswer window\n //this stops the event from continuing to be processed\n event.preventDefault();\n }\n }", "function keydown(event){switch(event.keyCode){case $mdConstant.KEY_CODE.LEFT_ARROW:event.preventDefault();incrementIndex(-1,true);break;case $mdConstant.KEY_CODE.RIGHT_ARROW:event.preventDefault();incrementIndex(1,true);break;case $mdConstant.KEY_CODE.SPACE:case $mdConstant.KEY_CODE.ENTER:event.preventDefault();if(!locked)select(ctrl.focusIndex);break;}ctrl.lastClick=false;}", "function _enable_keyboard_navigation() {\r\n\t\t\t$(document).keydown(function(objEvent) {\r\n\t\t\t\t_keyboard_action(objEvent);\r\n\t\t\t});\r\n\t\t}", "function processKeys(key) {\n var pressedKey = key.keyCode? key.keyCode : key.charCode;\n // TODO: make this work on IE?\n// alert (pressedKey);\n if (32 === pressedKey) {\n togglePause();\n } else if (37 === pressedKey) {\n userLeft();\n } else if (39 === pressedKey) {\n userRight();\n } else if (38 === pressedKey) {\n userUp();\n } else if (40 === pressedKey) {\n userDown();\n } else if (13 === pressedKey) {\n dismissDialog();\n }\n }", "function Simulator_ProcessOnKeyDown(event)\n{\n\t//user blocking and has designer?\n\tif (__SIMULATOR.UserInteractionBlocked() && __DESIGNER_CONTROLLER)\n\t{\n\t\t//direct forward and immediate return\n\t\treturn __DESIGNER_CONTROLLER.ProcessKeyDown(event.keyCode, event.ctrlKey, event.altKey, event.shiftKey, event);\n\t}\n\t//we only handle this if the window key is not held down\n\tvar bHandle = !window.__BROWSER_WINDOW_DOWN;\n\t//return value\n\tvar bReturn;\n\t//check the keycode first\n\tswitch (event.keyCode)\n\t{\n\t\t//escape pressed\n\t\tcase 0x1b:\n\t\t\t//are we in qa?\n\t\t\tif (__QA_ON)\n\t\t\t{\n\t\t\t\t//fire the end QA event\n\t\t\t\tQA_NotifyEscape();\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x10: //Shift\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_SHIFT_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_SHIFT_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_SHIFT_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x11: //Control\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_CTRL_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_CTRL_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_CTRL_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x12: //Alt\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_ALT_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_ALT_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_ALT_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x5b: //LWin\n\t\tcase 0x5c: //RWin\n\t\t\t//dont handle this\n\t\t\tbHandle = false;\n\t\t\t//Set window down as true\n\t\t\twindow.__BROWSER_WINDOW_DOWN = true;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//in block mode? or in camera mode\n\t\t\tif (__SIMULATOR.UserInteractionBlocked() || __SIMULATOR.Camera && __SIMULATOR.Camera.bInProgress && !__QA_ON)\n\t\t\t{\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//was this a directional key?\n\t\t\t\tswitch (event.keyCode)\n\t\t\t\t{\n\t\t\t\t\tcase 0x25://\"Left\"\n\t\t\t\t\tcase 0x27://\"Right\"\n\t\t\t\t\tcase 0x26://\"Up\"\n\t\t\t\t\tcase 0x28://\"Down\"\n\t\t\t\t\tcase 0x6b://\"Add\"\n\t\t\t\t\tcase 0x6d://\"Subtract\"\n\t\t\t\t\t\t//do we have a last focused?\n\t\t\t\t\t\tif (__SIMULATOR.LastFocusedObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//ensure its valid\n\t\t\t\t\t\t\tif (__SIMULATOR.LastFocusedObject.HTML && __SIMULATOR.LastFocusedObject.HTML.parentNode && Get_Bool(__SIMULATOR.LastFocusedObject.Properties[__NEMESIS_PROPERTY_ENABLED], true))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//trigger a on key down here without affecting any event processing\n\t\t\t\t\t\t\t\tvar result = __SIMULATOR.LastFocusedObject.ProcessOnKeyDown(Browser_DecodeKeyEvent(event));\n\t\t\t\t\t\t\t\t//we got a block\n\t\t\t\t\t\t\t\tif (result && result.Block)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//was this cursor movement (affects the scrolling)\n\t\t\t\t\t\t\t\t\tswitch (event.keyCode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase 0x26://\"Up\"\n\t\t\t\t\t\t\t\t\t\tcase 0x28://\"Down\"\n\t\t\t\t\t\t\t\t\t\tcase 0x25://\"Left\"\n\t\t\t\t\t\t\t\t\t\tcase 0x27://\"Right\"\n\t\t\t\t\t\t\t\t\t\t\t//always block\n\t\t\t\t\t\t\t\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//dont handle this\n\t\t\t\t\t\t\t\t\tbHandle = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\t//handle this?\n\tif (bHandle)\n\t{\n\t\t//forward to handle key event\n\t\tbReturn = Simulator_ProcessKeyEvent(event);\n\t}\n\t//return\n\treturn bReturn;\n}", "function pageKeyPress(KeyID) {\r\n\t\tif (KeyID == 92) {\r\n\t\t\ttoggleVisibility()\r\n\t\t}\r\n\t\t\r\n\t\tif (designImage.style.display == \"block\") {\r\n\t\t\tif ( KeyID == 91 ) {\r\n\t\t\t\toffsetCurrent.x--\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 93 ) {\r\n\t\t\t\toffsetCurrent.x++\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 44 ) {\r\n\t\t\t\toffsetCurrent.y--\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 46 ) {\r\n\t\t\t\toffsetCurrent.y++\r\n\t\t\t}\r\n\r\n\t\t\tif ( KeyID == 123 ) {\r\n\t\t\t\toffsetCurrent.x -= config.moveInterval\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 125 ) {\r\n\t\t\t\toffsetCurrent.x += config.moveInterval\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 60 ) {\r\n\t\t\t\toffsetCurrent.y -= config.moveInterval\r\n\t\t\t}\r\n\t\t\tif ( KeyID == 62 ) {\r\n\t\t\t\toffsetCurrent.y += config.moveInterval\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (KeyID == 91 || KeyID == 93 || KeyID == 123 || KeyID == 125) {\r\n\t\t\t\tmeasurement.xInput.value = offsetCurrent.x - originalPosition.x\r\n\t\t\t}\r\n\t\t\tif (KeyID == 44 || KeyID == 46 || KeyID == 60 || KeyID == 62) {\r\n\t\t\t\tmeasurement.yInput.value = offsetCurrent.y - originalPosition.y\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (KeyID == 91 || KeyID == 93 || KeyID == 123 || KeyID == 125 || KeyID == 44 || KeyID == 46 || KeyID == 60 || KeyID == 62) {\r\n\t\t\t\tmoveDesignImage()\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "function siteHandleKeyDown(evt) {\n\n if (!evt) evt = window.event;\n\n if (evt.keyCode==\"18\") altpressed = true;\n\n}", "HandleKeyDown(event) {}", "function observeKeyPress(e) {\n if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) closeLightbox();\n }", "function keydown_handler(event)\n{\n\tif (event.defaultPrevented) return;\n\tif (game.handle_key(event.code, true)) return;\n\n\t// cancel the default action to avoid it being handled twice\n\tevent.preventDefault();\n}", "function characterHandler() \n{ \n if (window.VKI.deadkeysOn && window.VKI.dead) // if a dead key has previously been typed\n {\n if (window.VKI.dead != this.firstChild.nodeValue) // and this is not the key that represents the dead key\n {\n for (key in window.VKI.deadkey) // search the deadkey hash table for the previously entered dead key\n {\n if (key == window.VKI.dead) // if this is it\n {\n // since this function is called by an onclick attribute and was dynamically assigned, \"this\" points to td object that was clicked\n if (this.firstChild.nodeValue != \" \") // this is key that was clicked after the dead key was clicked\n {\n for (var z = 0, rezzed = false, dk; dk = window.VKI.deadkey[key][z++];) \n {\n if (dk[0] == this.firstChild.nodeValue) // if typed key found in list attached to dead key\n {\n window.VKI.insert(dk[1]); // insert the dead key modification (instead of the key that was typed)\n rezzed = true;\n break;\n }\n }\n } \n else // if typed key is blank, just display the dead key\n {\n window.VKI.insert(VKI.dead);\n rezzed = true;\n } \n break;\n }\n } // end of search the deadkey hash table for the previously entered dead key\n } // end if current key is not the previously typed dead key\n else \n rezzed = true; // no dead key processing needed\n } // if a dead key has previously been typed\n \n VKI.dead = null; // force user to type a dead key again\n \n // If no insertion done above (rezzed=false) and the clicked key is not blank\n // If key is a dead key, set VKI.dead to it. Otherwise display key\n if (!rezzed && this.firstChild.nodeValue != \"\\xa0\") \n {\n if (VKI.deadkeysOn) \n {\n for (key in VKI.deadkey) \n {\n if (key == this.firstChild.nodeValue) \n {\n VKI.dead = key;\n obj.className += \" dead\";\n if (VKI.shift) \n VKI.modify(\"Shift\");\n if (VKI.alternate) \n VKI.modify(\"AltGr\");\n break;\n }\n }\n if (!VKI.dead) \n VKI.insert(this.firstChild.nodeValue);\n } // if dead keys on \n else \n VKI.insert(this.firstChild.nodeValue); // insert key without modification\n }\n\n VKI.modify(\"\");\n return false; // to be sure that click is not further acted upon.\n}", "function crosswordKeyHandler(event) {\n pencilToggle(event, '.Icon-pencil--1cTxu', 'Icon-pencil-active--1lOAS');\n pauseToggle(event, '.Timer-button--Jg5pv>button', '.buttons-modalButton--1REsR', '.buttons-modalButton--1REsR');\n }", "function doBksp() \n{ \n VKI.target.focus();\n var rng = null;\n if (VKI.target.setSelectionRange) // Not IE\n {\n if (VKI.target.readOnly && VKI.isWebKit) \n rng = [VKI.target.selStart || 0, VKI.target.selEnd || 0];\n else \n rng = [VKI.target.selectionStart, VKI.target.selectionEnd];\n \n if (rng[0] < rng[1]) \n rng[0]++;\n VKI.target.value = VKI.target.value.substr(0, rng[0] - 1) + VKI.target.value.substr(rng[1]);\n VKI.target.setSelectionRange(rng[0] - 1, rng[0] - 1);\n if (VKI.target.readOnly && VKI.isWebKit) \n {\n var range = window.getSelection().getRangeAt(0);\n VKI.target.selStart = range.startOffset;\n VKI.target.selEnd = range.endOffset;\n }\n } \n else if (VKI.target.createTextRange) // IE\n {\n try \n {\n VKI.target.range.select();\n } \n catch(e) \n { \n VKI.target.range = document.selection.createRange(); \n }\n if (!VKI.target.range.text.length) \n VKI.target.range.moveStart('character', -1);\n VKI.target.range.text = \"\";\n } \n else \n VKI.target.value = VKI.target.value.substr(0, VKI.target.value.length - 1);\n \n if (VKI.shift) \n VKI.modify(\"Shift\");\n \n if (VKI.alternate) \n VKI.modify(\"AltGr\");\n \n VKI.target.focus();\n \n return true;\n}", "function captureKeyShortcuts(event) {\n if (false && event.shiftKey && event.altKey && event.code == 'F1') {\n console.log('captureKeyShortcuts: record video');\n recordVideo(10000).then(() => {});\n } else if (event.altKey && event.code == 'IntlBackslash') {\n arc_capture_screenshot();\n } else if (event.ctrlKey && event.code == 'Backquote') {\n console.log('simulate escape');\n setTimeout(() => sendKeyCode(KEY_ESCAPE), 20);\n } \n}", "handleKeys() {\n this.xMove = 0;\n\t\tthis.yMove = 0;\n if (keyIsDown(65)) this.xMove += -this.speed;\n if (keyIsDown(68)) this.xMove += this.speed;\n //s\n if (keyIsDown(83)) this.yMove += this.speed;\n //w\n if (keyIsDown(87)) this.yMove += -this.speed;\n\n if (keyIsDown(32)) {\n this.placeBomb();\n }\n\n }", "onInternalKeyDown(event) {\n const sourceWidget = IdHelper.fromElement(event),\n isFromWidget = sourceWidget && sourceWidget !== this && !(sourceWidget instanceof MenuItem);\n\n if (event.key === 'Escape') {\n // Only close this menu if the ESC was in a child input Widget\n (isFromWidget ? this : this.rootMenu).close();\n return;\n }\n\n super.onInternalKeyDown(event);\n\n // Do not process keys from certain elemens\n if (isFromWidget) {\n return;\n }\n\n if (validKeys[event.key]) {\n event.preventDefault();\n }\n\n const active = document.activeElement,\n el = this.element;\n\n this.navigateFrom(active !== el && el.contains(active) ? active : null, event.key, event);\n }", "function _enable_keyboard_navigation() {\n\t\t\t$(document).keydown(function(objEvent) {\n\t\t\t\t//_keyboard_action(objEvent);\n\t\t\t\talert('teste');\n\t\t\t});\n\t\t}", "function myHandleSpecialKey(e, myname,fordebug){\n\ttry{\n\t\tvar e = window.frames[myname].event || e;\n\t\t//F2 或 ctrl+F3\n\t\tif(e.keyCode==113 || ( e.ctrlKey && e.keyCode==114) ){\n//\t\t\tamarExport(myname); //amarExportNew(myname);\t//amarPrint(myname);\n\t\t\treturn true;\n\t\t}\n\t\tif(e.keyCode==119 && e.ctrlKey ){ \t //CTRL+F8\n\t\t\tamarExportTemplate(myname);\n\t\t\treturn true;\n\t\t}\n\t\tif(fordebug){\n\t\t\tif(e.altKey && e.keyCode == 49){ //alt+1\n\t\t\t\tAsDebug.toggleWindow();\n\t\t\t\treturn true;\n\t\t\t}else if(e.altKey && e.keyCode == 50){ //alt+2\n\t\t\t\tif(typeof OverrideAlt2 == 'function') OverrideAlt2();\n\t\t\t\telse AsDebug.editDW();\n\t\t\t\treturn true;\n\t\t\t}else if(e.altKey && e.keyCode == 51){ //alt+3\n\t\t\t\tAsDebug.reloadCacheAll();\n\t\t\t\treturn true;\n\t\t\t}else if(e.keyCode == \"27\"){ //esc\n\t\t\t\tAsDebug.hideWindow();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}catch(e){\n\t\talert(e.name+\" \"+e.number+\" :\"+e.message); \n\t\treturn true;\t\n\t}\t\t\n\treturn false;\t\t\n}", "function onKeyDown(event) {\n switch (event.keyCode) {\n case 189: // Minus\n if (document.activeElement == document.body) {\n skipLessImportantSlides = true\n flashIndicator()\n sendSlideNumberToServer(true)\n event.preventDefault()\n }\n break\n case 187: // Plus\n if (document.activeElement == document.body) {\n skipLessImportantSlides = false\n flashIndicator()\n sendSlideNumberToServer(true)\n event.preventDefault()\n }\n break\n\n case 39: // Right arrow\n case 40: // Down arrow\n case 34: // Remote next (PgDn)\n if (document.activeElement == document.body) {\n nextSlide(event.shiftKey)\n event.preventDefault()\n }\n break\n\n case 37: // Left arrow\n case 38: // Up arrow\n case 33: // Remote previous (PgUp)\n case 8: // Backspace\n if (document.activeElement == document.body) {\n prevSlide(event.shiftKey)\n event.preventDefault()\n }\n break\n\n case 67: // C\n if ((document.activeElement == document.body) || (document.activeElement.getAttribute('type') == 'range')) {\n if (slideEls[currentSlideNumber].querySelector('.underline-playground-master')) {\n underlinePlaygroundPlaceInContext()\n }\n }\n break\n\n case 68: // D\n if (event.shiftKey) {\n var SLIDE_INFO = []\n var els = document.querySelectorAll('.presentation > div')\n for (var i = 0, el; el = els[i]; i++) {\n var slideInfo = {}\n slideInfo.filename = (i + 1) + '.jpg'\n slideInfo.skipInCompanion = el.classList.contains('skip-in-companion')\n\n if (el.querySelector('.companion-copy')) {\n slideInfo.copy = el.querySelector('.companion-copy').innerText\n }\n\n if (el.classList.contains('skip-if-pressed-on-time')) {\n slideInfo.skipIfPressedOnTime = true\n }\n\n SLIDE_INFO.push(slideInfo)\n }\n\n document.querySelector('.debug').classList.add('visible')\n document.querySelector('.debug textarea').value = 'var SLIDE_INFO = ' + JSON.stringify(SLIDE_INFO, false, 2)\n document.querySelector('.debug textarea').select()\n document.querySelector('.debug textarea').focus()\n event.preventDefault()\n }\n break\n }\n}", "function getKey(e){\n if (e == null) { // ie\n keycode = event.keyCode;\n } else { // mozilla\n keycode = e.which;\n }\n key = String.fromCharCode(keycode).toLowerCase();\n\n if(key == 'x'){ hideContentModal(); }\n}", "function keyHandler(e) {\n\n var charE = \"E\".charCodeAt(0);\n var charI = \"I\".charCodeAt(0);\n var charM = \"M\".charCodeAt(0);\n\n switch(e.keyCode) {\n\n // export\n case charE:\n\n dataExport();\n break;\n\n // import\n case charI:\n\n dataImport();\n break;\n\n // change mode\n case charM:\n\n break;\n\n }\n\n}", "function keydown(event) {\n keys[event.code] = event;\n }", "function updateKeys() {\n if (keyIsDown(ESCAPE)) {\n wasESC = true;\n } else {\n wasESC = false;\n }\n if (keyIsDown(ENTER)) {\n wasEnter = true;\n } else {\n wasEnter = false;\n }\n}", "function pgn4web_handleKey(e) {\n if (!e) {\n e = window.event;\n }\n\n if (e.altKey || e.ctrlKey || e.metaKey) {\n return true;\n }\n\n keycode = e.keyCode;\n\n switch (keycode) {\n case 37: // left-arrow\n backButton(e);\n break;\n\n case 38: // up-arrow\n startButton(e);\n break;\n\n case 39: // right-arrow\n forwardButton(e);\n break;\n\n case 40: // down-arrow\n endButton(e);\n break;\n\n case 86: // v\n if (numberOfGames > 1) { Init(0); }\n break;\n\n case 66: // b\n Init(currentGame - 1);\n break;\n\n case 78: // n\n Init(currentGame + 1);\n break;\n\n case 77: // m\n if (numberOfGames > 1) { Init(numberOfGames - 1); }\n break;\n\n default:\n return true;\n }\n\n return stopEvProp(e);\n}", "function keyup_handler(event)\n{\n\tgame.handle_key(event.code, false);\n}", "function _enable_keyboard_navigation() {\n\t\t\t$(document).keydown(function(objEvent) {\n\t\t\t\t_keyboard_action(objEvent);\n\t\t\t});\n\t\t}", "onKeyDown(keyName, e, handle) {\n console.log(\"test:onKeyDown\", keyName, e, handle);\n\n if (keyName == \"alt+s\") {\n // alert(\"save key\")\n this.saveClient();\n console.log(e.which);\n }\n\n this.setState({\n output: `onKeyDown ${keyName}`\n });\n }", "function addDefaultKeyEventListener() {\n window.addEventListener(\"keydown\", function(e){\n\n var keyPressed = e.which;\n if (keyPressed == 27) closeClicked(); // ESC\n else if (keyPressed == 73) showInfo(); // I\n else if (keyPressed == 76) toggleLabelVisibility(); // L\n else if (!e.ctrlKey && e.shiftKey) {\n if (keyPressed == 82) controls.reset(); // Shift + R\n else if (keyPressed == 83) { // Shift + S\n var screenShoot = renderer.domElement.toDataURL(\"image/png\");\n var imageUrl = screenShoot.replace(\"image/png\", 'data:application/octet-stream');\n window.open(imageUrl);\n }\n }\n });\n}", "function keyEventsIE() {\n\te = event;\n\te.which = e.keyCode;\n\tkeyEvents(e);\n}", "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\t// Verify the key to show the previous image\n\t\t\tif ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {\n\t\t\t\t// If we�re not showing the first image, call the previous\n\t\t\t\tif ( settings.activeImage != 0 ) {\n\t\t\t\t\tsettings.activeImage = settings.activeImage - 1;\n\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t_disable_keyboard_navigation();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Verify the key to show the next image\n\t\t\tif ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {\n\t\t\t\t// If we�re not showing the last image, call the next\n\t\t\t\tif ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {\n\t\t\t\t\tsettings.activeImage = settings.activeImage + 1;\n\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t_disable_keyboard_navigation();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function keyDownHandler(zEvent) {\n if (zEvent.ctrlKey && zEvent.code === \"KeyE\") {\n ConsolePrint('CONTROL-E KEY DETECTED');\n /* question editor present ? */\n var editor_div_array = document.getElementsByClassName('table-question heading-small ng-binding ng-hide');\n if( editor_div_array.length > 0 )\n {\n ConsolePrint(editor_div_array.length + ' EDITOR(S) DETECTED ');\n \n // Insert \"[; XX ;]\"\n // \n }\n }\n}", "function onKeyDown(event) {\n\t\tswitch (event.keyCode) {\n\t\tcase key.ENTER:\n\t\t\tinsertMention();\n\t\t\tbreak;\n\t\tcase key.UP:\n\t\t\tpopup.select('previous');\n\t\t\tbreak;\n\t\tcase key.DOWN:\n\t\t\tpopup.select('next');\n\t\t\tbreak;\n\t\tcase key.END:\n\t\t\tpopup.select('last');\n\t\t\tbreak;\n\t\tcase key.HOME:\n\t\t\tpopup.select();\n\t\t\tbreak;\n\t\tcase key.PAGE_UP:\n\t\t\tpopup.select('previousPage');\n\t\t\tbreak;\n\t\tcase key.PAGE_DOWN:\n\t\t\tpopup.select('nextPage');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * prevent a few navigation keys from\n\t\t * working when the popup is in view\n\t\t */\n\t\tEvent.stop(event);\n\t}", "function bindEscKey() {\n /**\n * TODO - Part 1 Step 5\n * For this step, add an event listener to document for the 'keydown' event,\n * if the escape key is pressed, use your router to navigate() to the 'home'\n * page. This will let us go back to the home page from the detailed page.\n */\n document.addEventListener('keydown', function(event){\n if (event.key == 'Escape'){\n router.navigate('home', false);\n }\n });\n}", "function KeyDown(elmt, event, Page){\r\n var Key = event.key;\r\n ///alert(Key);\r\n if(Key === \"Enter\"){\r\n $(elmt).blur();\r\n }else if(Key === \"Escape\"){\r\n $(elmt).val($(elmt).attr(\"OriginalValue\"));\r\n }\r\n}", "function keyEvents(e) {\n switch (e.which) {\n case 48: // 0\n case 49: // 1\n case 50: // 2\n case 51: // 3\n case 52: // 4\n case 53: // 5\n case 54: // 6\n case 55: // 7\n case 56: // 8\n case 57: // 9\n setTimeout(fireload, keyTimeOut, keyStack.push(e.which-48)); \n break;\n case 66: // b\n case 87: // w\n\t\t\ttoggle_blank(e.which == 66);\n break;\n case 32: // spacebar\n case 39: // rightkey\n case 40: // downkey\n case 78: // n\n loadslide(currentFileIndex()+1);\n break;\n case 37: // leftkey\n case 38: // upkey\n case 80: // p\n loadslide(currentFileIndex()-1);\n break;\n case 82: // r\n // toggle resolution--\n /* need to make size be read in from a cookie since slides.js is read\n * each time we can't really reset it here... */\n //size = (size==0) ? 1 : 0;\n //loadslide(currentFileIndex());\n break;\n case 84: // t\n loadslide(0);\n break;\n default: \n break;\n }\n}", "function onKeyDown(ev){var isEscape=ev.keyCode===$mdConstant.KEY_CODE.ESCAPE;return isEscape?close(ev):$q.when(true);}", "function keyDown(event) {\r\n keyboard[event.keyCode] = true;\r\n}", "function esc() {\n key = '';\n var element = document.getElementById('gamesModal');\n element.parentNode.removeChild(element);\n document.getElementsByTagName('html')[0].style = \"margin: 0; height: 100%; overflow: inline!important\";\n document.getElementsByTagName('body')[0].style = \"margin: 0; height: 100%; overflow: inline!important\";\n document.getElementById('masterContent').WebkitFilter = 'blur(0px)';\n document.getElementById('masterContent').style.filter = 'blur(0px)';\n background.style = \"display:none;\";\n gameAlive = false;\n window.removeEventListener('keyup', esc);\n loadEventRemove();\n loadEventAdd();\n\n}", "function keydown(event) {\n if (shouldIgnore(event)) {\n return;\n }\n\n switch (event.key) {\n case 'j':\n scrollBy(SLIGHT_SCROLL);\n break;\n case 'k':\n scrollBy(-SLIGHT_SCROLL);\n break;\n case 'd':\n scrollBy(FULL_SCROLL);\n break;\n case 'u':\n scrollBy(-FULL_SCROLL);\n break;\n case 'g':\n if (lastKey === 'g') {\n scrollTo(0);\n }\n break;\n case 'G':\n scrollTo(document.body.scrollHeight);\n break;\n case 'H':\n chrome.runtime.sendMessage({event : 'back'});\n break;\n case 'L':\n chrome.runtime.sendMessage({event : 'forward'});\n break;\n case 'y':\n if (lastKey === 'y') {\n chrome.runtime.sendMessage({event : 'duplicate'});\n }\n break;\n case 'i':\n focusInput();\n break;\n default:\n // Nothing to do.\n return\n }\n\n setLastKey(event.key);\n\n event.stopPropagation();\n event.preventDefault();\n}", "function document_keydown(e)\n{\n\tif (e.which == 9) e.preventDefault();\n}", "function keyDown(e){\n\te.preventDefault();\n\tkeys[e.key]=true;\n}", "function dispatchKeyEvents(keyData) {\n var handled = false;\n \n if (chrome.input.ime.sendKeyEvents != undefined) {\n chrome.input.ime.sendKeyEvents({\"contextID\": contextID, \"keyData\": [keyData]});\n handled = true;\n lastRemappedKeyEvent = keyData; \n } else if (keyData.type == \"keydown\" && !isPureModifier(keyData)) {\n chrome.input.ime.commitText({\"contextID\": contextID, \"text\": keyData.key});\n handled = true;\n }\n \n return handled;\n}", "function eiKeyDown(ev)\n{\n if (!ev)\n { // browser is not W3C compliant\n ev = window.event; // IE\n } // browser is not W3C compliant\n let code = ev.keyCode;\n let form = document.indForm;\n let idir = form.idir.value;\n\n // take action based upon code\n if (ev.ctrlKey)\n { // ctrl key shortcuts\n if (code == LTR_S)\n { // letter 'S'\n locTrace += \" editIndivid.js: eiKeyDown: Ctrl-S\\n\";\n validateForm();\n return false; // do not perform standard action\n } // letter 'S'\n } // ctrl key shortcuts\n\n if (ev.altKey)\n { // alt key shortcuts\n switch (code)\n {\n case LTR_A:\n { // letter 'A' edit address\n document.getElementById(\"Address\").click();\n return false; // suppress default action\n } // letter 'A'\n\n case LTR_C:\n { // letter 'C' census search\n document.getElementById(\"censusSearch\").click();\n return false; // suppress default action\n } // letter 'C'\n\n case LTR_D:\n { // letter 'D' delete\n document.getElementById(\"Delete\").click();\n return false; // suppress default action\n } // letter 'D'\n\n case LTR_E:\n { // letter 'E' add event\n document.getElementById(\"AddEvent\").click();\n return false; // suppress default action\n } // letter 'E'\n\n case LTR_F:\n { // letter 'F' edit families\n let marriagesButton = document.getElementById(\"Marriages\");\n if (marriagesButton)\n marriagesButton.click();\n return false; // suppress default action\n } // letter 'F'\n\n case LTR_I:\n { // letter 'I' edit pictures\n document.getElementById(\"Pictures\").click();\n return false; // suppress default action\n } // letter 'G'\n\n case LTR_M:\n { // letter 'M' merge button\n document.getElementById(\"Merge\").click();\n return false; // suppress default action\n } // letter 'M'\n\n case LTR_N:\n { // letter 'N' general notes\n document.getElementById(\"Detail6\").click();\n return false; // suppress default action\n } // letter 'N'\n\n case LTR_O:\n { // alt-O\n document.getElementById(\"Order\").click();\n return false; // suppress default action\n } // alt-O\n\n case LTR_P:\n { // letter 'P' edit parents\n let parentsButton = document.getElementById(\"Parents\");\n if (parentsButton)\n parentsButton.click();\n return false; // suppress default action\n } // letter 'P'\n\n case LTR_R:\n { // letter 'R' research notes\n document.getElementById(\"Detail7\").click();\n return false; // suppress default action\n } // letter 'R'\n\n case LTR_S:\n { // letter 'S' search tables\n document.getElementById(\"Search\").click();\n return false; // suppress default action\n } // letter 'S'\n\n case LTR_U:\n { // letter 'U' Update\n locTrace += \" editIndivid.js: eiKeyDown: Alt-U\\n\";\n validateForm();\n return false; // suppress default action\n } // letter 'U'\n\n case LTR_V:\n { // letter 'V' vital statistics search tables\n document.getElementById(\"bmdSearch\").click();\n return false; // suppress default action\n } // letter 'V'\n\n case LTR_Y:\n { // letter 'Y' ancestry.ca search\n document.getElementById(\"ancestrySearch\").click();\n return false; // suppress default action\n } // letter 'Y'\n\n } // switch on key code\n } // alt key shortcuts\n\n return true; // do default action\n}" ]
[ "0.61679", "0.6142176", "0.61072046", "0.60505444", "0.60253537", "0.5940192", "0.59013516", "0.5836257", "0.57199824", "0.5689657", "0.56724274", "0.5653734", "0.56348175", "0.56214106", "0.5614806", "0.561061", "0.5602841", "0.5598244", "0.5595935", "0.5567917", "0.55560786", "0.55530775", "0.55507123", "0.5534479", "0.55309546", "0.5523298", "0.55204403", "0.5504733", "0.55000067", "0.5473307", "0.5471962", "0.54711306", "0.5468653", "0.54629767", "0.54629767", "0.5456933", "0.5453409", "0.5448374", "0.5444882", "0.5444365", "0.5440412", "0.5421791", "0.54085654", "0.540831", "0.54031193", "0.53994", "0.53951913", "0.5389515", "0.5389229", "0.53795326", "0.53791404", "0.5374569", "0.53727055", "0.5365771", "0.53637886", "0.5362098", "0.53587484", "0.5353516", "0.5342561", "0.5342345", "0.53410596", "0.53409576", "0.53383404", "0.53382605", "0.53347677", "0.53315526", "0.5331241", "0.5318807", "0.53165495", "0.53105426", "0.5309303", "0.5308693", "0.53060186", "0.53047013", "0.53018326", "0.53004843", "0.5300003", "0.5295434", "0.52917355", "0.5290701", "0.5285312", "0.5284951", "0.52838236", "0.5282307", "0.52807105", "0.52772707", "0.5275107", "0.5270765", "0.52624387", "0.5257655", "0.5255943", "0.5251071", "0.5249511", "0.52456397", "0.52413356", "0.52409464", "0.52399457", "0.5237591", "0.5235338", "0.5231877", "0.52317566" ]
0.0
-1
Returns true if the element is focusable. This includes embeds like Flash, which steal the keybaord focus.
function isFocusable(element) { return isInputOrText(element) || element.tagName == "EMBED"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusable(element) {\n\t\t\t\t\t// Use the defined focusable checker when possible\n\t\t\t\t\tif ($.expr[':'].focusable) {\n\t\t\t\t\t\treturn $.expr[':'].focusable;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tvar isTabIndexNotNaN = !isNaN($.attr(element, 'tabindex')),\n\t\t\t\t\t nodeName = element.nodeName && element.nodeName.toLowerCase(),\n\t\t\t\t\t map,\n\t\t\t\t\t mapName,\n\t\t\t\t\t img;\n\t\n\t\t\t\t\tif ('area' === nodeName) {\n\t\t\t\t\t\tmap = element.parentNode;\n\t\t\t\t\t\tmapName = map.name;\n\t\t\t\t\t\tif (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\timg = $('img[usemap=#' + mapName + ']')[0];\n\t\t\t\t\t\treturn !!img && img.is(':visible');\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : 'a' === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN\n\t\t\t\t\t);\n\t\t\t\t}", "function canFocus(element) {\n return (\n !!element &&\n element.getAttribute('tabindex') !== '-1' &&\n !element.hasAttribute('disabled') &&\n (\n element.hasAttribute('tabindex') ||\n element.hasAttribute('href') ||\n element.isContentEditable ||\n ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'].indexOf(element.nodeName) !== -1\n )\n );\n}", "function isFocusable($elem) {\n // Discard elements that are removed from the tab order.\n if ($elem.getAttribute(\"tabindex\") === \"-1\" || isHidden($elem) || isDisabled($elem)) {\n return false;\n }\n return (\n // At this point we know that the element can have focus (eg. won't be -1) if the tabindex attribute exists\n $elem.hasAttribute(\"tabindex\")\n // Anchor tags or area tags with a href set\n || ($elem instanceof HTMLAnchorElement || $elem instanceof HTMLAreaElement) && $elem.hasAttribute(\"href\")\n // Form elements which are not disabled\n || ($elem instanceof HTMLButtonElement\n || $elem instanceof HTMLInputElement\n || $elem instanceof HTMLTextAreaElement\n || $elem instanceof HTMLSelectElement)\n // IFrames\n || $elem instanceof HTMLIFrameElement);\n}", "function focusable(element, isTabIndexNotNaN) {\n\tvar map, mapName, img,\n\t\tnodeName = element.nodeName.toLowerCase();\n\tif (\"area\" === nodeName) {\n\t\tmap = element.parentNode;\n\t\tmapName = map.name;\n\t\tif (!element.href || !mapName || map.nodeName.toLowerCase() !== \"map\") {\n\t\t\treturn false;\n\t\t}\n\t\timg = $(\"img[usemap=#\" + mapName + \"]\")[0];\n\t\treturn !!img && visible(img);\n\t}\n\treturn (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled :\n\t\t\"a\" === nodeName ?\n\t\telement.href || isTabIndexNotNaN :\n\t\tisTabIndexNotNaN) &&\n\t// the element and all of its ancestors must be visible\n\tvisible(element);\n}", "function focusable(element, isTabIndexNotNaN) {\n\t\tvar map, mapName, img,\n\t\t\tnodeName = element.nodeName.toLowerCase();\n\t\tif (\"area\" === nodeName) {\n\t\t\tmap = element.parentNode;\n\t\t\tmapName = map.name;\n\t\t\tif (!element.href || !mapName || map.nodeName.toLowerCase() !== \"map\") {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\timg = $(\"img[usemap=#\" + mapName + \"]\")[0];\n\t\t\treturn !!img && visible(img);\n\t\t}\n\t\treturn (/input|select|textarea|button|object/.test(nodeName) ?\n\t\t\t\t!element.disabled :\n\t\t\t\t\"a\" === nodeName ?\n\t\t\t\telement.href || isTabIndexNotNaN :\n\t\t\t\tisTabIndexNotNaN) &&\n\t\t\t// the element and all of its ancestors must be visible\n\t\t\tvisible(element);\n\t}", "function focusable(element, isTabIndexNotNaN) {\n var map, mapName, img, nodeName = element.nodeName.toLowerCase();\n if (\"area\" === nodeName) {\n map = element.parentNode;\n mapName = map.name;\n if (!element.href || !mapName || \"map\" !== map.nodeName.toLowerCase()) return !1;\n img = $(\"img[usemap='#\" + mapName + \"']\")[0];\n return !!img && visible(img);\n }\n return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : \"a\" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element);\n}", "function findFocusable($element) {\n if (!$element) {\n return false;\n }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':visible') || __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n }", "function canReceiveFocus(element) {\n return isRealElement(element) ? matches.call(element, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !element.hasAttribute('disabled') : true;\n }", "function doesElementContainFocus(element) {\n var document = Object(_dom_getDocument__WEBPACK_IMPORTED_MODULE_4__[\"getDocument\"])(element);\n var currentActiveElement = document && document.activeElement;\n if (currentActiveElement && Object(_dom_elementContains__WEBPACK_IMPORTED_MODULE_1__[\"elementContains\"])(element, currentActiveElement)) {\n return true;\n }\n return false;\n}", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n\n return isNativeFormElement(element) || isAnchorWithHref(element) || element.hasAttribute('contenteditable') || hasValidTabIndex(element);\n}", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}", "function canReceiveFocus(element) {\n return isRealElement(element) ? matches.call(element, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !element.hasAttribute('disabled') : true;\n}", "function doesElementContainFocus(element) {\n var document = Object(__WEBPACK_IMPORTED_MODULE_0__dom__[\"e\" /* getDocument */])(element);\n var currentActiveElement = document && document.activeElement;\n if (currentActiveElement && Object(__WEBPACK_IMPORTED_MODULE_0__dom__[\"a\" /* elementContains */])(element, currentActiveElement)) {\n return true;\n }\n return false;\n}", "function findFocusable($element) {\n if (!$element) {\n return false;\n }\n\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n\n\n return true;\n });\n}", "async isFocused() {\n await this._stabilize();\n return webdriver.WebElement.equals(this.element(), this.element().getDriver().switchTo().activeElement());\n }", "isFocusable(element, config) {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) &&\n ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element));\n }", "isFocusable(element, config) {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) &&\n ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element));\n }", "isFocusable(element, config) {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) &&\n ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element));\n }", "isFocusable(element, config) {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) && ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element));\n }", "function doesElementContainFocus(element) {\n var document = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_0__.getDocument)(element);\n var currentActiveElement = document && document.activeElement;\n if (currentActiveElement && (0,_dom_elementContains__WEBPACK_IMPORTED_MODULE_1__.elementContains)(element, currentActiveElement)) {\n return true;\n }\n return false;\n}", "function doesElementContainFocus(element) {\n var document = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_0__.getDocument)(element);\n var currentActiveElement = document && document.activeElement;\n if (currentActiveElement && (0,_dom_elementContains__WEBPACK_IMPORTED_MODULE_1__.elementContains)(element, currentActiveElement)) {\n return true;\n }\n return false;\n}", "function focusable(element, isTabIndexNotNaN) {\n\t var nodeName = element.nodeName.toLowerCase();\n\t return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : \"a\" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element);\n\t}", "function findFocusable($element) {\n if (!$element) {\n return false;\n }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':visible') || __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n}", "function focusable(element, isTabIndexNotNaN) {\n\t var nodeName = element.nodeName.toLowerCase();\n\t return (/input|select|textarea|button|object/.test(nodeName) ?\n\t !element.disabled :\n\t \"a\" === nodeName ?\n\t element.href || isTabIndexNotNaN :\n\t isTabIndexNotNaN) && visible(element);\n\t}", "function focusable(element, isTabIndexNotNaN) {\n\t var nodeName = element.nodeName.toLowerCase();\n\t return (/input|select|textarea|button|object/.test(nodeName) ?\n\t !element.disabled :\n\t \"a\" === nodeName ?\n\t element.href || isTabIndexNotNaN :\n\t isTabIndexNotNaN) && visible(element);\n\t}", "function focusable(element, isTabIndexNotNaN) {\n\t var nodeName = element.nodeName.toLowerCase();\n\t return (/input|select|textarea|button|object/.test(nodeName) ?\n\t !element.disabled :\n\t \"a\" === nodeName ?\n\t element.href || isTabIndexNotNaN :\n\t isTabIndexNotNaN) && visible(element);\n\t}", "function focusable(element, isTabIndexNotNaN) {\n\t var nodeName = element.nodeName.toLowerCase();\n\t return (/input|select|textarea|button|object/.test(nodeName) ?\n\t !element.disabled :\n\t \"a\" === nodeName ?\n\t element.href || isTabIndexNotNaN :\n\t isTabIndexNotNaN) && visible(element);\n\t}", "function isFocusable(type, attributes) {\n const tabIndex = getTabIndex(getProp(attributes, 'tabIndex'));\n if (isInteractiveElement(type, attributes)) {\n return (tabIndex === undefined || tabIndex >= 0);\n }\n return tabIndex >= 0;\n}", "_containsFocus() {\n const element = this._elementRef.nativeElement;\n const activeElement = this._document.activeElement;\n return element === activeElement || element.contains(activeElement);\n }", "function doesElementContainFocus(element) {\r\n var document = getDocument(element);\r\n var currentActiveElement = document && document.activeElement;\r\n if (currentActiveElement && elementContains(element, currentActiveElement)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function doesElementContainFocus(element) {\r\n var document = getDocument(element);\r\n var currentActiveElement = document && document.activeElement;\r\n if (currentActiveElement && elementContains(element, currentActiveElement)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function findFocusable($element) {\n if (!$element) {\n return false;\n }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n}", "function isElementFocusZone(element) {\r\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\r\n}", "function isElementFocusZone(element) {\r\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\r\n}", "isTabbable(element) {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n const frameElement = getFrameElement(getWindow(element));\n if (frameElement) {\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n }\n // Browsers disable tabbing to an element inside of an invisible frame.\n if (!this.isVisible(frameElement)) {\n return false;\n }\n }\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n if (nodeName === 'iframe' || nodeName === 'object') {\n // The frame or object's content may be tabbable depending on the content, but it's\n // not possibly to reliably detect the content of the frames. We always consider such\n // elements as non-tabbable.\n return false;\n }\n // In iOS, the browser only considers some specific elements as tabbable.\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n if (nodeName === 'audio') {\n // Audio elements without controls enabled are never tabbable, regardless\n // of the tabindex attribute explicitly being set.\n if (!element.hasAttribute('controls')) {\n return false;\n }\n // Audio elements with controls are by default tabbable unless the\n // tabindex attribute is set to `-1` explicitly.\n return tabIndexValue !== -1;\n }\n if (nodeName === 'video') {\n // For all video elements, if the tabindex attribute is set to `-1`, the video\n // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n // tabindex attribute is the source of truth here.\n if (tabIndexValue === -1) {\n return false;\n }\n // If the tabindex is explicitly set, and not `-1` (as per check before), the\n // video element is always tabbable (regardless of whether it has controls or not).\n if (tabIndexValue !== null) {\n return true;\n }\n // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n // has controls enabled. Firefox is special as videos are always tabbable regardless\n // of whether there are controls or not.\n return this._platform.FIREFOX || element.hasAttribute('controls');\n }\n return element.tabIndex >= 0;\n }", "isTabbable(element) {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n const frameElement = getFrameElement(getWindow(element));\n if (frameElement) {\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n }\n // Browsers disable tabbing to an element inside of an invisible frame.\n if (!this.isVisible(frameElement)) {\n return false;\n }\n }\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n if (nodeName === 'iframe' || nodeName === 'object') {\n // The frame or object's content may be tabbable depending on the content, but it's\n // not possibly to reliably detect the content of the frames. We always consider such\n // elements as non-tabbable.\n return false;\n }\n // In iOS, the browser only considers some specific elements as tabbable.\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n if (nodeName === 'audio') {\n // Audio elements without controls enabled are never tabbable, regardless\n // of the tabindex attribute explicitly being set.\n if (!element.hasAttribute('controls')) {\n return false;\n }\n // Audio elements with controls are by default tabbable unless the\n // tabindex attribute is set to `-1` explicitly.\n return tabIndexValue !== -1;\n }\n if (nodeName === 'video') {\n // For all video elements, if the tabindex attribute is set to `-1`, the video\n // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n // tabindex attribute is the source of truth here.\n if (tabIndexValue === -1) {\n return false;\n }\n // If the tabindex is explicitly set, and not `-1` (as per check before), the\n // video element is always tabbable (regardless of whether it has controls or not).\n if (tabIndexValue !== null) {\n return true;\n }\n // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n // has controls enabled. Firefox is special as videos are always tabbable regardless\n // of whether there are controls or not.\n return this._platform.FIREFOX || element.hasAttribute('controls');\n }\n return element.tabIndex >= 0;\n }", "isTabbable(element) {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n const frameElement = getFrameElement(getWindow(element));\n if (frameElement) {\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n }\n // Browsers disable tabbing to an element inside of an invisible frame.\n if (!this.isVisible(frameElement)) {\n return false;\n }\n }\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n if (nodeName === 'iframe' || nodeName === 'object') {\n // The frame or object's content may be tabbable depending on the content, but it's\n // not possibly to reliably detect the content of the frames. We always consider such\n // elements as non-tabbable.\n return false;\n }\n // In iOS, the browser only considers some specific elements as tabbable.\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n if (nodeName === 'audio') {\n // Audio elements without controls enabled are never tabbable, regardless\n // of the tabindex attribute explicitly being set.\n if (!element.hasAttribute('controls')) {\n return false;\n }\n // Audio elements with controls are by default tabbable unless the\n // tabindex attribute is set to `-1` explicitly.\n return tabIndexValue !== -1;\n }\n if (nodeName === 'video') {\n // For all video elements, if the tabindex attribute is set to `-1`, the video\n // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n // tabindex attribute is the source of truth here.\n if (tabIndexValue === -1) {\n return false;\n }\n // If the tabindex is explicitly set, and not `-1` (as per check before), the\n // video element is always tabbable (regardless of whether it has controls or not).\n if (tabIndexValue !== null) {\n return true;\n }\n // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n // has controls enabled. Firefox is special as videos are always tabbable regardless\n // of whether there are controls or not.\n return this._platform.FIREFOX || element.hasAttribute('controls');\n }\n return element.tabIndex >= 0;\n }", "function isElementFocusZone(element) {\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\n}", "function isElementFocusZone(element) {\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\n}", "function isElementFocusZone(element) {\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\n}", "function isElementFocusZone(element) {\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\n}", "function findFocusable($element) {\n if(!$element) {return false; }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) { return false; } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n}", "isTabbable(element) {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n\n const frameElement = getFrameElement(getWindow(element));\n\n if (frameElement) {\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n } // Browsers disable tabbing to an element inside of an invisible frame.\n\n\n if (!this.isVisible(frameElement)) {\n return false;\n }\n }\n\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n\n if (nodeName === 'iframe' || nodeName === 'object') {\n // The frame or object's content may be tabbable depending on the content, but it's\n // not possibly to reliably detect the content of the frames. We always consider such\n // elements as non-tabbable.\n return false;\n } // In iOS, the browser only considers some specific elements as tabbable.\n\n\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n\n if (nodeName === 'audio') {\n // Audio elements without controls enabled are never tabbable, regardless\n // of the tabindex attribute explicitly being set.\n if (!element.hasAttribute('controls')) {\n return false;\n } // Audio elements with controls are by default tabbable unless the\n // tabindex attribute is set to `-1` explicitly.\n\n\n return tabIndexValue !== -1;\n }\n\n if (nodeName === 'video') {\n // For all video elements, if the tabindex attribute is set to `-1`, the video\n // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n // tabindex attribute is the source of truth here.\n if (tabIndexValue === -1) {\n return false;\n } // If the tabindex is explicitly set, and not `-1` (as per check before), the\n // video element is always tabbable (regardless of whether it has controls or not).\n\n\n if (tabIndexValue !== null) {\n return true;\n } // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n // has controls enabled. Firefox is special as videos are always tabbable regardless\n // of whether there are controls or not.\n\n\n return this._platform.FIREFOX || element.hasAttribute('controls');\n }\n\n return element.tabIndex >= 0;\n }", "hasFocus() {\n if (ie) {\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && this.dom.contains(node)) {\n if (node.contentEditable == \"false\")\n return false;\n node = node.parentElement;\n }\n return true;\n }\n return this.root.activeElement == this.dom;\n }", "_containsFocus() {\n if (this._body) {\n const focusedElement = this._document.activeElement;\n const bodyElement = this._body.nativeElement;\n return focusedElement === bodyElement || bodyElement.contains(focusedElement);\n }\n return false;\n }", "_containsFocus() {\n if (!this._document || !this._elementRef) {\n return false;\n }\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }", "function hasFocus() {\n\t\t\treturn settings.hasFocus;\n\t\t}", "function isElementTabbable(element, checkTabIndex) {\r\n // If this element is null or is disabled, it is not considered tabbable.\r\n if (!element || element.disabled) {\r\n return false;\r\n }\r\n var tabIndex = 0;\r\n var tabIndexAttributeValue = null;\r\n if (element && element.getAttribute) {\r\n tabIndexAttributeValue = element.getAttribute('tabIndex');\r\n if (tabIndexAttributeValue) {\r\n tabIndex = parseInt(tabIndexAttributeValue, 10);\r\n }\r\n }\r\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\r\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\r\n var result = !!element &&\r\n isFocusableAttribute !== 'false' &&\r\n (element.tagName === 'A' ||\r\n element.tagName === 'BUTTON' ||\r\n element.tagName === 'INPUT' ||\r\n element.tagName === 'TEXTAREA' ||\r\n isFocusableAttribute === 'true' ||\r\n isTabIndexSet);\r\n return checkTabIndex ? tabIndex !== -1 && result : result;\r\n}", "function isElementTabbable(element, checkTabIndex) {\r\n // If this element is null or is disabled, it is not considered tabbable.\r\n if (!element || element.disabled) {\r\n return false;\r\n }\r\n var tabIndex = 0;\r\n var tabIndexAttributeValue = null;\r\n if (element && element.getAttribute) {\r\n tabIndexAttributeValue = element.getAttribute('tabIndex');\r\n if (tabIndexAttributeValue) {\r\n tabIndex = parseInt(tabIndexAttributeValue, 10);\r\n }\r\n }\r\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\r\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\r\n var result = !!element &&\r\n isFocusableAttribute !== 'false' &&\r\n (element.tagName === 'A' ||\r\n element.tagName === 'BUTTON' ||\r\n element.tagName === 'INPUT' ||\r\n element.tagName === 'TEXTAREA' ||\r\n isFocusableAttribute === 'true' ||\r\n isTabIndexSet);\r\n return checkTabIndex ? tabIndex !== -1 && result : result;\r\n}", "function isElementTabbable(element, checkTabIndex) {\n // If this element is null or is disabled, it is not considered tabbable.\n if (!element || element.disabled) {\n return false;\n }\n var tabIndex = 0;\n var tabIndexAttributeValue = null;\n if (element && element.getAttribute) {\n tabIndexAttributeValue = element.getAttribute('tabIndex');\n if (tabIndexAttributeValue) {\n tabIndex = parseInt(tabIndexAttributeValue, 10);\n }\n }\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\n var result = !!element &&\n isFocusableAttribute !== 'false' &&\n (element.tagName === 'A' ||\n element.tagName === 'BUTTON' ||\n element.tagName === 'INPUT' ||\n element.tagName === 'TEXTAREA' ||\n element.tagName === 'SELECT' ||\n isFocusableAttribute === 'true' ||\n isTabIndexSet);\n return checkTabIndex ? tabIndex !== -1 && result : result;\n}", "function isElementTabbable(element, checkTabIndex) {\n // If this element is null or is disabled, it is not considered tabbable.\n if (!element || element.disabled) {\n return false;\n }\n var tabIndex = 0;\n var tabIndexAttributeValue = null;\n if (element && element.getAttribute) {\n tabIndexAttributeValue = element.getAttribute('tabIndex');\n if (tabIndexAttributeValue) {\n tabIndex = parseInt(tabIndexAttributeValue, 10);\n }\n }\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\n var result = !!element &&\n isFocusableAttribute !== 'false' &&\n (element.tagName === 'A' ||\n element.tagName === 'BUTTON' ||\n element.tagName === 'INPUT' ||\n element.tagName === 'TEXTAREA' ||\n element.tagName === 'SELECT' ||\n isFocusableAttribute === 'true' ||\n isTabIndexSet);\n return checkTabIndex ? tabIndex !== -1 && result : result;\n}", "function isElementTabbable(element, checkTabIndex) {\n // If this element is null or is disabled, it is not considered tabbable.\n if (!element || element.disabled) {\n return false;\n }\n var tabIndex = 0;\n var tabIndexAttributeValue = null;\n if (element && element.getAttribute) {\n tabIndexAttributeValue = element.getAttribute('tabIndex');\n if (tabIndexAttributeValue) {\n tabIndex = parseInt(tabIndexAttributeValue, 10);\n }\n }\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\n var result = !!element &&\n isFocusableAttribute !== 'false' &&\n (element.tagName === 'A' ||\n element.tagName === 'BUTTON' ||\n element.tagName === 'INPUT' ||\n element.tagName === 'TEXTAREA' ||\n isFocusableAttribute === 'true' ||\n isTabIndexSet);\n return checkTabIndex ? tabIndex !== -1 && result : result;\n}", "function isFocused() {\n\t\t\treturn (result.allowFocusOnHover && focusedElement === oldTargetElement) || pointerLockElement === oldTargetElement;\n\t\t}", "isFocused() {\n return this.element.classList.contains('b-contains-focus');\n }", "function focusTriggersKeyboardModality(el) {\n const type = el.type;\n const tagName = el.tagName;\n const isReadOnly = el.readOnly;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n if (el.isContentEditable) {\n return true;\n }\n return false;\n }", "function isElementFocusSubZone(element) {\r\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\r\n}", "function isElementFocusSubZone(element) {\r\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\r\n}", "function isElementTabbable(element, checkTabIndex) {\n // If this element is null or is disabled, it is not considered tabbable.\n if (!element || element.disabled) {\n return false;\n }\n var tabIndex = 0;\n var tabIndexAttributeValue = null;\n if (element && element.getAttribute) {\n tabIndexAttributeValue = element.getAttribute('tabIndex');\n if (tabIndexAttributeValue) {\n tabIndex = parseInt(tabIndexAttributeValue, 10);\n }\n }\n var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\n var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\n var result = !!element &&\n isFocusableAttribute !== 'false' &&\n (element.tagName === 'A' ||\n element.tagName === 'BUTTON' ||\n element.tagName === 'INPUT' ||\n element.tagName === 'TEXTAREA' ||\n isFocusableAttribute === 'true' ||\n isTabIndexSet ||\n (element.getAttribute && element.getAttribute('role') === 'button'));\n return checkTabIndex ? tabIndex !== -1 && result : result;\n}", "get hasFocusableItems() {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].focusable === true) {\n return true;\n }\n }\n return false;\n }", "function isElementFocusSubZone(element) {\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\n}", "function isElementFocusSubZone(element) {\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\n}", "function isElementFocusSubZone(element) {\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\n}", "function isElementFocusSubZone(element) {\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\n}", "function isFocusOnCanvas() {\n if( !document.activeElement || \n !document.activeElement.attributes ||\n !document.activeElement.attributes['class'] ||\n document.activeElement.attributes['class'].value.substr(0,8) !== \"vtt game\" \n ) \n { \n return false;\n }\n else \n { \n return true;\n }\n}", "function isOnFocus() {\n // set the varible onFocus to true\n onFocus = true;\n }", "get hasFocus() {\n var _a;\n // Safari return false for hasFocus when the context menu is open\n // or closing, which leads us to ignore selection changes from the\n // context menu because it looks like the editor isn't focused.\n // This kludges around that.\n return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === void 0 ? void 0 : _a.lastContextMenu) > Date.now() - 3e4) &&\n this.root.activeElement == this.contentDOM;\n }", "function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n var isReadOnly = el.readOnly;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }", "focus() {\n if (this.isFocusable) {\n DomHelper.focusWithoutScrolling(this.focusElement);\n }\n }", "focus() {\n if (this.isFocusable) {\n DomHelper.focusWithoutScrolling(this.focusElement);\n }\n }", "function focusable(e,t){var r=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(r)?!e.disabled:\"a\"===r?e.href||t:t)&&visible(e)}", "attemptFocus(focusTarget) {\n focusTarget.focus();\n return this.document.activeElement === focusTarget;\n }", "attemptFocus(focusTarget) {\n focusTarget.focus();\n return this.document.activeElement === focusTarget;\n }", "attemptFocus(focusTarget) {\n focusTarget.focus();\n return this.document.activeElement === focusTarget;\n }", "attemptFocus(focusTarget) {\n focusTarget.focus();\n return this.document.activeElement === focusTarget;\n }", "attemptFocus(focusTarget) {\n focusTarget.focus();\n return this.document.activeElement === focusTarget;\n }", "function isValidFocusTarget(el) {\n if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {\n return true;\n }\n\n return false;\n }", "focusFirstTabbableElement() {\n const redirectToElement = this._getRegionBoundary('start');\n if (redirectToElement) {\n redirectToElement.focus();\n }\n return !!redirectToElement;\n }", "focusFirstTabbableElement() {\n const redirectToElement = this._getRegionBoundary('start');\n if (redirectToElement) {\n redirectToElement.focus();\n }\n return !!redirectToElement;\n }", "focusFirstTabbableElement() {\n const redirectToElement = this._getRegionBoundary('start');\n if (redirectToElement) {\n redirectToElement.focus();\n }\n return !!redirectToElement;\n }", "function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }", "get focusChanged() {\n return (this.flags & 1 /* Focus */) > 0;\n }", "_isFocusWithinDrawer() {\n var _a;\n const activeEl = (_a = this._doc) === null || _a === void 0 ? void 0 : _a.activeElement;\n return !!activeEl && this._elementRef.nativeElement.contains(activeEl);\n }", "_setFocusable() {\n const that = this;\n\n if (that.disabled || that.unfocusable) {\n that.removeAttribute('tabindex');\n return;\n }\n\n const tabindex = that.getAttribute('tabindex');\n\n if (tabindex === null || tabindex < 0) {\n that.setAttribute('tabindex', 0);\n }\n }", "function checkFocus() {\n const {\n activeElement\n } = ownerDocument;\n\n if (activeElement.tagName !== 'IFRAME' || activeElement.parentNode !== ref.current) {\n return;\n }\n\n activeElement.focus();\n }", "input_is_active() {\n return document.activeElement.matches('label input[type=\"text\"]') && document.activeElement;\n }", "function isFocusElement(id) {\n var focusElement = $(':focus');\n return focusElement.length > 0 && focusElement.attr(\"id\") !== undefined && focusElement.attr(\"id\").toLowerCase() == id.toLowerCase();\n }", "get enabled() { return this.focusTrap.enabled; }", "get enabled() { return this.focusTrap.enabled; }", "get enabled() { return this.focusTrap.enabled; }", "function checkFocus() {\n if (store.getState().battleState == 'BATTLE_ON' && store.getState().autoPause == 'ON' && store.getState().manualPaused != true) {\n if(document.hasFocus()) {\n isUserFocusOnThePage = true;\n } else {\n isUserFocusOnThePage = false;\n isUserFocusOnTheGame = false;\n }\n\n if(isUserFocusOnThePage == true && isUserFocusOnTheGame == true && store.getState().isGamePaused == true) {\n resumeGameStateChangeStarter();\n } else if (store.getState().isGamePaused == false){\n if (isUserFocusOnThePage == false || isUserFocusOnTheGame == false) {\n pauseGameStateChangeStarter();\n }\n }\n }\n }", "function hasValidTabIndex(element) {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n let tabIndex = element.getAttribute('tabindex');\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}", "function hasValidTabIndex(element) {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n let tabIndex = element.getAttribute('tabindex');\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}", "function hasValidTabIndex(element) {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n let tabIndex = element.getAttribute('tabindex');\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "function hasValidTabIndex(element) {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n var tabIndex = element.getAttribute('tabindex');\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}" ]
[ "0.77805924", "0.77609503", "0.7703886", "0.7479171", "0.74658275", "0.732273", "0.7255446", "0.7227287", "0.72002697", "0.71984595", "0.71633047", "0.71633047", "0.71633047", "0.71633047", "0.7161074", "0.7154766", "0.7136588", "0.7121359", "0.7070783", "0.7070783", "0.7070783", "0.70705515", "0.7064038", "0.7064038", "0.704553", "0.70394397", "0.69776654", "0.69776654", "0.69776654", "0.69776654", "0.69434935", "0.6881454", "0.6845803", "0.6845803", "0.6818579", "0.6817298", "0.6817298", "0.6814722", "0.6814722", "0.6814722", "0.67790574", "0.67790574", "0.67790574", "0.67790574", "0.6756716", "0.67342377", "0.67218554", "0.6677991", "0.6631784", "0.660966", "0.6470251", "0.6470251", "0.6450765", "0.6450765", "0.64451325", "0.6425684", "0.64175093", "0.64152116", "0.6414256", "0.6414256", "0.64099014", "0.63856417", "0.6383427", "0.6383427", "0.6383427", "0.6383427", "0.63768625", "0.6375718", "0.6371857", "0.63456225", "0.6281395", "0.6281395", "0.62522525", "0.62346923", "0.62346923", "0.62346923", "0.62346923", "0.62346923", "0.62274504", "0.6188867", "0.6188867", "0.6188867", "0.61650413", "0.6143186", "0.6118835", "0.60891575", "0.5975246", "0.5949377", "0.5901389", "0.5890933", "0.5890933", "0.5890933", "0.58785003", "0.5845385", "0.5845385", "0.5845385", "0.5841374", "0.5841374", "0.5841374", "0.58403736" ]
0.84320706
0
Input or text elements are considered focusable and able to receieve their own keyboard events, and will enter enter mode if focused. Note: we used to discriminate for textonly inputs, but this is not accurate since all input fields can be controlled via the keyboard, particuarlly SELECT combo boxes.
function isInputOrText(target) { var focusableInputs = ["input", "textarea", "select", "button"]; return focusableInputs.indexOf(target.tagName.toLowerCase()) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n var isReadOnly = el.readOnly;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }", "function focusTriggersKeyboardModality(el) {\n const type = el.type;\n const tagName = el.tagName;\n const isReadOnly = el.readOnly;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n if (el.isContentEditable) {\n return true;\n }\n return false;\n }", "onFocusEnter() { }", "_textBoxKeyDownHandler(event) {\n const that = this,\n key = event.key;\n\n if (that._scrollView) {\n that._handleScrollbarsDisplay();\n }\n\n that._autoExpandUpdate();\n that.value && that.value.length > 0 ? that.$.addClass('has-value') : that.$.removeClass('has-value');\n\n if (['Enter', 'Escape'].indexOf(key) === -1) {\n that._preventProgramaticValueChange = true;\n }\n\n if (['ArrowLeft', 'ArrowUp', 'ArrowDown', 'ArrowRight'].indexOf(key) > -1) {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n\n if (['PageUp', 'PageDown'].indexOf(key) > -1 && JQX.Utilities.Core.Browser.Chrome) {\n if (event.key === 'PageUp') {\n that.$.input.setSelectionRange(0, 0);\n that.$.input.scrollTop = 0;\n }\n\n if (event.key === 'PageDown') {\n that.$.input.setSelectionRange(that.$.input.value.length, that.$.input.value.length);\n that.$.input.scrollTop = that._scrollView.verticalScrollBar.max;\n }\n\n event.preventDefault();\n }\n }", "onInternalKeyDown(event) {\n const me = this,\n active = me.navigator.activeItem;\n\n switch (event.key) {\n case ' ':\n // If it's an input field that's providing events, allow it to process space.\n // Otherwise, it falls through and is processed the same as ENTER to make a click.\n if (event.target.nodeName.toUpperCase() === 'INPUT' && !event.target.readOnly) {\n break; // eslint-disable-line\n }\n\n case 'Enter':\n // eslint-disable-line\n if (active) {\n this.onItemClick(active, event); // Stop the keydown from bubbling.\n // And stop it from creating a keypress event.\n // No further action should be taken after item selection.\n\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n\n }\n }", "showKeyboard({ event }) {\n const input = this.input;\n\n if (DomHelper.isTouchEvent && document.activeElement === input && event.target === input) {\n GlobalEvents.suspendFocusEvents();\n input.blur();\n input.focus();\n GlobalEvents.resumeFocusEvents();\n }\n }", "function isFocusable(element) { return isInputOrText(element) || element.tagName == \"EMBED\"; }", "showKeyboard({\n event\n }) {\n const input = this.input;\n\n if (DomHelper.isTouchEvent && document.activeElement === input && event.target === input) {\n GlobalEvents.suspendFocusEvents();\n input.blur();\n input.focus();\n GlobalEvents.resumeFocusEvents();\n }\n }", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\tdom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(selection.getRng());\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}", "get focusElement(){return this._input()||this}", "function focusable(e,t){var r=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(r)?!e.disabled:\"a\"===r?e.href||t:t)&&visible(e)}", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\t// Disabled since it was interferring with the cE=false logic\n\t\t\t\t// Also coultn't reproduce the issue on Safari 9\n\t\t\t\t/*dom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});*/\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tvar rng;\n\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\trng = selection.getRng();\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\tif (CaretContainer.isCaretContainer(rng.startContainer)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\t// Disabled since it was interferring with the cE=false logic\n\t\t\t\t// Also coultn't reproduce the issue on Safari 9\n\t\t\t\t/*dom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});*/\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tvar rng;\n\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\trng = selection.getRng();\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\tif (CaretContainer.isCaretContainer(rng.startContainer)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(rng);\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}", "scopeEnterKey() {\r\n utils.addEventListenerByTag('form', 'keypress', (event) => {\r\n const key = event.charCode || event.keyCode || 0\r\n if (key === 13 && document.activeElement.tagName !== 'BUTTON') {\r\n event.preventDefault();\r\n }\r\n });\r\n }", "function handleKeyPress(event) {\n switch(event.key) {\n case 'Enter': \n document.activeElement.blur();\n break;\n default: break;\n }\n }", "setFocus(){\n this.getInputEle().focus();\n }", "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "function focusInput() {\n const results =\n evaluateXPath(textInputXPath(), XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);\n const visible = [];\n for (let i = 0; i < results.snapshotLength; i++) {\n let elem = results.snapshotItem(i);\n if (hasVisibleClientRect(elem)) {\n visible.push({\n elem,\n index : i,\n });\n }\n }\n\n visible.sort(({elem : elem1, index : i1}, {elem : elem2, index : i2}) => {\n if (elem1.tabIndex > 0) {\n if (elem2.tabIndex > 0) {\n let diff = elem1.tabIndex - elem2.tabIndex;\n if (diff !== 0) {\n return diff;\n } else {\n return i1 - i2;\n }\n }\n return -1;\n } else if (elem2.tabIndex > 0) {\n return 1;\n }\n return i1 - i2;\n });\n\n if (visible.length === 0) {\n return;\n }\n\n const target = visible[0].elem;\n\n target.focus();\n target.select();\n}", "function setInputEventListener() {\n\n var newItem = $(\"#add_new_item\");\n\n // bind on key press event to allow new item\n newItem.bind(\"keypress\", function(e) {\n\n var keyCode;\n if (!e) e = window.event;\n keyCode = e.keyCode || e.which;\n\n // verify that not only 'enter' is pressed\n if (keyCode === 13 && newItem.val().length >= 1) requestAddNewItem();\n });\n\n\n $(\"#add_new_item\").focusout(function() {\n var contentLen = $(\"#add_new_item\").val().length;\n if (contentLen >= 1) requestAddNewItem();\n });\n}", "input_is_active() {\n return document.activeElement.matches('label input[type=\"text\"]') && document.activeElement;\n }", "function enterInsertModeIfElementIsFocused() {\n // Enter insert mode automatically if there's already a text box focused.\n // TODO(philc): Consider using document.activeElement here instead.\n var focusNode = window.getSelection().focusNode;\n var focusOffset = window.getSelection().focusOffset;\n if (focusNode && focusOffset && focusNode.children.length > focusOffset &&\n isInputOrText(focusNode.children[focusOffset]))\n enterInsertMode();\n}", "function Picklist_HandleKeyDown(e) {\n if (!e) var e = window.event;\n if (e.keyCode == 9) // tab\n {\n this.MimicBlur();\n this.SelectionChanged();\n return true; \n }\n else if(e.keyCode == 13) // enter\n {\n e.returnValue = false;\n e.cancelBubble = true;\n\t if (e.stopPropagation) e.stopPropagation();\n\t this.SelectionChanged();\n\t return true;\n\t} \n\t\n\t// ignore all other keys except those below\n\tif (this.CanEditText == false) \n\t{\n\t if (e.keyCode != 37 // left arrow\n && e.keyCode != 38 // keyup\n && e.keyCode != 39 // right arrow\n && e.keyCode != 40) // keydown\n\t {\n\t return false;\n\t }\n\t}\n return true;\n}", "onElementKeyPress(event) {\n const me = this;\n\n // Only react to keystrokes on grid cell elements\n if (\n DomHelper.up(\n event.target,\n BrowserHelper.isIE11 ? '.b-widget:not(.b-grid-subgrid):not(.b-grid)' : '.b-widget:not(.b-grid)'\n ) ||\n event.key === 'Enter'\n ) {\n return;\n }\n\n if (me.grid._focusedCell) {\n const column = me.grid.columns.getById(me.grid._focusedCell.columnId);\n // if trying to search in invalid column, it's a hard failure\n\n if (column && column.searchable !== false) {\n me.columnId = me.grid._focusedCell.columnId;\n\n if (event.key && event.key.length === 1) {\n me.find += event.key;\n me.search(me.find);\n }\n }\n }\n }", "get _focusableElement(){return this.inputElement._inputElement}", "get _focusableElement(){return this.inputElement._inputElement}", "function textOnlyCheckEnter(e){\r\n \tvar characterCodeTextonly ;\r\n\r\n\tif(e && e.which){\r\n\te = e;\r\n\r\n\tcharacterCodeTextonly = e.which;\r\n\t}\r\n\telse{\r\n\te = event;\r\n\tcharacterCodeTextonly = e.keyCode ;\r\n\t}\r\n\r\n\tif(characterCodeTextonly == 13){\r\n\r\n\t\ttextOnlyGoSearch();\r\n\t}\r\n\telse{\r\n\r\n\t\ttextOnlyEnter ='false';\r\n\t}\r\n}", "function setKeyPressEventForCharInput(i, numCharInputs, spaceIndices, testType, placeHolderString, isPhrase, chosenExampleOccurrenceIgnoredIndexes,\n\t\tshowSpeakerIcon) {\n\tvar prevNonDisabled = findFirstNonDisabledLetterBefore(i);\n\tvar nextNonDisabled = findFirstNonDisabledLetterAfter(i);\n\n\t$(\"#char-input-\" + i.toString()).unbind();\n\n\t// according to the below URL,\n\t// Apple won't deliver the keypress/keydown event if the input field loses\n\t// focus while the keypress/keydown event is being fired.\n\t// http://support.apple.com/kb/ht4334 (see\n\t// CVE-ID: CVE-2010-1422)\n\n\t// so the goal here is to make sure that the keypress/keydown event is fired\n\t// and yet we still want to maintain the focus in the text field (otherwise\n\t// the keyboard in iOS devices will keep going \"up\" and \"down\" as user moves\n\t// to the next input fields)\n\n\t// solution: borrow ideas from\n\t// http://www.gundersen.net/keep-ipadiphone-ios-keyboard-up-between-input-fields/\n\n\t$(\"#char-input-\" + i.toString()).bind('keypress', function(event) {\n\t\tvar prefix = 'char-input-';\n\t\tvar thisid = $(this).attr(\"id\");\n\t\tvar i = parseInt(thisid.substring(prefix.length,thisid.length));\n\n\t\t// leave tab and shift+tab to browser to handle (based\n\t\t// on tabindex attributes + also ignore space (which is later handled\n\t\t// in the keyup event)\n\t\tif (event.keyCode != 9 && event.which != 32) {\n\t\t\tswitch (event.keyCode) {\n\t\t\tcase 13: // enter key\n\t\t\t\tthis.blur();\n\t\t\t\tcheckTypedWord(spaceIndices, testType, placeHolderString, isPhrase, chosenExampleOccurrenceIgnoredIndexes,\n\t\t\t\t\t\tshowSpeakerIcon);\n\t\t\t\tbreak;\n\t\t\t// for other keys, simply move to next input field\n\t\t\tdefault:\n\t\t\t\t// ignore back space and arrow keys\n\t\t\t\tif (event.keyCode != 8 && event.keyCode != 37\n\t\t\t\t\t\t&& event.keyCode != 38\n\t\t\t\t\t\t&& event.keyCode != 39\n\t\t\t\t\t\t&& event.keyCode != 40) {\n\t\t\t\t\tvar keypressed = String.fromCharCode(event.which).toUpperCase();\n\t\t\t\t $(\"#char-input-\" + i.toString()).val(keypressed);\n\n\t\t\t\t var nextid = findFirstNonDisabledLetterAfter(i);\n\n\t\t\t\t if (nextid != -1 && nextid <= numCharInputs) {\n\t\t\t\t\t\tchangeInputField(i.toString(), nextid, i, numCharInputs, false);\n\t\t\t\t\t\tthis.select();\n\t\t\t\t\t}\n\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t});\n\n\t// for some reasons, using keypress is not effective for Chrome, so we have\n\t// to move some keys to keydown\n\t$(\"#char-input-\" + i.toString()).bind('keydown', function(event) {\n\t\tvar prefix = 'char-input-';\n\t\tvar thisid = $(this).attr(\"id\");\n\t\tvar i = parseInt(thisid.substring(prefix.length,thisid.length));\n\n\t\t// leave tab and shift+tab to browser to handle (based\n\t\t// on tabindex attributes + also ignore space (which is later handled\n\t\t// in the keyup event)\n\t\tif (event.keyCode != 9 && event.which != 32) {\n\t\t\tswitch (event.keyCode) {\n\t\t\tcase 8: // for backspace move to previous input field\n\t\t\t\tvar curVal = $(\"#char-input-\" + i.toString()).val();\n\n\t\t\t\tvar supportBackSpace;\n\n\t\t\t\t// if not android, always support backspace\n\t\t\t\tif (!isAndroidBrowser) {\n\t\t\t\t\tsupportBackSpace = true;\n\t\t\t\t} else {\n\t\t\t\t\t// if android, only support back space if current char input\n\t\t\t\t\t// field is empty, i.e., moving backwards from an empty\n\t\t\t\t\t// field. this is because there is a bug in Android: when\n\t\t\t\t\t// we set the value of an input field, pressing backspace\n\t\t\t\t\t// on that field will not fire any keydown/keypress event\n\t\t\t\t\t// for more details, see the comments in changeInputField\n\t\t\t\t\t// regarding the hack for Android\n\t\t\t\t\tsupportBackSpace = (curVal == '');\n\t\t\t\t}\n\n\t\t\t\tvar previd = findFirstNonDisabledLetterBefore(i);\n\t\t\t\t\n\t\t\t\tif (supportBackSpace) {\n\t\t\t\t\t// erase the current value\n\t\t\t\t\t$(\"#char-input-\" + i.toString()).val('');\n\n\t\t\t\t\tif (previd != -1 && previd >= 1) {\n\t\t\t\t\t\t// var temp_val = $(\"#char-input-\" + previd.toString()).val();\n\n\t\t\t\t\t\tchangeInputField(i.toString(),previd, i, numCharInputs,\n\t\t\t\t\t\t\t true);\n\n\t\t\t\t\t\t// var e = jQuery.Event(\"keypress\");\n\t\t\t\t\t\t// e.which = String.charCodeAt(0);\n\t\t\t\t\t\t// $(\"#char-input-\" + previd).trigger(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tcase 37: // for left arrow move to previous input field\n\t\t\t\tvar previd = findFirstNonDisabledLetterBefore(i);\n\n\t\t\t\tif (previd != -1 && previd >= 1) {\n\t\t\t\t\tchangeInputField(i.toString(),previd, i, numCharInputs,\n\t\t\t\t\t\t false);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tcase 39: // for right arrow move to next input field\n\t\t\t\tvar nextid = findFirstNonDisabledLetterAfter(i);\n\n\t\t\t\tif (nextid != -1 && nextid <= numCharInputs) {\n\t\t\t\t\tchangeInputField(i.toString(),nextid, i, numCharInputs,\n\t\t\t\t\t\t false);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t});\n\n\t// in bindShorcuts() we use keyup for space so here we also use keyup for\n\t// space\n\t$(\"#char-input-\" + i.toString()).bind('keyup', 'space', function() {\n\t\tspaceButtonKeyUp();\n\t});\n}", "onElementKeyPress(event) {\n const me = this; // Only react to keystrokes on grid cell elements\n\n if (me.disabled || DomHelper.up(event.target, BrowserHelper.isIE11 ? '.b-widget:not(.b-grid-subgrid):not(.b-grid)' : '.b-widget:not(.b-grid)') || event.key === 'Enter') {\n return;\n }\n\n if (me.grid._focusedCell) {\n const column = me.grid.columns.getById(me.grid._focusedCell.columnId); // if trying to search in invalid column, it's a hard failure\n\n if (column && column.searchable !== false) {\n me.columnId = me.grid._focusedCell.columnId;\n\n if (event.key && event.key.length === 1) {\n me.find += event.key;\n me.search(me.find);\n }\n }\n }\n }", "function focusInputElement(){elements.input.focus();}", "function inputKeydown(e)\n {\n // Pressing enter or space bar or comma while focused on input\n if(e.keyCode == 13 || e.keyCode == 32 || e.keyCode == 188)\n {\n inputKeydownEnter();\n }\n\n // Pressing backspace while focused on input\n if(e.keyCode == 8)\n {\n hideIfUndefined(input);\n }\n }", "function _onKeyDown(event) {\n\t\tif ($.inArray(event.target.tagName.toLowerCase(), ['input','textarea']) < 0) { // let form elements handle their own input\n\t\t\tvar keyindex = $.inArray(event.which, [27,37,39,36,35]); // keys are [ESC, left arrow, right arrow, home, end]\n\t\t\tkeyindex < 0 || [hideDialog,previousItem,nextItem,firstItem,lastItem][keyindex]();\n\t\t\treturn false; // cancel event propagation\n\t\t}\n\t}", "function keyboardFocusIn(e) {\n clearTimeout(keyboardFocusOutTimer);\n //console.log(\"keyboardFocusIn from: \" + e.type + \" at: \" + Date.now());\n\n if (!e.target ||\n e.target.readOnly ||\n !ionic.tap.isKeyboardElement(e.target) ||\n !(scrollView = ionic.DomUtil.getParentWithClass(e.target, SCROLL_CONTAINER_CSS))) {\n if (keyboardActiveElement) {\n lastKeyboardActiveElement = keyboardActiveElement;\n }\n keyboardActiveElement = null;\n return;\n }\n\n keyboardActiveElement = e.target;\n\n // if using JS scrolling, undo the effects of native overflow scroll so the\n // scroll view is positioned correctly\n if (!scrollView.classList.contains(\"overflow-scroll\")) {\n document.body.scrollTop = 0;\n scrollView.scrollTop = 0;\n ionic.requestAnimationFrame(function(){\n document.body.scrollTop = 0;\n scrollView.scrollTop = 0;\n });\n\n // any showing part of the document that isn't within the scroll the user\n // could touchmove and cause some ugly changes to the app, so disable\n // any touchmove events while the keyboard is open using e.preventDefault()\n if (window.navigator.msPointerEnabled) {\n document.addEventListener(\"MSPointerMove\", keyboardPreventDefault, false);\n } else {\n document.addEventListener('touchmove', keyboardPreventDefault, false);\n }\n }\n\n if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n ionic.keyboard.isOpening = true;\n ionic.keyboard.isClosing = false;\n }\n\n // attempt to prevent browser from natively scrolling input into view while\n // we are trying to do the same (while we are scrolling) if the user taps the\n // keyboard\n document.addEventListener('keydown', keyboardOnKeyDown, false);\n\n\n\n // if we aren't using the plugin and the keyboard isn't open yet, wait for the\n // window to resize so we can get an accurate estimate of the keyboard size,\n // otherwise we do nothing and let nativeShow call keyboardShow once we have\n // an exact keyboard height\n // if the keyboard is already open, go ahead and scroll the input into view\n // if necessary\n if (!ionic.keyboard.isOpen && !keyboardHasPlugin()) {\n keyboardWaitForResize(keyboardShow, true);\n\n } else if (ionic.keyboard.isOpen) {\n keyboardShow();\n }\n}", "function handleInput(input) {\n switch (input) {\n\n case 'enter':\n enterKey = true;\n break;\n\n case 'space':\n spaceKey = true;\n break;\n\n case 'left':\n leftKey = true;\n break;\n\n case 'up':\n upKey = true;\n break;\n\n case 'right':\n rightKey = true;\n break;\n\n case 'down':\n downKey = true;\n }\n}", "handleKeyPress(e) {\n if ((e.keyCode === 13 && this.state.fieldsString.length) || e.keyCode === 9) {\n e.preventDefault();\n this.handleSelection();\n this.handleBlur();\n } else if (e.keyCode === 38) {\n e.preventDefault();\n this.higherSuggestion();\n } else if (e.keyCode === 40) {\n e.preventDefault();\n this.lowerSuggestion();\n } else if (e.keyCode === 27) {\n e.preventDefault();\n this.handleBlur();\n } else {\n this.updateFieldKv(e);\n }\n }", "function handleTyping(event){\n if(event.key === \"Enter\" ){\n for(let i=0; i< form.length; i++){\n if(form[i].id === \"input-title\"){\n form[id=\"description-area\"].focus();\n }\n }\n }\n\n }", "function keypress(e)\n {\n var target = e.target || {},\n keyCode = rcube_event.get_keycode(e);\n\n if (!has_focus || target.nodeName == 'INPUT' && keyCode != 38 && keyCode != 40 || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')\n return true;\n\n switch (keyCode) {\n case 38:\n case 40:\n case 63232: // 'up', in safari keypress\n case 63233: // 'down', in safari keypress\n var li = p.keyboard ? container.find(':focus').closest('li') : [];\n if (li.length) {\n focus_next(li, (mod = keyCode == 38 || keyCode == 63232 ? -1 : 1));\n }\n return rcube_event.cancel(e);\n\n case 37: // Left arrow key\n case 39: // Right arrow key\n var id, node, li = container.find(':focus').closest('li');\n if (li.length) {\n id = dom2id(li);\n node = indexbyid[id];\n if (node && node.children.length && node.collapsed != (keyCode == 37))\n toggle(id, rcube_event.get_modifier(e) == SHIFT_KEY); // toggle subtree\n }\n return false;\n\n case 9: // Tab\n if (p.keyboard && p.tabexit) {\n // jump to last/first item to move focus away from the treelist widget by tab\n var limit = rcube_event.get_modifier(e) == SHIFT_KEY ? 'first' : 'last';\n focus_noscroll(container.find('li[role=treeitem]:has(a)')[limit]().find('a:'+limit));\n }\n break;\n }\n\n return true;\n }", "function eventcheck(event) {\n if (!event)\n return;\n try {\n var obj = event.target;\n if (obj.mozIsTextField) {\n if (event.keyCode == 9 || event.keyCode == 13) {\n if (obj.id == gtGrdObj(event.target.parentNode).editCtrl) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else if (obj.value == \"\" && getIAttribute(event.target.nextSibling, \"q\") == \"t\") {\n event.preventDefault(true);\n event.stopPropagation();\n }\n }\n }\n }\n catch (ex) { }\n}", "handleFocus() {\n this.adapter_.addClass(cssClasses.FOCUSED);\n this.adapter_.floatLabel(true);\n this.notchOutline(true);\n this.adapter_.activateBottomLine();\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "function alphaValLeader(input){\r\n\tvar key;\r\n\tdocument.getElementById ? key = input.keyCode: key = input.which;\r\n\tif(event.keyCode == 13){\r\n\t\tgetNames();\r\n\t}\r\n\treturn ((key > 64 && key < 91) || (key > 96 && key < 123) || key == 8 || key == 39 || key == 16 || key == 13);\r\n}", "function onkeyForSearchInput(event)\n{\n //.charCode or .keyCode ??\n if(event.keyCode == 13) //ENTER key\n {\n //trigger already registered \"click\" handler\n document.getElementById('search-button').click();\n }\n}", "_handleKeydown(event) {\n if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "function focus(){}", "function activateKeyEvent(clickedCard){\n//selects inputs and addEventlistner to keyup\t\n\tinput.addEventListener(\"keyup\", function(){\n//checks the e.keyCode equals 13 is enter\n\t\tif(event.keyCode === 13) {\n//if the condition is true it calls functions to clearInput\t\t\t\n\t\t\tclearInputEvent()\n//otherwise if false \t\t\n\t\t}else {\n//if the condition is false it calls function to mirrorText passes clickedCard\t\t\n\t\tmirrorText(clickedCard);\n\t\t}\n\t\t\n\t\t\n\t});\n}", "function enter_detector(e) {\r\n\t// if enter key is pressed lose focus\r\n\tif(e.which==13||e.keyCode==13){\r\n\t$(this).blur();\r\n\t}\r\n\t}", "keyPress(e) {\n if ((this.type != 'string' || !this.props.p.multiline) && e.key == 'Enter') {\n this.paramChanged(e.target.value);\n e.preventDefault(); // eat the Enter so it doesn't get in our input field\n }\n }", "focus() {\n if (this.disabled || this.matches(':focus-within')) {\n // Don't shift focus from an element within the text field, like an icon\n // button, to the input when focus is requested.\n return;\n }\n super.focus();\n }", "function focusDefaultInput()\r\n{\r\n window.focus();\r\n $(\".text:not(.tabInaccessible):first\").focus();\r\n}", "function checkIfInputting() {\r\n if (document.activeElement.localName != 'textarea' && document.activeElement.localName != 'input')\r\n return true;\r\n else\r\n return false;\r\n}", "function bindEventsToInput(element) {\n element._input.addEventListener('keydown', function (e) {\n if (element.busy && e.keyCode === _keyCode2.default.SPACE) {\n e.preventDefault();\n }\n });\n // prevent toggle can be trigger through SPACE key on Firefox\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n element._input.addEventListener('click', function (e) {\n if (element.busy) {\n e.preventDefault();\n }\n });\n }\n}", "onInputKeyDown(e) {\n const { input } = this.state;\n const { keyCode, target } = e;\n\n // on enter key pressed, add new list item\n if (keyCode === ENTER) {\n e.preventDefault();\n if (input === \"\") {\n return;\n }\n\n this.addListItem(input);\n }\n }", "function isSelectable(element) {\r\n var selectableTypes = [\"search\", \"text\", \"password\"];\r\n return (element.tagName == \"INPUT\" && selectableTypes.indexOf(element.type) >= 0) ||\r\n element.tagName == \"TEXTAREA\";\r\n }", "function focusInput() { \n input.focus()\n}", "function onKeyPress(event)\n{\n var element = event.currentTarget;\n switch(event.keyCode){\n case 13: // 'enter'\n event.preventDefault(); \n return;\n case 43: // '+'\n case 45: // '-'\n case 46: // '.'\n if(element.id==\"age_element\" || element.id==\"id_element\"){\n event.preventDefault();\n return;\n }\n break;\n default: \n break;\n }\n\n onChangeContact();\n}", "keyDownHandler(event) {\n this.handleMoveOnKeyPress(event);\n // activate tab content on enter and tab if tab has focus\n if ((event.keyCode === 13 || event.keyCode === 32) && this.focusedControl) {\n this.focusedControl.click();\n }\n }", "function proximoInput(id, evento) {\n\n if(evento.keyCode == 13) {\n document.getElementById(id). focus()\n }\n}", "onElementKeyDown(event) {\n const me = this;\n\n // flagging event with handled = true used to signal that other features should probably not care about it\n if (event.handled) return;\n\n if (!me.editorContext) {\n const key = event.key,\n editingStartedWithCharacterKey = me.autoEdit && (key.length === 1 || key === 'Backspace');\n\n // enter or f2 to edit, or any character key if autoEdit is enabled\n if ((editingStartedWithCharacterKey || validNonEditingKeys[key]) && me.grid.focusedCell) {\n event.preventDefault();\n\n if (!me.startEditing(me.grid.focusedCell)) {\n return;\n }\n\n const inputField = me.editor.inputField,\n input = inputField.input;\n\n // if editing started with a keypress and the editor has an input field, set its value\n if (editingStartedWithCharacterKey && input) {\n // Simulate a keydown in an input field by setting input value\n // plus running our internal processing of that event\n input.value = key === 'Backspace' ? '' : key;\n inputField.internalOnInput(event);\n\n // IE11 + Edge put caret at 0 when focusing\n inputField.moveCaretToEnd();\n }\n }\n } else {\n // enter\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n if (me.finishEditing()) {\n // Finalizing might have been blocked by an invalid value\n if (!me.isEditing) {\n // Enter in combination with special keys finishes editing\n // On touch Enter always finishes editing. Feels more natural since no tab-key etc.\n if (event.ctrlKey || event.metaKey || event.altKey || me.grid.touch) {\n return;\n }\n // Edit previous\n else if (event.shiftKey) {\n if (me.grid.navigateUp()) {\n me.startEditing(me.grid.focusedCell);\n }\n }\n // Edit next\n else if (me.grid.navigateDown()) {\n me.startEditing(me.grid.focusedCell);\n }\n }\n }\n }\n\n // f2\n if (event.key === 'F2') {\n event.preventDefault();\n me.finishEditing();\n }\n\n // esc\n if (event.key === 'Escape') {\n event.stopPropagation();\n event.preventDefault();\n me.cancelEditing();\n }\n\n // tab\n if (event.key === 'Tab') {\n event.preventDefault();\n\n let focusedCell = me.grid.focusedCell;\n\n if (focusedCell) {\n let cellInfo = me.getAdjacentEditableCell(focusedCell, !event.shiftKey);\n\n if (cellInfo) {\n if (me.finishEditing()) {\n me.grid.focusCell(cellInfo, {\n animate: 100\n });\n\n me.startEditing(cellInfo);\n }\n }\n }\n }\n\n // prevent arrow keys from moving editor\n if (validEditingKeys[event.key]) {\n event.handled = true;\n }\n }\n }", "keyDownHandler(event) {\r\n if (event.keyCode === 13 && this.focusedControl) {\r\n this.focusedControl.click();\r\n }\r\n }", "onInternalKeyDown(event) {\n const me = this,\n active = me.navigator.activeItem;\n\n switch (event.key) {\n case ' ':\n if (!event.target.readOnly) {\n break; // eslint-disable-line\n }\n case 'Enter': // eslint-disable-line\n if (active) {\n this.onItemClick(active, event);\n\n // Stop the keydown from bubbling.\n // And stop it from creating a keypress event.\n // No further action should be taken after item selection.\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n }\n }", "setInputFocus(){\n this.textInput.removeAttribute('disabled');//Remove disabled attrib so input is interactible again\n this.textInput.focus();\n this.textInput.select();\n }", "onFocus() {\r\n // Stub\r\n }", "onElementKeyDown(event) {\n const me = this;\n\n // flagging event with handled = true used to signal that other features should probably not care about it.\n // for this to work you should specify overrides for onElementKeyDown to be run before this function\n // (see for example CellEdit feature)\n if (event.handled) return;\n\n if (event.target.matches('.b-grid-header.b-depth-0')) {\n me.handleHeaderKeyDown(event);\n } else if (event.target === this.element || (BrowserHelper.isIE11 && event.currentTarget === this.element)) {\n // IE11 Browser check is not placed in EventHelper to maintain built-in delegated functionality\n me.handleViewKeyDown(event);\n }\n // If focus is *within* a cell (eg WidgetColumn or CheckColumn), jump up to focus the cell.\n else if (event.key === 'Escape' && me.isActionableLocation) {\n const focusedCell = ObjectHelper.clone(me.focusedCell);\n focusedCell.element = null;\n me.focusCell(focusedCell);\n DomHelper.focusWithoutScrolling(me.element);\n }\n }", "function onKeyDown(e) {\n if (e.key !== 'Tab' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {\n return;\n }\n\n if (isValidFocusTarget(document.activeElement)) {\n addFocusVisibleAttribute(document.activeElement);\n }\n\n hadKeyboardEvent = true;\n }", "function KeyDown(elmt, event, Page){\r\n var Key = event.key;\r\n ///alert(Key);\r\n if(Key === \"Enter\"){\r\n $(elmt).blur();\r\n }else if(Key === \"Escape\"){\r\n $(elmt).val($(elmt).attr(\"OriginalValue\"));\r\n }\r\n}", "onElementKeyDown(event) {\n const me = this; // flagging event with handled = true used to signal that other features should probably not care about it.\n // for this to work you should specify overrides for onElementKeyDown to be run before this function\n // (see for example CellEdit feature)\n\n if (event.handled) return;\n\n if (event.target.matches('.b-grid-header.b-depth-0')) {\n me.handleHeaderKeyDown(event);\n } else if (event.target === me.focusElement || BrowserHelper.isIE11 && event.currentTarget === me.focusElement) {\n // IE11 Browser check is not placed in EventHelper to maintain built-in delegated functionality\n me.handleViewKeyDown(event);\n } // If focus is *within* a cell (eg WidgetColumn or CheckColumn), jump up to focus the cell.\n else if (event.key === 'Escape' && me.isActionableLocation) {\n const focusedCell = ObjectHelper.clone(me.focusedCell);\n focusedCell.element = null;\n me.focusCell(focusedCell);\n DomHelper.focusWithoutScrolling(me.element);\n }\n }", "function addFocusEventHandlers(p_sType, p_aArgs) {\r\n\r\n var me = this;\r\n\r\n function isFocusable(el) {\r\n\r\n var sTagName = el.tagName.toUpperCase(),\r\n bFocusable = false;\r\n \r\n switch (sTagName) {\r\n \r\n case \"A\":\r\n case \"BUTTON\":\r\n case \"SELECT\":\r\n case \"TEXTAREA\":\r\n\r\n if (!Dom.isAncestor(me.element, el)) {\r\n Event.on(el, \"focus\", onElementFocus, el, true);\r\n bFocusable = true;\r\n }\r\n\r\n break;\r\n\r\n case \"INPUT\":\r\n\r\n if (el.type != \"hidden\" && \r\n !Dom.isAncestor(me.element, el)) {\r\n\r\n Event.on(el, \"focus\", onElementFocus, el, true);\r\n bFocusable = true;\r\n\r\n }\r\n\r\n break;\r\n \r\n }\r\n\r\n return bFocusable;\r\n\r\n }\r\n\r\n this.focusableElements = Dom.getElementsBy(isFocusable);\r\n \r\n }", "onKeyPress(e){\n (e.key === 'Enter') && this.onAddButton()\n }", "keepFocus () {\n let element = this.activeElement;\n let allTabbableElements = [];\n\n // Don't keep the focus if the browser is unable to support\n // CSS3 selectors\n try {\n allTabbableElements = element.querySelectorAll(this.tabbableElements.join(','));\n } catch (ex) {\n return;\n }\n\n let firstTabbableElement = this.getFirstElementVisible(allTabbableElements);\n let lastTabbableElement = this.getLastElementVisible(allTabbableElements);\n\n let focusHandler = (event) => {\n var keyCode = event.which || event.keyCode;\n\n // TAB pressed\n if (keyCode !== 9) {\n return;\n }\n\n // Polyfill to prevent the default behavior of events\n event.preventDefault = event.preventDefault || function () {\n event.returnValue = false;\n };\n\n // Move focus to first element that can be tabbed if Shift isn't used\n if (event.target === lastTabbableElement && !event.shiftKey) {\n event.preventDefault();\n firstTabbableElement.focus();\n\n // Move focus to last element that can be tabbed if Shift is used\n } else if (event.target === firstTabbableElement && event.shiftKey) {\n event.preventDefault();\n lastTabbableElement.focus();\n }\n };\n\n this.Helpers.on('keydown', element, focusHandler);\n }", "function autoSubmitIfFilled(element, event){\r\n\tvar pool = element.name.split(\"_\");\r\n\tif (pool.length == 3 ||(pool.length>3 && pool[3]!=\"radio\")){\r\n\t\tif (pool[0].indexOf(\"in\")!=-1){\r\n\t\t\tif (!isNaN(pool[2])){\r\n\t\t\t\tif (element.value.length == pool[2]){\r\n\t\t\t\t\tms(\"[enter]\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!MAC && !isIE)\r\n\t\tevent.returnValue = true;\r\n}", "function enterKeySelection(key, value) {\n if (key === \"Enter\") {\n $(\"#\" + value).click();\n }\n}", "function eventInputManagerKeyControlKeyDown(inputmanager, element, event)\n{\n\tvar isKeyControlEnabled = webclient.settings.get(\"global/shortcuts/enabled\", false);\n\n\tif (isKeyControlEnabled && !isMenuOpen()){\n\t\tif (event.keyCode != inputmanager.previousKeyCode){\n\t\t\tinputmanager.keyStrokes.push(event.keyCode.fromCharCode());\n\t\t\tinputmanager.previousKeyCode = event.keyCode;\n\t\t}\n\n\t\t/* Check if current keystrokes are either registered by any module.\n\t\t * if registered then return false, because module wants to handle it.\n\t\t */\n\t\tvar keyCombination = inputmanager.keyStrokes ? inputmanager.keyStrokes.join(\"+\") : '';\n\t\t// We want to handle keystrokes on input fields only in dialogs.\n\t\tvar handleKeysOnInput = (typeof parentWebclient != \"undefined\") ? false : true;\n\n\t\tif (event && event.target && (handleKeysOnInput ? checkFieldsForKeycontrol(event) : true)){\n\t\t\tfor (var type in inputmanager.keyControlBindings){\n\t\t\t\tfor (var i in inputmanager.keyControlBindings[type]){\n\t\t\t\t\tvar binding = inputmanager.keyControlBindings[type][i];\n\n\t\t\t\t\tif (inputmanager.isKeyRegisteredToObject(binding, keyCombination)) {\n\t\t\t\t\t\tif (typeof event.preventDefault != 'undefined') event.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"] || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]) && !Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"hasModifierKey\"])(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"] || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]) && !Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"hasModifierKey\"])(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "_focusHandler() {\n const i = document.querySelector('paper-input');\n if (!i) {\n return;\n }\n i.inputElement.focus();\n }", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.ENTER || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.SPACE) && !(0,_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.hasModifierKey)(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "function isInput( e ) {\n\n var t = getTN( e );\n\n return t === 'input' || t === 'textarea';\n\n }", "function Edit_KeyDown(event)\n{\n\t//switch the event key\n\tswitch (event.keyCode)\n\t{\n\t\tcase 0x0d://\"Enter\":\n\t\t\t//if this is multiline\n\t\t\tif (/textarea/gi.test(this.tagName))\n\t\t\t{\n\t\t\t\t//stop the propagation as this must be processed as a normal event (no action or error)\n\t\t\t\tBrowser_CancelBubbleOnly(event);\n\t\t\t}\n\t\t//fallthrough\n\t\tcase 0x26://\"Up\":\n\t\tcase 0x28://\"Down\":\n\t\tcase 0x10://\"Shift\":\n\t\tcase 0x11://\"Control\":\n\t\tcase 0x12://\"Alt\":\n\t\tcase 0x08://\"BACKSPACE\":\n\t\tcase 0x25://\"Left\":\n\t\tcase 0x27://\"Right\":\n\t\tcase 0x23://\"End\":\n\t\tcase 0x24://\"Home\":\n\t\tcase 0x2e://\"Delete\":\n\t\t\t//dont process anything here\n\t\t\treturn;\n\t}\n\t//get the html\n\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t//valid?\n\tif (theHTML)\n\t{\n\t\t//has space filled?\n\t\tvar spaceFilled = Get_Number(theHTML.InterpreterObject.Properties[__NEMESIS_PROPERTY_SPACEFILLED], null);\n\t\t//valid?\n\t\tif (spaceFilled != null)\n\t\t{\n\t\t\t//helpers\n\t\t\tvar caret;\n\t\t\t//can we access selection start and end?\n\t\t\tif (typeof theHTML.selectionStart == \"number\" && typeof theHTML.selectionEnd == \"number\")\n\t\t\t{\n\t\t\t\t//no selection?\n\t\t\t\tif (theHTML.selectionStart == theHTML.selectionEnd)\n\t\t\t\t{\n\t\t\t\t\t//are we in Edge?\n\t\t\t\t\tif (__BROWSER_EDGE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get caret position\n\t\t\t\t\t\tcaret = theHTML.selectionStart;\n\t\t\t\t\t\t//edge is getting confused here, lets just delete the character in front of us\n\t\t\t\t\t\ttheHTML.value = theHTML.value.substr(0, theHTML.selectionStart) + theHTML.value.substr(theHTML.selectionStart + 1);\n\t\t\t\t\t\t//reset caret\n\t\t\t\t\t\ttheHTML.selectionStart = caret;\n\t\t\t\t\t\ttheHTML.selectionEnd = theHTML.selectionStart;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//get caret position\n\t\t\t\t\t\tcaret = theHTML.selectionStart;\n\t\t\t\t\t\t//reset caret\n\t\t\t\t\t\ttheHTML.selectionStart = caret;\n\t\t\t\t\t\ttheHTML.selectionEnd = caret + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we have document selection?\n\t\t\telse if (document.selection)\n\t\t\t{\n\t\t\t\t//get its text range\n\t\t\t\tvar textRange = document.selection.createRange();\n\t\t\t\t//no selection?\n\t\t\t\tif (textRange.text.length == 0)\n\t\t\t\t{\n\t\t\t\t\t// Move selection one step forward\n\t\t\t\t\ttextRange.moveEnd(\"character\", 1);\n\t\t\t\t\t//select it\n\t\t\t\t\ttextRange.select();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "onKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n\t\tif (event.key === 'Enter') {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif (this.state.shift) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tvalue:this.state.value+'\\n',\n\t\t\t\t})\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.handleSubmit();\n\t\t\t}\n\t\t} else if (event.key === 'Shift') {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshift: true,\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function stopEnterKeyPress(evt) {\n var evt = (evt) ? evt : ((event) ? event : null);\n var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);\n \n if ((evt.keyCode == 13) && (node.type==\"text\")) {return false;}\n\n}", "async onElementKeyDown(event) {\n const me = this; // flagging event with handled = true used to signal that other features should probably not care about it\n\n if (event.handled || !me.grid.focusElement.contains(event.target)) return;\n\n if (!me.editorContext) {\n const key = event.key,\n editingStartedWithCharacterKey = me.autoEdit && (key.length === 1 || key === 'Backspace'); // enter or f2 to edit, or any character key if autoEdit is enabled\n\n if ((editingStartedWithCharacterKey || validNonEditingKeys[key]) && me.grid.focusedCell) {\n event.preventDefault();\n\n if (!me.startEditing(me.grid.focusedCell)) {\n return;\n }\n\n const inputField = me.editor.inputField,\n input = inputField.input; // if editing started with a keypress and the editor has an input field, set its value\n\n if (editingStartedWithCharacterKey && input) {\n // Simulate a keydown in an input field by setting input value\n // plus running our internal processing of that event\n input.value = key === 'Backspace' ? '' : key;\n inputField.internalOnInput(event); // IE11 + Edge put caret at 0 when focusing\n\n inputField.moveCaretToEnd();\n }\n }\n } else {\n switch (event.key) {\n case 'Enter':\n me.onEnterKeyPress(event);\n break;\n\n case 'F2':\n event.preventDefault();\n me.finishEditing();\n break;\n\n case 'Escape':\n event.stopPropagation();\n event.preventDefault();\n me.cancelEditing();\n break;\n\n case 'Tab':\n me.onTabKeyPress(event);\n break;\n } // prevent arrow keys from moving editor\n\n if (validEditingKeys[event.key]) {\n event.handled = true;\n }\n }\n }", "_handleInputFocus(e) {\n this.refs.input.focus();\n }", "focus() {}", "focus() {}", "function initConvertEnterToTab() {\n $('body').on('keydown', 'input, select', function(e) {\n //console.log('init convert enter to tab');\n if( $(this).hasClass('submit-on-enter-field') ) {\n //console.log('submit-on-enter-field !');\n return;\n }\n //console.log('continue convert enter to tab');\n\n var self = $(this)\n , form = self.parents('form:eq(0)')\n , focusable\n , next\n ;\n if( e.keyCode == 13 ) {\n //focusable = form.find('input,a,select,button,textarea').filter(':visible');\n focusable = form.find('input,select').filter(':visible').not(\"[readonly]\").not(\"[disabled]\");\n next = focusable.eq(focusable.index(this)+1);\n //console.log('next.length='+next.length);\n if( next.length ) {\n //printF(next,'go next:');\n next.focus();\n } else {\n //form.submit();\n }\n return false;\n }\n });\n}", "function handleKeypress( e ) {\r\n if ( e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 13 ) {\r\n return;\r\n }\r\n\r\n var $this = $( this );\r\n var isInput = $this.is( \".bselect-search-input\" );\r\n\r\n switch ( e.keyCode ) {\r\n // UP\r\n case 38:\r\n if ( isInput ) {\r\n $( e.delegateTarget ).find( \".bselect-option:visible:last\" ).focus();\r\n } else {\r\n $this.prevAll( \".bselect-option:visible\" ).eq( 0 ).focus();\r\n }\r\n break;\r\n\r\n // DOWN\r\n case 40:\r\n if ( isInput ) {\r\n $( e.delegateTarget ).find( \".bselect-option:visible:first\" ).focus();\r\n } else {\r\n $this.nextAll( \".bselect-option:visible\" ).eq( 0 ).focus();\r\n }\r\n break;\r\n\r\n // ENTER\r\n case 13:\r\n if ( !isInput ) {\r\n $this.trigger( \"click\" );\r\n }\r\n break;\r\n }\r\n\r\n return false;\r\n }", "function onEditableFocus() {\n\t\t// Gecko does not support 'DOMFocusIn' event on which we unlock selection\n\t\t// in selection.js to prevent selection locking when entering nested editables.\n\t\tif ( CKEDITOR.env.gecko )\n\t\t\tthis.editor.unlockSelection();\n\n\t\t// We don't need to force selectionCheck on Webkit, because on Webkit\n\t\t// we do that on DOMFocusIn in selection.js.\n\t\tif ( !CKEDITOR.env.webkit ) {\n\t\t\tthis.editor.forceNextSelectionCheck();\n\t\t\tthis.editor.selectionChange( 1 );\n\t\t}\n\t}", "function FocusEvent(type) {\n var evt = document.createEvent('FocusEvent');\n evt.initEvent(type, false, false);\n return evt;\n }", "function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleAttribute(e.target);\n }\n }", "_handleKeyup(e) {\n if (\n (this.details &&\n typeof this.details.open === \"undefined\" &&\n e.keyCode == 13) ||\n e.keyCode == 32\n ) {\n this.toggleOpen();\n e.preventDefault();\n e.stopPropagation();\n }\n }", "_inputFocusHandler() {\n const that = this;\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.setAttribute('focus', '');\n }\n if (that.radixDisplay) {\n that.$.radixDisplayButton.setAttribute('focus', '');\n }\n if (that.showUnit) {\n that.$.unitDisplay.setAttribute('focus', '');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n that.setAttribute('focus', '');\n\n if (that.outputFormatString) {\n that.$.input.value = that._editableValue;\n }\n }", "onElementKeyDown(event) {\n // only catch space on grid element, not in editors etc...\n if (event.target === this.client.focusElement && event.key === ' ') {\n event.preventDefault();\n\n this.toggleCollapse(this.grid.focusedCell.id);\n }\n }", "focusInput() {\n if (this.mode == Editor.MODE_COMMAND)\n this.commandInput.focus(this.input.getCursorPosition());\n else\n this.input.focus(this.input.getCursorPosition());\n }", "renderedKeyDown(e) {\n const shift = e.shiftKey;\n const ctrl = e.ctrlKey;\n if ((shift || ctrl) && e.key === 'Enter') {\n this.setState({ view: true });\n return false;\n }\n\n switch (e.key) {\n case 'ArrowUp':\n this.props.focusAbove();\n break;\n case 'ArrowDown':\n this.props.focusBelow();\n break;\n case 'Enter':\n this.openEditor();\n e.preventDefault();\n return false;\n default:\n }\n return true;\n }", "function keydown(e){\n e= e || window.event\n var propagate= true\n var ele= e.target || e.srcElement\n if(ele.nodeType == 3) ele= ele.parentNode\n var code= e.keyCode || e.which\n var input= (ele.tagName == 'INPUT' || ele.tagName == 'TEXTAREA')\n if(code >= 112 && code <= 123){ // F1-12\n shortcut_call(code-112)\n propagate= false\n } else if(code == 32 && !input){ // space\n el('bar').select()\n propagate= false\n } else if(ele.id == 'bar'){ // up and down\n if(code == 38) backCmd()\n else if(code == 40) nextCmd()}\n if(!propagate){\n e.cancelBubble= true; e.returnValue= false\n if(e.stopPropagation)\n {e.stopPropagation(); e.preventDefault()}\n return false}}", "if (!node.contains(document.activeElement)) {\n node.focus();\n }", "setFocus() {\n const focusable = this.wrapper.querySelectorAll('a, button, input, select')[0];\n if (focusable) {\n focusable.focus();\n }\n }", "focus() {\n this.$.input._focusableElement.focus();\n }", "_onInputChangeHandler(event) {\n // stops the current event\n event.stopPropagation();\n\n const handle = event.target.closest(`.${CLASSNAME_HANDLE}`);\n\n if (event.target === document.activeElement) {\n this._focus(event);\n }\n\n this._updateValue(handle, event.target.value, true);\n }", "function bindKeyboardNav() {\n $(container).keydown(function (e) {\n if ($(container).is(':visible')) {\n switch (e.which) {\n case 13:\n // enter\n break;\n case 38:\n // up\n if ($(e.target).is('a')) {\n e.preventDefault();\n var anchors = $(container).find('a');\n var current = $(anchors).index($(e.target));\n current == 0 ? $(container).find('input').focus() : anchors[current - 1].focus();\n }\n if ($(e.target).is('input')) {\n e.preventDefault();\n $(container).find('a').last().focus();\n }\n break;\n case 40:\n // down\n if ($(e.target).is('a')) {\n e.preventDefault();\n var anchors = $(container).find('a');\n var current = $(anchors).index($(e.target));\n current == anchors.length - 1 ? $(container).find('input').focus() : anchors[current + 1].focus();\n }\n if ($(e.target).is('input')) {\n e.preventDefault();\n $(container).find('a').first().focus();\n }\n break;\n default:\n $(container).find('input').focus();\n break;\n }\n }\n });\n }", "function isPotentiallyFocusable(element) {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}" ]
[ "0.66177005", "0.6552543", "0.6396089", "0.62923485", "0.6270373", "0.6253724", "0.620435", "0.6187073", "0.61057436", "0.60752434", "0.6061508", "0.6040187", "0.6040187", "0.6040073", "0.6029886", "0.6013559", "0.5984237", "0.5984237", "0.5968751", "0.5960234", "0.5944438", "0.59294206", "0.5915798", "0.59149307", "0.59109265", "0.59109265", "0.59069014", "0.5887681", "0.5876782", "0.5863277", "0.5851118", "0.58447605", "0.58314997", "0.5815554", "0.5814305", "0.58113366", "0.58045495", "0.580174", "0.57941943", "0.5782007", "0.5765243", "0.57601064", "0.5758439", "0.5753082", "0.5751629", "0.57460886", "0.5744362", "0.57386893", "0.57309085", "0.572664", "0.57153964", "0.5714938", "0.57092375", "0.57034487", "0.570188", "0.57013077", "0.56841284", "0.56840545", "0.56830305", "0.56746894", "0.566582", "0.5665401", "0.5657677", "0.5656474", "0.5655575", "0.565542", "0.5651773", "0.56293803", "0.5627709", "0.56263447", "0.5624976", "0.56165105", "0.56165105", "0.56099665", "0.56057465", "0.56004524", "0.5592895", "0.55837977", "0.558023", "0.55741036", "0.5573598", "0.55731785", "0.55731785", "0.5572569", "0.5571463", "0.5571047", "0.557098", "0.5567854", "0.5565531", "0.55615014", "0.5560405", "0.5557739", "0.5549644", "0.5543888", "0.5543509", "0.5540935", "0.55406153", "0.5538354", "0.5538307", "0.5537261" ]
0.5596671
76
We need this so that the find mode HUD doesn't match its own searches.
function insertSpaces(query) { var newQuery = ""; for (var i = 0; i < query.length; i++) { if (query[i] == " " || (i + 1 < query.length && query[i + 1] == " ")) newQuery = newQuery + query[i]; else newQuery = newQuery + query[i] + "<span style=\"font-size: 0px;\"> </span>"; } return newQuery; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleSearch () {}", "function _launchFind() {\n var editor = EditorManager.getFocusedEditor();\n if (editor) {\n var codeMirror = editor._codeMirror;\n\n // Bring up CodeMirror's existing search bar UI\n codeMirror.execCommand(\"find\");\n\n // Prepopulate the search field with the current selection, if any\n $(\".CodeMirror-dialog input[type='text']\")\n .attr(\"value\", codeMirror.getSelection())\n .get(0).select();\n }\n }", "function find() {}", "function _startFind() {\n\t\tfunction isValidQuery(s) {\n\t\t\tvar match = s.match(/^[\\s]*$/g);\n\t\t\treturn match ? false : true;\n\t\t}\n\n\t\tif ($dialogInput && currentEditor) {\n\t\t\tvar text = _getVisibleText();\n\t\t\tvar rawQuery = $dialogInput.val();\n\t\t\tvar query = isValidQuery(rawQuery) ? rawQuery : \"\";\n\t\t\tif (query.length > 0) {\n\t\t\t\t_doHighlight(text, query);\n\t\t\t}\n\t\t}\n\t}", "function findWords(){\n if(options.isOn == false){\n options.isOn = true;\n options.timer.check(\"Traverse Grid\");\n result = traverseGrid();\n options.isOn = false;\n loading.stop();\n options.timer.check(\"Display Results\");\n displayResults(result);\n options.timer.stop()\n displayTime();\n }\n }", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function defaultFind() {\n var search1 = $(\"input#search1\").val()\n var search2 = $(\"input#search2\").val()\n var csrfid = $(\"input#csrf_id_find\").val()\n var findUrl;\n if(typeof(finderValues[actTab]) !== 'undefined') {\n findUrl = finderValues[actTab].findUrl;\n $(\"#qapps\").load(findUrl, {lastname: search1, firstname: search2, csrf_token: csrfid,\n action: actTab, flag: actTab === 'cancellation' ? searchFlag : ''},\n showSelect);\n }\n }", "function find() {\n const searchInput = document\n .querySelector('#search-bar')\n .value.toUpperCase();\n const fullList = document.querySelectorAll('.pokedex-list__item');\n\n fullList.forEach(function (entry) {\n if (entry.innerText.toUpperCase().indexOf(searchInput) > -1) {\n entry.style.display = '';\n } else {\n entry.style.display = 'none';\n }\n });\n }", "function searchUILoaded() { if (MyOptions) MyOptions.resetToolTips(); }", "function matchingEngine() {\n updateScoreBoard();\n if (selectedElements[0][0].firstChild.className == selectedElements[1][0].firstChild.className) {\n $(selectedElements[1]).addClass('open show match');\n $(selectedElements[0]).addClass('match');\n $(selectedElements[1]).off('click');\n matchFound();\n selectedElements = [];\n } else {\n $(selectedElements[1]).addClass('open show nomatch');\n $(selectedElements[0]).addClass('nomatch');\n setTimeout(() => {\n $(selectedElements[1]).removeClass('open show nomatch');\n $(selectedElements[0]).removeClass('open show nomatch');\n $(selectedElements[0]).on('click', onClickEvent);\n selectedElements = [];\n }, 800);\n }\n}", "function performSearch() {\n giphiesPage.searchInput().type('drake');\n giphiesPage.searchButton().click();\n\n firstGiph = giphiesPage.allGiphies().first();\n }", "function DummyFindBar() {}", "function doFind() {\n //Set the search text to the value in the box\n if (this.id == 'search') {\n findParams.searchText = dom.byId(\"roadName\").value;\n whichSearch = \"grid\";\n } else if (this.id == 'search2') {\n findParams.searchText = dom.byId(\"parcelInfo\").value;\n whichSearch = \"grid1\";\n }\n findTask.execute(findParams, showResults);\n }", "function searchState() {\n this.posFrom = this.posTo = null;\n this.lastQuery = this.query = this.replaceText = this.queryText = null;\n this.dialog = this.overlay = null;\n this.caseSensitive = this.regex = this.opened = this.matches = null;\n }", "function searching() {\n $('.searchboxfield').on('input', function () { // connect to the div named searchboxfield\n var $targets = $('.urbacard'); // \n $targets.show();\n //debugger;\n var text = $(this).val().toLowerCase();\n if (text) {\n $targets.filter(':visible').each(function () {\n //debugger;\n mylog(mylogdiv, text);\n var $target = $(this);\n var $matches = 0;\n // Search only in targeted element\n $target.find('h2, h3, h4, p').add($target).each(function () {\n tmp = $(this).text().toLowerCase().indexOf(\"\" + text + \"\");\n //debugger;\n if ($(this).text().toLowerCase().indexOf(\"\" + text + \"\") !== -1) {\n // debugger;\n $matches++;\n }\n });\n if ($matches === 0) {\n // debugger;\n $target.hide();\n }\n });\n }\n\n });\n\n\n}", "function search() {\n\t\n}", "find(input) {}", "function search() {\n return shell().Search;\n}", "function showOppSearchedArea(target) {\n if (!window.mapImg) {\n window.mapImg = searchGrid.grabImageData();\n var area = $(target).text().substr(5, 2);\n if (area) searchGrid.drawOppSearchArea(area);\n }\n}", "function unrankedFind(mode){\n return (mode['playerStatSummaryType'] == \"Unranked\")\n }", "ClearForSearch() {\n\t\tlet index = 0\n\n\t\tfor (index = 0; index < 14 * BRD_SQ_NUM; ++index) {\n\t\t\tthis.GameBoard.m_searchHistory[index] = 0\n\t\t}\n\n\t\tfor (index = 0; index < 3 * MAXDEPTH; ++index) {\n\t\t\tthis.GameBoard.m_searchKillers[index] = 0\n\t\t}\n\n\t\tthis.ClearPvTable()\n\t\tthis.GameBoard.m_ply = 0\n\t\tthis.SearchController.nodes = 0\n\t\tthis.SearchController.fh = 0\n\t\tthis.SearchController.fhf = 0\n\t\tthis.SearchController.start = Date.now()\n\t\tthis.SearchController.stop = false\n\t}", "function editSearch($quickFind) {\n // If there isn't already a value in the quickFind field\n if (!$quickFind.val() && $quickFind.attr('placeholder').toLowerCase() !== 'quick find') {\n $quickFind.val($quickFind.attr('placeholder'));\n }\n}", "_deferredInvocUpdateSearch() {\n QuickFilterBarMuxer.updateSearch();\n }", "arrayLikeSearch() {\r\n this.setEventListener();\r\n if (!this.display || this.display == this.selectedDisplay) {\r\n this.setEmptyTextResults();\r\n \r\n return true;\r\n }\r\n this.resultslength = this.results.length;\r\n this.$emit(\"results\", { results: this.results });\r\n this.load = false;\r\n\r\n if (this.display != this.selectedDisplay) {\r\n this.results = this.source.filter((item) => {\r\n return this.formatDisplay(item)\r\n .toLowerCase()\r\n .includes(this.display.toLowerCase())&& !item.invisible;\r\n });\r\n \r\n \r\n }\r\n }", "function searchMainWindow() {\n\tvar query = document.getElementById(\"searchinput\").value;\n\tsearch(query, 0);\n}", "function doGeneralImageSearch() {\n\n}", "function masterSearch(){\n switch (userCommand) {\n\n case \"my-tweets\":\n findTweets();\n break;\n\n case \"spotify-song\":\n spotifyNow();\n break;\n\n case \"movie-please\":\n movie();\n break;\n\n case \"directions-por-favor\":\n followDirections();\n break;\n }\n}", "function search(userInput) {\n if (userInput === \"room\") {\n // search an interactable\n writeToTerminal(\n \"With a sweeping look over the delapitated area you identify a few things..There is one door to the place, on the righthand side of the door there is a shady looking plant. Left of the door the roof seem to have fallen in and on the floor a bunch of odd moldy planks lie in a heap.behind you on the left quite close the the planks there is a big pool of coagulated stale blood.From the pool leading to inbehind a cupboard in the corner on the oposite side of the shady plant is a trail of the congealed old looking substance. the cupboard is closed but not sealed in any obvious way.\"\n );\n knowlage.knowRoom = true;\n actions.search = false;\n writeToTerminal(\"What do you do?\");\n itentifyAndSpliceFromInteractable(\"room\");\n map();\n }\n if (actions.search && interactable.includes(userInput)) {\n console.log(\"search success\");\n writeToTerminal(\"You searched the \" + userInput);\n whatDoesThisDo();\n actions.search = false;\n } else if (actions.search && !interactable.includes(userInput)) {\n // search FAIL\n writeToTerminal(\"You can't search that?\");\n actions.search = false;\n }\n}", "async matchFinder(target, seedArray) {\n\t\t//Your logic here\n\t}", "function search_phase() {\n game_phase = SEARCHING;\n\n // Start of timer for search time\n begin = new Date();\n\n // Start circle becomes visible, target, cursor invisible\n d3.select('#start').attr('display', 'block').attr('fill', 'none');\n d3.select('#target').attr('display', 'none').attr('fill', target_color);\n d3.select('#cursor').attr('display', 'none');\n // d3.select('#search_ring').attr('display', 'block').attr('r', r);\n d3.select('#message-line-1').attr('display', 'none');\n d3.select('#message-line-2').attr('display', 'none');\n d3.select('#message-line-3').attr('display', 'none');\n d3.select('#message-line-4').attr('display', 'none');\n d3.select('#too_slow_message').attr('display', 'none');\n d3.select('#trialcount').attr('display', 'block');\n }", "function glyphsMainSearchInput(searchSetID, str, e) {\n var searchset = document.getElementById(searchSetID);\n if(!searchset) { return; }\n \n var searchInput = document.getElementById(searchSetID + \"_inputID\");\n if(searchInput.show_default_message) { return; }\n\n if(!str) {\n if(searchInput) { str = searchInput.value; }\n }\n str = trim_string(str);\n if(!str) {\n eedbClearSearchResults(searchSetID);\n return;\n }\n\n if(gLyphsParseLocation(str)) { \n var charCode;\n if(e && e.which) charCode=e.which;\n else if(e) charCode = e.keyCode;\n if((charCode==13) || (e.button==0)) { \n gLyphsInitLocation(str);\n reloadRegion(); \n //dhtmlHistory.add(\"#config=\"+current_region.configUUID +\";loc=\"+current_region.asm+\"::\"+current_region.chrom+\":\"+current_region.start+\"..\"+current_region.end);\n gLyphsChangeDhtmlHistoryLocation();\n }\n eedbEmptySearchResults(searchSetID);\n return;\n }\n\n eedbEmptySearchResults(searchSetID);\n\n var searchDivs = allBrowserGetElementsByClassName(searchset,\"EEDBsearch\");\n for(i=0; i<searchDivs.length; i++) {\n var searchDiv = searchDivs[i];\n searchDiv.exact_match_autoclick = false;\n if(current_region.init_search_term) { searchDiv.exact_match_autoclick = true; }\n eedbSearchSpecificDB(searchSetID, str, e, searchDiv);\n }\n\n}", "function handleSearch(e) {\n setSearchRes([]);\t \n const idx = lunr(function() {\nthis.ref('id');\nthis.field('text');\nthis.metadataWhitelist = ['position'];\n//console.log('hook: ',mdPaths)\nmdRaws.forEach(function(raw) {\nthis.add(raw);\n}, this);\t\n});\nlet results = e.target.value !== \"\" ? idx.search(e.target.value) : [];\n//console.log(idx.search(e.target.value));\n//console.log('search result: ', searchResult);\n// let resultRaw = document.querySelector('.result-raw');\n//\t\tresultRaw.remove();\t\t\n\nsetBar(true);\nsetSearchRes(results);\t \n\nlet expanded = document.querySelector('.search-bar-expanded');\nlet dropdown = document.querySelector('.dropdown');\nlet navSearch = document.querySelector('.navbar__search');\n if (expanded !== null) {\ndropdown.style.display = 'block';\nnavSearch.style.position = 'relative';\t \n\t \n//\t console.log(mdRaws);\n }\n//console.log(expanded);\t\ndropdown.style.display = 'hide';\n}", "onKeyDownInternal() {\n // tslint:disable-next-line:max-line-length\n let inputElement = document.getElementById(this.viewer.owner.containerId + '_option_search_text_box');\n inputElement.blur();\n let text = inputElement.value;\n if (text === '') {\n return;\n }\n if (text.length >= 1 && this.searchIcon.classList.contains('e-de-op-search-icon')) {\n this.searchIcon.classList.add('e-de-op-search-close-icon');\n this.searchIcon.classList.remove('e-de-op-search-icon');\n }\n let height = this.isOptionsPane ? 215 : 292;\n let resultsContainerHeight = this.viewer.owner.getDocumentEditorElement().offsetHeight - height;\n this.clearSearchResultItems();\n this.viewer.owner.searchModule.clearSearchHighlight();\n let pattern = this.viewer.owner.searchModule.textSearch.stringToRegex(text, this.findOption);\n let endSelection = this.viewer.selection.end;\n let index = endSelection.getHierarchicalIndexInternal();\n this.results = this.viewer.owner.searchModule.textSearch.findAll(pattern, this.findOption, index);\n let results = this.results;\n if (isNullOrUndefined(results)) {\n this.viewer.renderVisiblePages();\n }\n if (results != null && results.length > 0) {\n if ((this.focusedElement.indexOf(this.navigateToPreviousResult) === -1) && this.isOptionsPane) {\n this.focusedElement.push(this.navigateToPreviousResult);\n }\n if ((this.focusedElement.indexOf(this.navigateToNextResult) === -1) && this.isOptionsPane) {\n this.focusedElement.push(this.navigateToNextResult);\n }\n this.viewer.owner.searchModule.navigate(this.results.innerList[this.results.currentIndex]);\n this.viewer.owner.searchModule.highlight(results);\n this.viewer.owner.searchModule.addFindResultView(results);\n // if (this.isOptionsPane) {\n this.resultsListBlock.style.display = 'block';\n this.resultsListBlock.style.height = resultsContainerHeight + 'px';\n this.resultContainer.style.display = 'block';\n let list = this.viewer.owner.findResultsList;\n let text = '';\n this.clearFocusElement();\n this.resultsListBlock.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n text += list[i];\n }\n this.resultsListBlock.innerHTML = text;\n for (let i = 0; i < this.resultsListBlock.children.length; i++) {\n this.focusedElement.push(this.resultsListBlock.children[i]);\n }\n let lists = this.resultsListBlock.children;\n let currentIndex = this.results.currentIndex;\n // tslint:disable-next-line:max-line-length\n this.messageDiv.innerHTML = this.localeValue.getConstant('Result') + ' ' + (currentIndex + 1) + ' ' + this.localeValue.getConstant('of') + ' ' + this.resultsListBlock.children.length;\n let listElement = this.resultsListBlock.children[currentIndex];\n if (listElement.classList.contains('e-de-search-result-item')) {\n listElement.classList.remove('e-de-search-result-item');\n listElement.classList.add('e-de-search-result-hglt');\n listElement.children[0].classList.add('e-de-op-search-word-text');\n }\n this.navigateToNextResult.focus();\n this.focusedIndex = 6;\n this.getMessageDivHeight();\n // } else {\n //this.focusedIndex = 4;\n // }\n }\n else {\n this.messageDiv.innerHTML = this.localeValue.getConstant('No matches');\n this.resultContainer.style.display = 'block';\n this.resultsListBlock.style.display = 'none';\n this.clearFocusElement();\n this.resultsListBlock.innerHTML = '';\n }\n }", "function SearchWrapper () {}", "function help_finder() {\n var oDiv = $('#divSearchBoxContainer');\n\n if (oDiv.css('display') == 'block') {\n oDiv.css('display', 'none');\n }\n else {\n oDiv.css('display', 'block');\n }\n}", "async findRobot() {\n await this.sendCommand(\"find_me\", [], {});\n }", "static _findMatch(text) {\n return DirectiveState.keywords.find(elem => {\n return elem === text;\n });\n }", "function gLyphsSearchInterface(glyphsGB) {\n if(zenbu_embedded_view) { return; }\n if(!glyphsGB) { return; }\n if(!glyphsGB.main_div) { return; }\n\n if(!glyphsGB.searchFrame) { \n glyphsGB.searchFrame = document.createElement('div');\n if(glyphsGB.main_div.firstChild) {\n glyphsGB.main_div.insertBefore(glyphsGB.searchFrame, glyphsGB.main_div.firstChild);\n } else {\n glyphsGB.main_div.appendChild(glyphsGB.searchFrame);\n }\n }\n if(!glyphsGB.searchInput) { \n var searchInput = document.createElement(\"input\");\n glyphsGB.searchInput = searchInput;\n searchInput.type = \"text\";\n searchInput.className = \"sliminput\";\n searchInput.autocomplete = \"off\";\n searchInput.default_message = \"search for annotations (eg EGR1 or kinase) or set location (eg: chr19:36373808-36403118)\";\n searchInput.onkeyup = function(evnt) { glyphsMainSearchInput(glyphsGB, this.value, evnt); } \n searchInput.onclick = function() { gLyphsClearDefaultSearchMessage(glyphsGB); }\n searchInput.onfocus = function() { gLyphsClearDefaultSearchMessage(glyphsGB); }\n searchInput.onblur = function() { gLyphsSearchUnfocus(glyphsGB); }\n //searchInput.onmouseout = function() { gLyphsSearchUnfocus(glyphsGB); } \n searchInput.value = searchInput.default_message; \n searchInput.style.color = \"lightgray\";\n searchInput.show_default_message = true;\n }\n if(!glyphsGB.searchResults) { \n glyphsGB.searchResults = document.createElement('div');\n glyphsGB.searchResults.glyphsGB = glyphsGB;\n glyphsGB.searchResults.default_message = \"search for annotations (eg EGR1 or kinase) or set location (eg: chr19:36373808-36403118)\";\n }\n if(!glyphsGB.searchMessage) {\n var msgDiv = document.createElement(\"div\");\n glyphsGB.searchMessage = msgDiv;\n }\n\n if(!glyphsGB.searchbox_enabled) { \n glyphsGB.searchFrame.style.display = \"none\";\n return; \n }\n\n glyphsGB.searchFrame.innerHTML = \"\";\n glyphsGB.searchFrame.style.display = \"block\";\n glyphsGB.searchResults.innerHTML = \"\";\n glyphsGB.searchResults.style.display = \"none\";\n\n var searchFrame = glyphsGB.searchFrame;\n \n var form = searchFrame.appendChild(document.createElement('form'));\n form.setAttribute(\"onsubmit\", \"return false;\");\n\n var span1 = form.appendChild(document.createElement('span'));\n \n var searchInput = glyphsGB.searchInput;\n form.appendChild(searchInput);\n\n var buttonSpan = form.appendChild(document.createElement('span'));\n var button1 = buttonSpan.appendChild(document.createElement('input'));\n button1.type = \"button\";\n button1.className = \"slimbutton\";\n button1.value = \"search\";\n button1.onclick = function(envt) { glyphsMainSearchInput(glyphsGB, '', envt); }\n\n var button2 = buttonSpan.appendChild(document.createElement('input'));\n button2.type = \"button\";\n button2.className = \"slimbutton\";\n button2.value = \"clear\";\n button2.onclick = function() { gLyphsClearSearchResults(glyphsGB); }\n \n searchFrame.appendChild(glyphsGB.searchResults); //moves to correct location\n searchFrame.appendChild(glyphsGB.searchMessage); //moves to correct location\n \n //set width\n var buttonsRect = buttonSpan.getBoundingClientRect();\n console.log(\"search buttons width: \"+buttonsRect.width);\n console.log(\"search_input width: \"+(glyphsGB.display_width - buttonsRect.width));\n searchInput.style.width = ((glyphsGB.display_width - buttonsRect.width)*0.80) +\"px\"; //glyphsGB.display_width;\n searchInput.style.margin = \"0px 0px 5px 0px\";\n \n //gLyphsClearSearchResults(glyphsGB);\n}", "_findTopmostOf(_arrOfIds, _area, _matchMethodName, _selfId) {\n const _matchMethod = {\n contains: _view => {\n return _view.contains(_area.x, _area.y);\n },\n intersects: _view => {\n return _view.intersects(_area.x, _area.y, _area.width, _area.height);\n }\n }[_matchMethodName];\n if (this.isntFunction(_matchMethod)) {\n console.error(\n `HEventManager#_findTopmostOf error; unknown _matchMethodName: ${_matchMethodName}`);\n return [];\n }\n else {\n const _search = _viewIds => {\n const _subviews = _viewIds.filter(_viewId => {\n // first filter out all but self:\n return _viewId !== _selfId;\n }).map(_viewId => {\n // then convert _viewId to _view:\n return this._views[_viewId];\n }).filter(_view => {\n // then filter out non-views and hidden views:\n return this._isValidView(_view) && !_view.isHidden;\n }).map(_view => {\n return [_view.viewId, _view];\n });\n // TODO: combine this with the map/filter above via reduce:\n for (const [_viewId, _view] of _subviews) {\n // recursive search for matching geometry\n if (_matchMethod(_view)) {\n const _foundId = _search(_view.getZOrder().reverse());\n if (_arrOfIds.includes(_viewId)) {\n if (_foundId !== false) {\n return _foundId;\n }\n else {\n // no (matching) subviews:\n return _viewId;\n }\n }\n else if (_foundId !== false) {\n return _foundId;\n }\n }\n // elses of both are: continue loop\n }\n return false; // end of loop without matches, or no _subviews\n };\n const _foundId = _search(HSystem.getZOrder().reverse());\n if (_foundId !== false) {\n return [_foundId];\n }\n else {\n return [];\n }\n }\n }", "_findTopmostOf(_arrOfIds, _area, _matchMethodName, _selfId) {\n const _matchMethod = {\n contains: _view => {\n return _view.contains(_area.x, _area.y);\n },\n intersects: _view => {\n return _view.intersects(_area.x, _area.y, _area.width, _area.height);\n }\n }[_matchMethodName];\n if (this.isntFunction(_matchMethod)) {\n console.error(\n `HEventManager#_findTopmostOf error; unknown _matchMethodName: ${_matchMethodName}`);\n return [];\n }\n else {\n const _search = _viewIds => {\n const _subviews = _viewIds.filter(_viewId => {\n // first filter out all but self:\n return _viewId !== _selfId;\n }).map(_viewId => {\n // then convert _viewId to _view:\n return this._views[_viewId];\n }).filter(_view => {\n // then filter out non-views and hidden views:\n return this._isValidView(_view) && !_view.isHidden;\n }).map(_view => {\n return [_view.viewId, _view];\n });\n // TODO: combine this with the map/filter above via reduce:\n for (const [_viewId, _view] of _subviews) {\n // recursive search for matching geometry\n if (_matchMethod(_view)) {\n const _foundId = _search(_view.getZOrder().reverse());\n if (_arrOfIds.includes(_viewId)) {\n if (_foundId !== false) {\n return _foundId;\n }\n else {\n // no (matching) subviews:\n return _viewId;\n }\n }\n else if (_foundId !== false) {\n return _foundId;\n }\n }\n // elses of both are: continue loop\n }\n return false; // end of loop without matches, or no _subviews\n };\n const _foundId = _search(HSystem.getZOrder().reverse());\n if (_foundId !== false) {\n return [_foundId];\n }\n else {\n return [];\n }\n }\n }", "onSearching(aFolderDisplay, aIsSearching) {\n // we only care if we just started searching and we are active\n if (!aIsSearching || !aFolderDisplay.active) {\n return;\n }\n\n // - Update match status.\n this.reflectFiltererResults(this.activeFilterer, aFolderDisplay);\n }", "function webSearchCallback() {\n // This needs to be in a timeout so that we don't end up refocused\n // in the url bar\n setTimeout(BrowserSearch.webSearch, 0);\n }", "showQuickFind() {\n const me = this,\n header = me.grid.getHeaderElement(me.columnId);\n\n if (header) {\n if (!me.headerField) {\n const [element, field, badge] = DomHelper.createElement({\n tag: 'div',\n className: 'b-quick-hit-header',\n children: [{\n tag: 'div',\n className: 'b-quick-hit-field'\n }, {\n tag: 'div',\n className: 'b-quick-hit-badge'\n }]\n }, true);\n\n if (me.mode === 'header') {\n header.appendChild(element);\n } else {\n element.className += ' b-quick-hit-mode-grid';\n me.grid.element.appendChild(element);\n }\n\n me.headerField = {\n header: element,\n field: field,\n badge: badge,\n colHeader: header\n };\n }\n\n me.headerField.field.innerHTML = me.find;\n me.headerField.badge.innerHTML = me.found.length;\n header.classList.add('b-quick-find-header');\n\n if (!me.renderListenerInitialized) {\n me.grid.rowManager.on({\n rendercell: me.renderCell,\n thisObj: me\n });\n me.renderListenerInitialized = true;\n }\n }\n }", "function updateForSearchVisible() {\n /* Prevent accidental scrolling of the body, prevent page layout jumps */\n let scrolledBodyWidth = document.body.offsetWidth;\n document.body.style.overflow = 'hidden';\n document.body.style.paddingRight = (document.body.offsetWidth - scrolledBodyWidth) + 'px';\n\n document.getElementById('search-input').value = '';\n document.getElementById('search-input').focus();\n document.getElementById('search-results').style.display = 'none';\n document.getElementById('search-notfound').style.display = 'none';\n document.getElementById('search-help').style.display = 'block';\n}", "function searchSuggestNIEUW() {\n if ($('.search-results').length < 1) return;\n\n var delay = (function () {\n\t\tvar timer = 0;\n\t\treturn function (callback, ms) {\n\t\t\twindow.clearTimeout(timer);\n\t\t\ttimer = window.setTimeout(callback, ms);\n\t\t};\n\t}());\n\n // append the view all button\n $('<div class=\"search-results-all\"><a class=\"view-all btn v3 color2\">Bekijk alle <span></span> resultaten</a></div>').insertAfter('#opleidingen');\n $('a.view-all').click(function (e)\n { $('header .search input[type=\"submit\"]').trigger('click'); });\n\n\tvar controlkeys = [16, 17, 18, 20, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 91, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 144, 145];\n\n\tvar currentSearchField = null;\n\n\tvar search_success = function (data) {\n\t results = currentSearchField.closest(\"div\").siblings(\".search-results\");\n\t elsToToggle = $('.search-results, #suggesties, #opleidingen, a.view-all');\n\n\t var searchBox = results.closest(\"div\").siblings(\".searchBox\");\n\t var searchResultUrl = searchBox.attr(\"data-search-result-page\");\n\n\t if (data && data.Suggestions.length == 0 && data.Hits.length == 0) {\n elsToToggle.hide();\n\t }\n else {\n elsToToggle.show();\n\n var suggesties = results.find(\"#suggesties\");\n suggesties.empty().removeAttr('style');\n\n if (data && data.Suggestions.length > 0) {\n $($.map(data.Suggestions, function (el) {\n var searchText = el.Text.replace(\"<b>\", '').replace(\"</b>\", \"\");\n return $('<a />', { href: searchResultUrl + \"?searchtext=\" + searchText, html: el.Text }).get(0);\n })).appendTo(suggesties);\n }\n\n var opleidingen = results.find(\"#opleidingen\");\n opleidingen.empty().removeAttr('style');\n\n if (data && data.Hits.length > 0) {\n $($.map(data.Hits, function (el) {\n return $('<a />', { href: el.Url.replace(/~/g, '') + '?bron=autosuggest&searchtext=' + $('.searchinput').val(), html: el.Title }).get(0);\n })).appendTo(opleidingen);\n\n // update total count in the btn\n $('a.view-all span').html(data.Total);\n }\n }\n\t};\n\n\tvar search_fail = function (error) {\n\t\tif (console && console.error) {\n\t\t\tconsole.error(error.get_message());\n\t\t}\n\t};\n\n\t$(\".searchinput, .elasticSearchInput\").keyup(function (e) {\n\t currentSearchField = $(this);\n\t\tvar input = this;\n\t\tif (e.keyCode === 13) {\n //execute search\n }\n else if (input.value && $.inArray(e.keyCode, controlkeys) === -1) {\n \tdelay(function () {\n \t WebService.ElasticSearchSuggest(input.value, 'NCOI', search_success, search_fail);\n \t}, 0);\n }\n\t});\n\n // if user clicks within search suggestions, prevent close function from being triggered\n $('.search-results').click(function (e) { e.stopPropagation(); })\n // user has pressed escape\n $(document).keydown(function (e) { if (e.keyCode == 27) $('.search-results').fadeOut('fast'); });\n // user has clicked outside of search suggestions or on close btn\n $('.search-results a.close, body').click(function (e) { $('.search-results').fadeOut('fast'); });\n}", "find(value) {\n const matches = [];\n this._viewCells.forEach(cell => {\n const cellMatches = cell.startFind(value);\n if (cellMatches) {\n matches.push(cellMatches);\n }\n });\n return matches;\n }", "function searchFuse(hotterm, clearOut){\n var result = fuse.search(hotterm);\n var fl = [];\n\n for (var i = 0; i < 5; i++) {\n \tresult[i].idx = i+1;\n \tfl.push(result[i]);\n };\n var scope = angular.element($(\"#fuseList\")).scope();\n if(clearOut){\n \tfl = [];\n }\n scope.$apply(function(){\n scope.fuseList = fl;\n });\n}", "function hideSuggest(e) {\n\n \n\n var updatedDisplay = false;\n\n \n\n if (!updatedDisplay && $(e.target).closest(\".hawk-searchQuery\").length <= 0) {\n\n \n\n showSuggest(null, false);\n\n \n\n updatedDisplay = true;\n\n \n\n };\n\n \n\n }", "function FMCClearSearch( win )\n{\n var highlights\t= FMCGetElementsByClassRoot( win.document.body, \"highlight\" );\n \n for ( var i = 0; i < highlights.length; i++ )\n {\n\t\tvar highlight\t= highlights[i];\n\t\tvar innerSpan\t= FMCGetChildNodeByTagName( highlight, \"SPAN\", 0 );\n var text\t\t= win.document.createTextNode( innerSpan.innerHTML );\n \n highlight.parentNode.replaceChild( text, highlight );\n }\n \n gColorIndex = 0;\n gFirstHighlight = null;\n \n // At this point, highlight nodes got replaced by text nodes. This causes nodes that were once single text nodes to\n // become divided into multiple text nodes. Future attempts to highlight multi-character strings may not work\n // because they may have been divided into multiple text nodes. To solve this, we merge adjacent text nodes.\n \n FMCMergeTextNodes( win.document.body );\n}", "hideQuickFind() {\n const me = this;\n\n // rerender cells to remove quick-find markup\n for (let hit of me.prevFound || me.found) {\n let row = me.grid.getRowById(hit.id);\n if (row) row.renderCell(row.getCell(me.columnId), hit.data);\n }\n\n if (me.headerField) {\n me.headerField.header.parentNode.removeChild(me.headerField.header);\n me.headerField.colHeader.classList.remove('b-quick-find-header');\n me.headerField = null;\n }\n\n if (me.renderListenerInitialized) {\n me.grid.rowManager.un({ rendercell: me.renderCell }, me);\n me.renderListenerInitialized = false;\n }\n\n me.grid.trigger('hideQuickFind');\n }", "function queryMyWindow(win){\r\n\t\twin.query(info.selectionText);\r\n\t\tvar toHide = [\"logo\", \"word\", \"search\"];\r\n\t\tfor(var i = 0; i< toHide.length ; i ++){\r\n\t\t\tvar id = toHide[i];\r\n\t\t\tvar elem = win.document.getElementById(id);\r\n\t\t\telem.setAttribute(\"style\", \"display:none\");\r\n\t\t}\r\n\t}", "hideQuickFind() {\n const me = this; // rerender cells to remove quick-find markup\n\n for (let hit of me.prevFound || me.found) {\n let row = me.grid.getRowById(hit.id);\n if (row) row.renderCell(row.getCell(me.columnId), hit.data);\n }\n\n if (me.headerField) {\n me.headerField.header.parentNode.removeChild(me.headerField.header);\n me.headerField.colHeader.classList.remove('b-quick-find-header');\n me.headerField = null;\n }\n\n if (me.renderListenerInitialized) {\n me.grid.rowManager.un({\n rendercell: me.renderCell\n }, me);\n me.renderListenerInitialized = false;\n }\n\n me.grid.trigger('hideQuickFind');\n }", "function walkFolderFind()\n\t\t{\n\t\t\t// set up the callback function\n\t\t\t\tfunction callback(element, index, level, indent)\n\t\t\t\t{\n\t\t\t\t\ttrace(indent + '/' + element.name);\n\t\t\t\t\tif(element instanceof File && element.contents.indexOf(search) > -1)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// promt the user and search\n\t\t\t\tvar search = prompt('Enter some text to find', 'Find a file by searching folders and comparing contents')\n\t\t\t\tvar result = Utils.walkFolder('{user}', callback);\n\n\t\t\t// do something with the result\n\t\t\t\tresult ? trace(result) : trace('Nothing was found');\n\n\t\t}", "showQuickFind() {\n const me = this,\n header = me.grid.getHeaderElement(me.columnId);\n\n if (header) {\n if (!me.headerField) {\n const [element, field, badge] = DomHelper.createElement(\n {\n tag: 'div',\n className: 'b-quick-hit-header',\n children: [\n { tag: 'div', className: 'b-quick-hit-field' },\n { tag: 'div', className: 'b-quick-hit-badge' }\n ]\n },\n true\n );\n\n if (me.mode === 'header') {\n header.appendChild(element);\n } else {\n element.className += ' b-quick-hit-mode-grid';\n me.grid.element.appendChild(element);\n }\n\n me.headerField = {\n header: element,\n field: field,\n badge: badge,\n colHeader: header\n };\n }\n\n me.headerField.field.innerHTML = me.find;\n me.headerField.badge.innerHTML = me.found.length;\n\n header.classList.add('b-quick-find-header');\n\n if (!me.renderListenerInitialized) {\n me.grid.rowManager.on({\n rendercell: me.renderCell,\n thisObj: me\n });\n me.renderListenerInitialized = true;\n }\n }\n }", "function whatToSearch(){\n $(`.js-search`).on('click',function(){\n //will eventually ask to allow for location\n // make an if statement to set a global variable to winerie or taste room depending on which button was pressed.\n $(`.js-where`).removeClass('hidden')\n\n })\n}", "function stephandler() {\n if (queryPosition === query.length -1) {\n startSearch(false);\n } else {\n delayedAdvance(false);\n }\n}", "function onMemberSearchChange() {\n const container = document.getElementById('rightPlayerColumn');\n const guild = guilds[selectedGuild];\n let result = memberFuse.search(this.value);\n if (result.length > 0) {\n // Limit matches to first 10.\n result = result.slice(0, 10);\n\n for (let i = 0; i < container.children.length; i++) {\n container.children[i].classList.toggle(\n 'hidden',\n !result.find((el) => el.user.id == container.children[i].id));\n }\n for (let i = 0; i < result.length; i++) {\n const match = container.getElementsByClassName(result[i].user.id)[0];\n if (match) {\n container.appendChild(match);\n } else {\n container.appendChild(makePlayerRow(result[i], guild));\n }\n }\n } else {\n for (let i = 0; i < container.children.length; i++) {\n container.children[i].classList.remove('hidden');\n }\n sortMembers(container, guild.hg);\n }\n container.dispatchEvent(new Event('scroll'));\n }", "onUpdateTextFind(e){\n this.textFind = e.target.value;\n }", "function searchForPlayers() {\n searchingForGame = true;\n views.setSeachingPlayers();\n socket.emit('lookingForGame', authId);\n console.log(\"waiting for game \" + authId)\n socket.on('startMatch', (otherId) => {\n startMultiPlayer(otherId);\n });\n}", "function searchForTraits(field, newV, oldV, listToUpdate) {\n if (newV !== oldV) {\n listToUpdate.hide();\n CQ.Ext.Msg.wait(CQ.I18n.getMessage(\"Searching....\"));\n $.getJSON(traitLookupUrl, {\n q : newV\n }, function(result) {\n CQ.Ext.Msg.wait(CQ.I18n.getMessage(\"Searching....\")).hide();\n if (result.traits) {\n debug(\"Value set to \" + JSON.stringify(result.traits));\n listToUpdate.options = [];\n newOptionsMap = updateOptionsMap(result.traits);\n updateListComponent(listToUpdate, newOptionsMap);\n listToUpdate.show();\n\n }\n }).error(function() {\n CQ.Ext.Msg.wait(CQ.I18n.getMessage(\"Search Failed, please contact support\")).hide();\n CQ.Ext.Msg.alert(CQ.I18n.getMessage('Error'), CQ.I18n.getMessage('Search Failed, please contact support'));\n });\n }\n }", "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "search(find, columnFieldOrId = this.columnId) {\n let me = this,\n column = me.grid.columns.getById(columnFieldOrId) || me.grid.columns.get(columnFieldOrId),\n found = me.store.findByField(column.field, find),\n i = 1,\n grid = me.grid;\n\n Object.assign(me, {\n foundMap: {},\n prevFound: me.found,\n found: found,\n find: find,\n columnId: column.id\n });\n\n if (find) {\n me.showQuickFind();\n } else {\n me.hideQuickFind();\n }\n\n // reset column to use its normal settings for htmlEncoding\n if (me.currentColumn && me.currentColumn !== column) me.currentColumn.disableHtmlEncode = false;\n\n // clear old hits\n for (let cell of DomHelper.children(grid.element, '.b-quick-hit')) {\n //IE11 doesnt support this\n //cell.classList.remove('b-quick-hit', 'b-quick-hit-cell');\n cell.classList.remove('b-quick-hit');\n cell.classList.remove('b-quick-hit-cell');\n\n // rerender cell to remove quick-hit-text\n let row = DomDataStore.get(cell).row;\n row.renderCell(cell);\n }\n\n // want to set innerHTML each time for cell decoration to work\n column.disableHtmlEncode = true;\n me.currentColumn = column;\n\n if (!found) return;\n\n if (found.length > 0) {\n me.gotoClosestHit(grid.focusedCell, found);\n }\n\n // highlight hits for visible cells\n for (let hit of found) {\n me.foundMap[hit.id] = i++;\n\n let row = grid.getRowById(hit.data.id);\n if (row) {\n row.renderCell(row.getCell(column.id));\n }\n\n // limit highlighted hits\n if (i > 1000) break;\n }\n\n me.grid.trigger('quickFind', { find, found });\n }", "function searchOnKeyUp(e) {\n // Filter out up, down, esc keys\n const keyCode = e.keyCode;\n const cannotBe = [40, 38, 27];\n const isSearchBar = e.target.id === \"search-bar\";\n const keyIsNotWrong = !cannotBe.includes(keyCode);\n if (isSearchBar && keyIsNotWrong) {\n // Try to run a search\n runSearch(e);\n }\n}", "function data_TextSearch()\n{\n var srch = Node(\"data_search\").value;\n if (srch.length == 0) return;\n \n \t// Do the search, and update the selected molecules.\n \n srch = srch.toLowerCase();\n \n var numfound = 0, firsthit = 0;\n for (var i = 1; i <= num_molecules; i++) {\n\tSelectMolecule(i, false);\n\tfor (var j = 0; j < num_textfields; j++) {\n\t if (srch == textfield_data[i-1][j].toLowerCase()) {\n\t\tSelectMolecule(i, true);\n\t \tnumfound++;\n\t\tif (firsthit == 0) firsthit = i;\n\t\tbreak;\n\t }\n\t}\n }\n\n ReplaceContent();\n \n if (numfound == 0) {\n \talert(\"Search text not found.\");\n\treturn;\n }\n \n \t// Adjust the scroller position.\n \n var el = Node(\"data_mol\" + firsthit), y = el.offsetTop - 5;\n while (el = el.offsetParent) {\n\ty = y + el.offsetTop;\n }\n window.scrollTo(0, y);\n}", "function handleQuery () {\n var searchText = $scope.searchText,\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "updateSearch(aTab) {\n let tab = aTab || this.tabmail.currentTabInfo;\n // bail if things don't really exist yet\n if (!tab.folderDisplay || !tab.folderDisplay.view.search) {\n return;\n }\n\n let filterer = tab._ext.quickFilter;\n filterer.displayedFolder = tab.folderDisplay.displayedFolder;\n\n let [terms, listeners] = filterer.createSearchTerms(\n tab.folderDisplay.view.search.session\n );\n\n for (let [listener, filterDef] of listeners) {\n // it registers itself with the search session.\n new QuickFilterSearchListener(\n tab.folderDisplay,\n filterer,\n filterDef,\n listener,\n QuickFilterBarMuxer\n );\n }\n tab.folderDisplay.view.search.userTerms = terms;\n // Uncomment to know what the search state is when we (try and) update it.\n // dump(tab.folderDisplay.view.search.prettyString());\n }", "function search() {\n if (_.isEmpty($scope.user.name)) {\n return;\n }\n\n $scope.step1lock = true;\n $scope.loadingText = 'Searching for Summoner...';\n\n $('.step-1').fadeOut(1000,function(){\n $('.loader').fadeIn(1000, function() {\n $('.loader').fadeOut(1000, function() {\n $('.step-2').fadeIn(1000, function() {\n $(window).resize();\n $('#highchart').highcharts().reflow();\n });\n });\n });\n });\n }", "function searchForQuery(query) {\r\n toggleMainContainer(false);\r\n togglePreloader(true);\r\n showLoadMoreButtons();\r\n clearLists();\r\n search(query, false, 1);\r\n search(query, true, 1); \r\n setCurrentQuery(query);\r\n }", "function ControllerUp() {\n\tMouseX = ControllerButtonsX[ControllerCurrentButton];\n\tMouseY = ControllerButtonsY[ControllerCurrentButton];\n\t// console.log(\"starting search\");\n\tif (ControllerCurrentButton > ControllerButtonsX.length) ControllerCurrentButton = 0;\n\tvar CurrentY = ControllerButtonsY[ControllerCurrentButton];\n\tvar CurrentX = ControllerButtonsX[ControllerCurrentButton];\n\tvar found = false;\n\twhile (CurrentY > 0 && found == false) {\n\t\tCurrentY -= 1;\n\t\tvar f = 0;\n\t\twhile (f < ControllerButtonsX.length && found == false) {\n\t\t\tif (CurrentY == ControllerButtonsY[f] && CurrentX == ControllerButtonsX[f]) {\n\t\t\t\tfound = true;\n\t\t\t\tMouseX = CurrentX;\n\t\t\t\tMouseY = CurrentY;\n\t\t\t\tControllerCurrentButton = f;\n\t\t\t\t//console.log(\"found at X=\" + CurrentX + \", Y=\" + CurrentY);\n\t\t\t}\n\t\t\tf += 1;\n\t\t\t//console.log(\"searching: \" + CurrentY + \" \" + CurrentX); //debug\n\t\t}\n\t}\n\tif (found == false) {\n\t\t// console.log(\"round 2\");\n\t\tvar CurrentY = ControllerButtonsY[ControllerCurrentButton];\n\t\tvar CurrentX = ControllerButtonsX[ControllerCurrentButton];\n\t\tvar CurrentXX = ControllerButtonsX[ControllerCurrentButton];\n\t\twhile (CurrentY > 0 && found == false) {\n\t\t\tCurrentY -= 1;\n\t\t\tvar OffsetX = 0;\n\t\t\twhile (OffsetX < 2000 && found == false) {\n\t\t\t\tOffsetX += 1;\n\t\t\t\tCurrentX = CurrentXX + OffsetX;\n\t\t\t\tvar f = 0;\n\t\t\t\twhile (f < ControllerButtonsX.length && found == false) {\n\t\t\t\t\tif (CurrentY == ControllerButtonsY[f] && CurrentX == ControllerButtonsX[f]) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tMouseX = CurrentX;\n\t\t\t\t\t\tMouseY = CurrentY;\n\t\t\t\t\t\tControllerCurrentButton = f;\n\t\t\t\t\t\t//console.log(\"found at X=\" + CurrentX + \", Y=\" + CurrentY);\n\t\t\t\t\t}\n\t\t\t\t\tf += 1;\n\t\t\t\t\t//console.log(\"searching: \" + CurrentY + \" \" + CurrentX); //debug\n\t\t\t\t}\n\t\t\t\tCurrentX = CurrentXX - OffsetX;\n\t\t\t\tvar f = 0;\n\t\t\t\twhile (f < ControllerButtonsX.length && found == false) {\n\t\t\t\t\tif (CurrentY == ControllerButtonsY[f] && CurrentX == ControllerButtonsX[f]) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tMouseX = CurrentX;\n\t\t\t\t\t\tMouseY = CurrentY;\n\t\t\t\t\t\tControllerCurrentButton = f;\n\t\t\t\t\t\t//console.log(\"found at X=\" + CurrentX + \", Y=\" + CurrentY);\n\t\t\t\t\t}\n\t\t\t\t\tf += 1;\n\t\t\t\t\t//console.log(\"searching: \" + CurrentY + \" \" + CurrentX); //debug\n\t\t\t\t}\n\t\t\t\t//console.log(OffsetX);\n\t\t\t}\n\t\t\t//console.log(\"searching round 2 Y=\" + CurrentY);\n\t\t\t//console.log(\"searching round 2 MouseX, MouseY=\" + MouseX + \", \" + MouseY);\n\t\t}\n\t}\n\tif (found == false) {\n\t\t// console.log(\"not found\");\n\t}\n}", "search(find, columnFieldOrId = this.columnId) {\n let me = this,\n column = me.grid.columns.getById(columnFieldOrId) || me.grid.columns.get(columnFieldOrId),\n found = me.store.findByField(column.field, find),\n i = 1,\n grid = me.grid;\n Object.assign(me, {\n foundMap: {},\n prevFound: me.found,\n found: found,\n find: find,\n columnId: column.id\n });\n\n if (find) {\n me.showQuickFind();\n } else {\n me.hideQuickFind();\n } // reset column to use its normal settings for htmlEncoding\n\n if (me.currentColumn && me.currentColumn !== column) me.currentColumn.disableHtmlEncode = false; // clear old hits\n\n for (let cell of DomHelper.children(grid.element, '.b-quick-hit')) {\n //IE11 doesnt support this\n //cell.classList.remove('b-quick-hit', 'b-quick-hit-cell');\n cell.classList.remove('b-quick-hit');\n cell.classList.remove('b-quick-hit-cell'); // rerender cell to remove quick-hit-text\n\n let row = DomDataStore.get(cell).row;\n row.renderCell(cell);\n } // want to set innerHTML each time for cell decoration to work\n\n column.disableHtmlEncode = true;\n me.currentColumn = column;\n if (!found) return;\n\n if (found.length > 0) {\n me.gotoClosestHit(grid.focusedCell, found);\n } // highlight hits for visible cells\n\n for (let hit of found) {\n me.foundMap[hit.id] = i++;\n let row = grid.getRowById(hit.data.id);\n\n if (row) {\n row.renderCell(row.getCell(column.id));\n } // limit highlighted hits\n\n if (i > 1000) break;\n }\n\n me.grid.trigger('quickFind', {\n find,\n found\n });\n }", "function searchUser(name) {\n\n if (system.searched.indexOf(name) === -1 || settings.tag_only) {\n searching = name;\n\n loadMore()\n }\n\n if (system.searched.indexOf(name) != -1 && !settings.tag_only) {\n system.searchingUsers = false;\n searchUsers()\n }\n }", "function searchDriver() {\n const queries = [\n\t['bre'],\n\t['bread'],\n\t['break'],\n\t['piz'],\n\t['nach'],\n\t['garbage'],\n\n\t['bre', 'piz'],\n\t['bre', 'flour'],\n ];\n for( const q of queries ) {\n\tconsole.log( \"query=[%s]\", q.join(\", \") );\n\tsearchElements( q, recipeIndex );\n }\n}", "function realtimeSearch() {\n\tvar searchTerm = $('.search').val().toUpperCase();\n\t$('article').each(function (index, element) {\n\t\tvar ideaCard = extractCard(element);\n\t\tif (ideaCard.doYouMatch(searchTerm)) {\n\t\t\t$(element).removeClass('card-display-none');\n\t\t} else {\n\t\t\t$(element).addClass('card-display-none');\n\t\t};\n\t});\n}", "function searchForChannel() {\n var channelToSearch = $(\"#searchInput\").val().toUpperCase();\n /* var foundElement = $(\"[data-name='\"+channelToSearch+\"']\"); */\n\n //$(\".singleChannel\").show();\n\n $(\".singleChannel\").hide();\n\n if (seePartners) {\n $(\"[isPartner='true'\").show();\n } else {\n $(\"[div-index='0'\").show();\n }\n\n if (channelToSearch != \"\") {\n\n for (var i = 0; i < $(\".singleChannel\").length; i++) {\n var currentChannel = $(\".singleChannel\").eq(i);\n if ((currentChannel.attr(\"data-name\").indexOf(channelToSearch) < 0) && (currentChannel.attr(\"data-code\").indexOf(channelToSearch) < 0)) {\n currentChannel.hide();\n } else {\n currentChannel.show();\n }\n }\n }\n}", "function menutogglevids(theSearch) {\n\tif($('videoList')) $('videoList').parentNode.removeChild($('videoList'));\n\tif(options.vdsrchr == \"youtube\") {\n\t\tget(\"http://gdata.youtube.com/feeds/api/videos?alt=json&max-results=5&format=5&q=\" + encodeURIComponent(theSearch), youtubeSearched, novids);\n\t} else {\n\t\tget(\"http://ajax.googleapis.com/ajax/services/search/video?v=1.0&gbv=2&rsz=5&start=0&q=\" + encodeURIComponent(theSearch), showvids, novids);\n\t}\n}", "function suggestFilter(msg, arg){\r\n\t\tstate = 3;\r\n\t\thasTheWord = arg;\r\n\t\topenPanel(msg);\r\n\t}", "function updateAdanvceSearch(){\n if(typeof searchPnt != \"undefined\"){\n whereClause = searchFilters.buildWhereClause();\n findOptimalSearchRadius(providerFS,searchPnt,whereClause)\n }\n }", "function _findMatch(ev) {\n var otop = 0, match=0;\n var event_top = ev.target.offsetParent.offsetTop;\n objtypes.each(function(i, elem) {\n otop = getElementTop(elem);\n // elemoffsetHeight = 0 for invisible entries\n if (otop <= event_top && (otop+elem.offsetHeight)>=event_top) {\n match = elem;\n return false; // break out of loop\n }\n });\n return match;\n }", "function updateSearch () {\n // Triggered by timeout (or Enter key), so now clear the id\n inputTimeout = null;\n\n // Get search string\n let value = SearchTextInput.value;\n\n // Do not trigger any search if the input box is empty\n // Can happen in rare cases where we would hit the cancel button, and updateSearch() is dispatched\n // before the event dispatch to manageSearchTextHandler() and so before it could clear the timeout.\n if (value.length > 0) { // Launch search only if there is something to search for\n\t// Activate search mode and Cancel search button if not already\n\tif (sboxState != SBoxExecuted) {\n\t enableCancelSearch();\n\t}\n\t// Update search history list\n\tupdateSearchList(value);\n\n\t// Discard previous results table if there is one\n\tif (resultsTable != null) {\n\t SearchResult.removeChild(resultsTable);\n\t resultsTable = null;\n\t curResultRowList = {};\n//\t resultsFragment = null;\n\n\t // If a row cell was highlighted, do not highlight it anymore\n//\t clearCellHighlight(rcursor, rlastSelOp, rselection.selectIds);\n\t cancelCursorSelection(rcursor, rselection);\n\t}\n\n\t// Display waiting for results icon\n\tWaitingSearch.hidden = false;\n\n\t// Look for bookmarks matching the search text in their contents (title, url .. etc ..)\n\tlet searching;\n\tif (!options.noffapisearch\n\t\t&& (options.searchField == \"both\") && (options.searchScope == \"all\") && (options.searchMatch == \"words\")) {\n//console.log(\"Using FF Search API\");\n\t // It seems that parameters can make the search API fail and return 0 results sometimes, so strip them out,\n\t // there will be too much result maybe, but at least some results !\n\t let simpleUrl;\n\t let paramsPos = value.indexOf(\"?\");\n\t if (paramsPos >= 0) {\n\t\tsimpleUrl = value.slice(0, paramsPos);\n\t }\n\t else {\n\t\tsimpleUrl = value;\n\t }\n\t searching = browser.bookmarks.search(decodeURI(simpleUrl));\n\t}\n\telse {\n//console.log(\"Using BSP2 internal search algorithm\");\n\t searching = new Promise ( // Do it asynchronously as that can take time ...\n\t\t(resolve) => {\n\t\t let a_matchStr;\n\t\t let matchRegExp;\n\t\t let isRegExp, isTitleSearch, isUrlSearch;\n\t\t let a_BN;\n\n\t\t if (options.searchField == \"both\") {\n\t\t\tisTitleSearch = isUrlSearch = true;\n\t\t }\n\t\t else if (options.searchField == \"title\") {\n\t\t\tisTitleSearch = true;\n\t\t\tisUrlSearch = false;\n\t\t }\n\t\t else {\n\t\t\tisTitleSearch = false; \n\t\t\tisUrlSearch = true;\n\t\t }\n\n\t\t if (options.searchMatch == \"words\") { // Build array of words to match\n\t\t\tisRegExp = false;\n\t\t\ta_matchStr = strLowerNormalize(value).split(\" \"); // Ignore case and diacritics\n\t\t }\n\t\t else {\n\t\t\tisRegExp = true;\n\t\t\ttry {\n\t\t\t matchRegExp = new RegExp (strNormalize(value), \"i\"); // Ignore case and diacritics\n\t\t\t}\n\t\t\tcatch (e) { // If malformed regexp, do not continue, match nothing\n\t\t\t a_BN = [];\n\t\t\t}\n\t\t }\n\n\t\t if (a_BN == undefined) { // No error detected, execute search\n\t\t\tif (options.searchScope == \"all\") { // Use the List form\n\t\t\t a_BN = searchCurBNList(a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch);\n\t\t\t}\n\t\t\telse { // Use the recursive form\n\t\t\t let BN;\n\t\t\t if (cursor.cell == null) { // Start from Root\n\t\t\t\tBN = rootBN;\n\t\t\t }\n\t\t\t else { // Retrieve BN of cell in cursor\n\t\t\t\tBN = curBNList[cursor.bnId];\n\t\t\t\t// Protection\n\t\t\t\tif (BN == undefined) {\n\t\t\t\t BN = rootBN;\n\t\t\t\t}\n\t\t\t }\n\t\t\t a_BN = searchBNRecur(BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch,\n\t\t\t\t\t\t\t\t (options.searchScope == \"subfolder\") // Go down to subfolders, or only current folder ?\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t }\n\n\t\t resolve(a_BN);\n\t\t}\n\t );\n\t}\n\tsearching.then(\n\t function (a_BTN) { // An array of BookmarkTreeNode or of BookmarkNode (a poor man's kind of \"polymorphism\" in Javascript ..)\n\t\t// Create the search results table only if a search is still active.\n\t\t// Can happen when browser.bookmarks.search() is very long, like higher than InputKeyDelay,\n\t\t// and we have cleared the input box / cancelled the search in between.\n\t\tif (SearchTextInput.value.length > 0) { // Display results only if there is something to search for\n\t\t displayResults(a_BTN);\n\t\t}\n\t }\n\t);\n }\n}", "function updateFilteredSearch(){\n \n if(typeof searchPnt != \"undefined\")\n findProviders(providerFS, searchPnt)\n }", "function searchNames() {\r\n\r\n Word.run(function (context) {\r\n\r\n // Mettez en file d'attente une commande pour obtenir la selection actuelle, puis\r\n // creez un objet de plage proxy avec les resultats.\r\n var body = context.document.body;\r\n context.load(body, 'text');\r\n\r\n // Empties the politicians already found since we \"relaunch\" the search.\r\n alreadyFoundPoliticians = {};\r\n\r\n $('#politicians').empty(); // Empties all the content of the panel.\r\n\r\n return context.sync().then(function () {\r\n\r\n var wholeText = body.text; // Get the whole text of the body as a String\r\n\r\n // Launch the search\r\n inspectText(wholeText, context);\r\n\r\n }).then(context.sync);\r\n })\r\n .catch(errorHandler);\r\n\r\n }", "function handleOneSearch() {\n $(\"#search-screen-header\").hide();\n $(\"#js-search-one\").on(\"click\", event => {\n event.preventDefault();\n $(\"#main-screen-header\").hide();\n $(\"#similars-search-screen-header\").hide();\n $(\"#js-multi-search-option\").hide();\n $(\"#js-search-one\").hide();\n $(\"#one-movie-search\").show();\n $(\"#search-screen-header\").show();\n });\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function initialize_search(){\n for (var i=1; i<=graph.nvertices; i++) {\n processed[i] = discovered[i] = false;\n parents[i] = -1;\n }\n}", "function search_switch_name() {\r\n\t\tvar args = autoSearchSwNFix.apply(this, arguments);\r\n\t\tvar eventId = search_name(args[0], 0, 0, args[5], true); \r\n\t\tvar counted = search_switch(args[1], args[2], \"thisM\", args[3], args[4], eventId, args[6]);\r\n\t\treturn counted;\r\n\t}", "function startSearchMode ( ) {\r\n searchMode = true;\r\n newOrSubmitButton.innerHTML = searchModeButtonText;\r\n primaryButtonHelp.innerHTML = searchModePrimaryButtonHelp;\r\n secondaryButtonHelp.innerHTML = searchModeSecondaryButtonHelp;\r\n tertiaryButtonHelp.innerHTML = onlyTertiaryButtonHelp;\r\n titleHelp.innerHTML = searchModeTitleHelp;\r\n}", "function dfSearch(node, target) {}", "function srQuery(container, search, replace, caseSensitive) {\r\n var rng;\r\n if (document.body.createTextRange) {\r\n // IE branch\r\n var args = getSearchArgs(caseSensitive);\r\n var found = \"\";\r\n rng = document.body.createTextRange();\r\n rng.moveToElementText(container);\r\n clearUndoBuffer();\r\n while (rng.findText(search, 10000, args)) {\r\n rng.select();\r\n found = rng.text;\r\n rng.scrollIntoView();\r\n if (confirm(\"Replace?\")) {\r\n rng.text = replace;\r\n pushUndoNew(rng, search, replace, found);\r\n }\r\n rng.collapse(false) ;\r\n } \r\n alert(\"Search completed.\");\r\n } else if (document.createRange && window.find) {\r\n // Mozilla (W3C) branch\r\n var sel;\r\n var args = caseSensitive || false;\r\n while (window.find(search, args)) {\r\n sel = window.getSelection();\r\n if (sel.anchorNode) {\r\n rng = sel.getRangeAt(0);\r\n if (rng.intersectsNode(container)) {\r\n if (confirm(\"Replace?\")) {\r\n pushUndoNew(rng, search, replace, rng.toString());\r\n rng.deleteContents();\r\n rng.insertNode(document.createTextNode(replace));\r\n rng.startContainer.parentNode.normalize();\r\n } else {\r\n // move selection beyond current item for next find()\r\n rng.collapse(false);\r\n sel.addRange(rng);\r\n }\r\n }\r\n }\r\n }\r\n alert(\"Search completed.\");\r\n }\r\n}", "function jss_search2() {\n window.clearTimeout(jss_timer);\n jss_start_search(jss_str, jss_result_elem);\n}", "checkSearchSelectedText() {\n if (this.viewMode === DATA_VIEW_MODES.TEXT_SEARCH && this.fileName) {\n this.viewMode = DATA_VIEW_MODES.TEXT;\n }\n }", "function toggleSearchMode() {\n self.searchMode = !self.searchMode;\n }", "function addMatch() {\n openCards[0][0].classList.add(\"match\");\n openCards[1][0].classList.add(\"match\");\n $(openCards[0]).off('click');\n $(openCards[1]).off('click');\n openCards = [];\n matchFound += 1;\n setTimeout(checkWin,600);\n }", "function search(current){\n\n}", "function openSearch() {\n // shows all levels - we want to show all the spaces for smaller screens\n showAllLevels();\n\n classie.add(spacesListEl, 'spaces-list--open');\n classie.add(containerEl, 'container--overflow');\n }", "function actuallyPerformKeywordSearch(_keyword, ts, _strategy) {\r\n\tfunction notFoundMessage(_keyword, _strategy_expanded) {\r\n\t\tvar s = \"Unable to locate a Release that contains the keyword '\" + _keyword + \"'\" + _strategy_expanded + \".\";\r\n\t\treturn s;\r\n\t}\r\n\r\n\tif (_previousKeywordSearch_area.length > 0) {\t// here we restore the state of the last search\r\n\t\tvar cObj = getGUIObjectInstanceById(_previousKeywordSearch_area + _previousKeywordSearch_tabNum.toString());\r\n\t\tif ( (cObj != null) && (isTextarea(cObj) == false) ) {\r\n\t\t\tif (_previousKeywordSearch_innerHTML.trim().length > 0) {\r\n\t\t\t\tcObj.innerHTML = _previousKeywordSearch_innerHTML;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t_previousKeywordSearch_tabNum = -1;\t\t// initialize\r\n\t_previousKeywordSearch_area = '';\t\t// initialize\r\n\t_previousKeywordSearch_innerHTML = '';\t// initialize\r\n\r\n\tvar _strategy_hint = '';\r\n\tvar _strategy_expanded = '';\r\n\tif (_strategy.trim().length > 0) {\r\n\t\t_strategy_expanded = ' using keyword search strategy of ' + _strategy;\r\n\t\tif (_strategy.toUpperCase() == const_depth_first.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from top to bottom then left to right.';\r\n\t\t} else if (_strategy.toUpperCase() == const_depth_last.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from left to right then top to bottom.';\r\n\t\t} else if (_strategy.toUpperCase() == const_tab_titles.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from left to right (limited to tab titles only).';\r\n\t\t}\r\n\t\twindow.status = 'Keyword search strategy is ' + _strategy + _strategy_hint;\r\n\t}\r\n\r\n\tvar len = ts.tabs.length;\r\n\tvar _f = -1;\r\n\tvar _isAnySearchedComments = 0;\r\n\tif ( (_strategy.trim().length == 0) || (_strategy.toUpperCase() == const_depth_first.toUpperCase()) ) {\r\n\t\tfor(var i = 0; i < len; i++) {\r\n\t\t\tvar tab = ts.tabs[i];\r\n\t\t\tvar cObj = getGUIObjectInstanceById(_const__tab + (i + 1).toString());\r\n\t\t\tif (cObj != null) {\r\n\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t_previousKeywordSearch_area = _const__tab;\r\n\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_content + (i + 1).toString());\r\n\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t_previousKeywordSearch_area = _const_content;\r\n\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_comments_symbol + (i + 1).toString());\r\n\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t_f = cObj.value.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t_isAnySearchedComments++;\r\n\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t_previousKeywordSearch_area = _const_comments_symbol;\r\n\t\t\t\t\t\t_previousKeywordSearch_innerHTML = ''; // there is no need to refresh the contents of a textarea to clear the previous search...\r\n\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor (var td_i = 1; td_i <= _array_numRows[(i + 1)]; td_i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_releaseLogSubReportRow + (i + 1).toString() + '.' + + td_i.toString() + '.2');\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_releaseLogSubReport;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\tSearchObj.getInstanceEx(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, cObj.id, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if ( (_strategy.toUpperCase() == const_depth_last.toUpperCase()) || (_strategy.toUpperCase() == const_tab_titles.toUpperCase()) ) {\r\n\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\tvar cObj = getGUIObjectInstanceById(_const__tab + (i + 1).toString());\r\n\t\t\tif (cObj != null) {\r\n\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t_previousKeywordSearch_area = _const__tab;\r\n\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (_strategy.toUpperCase() != const_tab_titles.toUpperCase()) {\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tfor (var td_i = 1; td_i <= _array_numRows[(i + 1)]; td_i++) {\r\n\t\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_releaseLogSubReportRow + (i + 1).toString() + '.' + + td_i.toString() + '.2');\r\n\t\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_releaseLogSubReport;\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\t\tSearchObj.getInstanceEx(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, cObj.id, _previousKeywordSearch_innerHTML, _f);\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\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_comments_symbol + (i + 1).toString());\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.value.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_isAnySearchedComments++;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_comments_symbol;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = ''; // there is no need to refresh the contents of a textarea to clear the previous search...\r\n\t\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\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\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_content + (i + 1).toString());\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_content;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (SearchObj.instances.length == 0) {\r\n\t\talert(notFoundMessage(_keyword, _strategy_expanded));\r\n\t} else {\r\n\t\tvar nbObj = getGUIObjectInstanceById('next_findKeywordRelease');\r\n\t\tvar sdObj = getGUIObjectInstanceById('status_findKeywordRelease');\r\n\t\tif ( (nbObj != null) && (sdObj != null) ) {\r\n\t\t\tvar so = SearchObj.instances[SearchObj.position];\r\n\t\t\tif (so._f != -1) {\r\n\t\t\t\tSearchObj.keyword = _keyword;\r\n\t\t\t\tso.hilite(_const_releaseLogSubReport, handleReleaseLogSearchResults);\r\n\t\t\t\tnbObj.style.display = (SearchObj.instances.length > 1) ? const_inline_style : const_none_style;\r\n\t\t\t\tsdObj.style.display = const_inline_style;\r\n\t\t\t\tsdObj.innerHTML = SearchObj.statusHTML();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function find() {\n //If statements to check from where the search is performed\n if ($(\"input[name='SearchInit']:checked\").val() == \"fromGPSlocation\") {\n findFromPos = true;\n findFromPoint = false;\n findFromTrail = false;\n }\n else if ($(\"input[name='SearchInit']:checked\").val() == \"fromClick\") {\n findFromPos = false;\n findFromPoint = true;\n findFromTrail = false;\n }\n else if ($(\"input[name='SearchInit']:checked\").val() == \"fromTrail\") {\n findFromPos = false;\n findFromPoint = false;\n findFromTrail = true;\n }\n\n //If statements to check what is searched for, point or line and table name\n if ($(\"input[name='SearchChoice']:checked\").val() == \"bathSite\") {\n target = \"point\";\n table = \"w_bathmade\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"NaturBathSite\") {\n target = \"point\";\n table = \"w_bathnatural\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"View\") {\n target = \"point\";\n table = \"w_viewpoint\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"Gems\") {\n target = \"point\";\n table = \"w_nicespots\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"LargeTrail\") {\n target = \"line\";\n table = \"w_pathbig\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"Trail\") {\n target = \"line\";\n table = \"w_pathsmall\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"SmallTrail\") {\n target = \"line\";\n table = \"w_pathnondistinct\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"GreenTrail\") {\n target = \"line\";\n table = \"w_trailgreen\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"RedTrail\") {\n target = \"line\";\n table = \"w_trailhellas5\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"BlueTrail\") {\n target = \"line\";\n table = \"w_traillake\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"PurpleTrail\") {\n target = \"line\";\n table = \"w_trailwhite\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"DetailedRoads\") {\n target = \"line\";\n table = \"w_road\";\n }\n\n //If Statements to handle the search if it is performed from the device pos, a clicked point or a marked line\n //Searching from my current position\n if (findFromPos) {\n console.log('find from position');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, error);\n function success(position) {\n //Extracting the position from geolocation as latitude and longitude\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n //Calling a function to handle search for either line or point features from the extracted position\n //\"myPos\" is passed to place the position marker of the search from position in the correct feature\n if (target === \"point\") {\n createfoundpoints(latitude, longitude, \"myPos\");\n }\n else if (target === \"line\") {\n createfoundlines(latitude, longitude, \"myPos\");\n }\n }\n function error() {\n }\n }\n }\n //If searching from a clicked point\n else if (findFromPoint) {\n console.log('find from point');\n //Extracting the latitue and longitude from the clicked position\n latitude = clickcoordinate[1];\n longitude = clickcoordinate[0];\n console.log(latitude, longitude)\n //Calling a function to handle search for either line or point features from the extracted point\n //\"clickedArray\" is passed to place the position marker of the search from position in the correct feature\n if (target === \"point\") {\n createfoundpoints(latitude, longitude, \"clickedArray\");\n }\n else if (target === \"line\") {\n createfoundlines(latitude, longitude, \"clickedArray\");\n }\n }\n //If searching from a marked trail\n else if (findFromTrail) {\n console.log('find from trail');\n //Get table name from clicked line! NOT WORKING YET, JUST HARD CODING THE RED TRAIL\n table2 = \"w_trailhellas5\"\n //Calling a function to handle search for either line or point features from the line feature table extracted\n if (target === \"point\") {\n createfoundpointsfromline(table2);\n }\n else if (target === \"line\") {\n createfoundlinesfromline(table2);\n }\n }\n //function that query and create search points from a point\n function createfoundpoints(latitude, longitude, fromArray) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, longitude, latitude, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findpointfrompoint',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes table, search from position and distance as req.body parameters\n data: JSON.stringify({\n table: table,\n longitude: longitude,\n latitude: latitude,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers and adds a new in the correct feature (fromArray)\n clickedArray.clear();\n positionArray.clear();\n addPositionMarker(longitude, latitude, fromArray);\n //Loops the rows of the query result and adds positions markers\n for (var i in res) {\n console.log(latitude, longitude, res[i].latitude, res[i].longitude);\n console.log('Point within distance Yeey!');\n addPositionMarker(res[i].longitude, res[i].latitude, \"searchResult\");\n }\n //Sets the view to the search from position\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n }\n })\n }\n //function that query and create search lines from a point\n function createfoundlines(latitude, longitude, fromArray) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, longitude, latitude, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findlinefrompoint',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes table, search from position and distance as req.body parameters\n data: JSON.stringify({\n table: table,\n longitude: longitude,\n latitude: latitude,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers and adds a new in the correct feature (fromArray)\n clickedArray.clear();\n positionArray.clear();\n addPositionMarker(longitude, latitude, fromArray);\n //Passes the rows to a parsing function and ads the line features as new features in the searchTrailArray vector source\n var list_Feat = jsonAnswerDataToListElements(res);\n var line_data = {\n \"type\": \"FeatureCollection\",\n \"features\": list_Feat\n }\n searchTrailArray.addFeatures(new ol.format.GeoJSON().readFeatures(line_data, { featureProjection: 'EPSG: 3857' }))\n //Sets the view to the search from position\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n }\n })\n }\n //function that query and create search points from a line\n function createfoundpointsfromline(table2) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, table2, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findpointfromline',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes tables and distance as req.body parameters\n data: JSON.stringify({\n table1: table,\n table2: table2,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers\n clickedArray.clear();\n positionArray.clear();\n //Loops the rows of the query result and adds positions markers\n for (var i in res) {\n console.log(latitude, longitude, res[i].latitude, res[i].longitude);\n console.log('Point within distance Yeey!');\n addPositionMarker(res[i].longitude, res[i].latitude, \"searchResult\");\n }\n /*\n map.setView(new View({\n center: fromLonLat([res[1].longitude, res[1].latitude]),\n zoom: 13\n }))\n */\n }\n })\n }\n //function that query and create search lines from a line\n function createfoundlinesfromline(table2) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, table2, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findlinefromline',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes tables and distance as req.body parameters\n data: JSON.stringify({ //req body\n table1: table,\n table2: table2,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers\n clickedArray.clear();\n positionArray.clear();\n //Passes the rows to a parsing function and ads the line features as new features in the searchTrailArray vector source\n var list_Feat = jsonAnswerDataToListElements(res);\n var line_data = {\n \"type\": \"FeatureCollection\",\n \"features\": list_Feat\n }\n searchTrailArray.addFeatures(new ol.format.GeoJSON().readFeatures(line_data, { featureProjection: 'EPSG: 3857' }))\n /*\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n */\n }\n })\n }\n}", "function showHideWhere() {\n if (!$('body.results .content.header').hasClass('stickyForm')) {\n if($('.header_forms .yp-what-where > li.where-wrap .input-label').css('display') == 'none') {\n if ($('#search-where-search-top').val() == '' && $('#search-what-search-top').val() != '') {\n $('#search-where-search-top').parents('li.where-wrap').hide();\n }\n }\n }\n }", "get found() {\n return this._found;\n }", "function checkWin() {\n match_found += 1;\n if (match_found === 8) {\n showResults();\n }\n}", "function prepUIforSearch() {\n $(\".btn-secondary.nav.removable\").hide(400)\n $(\".nav-item.active.removable\").hide(400)\n}" ]
[ "0.6082028", "0.6027638", "0.600003", "0.5767678", "0.56559587", "0.5632707", "0.5623649", "0.55380046", "0.542557", "0.53851926", "0.53812", "0.5330543", "0.527344", "0.5178206", "0.5168843", "0.51355743", "0.5126327", "0.5125466", "0.51208574", "0.51127166", "0.5111031", "0.5098936", "0.50965065", "0.5083637", "0.5069448", "0.5065657", "0.506276", "0.5056731", "0.5050918", "0.5044732", "0.50406253", "0.5032778", "0.50231034", "0.5019329", "0.50163263", "0.5016043", "0.49986783", "0.49985158", "0.49983037", "0.49983037", "0.49899358", "0.4989527", "0.49829188", "0.49813965", "0.49760467", "0.4974483", "0.4974016", "0.49670497", "0.49621296", "0.49561578", "0.4954873", "0.49530616", "0.49529848", "0.49433675", "0.4936129", "0.49352184", "0.493211", "0.492772", "0.49198726", "0.4917577", "0.4913537", "0.4908024", "0.4906762", "0.48928273", "0.488903", "0.48852503", "0.48813695", "0.48806506", "0.4878637", "0.48713398", "0.487132", "0.48703772", "0.48659638", "0.48629856", "0.48607713", "0.48565993", "0.4855145", "0.4851484", "0.4844533", "0.4843067", "0.48405725", "0.48387513", "0.4837571", "0.4833237", "0.48315445", "0.482938", "0.48273727", "0.48252904", "0.48246747", "0.4821851", "0.48137224", "0.48061147", "0.4803399", "0.47994113", "0.47956023", "0.4793082", "0.4791776", "0.4789272", "0.47880977", "0.4783541", "0.4780109" ]
0.0
-1
Report info in console
function reportInfo(vars, showType = false) { if (showType === true) console.log(typeof vars); console.log(vars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function info() {\n\tseperator();\n\tOutput('<span>>info:<span><br>');\n\tOutput('<span>Console simulator by Mario Duarte https://codepen.io/MarioDesigns/pen/JbOyqe</span></br>');\n}", "function showInfoConsole(){\n var msg = clc.xterm(221);\n console.clear;\n console.info(\" Transmission Node Rest Made by \"+msg('RaulGF92')+\" \");\n console.info(\" ---------------------------------------------------------\");\n console.info(\" | [Transmission Node Rest] is listenning on PORT \"+clc.red('8888')+\" |\");\n console.info(\" ---------------------------------------------------------\");\n console.info(\" Server transmission Info: (change:\"+change+\") \");\n console.info(\"\");\n console.info(server);\n}", "info (msg : string, ...args : mixed[]) {\n\t\tthis._print(\"info\", msg, ...args)\n\t}", "static info(){\r\n\t\t\tconsole.log('A dog is a mammal');\r\n\t\t}", "info() {}", "info() {}", "info(...parameters)\n\t{\n\t\tconsole.log(this.preamble, generate_log_message(parameters))\n\t}", "report() {\n console.log(this.name + \" is a \" + this.type + \" type and has \" + this.energy + \" energy.\");\n }", "static info(...args) {\n if (this.toLog('INFO')) {\n // noinspection TsLint\n console.info.apply(console, arguments); // eslint-disable-line\n }\n }", "Information(){\n console.log(`Make: ${this.make}, Model: ${this.model}, Year: ${this.year}, Color: ${this.color}`);\n }", "printInfo(text) {\n const targetName = this.context.isTestTarget ? 'test' : 'build';\n this.logger.info(`- ${this.context.projectName}@${targetName}: ${text}`);\n }", "info(...args) {\n const formatted = format(...args);\n this.debug('%s', formatted);\n this.emit('info', formatted);\n }", "function info(message) {\n process.stdout.write(message + os.EOL);\n }", "function printServerInfo() {\n\tconsole.info('Server Details:');\n\tconsole.info();\n\tconsole.info('Server: ',configuration.url);\n\tconsole.info('Port: ',configuration.port);\n\tconsole.info('DB Name:',configuration.mongo.db);\n\tconsole.info('DB Host:',configuration.mongo.host);\n\tconsole.info('DB Port:',configuration.mongo.port);\n\tconsole.info('DB User:',configuration.mongo.user);\n\tconsole.info();\n}", "function info(msg) {\n if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n}", "function info(msg) {\n if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n}", "function info(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos){console.log('Info: '+msg);}} // Non-fatal warnings.", "function outputDeviceSummary(){\n console.log(\"============================\");\n console.log(\"Power: \" + pCurrent);\n console.log(\"Mode: \" + mCurrent);\n console.log(\"============================\");\n}", "function info(message) {\r\n process.stdout.write(message + os.EOL);\r\n}", "function info(message) {\r\n process.stdout.write(message + os.EOL);\r\n}", "function info(msg) {\n if (verbosity >= VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n }", "info() { }", "async logDeviceInfo() {\n try {\n let sysinfo = await this.iologik.getSysInfo();\n for (let key in sysinfo) {\n this.log(key + ': ' + sysinfo[key]);\n }\n } catch (e) {\n this.emit('error', e);\n }\n }", "info(el) {\n\t\tif (this.level >= 2) {\n\t\t\tconst color = \"\\x1b[36m%s\\x1b[0m\"\n\t\t\tconst log = \"Info: \" + el\n\t\t\tconsole.info(color, log)\n\t\t\tthis.writeLog(log)\n\t\t}\n\t}", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "function show_info(message) {\n\tprocess.title = message;\n\tconsole.info('\\x1b[35;46m' + message + '\\x1b[0m');\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function report(text) {\n\tif(DEBUG) {\n\t\tconsole.log('\\x1b[33m[%s]\\x1b[0m', text);\n\t}\n}", "function logToConsole(info) {\n return console.log(info + \" is something important to keep in mind\");\n }", "info(...args) {\n console.info(this.getColorOn() + args.join(\" \"));\n }", "info(toInfo) {\r\n if (this.configManager.envConfig.messagingWebClient.enableConsoleLogging) {\r\n this.console.info(toInfo);\r\n }\r\n }", "showStats(){\n console.log(\"Name:\", this.name, \"\\nStrength:\", this.strength, \"\\nSpeed:\", this.speed, \"\\nHealth:\", this.health);\n }", "displayInConsole() {\n console.log(\"{ name: \" + this.name + \", colors: \" + this.colors + \", manaCost: \" + this.manaCost + \", type: \" + this.modifier + \", TCGPlayer price: \" + this.tcgprice + \", Card Kingdom price: \" + this.ckprice);\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "function Info(text){\r\n\tvar txt=\"\";\r\n\tfor( var i = 0; i < arguments.length; i++ ) txt+=arguments[i];\r\n\tconsole.log(txt);\r\n}", "info(text) {\n this.log(text, LogLevel.Info);\n }", "function report(){\n\n\tconsole.log(\"Summary of Current Session: \")\n\tfor(var url in urlDict){\n\t\tconsole.log(\"\\tURL: \" + url + \"\\tElapsed Time: \" + urlDict[url] + \"s\");\n\t}\n}", "function printInfo() {\n let ypos = 20;\n let xpos = 10;\n function nextY(){ ypos+=20; return ypos;}\n viewer.print('Dr.Santi Nuratch', xpos, nextY(), 'rgba(255,255,255,0.5)', 14);\n viewer.print('Machine Learning Algorithm', xpos, nextY(), 'rgba(255,255,10,0.5)', 14);\n viewer.print('Embedded Computing and Control Laboratory', xpos, nextY(), 'rgba(50,255,85,0.5)', 14);\n viewer.print('ECC-Lab | INC-KMUTT', xpos, nextY(), 'rgba(255,150,50,0.5)', 14);\n viewer.print('02 April 2018', xpos, nextY(), 'rgba(155,155,255,0.5)', 14);\n \n\n nextY(); // add empty line\n for(let i=0; i<centroids.length; i++) {\n viewer.print('Class-' + i + ': ' + centroids[i].members.length, xpos, nextY(), centroids[i].color);\n }\n viewer.print('Iteration: ' + (numIterations+1), xpos, nextY(), 'rgba(255,255,255,0.5)'); \n \n let err = (cenDist==0)?TERMINATION_TH/2 + Math.random() : cenDist;\n viewer.print('Error[' + (numIterations+1) +']: ' + err.toFixed(2), xpos, nextY(), 'rgba(255,255,255,0.5)'); \n }", "function printInfo(text) {\n var str = '';\n for(var index in that.info_text) {\n if(str !== '' && that.info_text[index] !== '') {\n str += \" - \";\n }\n str += that.info_text[index];\n }\n document.getElementById(\"graph-info\").innerHTML = str;\n }", "async _printInformation() {\n\t\tif((plantworksEnv !== 'development') && (plantworksEnv !== 'test'))\n\t\t\treturn;\n\n\t\tawait snooze(600);\n\t\tthis.$dependencies.LoggerService.debug(`Sharding cluster initialized at ${this.$hashring.whoami()}`);\n\t}", "function info(message) {\n process.stdout.write(message + os$1.EOL);\n}", "function info(message) {\n process.stdout.write(message + os$1.EOL);\n}", "function printInfo (arg) {\n if (arg !== 0) {\n console.log(`The user with the id has the email of ${arg.email}, the name of ${arg.name} and the address of ${arg.address}.`)\n } else {\n console.log('Try again')\n }\n}", "static print() {\n console.log(\"snapClinical JS SDK Version: \" + \"1.2.15\" );\n }", "report() {\n\t\tconsole.log(`${this.name}'s energy level is ${this.elevel}.`);\n\t}", "function logSiteInfo() {\n\t\tvar siteName = $(document.body).data('site-name');\n\t\tvar siteNameStyles = 'font-family: sans-serif; font-size: 42px; font-weight: 700; color: #16b5f1; text-transform: uppercase;';\n\n\t\tvar siteDescription = $(document.body).data('site-description');\n\n\t\tconsole.log('%c%s', siteNameStyles, siteName);\n\t\tlog(siteDescription);\n log('Designed by: Nat Cheng http://natcheng.com/');\n log('Coded by: Den Isahac https://www.denisahac.xyz/');\n\t}", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', менеджер: ' + this.manager.name ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "function printInfo(text) {\n var str = '';\n for(var index in info_text) {\n if(str != '' && info_text[index] != '') {\n str += \" - \";\n }\n str += info_text[index];\n }\n document.getElementById(\"graph-info\").innerHTML = str;\n }", "function logInfo(text) {\n console.log(chalk_1.default.blue(text));\n}", "function util_print() {\n\n //1.Should append Extra lines to the Result files\n // var conn = conn_dev;\n var conn = conn_uat\n //2. Able to PRint the Environmental Details\n var formattext = '\\r\\n------------------------------\\r\\n' + 'D/b SERVER Conected: ' + conn.config.server + '\\r\\n' + '-------------------------------\\r\\n';\n console.log(formattext);\n let fss;\n try {\n fss = fs.openSync('message.txt', 'a');\n fs.appendFileSync(fss, formattext, );\n \n } catch (err) {\n throw err;\n }\n finally {\n console.log('\\r\\n ..In Output, Server Name Added. \\r\\n ');\n if (fss !== undefined)\n fs.closeSync(fss);\n }\n //});\n\n}", "printEmployee() {\n // get employee information\n dbFunctions.employeeInfo()\n // show results in console\n .then((results) => {\n console.table(results)\n startManagement()\n })\n }", "function info(msg) {\n if (argv.verbose >= 1) {\n console.warn(msg);\n }\n}", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "function info()\n{\n console.log('Normal Functions') ;\n}", "function printInfo(target, methodName, paramIndex) {\n console.log('Target', target);\n console.log('Method', methodName);\n console.log('index', paramIndex);\n console.log(Date.now());\n}", "logInfo(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('info')) {\n console.log(`Info : ${text}`);\n }\n }", "function printInfo(profileName, badgeCount, firstPointCount, secondPointCount) {\n var infoMessage = profileName + ' has ' + badgeCount + ' Treehouse badges, ' + firstPointCount + ' JavaScript points, & ' + secondPointCount + ' Ruby points!';\n console.log(infoMessage);\n}" ]
[ "0.74332", "0.69564277", "0.68985623", "0.6885694", "0.67392135", "0.67392135", "0.6701192", "0.663166", "0.6609604", "0.6606793", "0.6536496", "0.653191", "0.6507201", "0.6501332", "0.6458283", "0.6458283", "0.6446817", "0.64459467", "0.6441109", "0.6441109", "0.64379674", "0.64020735", "0.63894075", "0.6388766", "0.63735217", "0.63732725", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.63294065", "0.62786156", "0.6260802", "0.62427145", "0.6232621", "0.62269974", "0.62158924", "0.6212235", "0.62023395", "0.6201051", "0.6187039", "0.61849165", "0.6180387", "0.6156567", "0.61341536", "0.61341536", "0.6130419", "0.61303455", "0.61291236", "0.61275387", "0.6086677", "0.6083802", "0.6077381", "0.6073488", "0.6036241", "0.6030838", "0.6027943", "0.6027539", "0.6020602", "0.6020297", "0.6015644" ]
0.0
-1
Set value via localStorage
function setValue(item, value) { window.localStorage[item] = (typeof value === 'string') ? value : JSON.stringify(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "function setLocalValue( key, value ) {\n\twindow.localStorage.setItem( key, value );\n\t/*console.log(\"key: \" + key + \", value: \" + value);\n\tconsole.log( getLocalValue( key ) );*/\n\twindow.location.href = \"paquetes_detalle.html\";\n}", "function setStorage(key, value){\n localStorage.setItem(key, value)\n}", "function setLocalStorageItem(key, value) {\n localStorage.setItem(key, value);\n}", "function set_value_in_local_storage(key,value)\n{\n\tif(key == null || value == null)\n\t{\n\t\treturn false;\n\t}\n\t\n\ttry\n\t{\n\t\tif ($(\"#\"+value).val() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).val();\n\t\t\t\n\t\t}\n\t\telse if($(\"#\"+value).html() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).html();\n\t\t\t\n\t\t}\n\t\t// save value in localStorage Object\n\t\tlocalStorage.setItem(key,value);\n\t\t\n\t\t// update current page cache of var your_name\n\t\tyour_name = get_value_from_local_storage(\"name\");\n\t\tupdate_message('Name Saved as ('+your_name+')','form_ok');\n\t\t\n\t\treturn true;\n\t} catch(e)\n\t{\n\t\treturn false;\n\t\tupdate_message('Failed to Save your name','form_error');\n\t}\n}", "function setLocalStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "function setValue(key, value) {\n if (localStorage) { // in case browser doesn't support localStorage\n localStorage.setItem(key, value);\n }\n}", "function setToLocalStorage(name, value){\n if(isLocalStorageAvailable()){\n try {\n localStorage.setItem(name, value);\n } catch (e) {\n if (e == QUOTA_EXCEEDED_ERR) {\n }\n }\n }\n}", "function setLocalStorage(fieldName, value) {\n\twindow.localStorage.setItem(fieldName, JSON.stringify(value));\t\n}", "function setToStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "function local_setValue(name, value) { name=\"GMxs_\"+name; if ( ! value && value !=0 ) { localStorage.removeItem(name); return; }\n var str=JSON.stringify(value); localStorage.setItem(name, str );\n }", "function setLocalStorageItem(key, value) {\n if (typeof (Storage) !== \"undefined\" && localStorage != null) {\n localStorage.setItem(key, value);\n }\n}", "function setLocalStorage(key, value) {\n \t return localStorageService.set(key, value);\n }", "set(key, value) {\n return localStorage.setItem(key, value);\n }", "set(key, value) {\n return localStorage.setItem(key, value);\n }", "function setLocal(number, id)\r\n{\r\n console.log(number, id)\r\n localStorage.setItem(\"number\", number)\r\n localStorage.setItem(\"id\", id);\r\n}", "function setLocaleStorage(name, value){\n localStorage.setItem(name, JSON.stringify(value));\n}", "function setItem(key, value) {\n localStorage.setItem(key, value);\n}", "function setStorage(key, value) \n{\n\tif(typeof(window.localStorage) != 'undefined'){ \n\t\twindow.localStorage.setItem(key,value); \n\t} \n}", "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "function salvar(valor){\n aceitouSalvar = valor\n localStorage.setItem('aceitouSalvar', valor)\n}", "function storeInLocalStorage(key, value) {\n localStorage.setItem(key, value);\n}", "set(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n return value;\n }", "static setItem(value) {\n let item = JSON.stringify(value);\n localStorage.setItem(CartManager.key, item);\n }", "function putValue(key, value){\n\tif (hasStorage()) {\n\t\tlocalStorage.setItem(window.xuser.id + '|' + key, stringify(value));\n\t}\n}", "function setLocalStorage(chave, valor, minutos)\n{\n var expirarem = (new Date().getTime()) + (60000 * minutos);\n\n localStorage.setItem(chave, JSON.stringify({\n \"value\": valor,\n \"expires\": expirarem\n }));\n}", "static save(key, value) {\r\n value = JSON.stringify(value);\r\n \r\n localStorage.setItem(key, value);\r\n }", "function setJsonStorage (chave, valor){\n localStorage.setItem(chave,valor);\n}", "function setItem(key: string, value: any) {\n try {\n localStorage.setItem(key, isString(value) ? value : JSON.stringify(value));\n } catch (e) {\n Raven.captureException(e);\n }\n}", "function valueToLStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj);\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tlocalStorage.setItem(aux.id, aux.value);\n\t\t}\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente');\n\t\t}\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage');}\n}", "function lsSet(key, val) {\n return window.localStorage.setItem(key, val);\n}", "function lsSet(key, val) {\n return window.localStorage.setItem(key, val);\n}", "function setLocalStorge() {\n\n // khi lưu xuống localStorage chuyển data thành String\n\n localStorage.setItem(\n \"DanhSachNhanVien\",\n JSON.stringify(danhSachNhanVien.mangNhanVien)\n );\n}", "function save(key, value) {\n\t\tlocalStorage[key] = value;\n\t}", "function setValue(key, value) {\r\n\tlocalStorage.setItem(\"DCOC_\"+key, value);\r\n}", "function localset(key, value) {\r\n try {\r\n var ret = true;\r\n localStorage.setItem(key, escape(JSON.stringify(value)));\r\n }\r\n catch (se) {\r\n // Presume this is a quota exception, so clear and try again\r\n try {\r\n if (clearstorage())\r\n localStorage.setItem(key, escape(JSON.stringify(value)));\r\n else\r\n ret = false;\r\n }\r\n catch (ise) {\r\n ret = false;\r\n }\r\n }\r\n finally {\r\n return ret;\r\n }\r\n }", "function saveToLS(key, val) {\n \n if( !(\"localStorage\" in window) ) return; // jesli nie wspiera TO WYCHODZIMY Z FUNKCJI\n \n window.localStorage.setItem(key, val); // jesli w spiera to zapisujemy dane w local storage\n \n }", "function set(key, value) {\n getLocalStorage().setItem(PREFIX + key, value);\n}", "function setItem(key, value){\r\n try{\r\n window.localStorage.removeItem(key);\r\n window.localStorage.setItem(key, value);\r\n }catch(e){\r\n console.log(\"Unable to set value for key \" + key);\r\n }\r\n}", "lset(key, data) {\n const encryptedData = Encrypt.encrypt(data)\n localStorage.setItem(key, encryptedData)\n }", "function storage() {\n var el = document.getElementById(event.target.id);\n localStorage.setItem(el.id, el.value);\n}", "function setLocalStorage(location,data){\n localStorage.setItem(location, JSON.stringify(data));\n}", "function asignarUsuario(){\n usuarioActual = localStorage.getItem('nombre');\n document.getElementById(\"nombreUsuario\").value = usuarioActual;\n}", "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "function us_saveValue(name, value) {\r\n\tif (isGM) {\r\n\t\tGM_setValue(name, value);\r\n\t} else {\r\n\t\tlocalStorage.setItem(name, value);\r\n\t}\r\n}", "function setValue(key, value) {\n try {\n window.localStorage.setItem(key, JSON.stringify(value));\n } catch (error) {\n //An older Gecko 1.8.1/1.9.0 method of storage (Deprecated due to the obvious security hole):\n window.globalStorage[location.hostname].setItem(key, JSON.stringify(value));\n }\n}", "function givevalue(){\r\n document.getElementById(\"qty_field\").value=\"1\";\r\n document.getElementById(\"pname\").innerText=localStorage.getItem(\"name\");\r\n document.getElementById(\"pprice\").innerText=localStorage.getItem(\"price\");\r\n document.getElementById(\"totalp\").innerText=localStorage.getItem(\"price\");\r\n }", "function setBalance(value){\n\tlocalStorage.setItem(\"balance\", value);\n}", "function setnewvalue(value, class_name) {\n window.localStorage.setItem(class_name, value);\n $('.' + class_name).html(value);\n $('#save_changes').css({ \"visibility\": \"visible\" });\n}", "function setLocalStorage(key, value) {\n\n switch(key){\n case \"repository\":\n localStorage.repository = value;\n break;\n case \"branch\":\n localStorage.branch = value;\n break;\n case \"functional_area\":\n localStorage.functional_area = value;\n break;\n case \"impacted_area\":\n localStorage.impacted_area = value;\n break;\n case \"weblink\":\n localStorage.weblink = value;\n break;\n case \"start_date\":\n localStorage.start_date = value;\n break;\n case \"end_date\":\n localStorage.end_date = value;\n break;\n }\n\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function setObject(key, value) {\n window.localStorage.setItem(key, JSON.stringify(value));\n}", "function setStorage(data)\n\t\t \t{\n\t\t \t\tvar data = JSON.stringify(data);\n\t\t \t\t//alert(\"SAVED\");\n\t\t \t\tlocalStorage.setItem('data',data);\n\t\t \t}", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n alert('Please use a modern browser to properly view this template!');\n }\n }", "function saveToLocal( key, value ) {\n var localSavedData = JSON.stringify( value );\n localStorage.setItem( key, localSavedData );\n}", "function setObject(key, value) {\n\twindow.localStorage.setItem(key, JSON.stringify(value));\n}", "setStorage (name, content) {\n if (!name) return\n if (typeof content !== 'string') {\n content = JSON.stringify(content)\n }\n window.localStorage.setItem(name, content)\n }", "static setItem(key, value) {\n\n localStorage.setItem(`${MEMORY_KEY_PREFIX}${key}`, value);\n return value;\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n }", "function SetSetting(key, value) {\n // Check if local storage is supported\n if (supports_html5_storage()) {\n // Try to save to local storage\n try {\n localStorage.setItem(key, value); // saves to the database, \"key\", \"value\"\n } catch (e) {\n if (e == QUOTA_EXCEEDED_ERR) {\n alert('Quota exceeded!'); //data wasn't successfully saved due to quota exceed so throw an error\n }\n }\n } else {\n alert(\"Browser does not support local storage!\")\n }\n}", "set(value){\r\n\r\n this.list.push(value)\r\n localStorage.setItem(this.name, JSON.stringify(this.list))\r\n\r\n }", "function updateLocalStorage() {\n objString = '{\"nextId\": \"' + nextId + '\"}';\n convertObjectToString(root);\n localStorage.setItem(LOCAL_STORAGE, objString);\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n}", "function setData(url, data) {\n localStorage.setItem(url, data);\n }", "function setData(loc, val) {\n if (storage) {\n storage.setItem(loc, JSON.stringify(val));\n }\n }", "saveToLocalStorage (key, value) {\n if (global.localStorage) {\n global.localStorage.setItem(\n key,\n JSON.stringify({\n value: value\n })\n );\n }\n }", "static setItem(key, value) {\n if (this.isAvailable() === false) {\n return;\n }\n\t\tlocalStorage.setItem(key, value);\n\t}", "async function setValue(value) {\n //using browser storage api, set value by passing it an object\n await browser.storage.local.set({ value });\n}", "function setData(id, obj){\n localStorage.setItem(id, JSON.stringify(obj));\n}", "function setLocalStorage() {\n var dados = {\n jornadaCertPonto: jornadaCertPonto,\n almoco: almoco,\n jornadaSap: jornadaSap,\n tolerancia: tolerancia,\n semAlmoco: semAlmoco,\n horasAbonadas: horasAbonadas,\n saldoAdpBruto: saldoAdpBruto,\n };\n\n localStorage.setItem(keyLocalStorage, JSON.stringify(dados));\n}", "setStorage(city) {\r\n localStorage.setItem('city', city);\r\n }", "function store(name, val) {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tlocalStorage.setItem(name, val);\n\t} else {\n\t\twindow.alert('Please use a modern browser to properly view this template!');\n\t}\n}", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function remplirInpuTLocalStorage(input){\n document.querySelector(`#${input}`).value = dataLocaleStorageObjet[input];\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function setA() {localStorage.setItem(\"detail\", JSON.stringify(new Roll(\"A\",\"Air-Fryer Bourbon Bacon Cinnamon Rolls\", 0, 5, \"----\",\"img/rolls/Air-Fryer Bourbon Bacon Cinnamon Rolls.jpg\")));}", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function setItemToLocalStorage(name, data) {\n localStorage.setItem(name, JSON.stringify(data));\n}", "set (data, callback) {\n chrome.storage.local.set(data, callback)\n }", "function guardarLocalStorage(clave, valor) {\n localStorage.setItem(clave, JSON.stringify(valor)); \n}", "function setLocalData(key, data) {\n if (Modernizr.localstorage) {\n localStorage.setItem(key, JSON.stringify(data));\n }\n }", "setUsername() {\n var username = document.getElementById(\"username\");\n localStorage.setItem('username', username.value);\n localStorage.setItem('balance', 100);\n localStorage.setItem('round', 0);\n localStorage.setItem('pool', 0);\n }", "function updateLocalStorage(key, value) {\n localStorage.setItem(key, value);\n if (key === \"location\") {\n location = value;\n } else if (key === \"forecastlink\") {\n forecastLink = value;\n } else if (key === \"unit\") {\n unit = value;\n }\n}", "function saveInStorage(name, value) {\n\tlocalStorage.removeItem(name);\n\tlocalStorage.setItem(name, JSON.stringify(value));\n}", "setToken(value) {\n localStorage.setItem('token', value);\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function setCurrent(){\n\t\t//set ls items\n\t\tlocalStorage.setItem('currentMiles', $(this).data('miles'));\n\t\tlocalStorage.setItem('currentDate', $(this).data('date'));\n\n\t\t//insert into the edit form\n\t\t$('#editMiles').val(localStorage.getItem('currentMiles'));\n\t\t$('#editDate').val(localStorage.getItem('currentDate'));\n\t}", "function editLocalStorage(id, value) {\n let items = getLocalStorage();\n\n items = items.map((item) => {\n if (item.id === id) {\n item.value = value;\n }\n return item;\n });\n localStorage.setItem(\"list\", JSON.stringify(items));\n}", "function setStorage(key, value) {\n /// <summary>Save this value in the browser's local storage. Dates do NOT get returned as full dates!</summary>\n /// <param name=\"key\" type=\"string\">The key to use</param>\n /// <param name=\"value\" type=\"string\">The value to store. Can be a simple or complex object.</param>\n if (value === null) {\n localStorage.removeItem(key);\n return null;\n }\n if (typeof value === 'object' || typeof value === 'boolean') {\n var strObj = JSON.stringify(value);\n value = ObjectConstant + strObj;\n }\n\n localStorage[key] = value + \"\";\n\n return value;\n}", "set storage(value) { this._storage = value; }", "function getValue(){\r\n document.getElementById(\"calc\").value=localStorage.getItem(\"M+ Values\");\r\n}", "function storeDataLocalStorage(a, b) {\n window.localStorage.setItem(a, b);\n console.log(a, b);\n}", "function set_storage(e) {\n var myStorage = window.localStorage;\n\n var ref = db.ref(\"userList/\" + user + \"/name\");\n ref.once(\"value\")\n .then(function(s) {\n var name_thing = s.val();\n myStorage.setItem(\"name\", name_thing);\n })\n var code_value = document.getElementById(e.id).value + \"\";\n myStorage.setItem(\"roomCode\", code_value);\n}", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "setSession(value){\n localStorage.setItem(this.SESSION, value);\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }" ]
[ "0.77329993", "0.76940364", "0.7648986", "0.76454145", "0.76193804", "0.7613673", "0.759538", "0.7592993", "0.757655", "0.7573321", "0.7558269", "0.75386804", "0.7531605", "0.75293916", "0.75293916", "0.75050634", "0.7476166", "0.7427593", "0.7425734", "0.73765206", "0.7340248", "0.73386973", "0.73356646", "0.7328066", "0.731456", "0.7302734", "0.729178", "0.7287258", "0.7263156", "0.72445065", "0.72355586", "0.72355586", "0.72169864", "0.7191583", "0.71704066", "0.716817", "0.7161108", "0.71362925", "0.712242", "0.71149015", "0.7110068", "0.70981616", "0.7083473", "0.7058698", "0.7047172", "0.70336646", "0.70281434", "0.70230573", "0.70177954", "0.7017347", "0.7015924", "0.7013378", "0.70073473", "0.70059615", "0.699592", "0.6982222", "0.6978284", "0.6977052", "0.69759065", "0.69672495", "0.6958955", "0.6956127", "0.6955635", "0.6954927", "0.6944338", "0.6941241", "0.6934924", "0.692673", "0.69243443", "0.69156593", "0.69136846", "0.69069934", "0.69022864", "0.6897347", "0.6893131", "0.6893131", "0.6888612", "0.68764466", "0.68764466", "0.68764466", "0.6864198", "0.6861502", "0.68546444", "0.68545395", "0.6848863", "0.68472034", "0.68403876", "0.6833277", "0.68311906", "0.68292624", "0.6824186", "0.6824107", "0.68148506", "0.6810045", "0.68070024", "0.68055207", "0.6799433", "0.67932767", "0.6792957", "0.6792957" ]
0.7550124
11
Get value via localStorage
function getValue(item, toJSON) { return (window.localStorage[item]) ? ((toJSON) ? JSON.parse(window.localStorage[item]) : window.localStorage[item]) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_value_from_local_storage(key)\n{\n\ttry\n\t{\n\t\treturn localStorage.getItem(key);\n\t} catch(e)\n\t{\n\t\treturn false;\n\t}\n}", "getStorage(arg1) {\n return window.localStorage.getItem(arg1);\n\n }", "get(key) {\n return localStorage.getItem(key);\n }", "get(key) {\n return localStorage.getItem(key);\n }", "get() {\n const str = localStorage.getItem(this.getStorageKey());\n\n if (str) {\n const data = JSON.parse(str);\n \n return data;\n }\n\n return undefined;\n }", "function get(name) {\n if (typeof (Storage) !== 'undefined') {\n return localStorage.getItem(name)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n }", "function getFromLocalStorage(key) {\n\tvar item = localStorage.getItem(key);\n\tif(item) { \n\t\treturn item;\n\t}\n\telse {\n\t\tconsole.log(\"could not store \" + key);\n\t\treturn null;\n\t}\n}", "function getValue(key) {\n if (localStorage) { // in case browser doesn't support localStorage\n return localStorage.getItem(key) // returns value; returns null if not found\n } else {\n return null;\n }\n}", "function getFromLocalStorage(name) {\n return JSON.parse(localStorage.getItem(name));\n \n}", "function getFromLocalStorage(name) {\n var value = JSON.parse(localStorage.getItem(name));\n\n if(value == null) {\n if(name == 'ScriptsRun') value = 1;\n else value = 0;\n }\n\n return value;\n}", "function get(name) {\n if (typeof (Storage) !== 'undefined') {\n return localStorage.getItem(name)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n}", "function getItem(key){\r\n try{\r\n var val = window.localStorage.getItem(key);\r\n if(val == null)\tval = \"\";\r\n return val;\r\n }catch(e){\r\n console.log(\"Unable to return value for key \" + key);\r\n return \"\";\r\n }\r\n}", "function get (key) {\n return JSON.parse(window.localStorage.getItem(key));\n}", "function getSavedValue(v) {\n if (typeof(Storage) !== \"undefined\") {\n if (!localStorage.getItem(v)) {\n return \"\";// You can change this to your defualt value.\n }\n return localStorage.getItem(v);\n }\n else {\n console.log(\"Sorry, your browser does not support web storage...\");\n }\n}", "function getValueFromLocalStorage(){\n var dataArray = JSON.parse(localStorage.getItem(\"quizResult\"));\n \n if (dataArray !== null) {\n storedValues = dataArray;\n }\n}", "function work(){\r\n var storedValue = localStorage.getItem('wname');\r\n var storedValue = localStorage.getItem('wdescription');\r\n var storedValue = localStorage.getItem('wdateline');\r\n }", "function getItem(key) {\n var value;\n log('Get Item:' + key);\n try {\n value = window.localStorage.getItem(key);\n }catch(e) {\n log(\"Error inside getItem() for key:\" + key);\n log(e);\n value = \"null\";\n }\n log(\"Returning value: \" + value);\n return value;\n }", "function getAmount()\n{\n return localStorage.getItem(\"totalPrice\");\n}", "function get(name) {\n if (typeof (Storage) !== \"undefined\") {\n return localStorage.getItem(name);\n } else {\n alert('Please use a modern browser to properly view this template!');\n }\n }", "function getValue(){\r\n document.getElementById(\"calc\").value=localStorage.getItem(\"M+ Values\");\r\n}", "function getLocalStorageItem(key) {\n return localStorage.getItem(key);\n}", "function getLocalStorage() {\n return JSON.parse(localStorage.getItem(\"user\")) \n}", "getStorage() {\n return this.parse( localStorage.getItem( this.key ) )\n }", "function getStorage()\n\t\t \t{\n\t\t \t\tvar data = localStorage.getItem('data');\n\t\t \t\tdata = JSON.parse(data);\n\t\t \t\treturn data;\n\t\t \t}", "getItem(itemName) {\r\n if (!is.aPopulatedString(itemName)) { return null; }\r\n const valueToBeDeserialized = localStorage.getItem(itemName);\r\n if (!valueToBeDeserialized) { return null; }\r\n const deserializedValue = JSON.parse(valueToBeDeserialized);\r\n if (deserializedValue.hasOwnProperty('value')) { return deserializedValue.value; }\r\n return null;\r\n }", "get() {\n return new Promise((resolve, reject) => {\n try {\n const result = localStorage.getItem(this.name);\n resolve(result);\n } catch (err) {\n reject(err);\n }\n });\n }", "function us_getValue(name, alternative) {\r\n\tif (isGM) {\r\n\t\treturn (GM_getValue(name, alternative));\r\n\t} else {\r\n\t\treturn (localStorage.getItem(name, alternative));\r\n\t}\t\r\n}", "function getLS(key){\n let value= window.localStorage.getItem(key);\n let setString= JSON.parse(value);\n return setString;\n\n}", "function get(name) {\n if (typeof (Storage) !== 'undefined') {\n return localStorage.getItem(name)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function getItem(key) {\n var value = null;\n log('Get Item:' + key);\n try {\n value = window.localStorage.getItem(key);\n }catch(e) {\n log(\"Error inside getItem() for key:\" + key);\n log(e);\n value = null;\n }\n log(\"Returning value: \" + value);\n return value;\n}", "function getValue(key){\n\tif (hasStorage()) {\n\t\treturn thisX.eval('__xstorage = ' + localStorage.getItem(window.xuser.id + '|' + key) + ';');\n\t}\n\treturn null;\n}", "function get(name) {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\treturn localStorage.getItem(name);\n\t} else {\n\t\twindow.alert('Please use a modern browser to properly view this template!');\n\t}\n}", "function get(name) {\n if (typeof (Storage) !== 'undefined') {\n return localStorage.getItem(name)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function get(name) {\n if (typeof (Storage) !== 'undefined') {\n return localStorage.getItem(name)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "get(id){\n const hit = localStorage.getItem(`${this.state.context}-${id}`);\n if (hit) {\n return JSON.parse(hit)\n }\n return null;\n }", "function retrieve_item() {\n let qty_in_store = localStorage.getItem('Qty');\n if(qty_in_store){\n qty = JSON.parse(qty_in_store);\n }\n}", "function Cargar(nombre){\n var valor = localStorage.getItem(nombre);\n document.getElementById(nombre).value = valor;\n return valor;\n}", "function get(name) {\n if (typeof (Storage) !== \"undefined\") {\n return localStorage.getItem(name);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function get(name) {\n if (typeof (Storage) !== \"undefined\") {\n return localStorage.getItem(name);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function get(name) {\n if (typeof (Storage) !== \"undefined\") {\n return localStorage.getItem(name);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function getStorage(data)\n{\n return JSON.parse(localStorage.getItem(data))\n}", "function GetSetting(key) {\n // Check if local storage is supported\n if (supports_html5_storage()) {\n // If it does then return the value.\n return localStorage.getItem(key);\n } else {\n alert(\"Browser does not support local storage!\")\n }\n}", "static get(key) {\r\n key = localStorage.getItem(key);\r\n \r\n try {\r\n return JSON.parse(key);\r\n } catch {\r\n return key;\r\n }\r\n }", "function getStored(key, init_value) {\n const d = localStorage.getItem(key);\n if(d) return JSON.parse(d);\n return init_value;\n}", "function get(name) {\n if (typeof (Storage) !== \"undefined\") {\n return localStorage.getItem(name);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function getFromStorage(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function getItem(key) {\n var value;\n \n try {\n value = window.localStorage.getItem(key);\n }catch(e) {\n console.error(\"Error inside getItem() for key: \" + key);\n\t console.log(e);\n\t value = \"null\";\n }\n \n console.log('getItem(' + key +'): ' + value );\n return value;\n }", "function getLocalValue( key ) {\n\tif( window.localStorage.getItem( key ) == null )\n\t\treturn '';\n\telse\n\t\treturn window.localStorage.getItem( key );\n}", "get(key, $default = null) {\n let value = localStorage.getItem(key);\n\n try {\n value = JSON.parse(value);\n } catch (e) {\n value = null;\n }\n\n return value === null ? $default : value;\n }", "function getDataFromLocalStorage(){\n var students = JSON.parse(localStorage.getItem(\"students\"));\n return students;\n \n }", "function retrieFromLocal(key){\n\tconsole.log(\"recovered\");\n\treturn JSON.parse(localStorage.getItem(key));\t\n}", "function getlocalStorage(hour){\n var inputval = localStorage.getItem(hour)\n if(true){\n // $(\"input\").data(`input${hour}`)\n var text= $(`input#inputText${hour}`).val(inputval)\n console.log(text)\n }\n }", "function getLocalStorageItem(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getLocStorage(toRetreive) {\n return localStorage.getItem(toRetreive[0]);\n}", "function get(name) {\r\n if (typeof Storage !== \"undefined\") {\r\n return localStorage.getItem(name);\r\n } else {\r\n window.alert(\r\n \"Please use a modern browser to properly view this template!\"\r\n );\r\n }\r\n }", "function getSavedValue(key, initialValue){\n const savedValue = JSON.parse(localStorage.getItem(key))// para obtener el valor almacenado en el localstorage\n if(savedValue) return savedValue;\n if(initialValue instanceof Function) return initialValue();\n return initialValue;\n\n}", "function getOptionSetting() {\n return localStorage;\n}", "retrieveFromLocalStorage(difficulty, rank) {\n return JSON.parse(localStorage.getItem(`${difficulty}_${rank}`));\n }", "getStorage(key) {\n const now = Date.now(); //epoch time, lets deal only with integer\n // set expiration for storage\n let expiresIn = this.$localStorage.get(key + \"_expiresIn\");\n if (expiresIn === undefined || expiresIn === null) {\n expiresIn = 0;\n }\n if (expiresIn < now) {\n // Expired\n this.removeStorage(key);\n return null;\n } else {\n try {\n const value = this.$localStorage.get(key);\n return value;\n } catch (e) {\n logger.publish(\n 4,\n \"store\",\n `getStorage: Error reading key [\n ${key}\n ] from localStorage: `,\n e\n );\n return null;\n }\n }\n }", "function getItem(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getObject(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getItem(key) {\n\treturn JSON.parse(localStorage.getItem(key));\n}", "function getKeyVal(key) {\n var value = \"\";\n value = window.localStorage.getItem(key);\n if (value === undefined) {\n return \"\";\n }\n return value;\n }", "function get(name) {\n var value = (_.isFunction($cookies.get) ? $cookies.get(name) : $cookies[name]);\n\n if (!value && localStorage) {\n\n try {\n value = localStorage.getItem(name);\n }\n catch (ex) {}\n\n if (value) {\n set(name, value);\n }\n }\n\n return value;\n }", "function getItem(key) {\n var value;\n log('Retrieving key [' + key + ']');\n try {\n value = window.localStorage.getItem(key); // <-- Local storage!\n }catch(e) {\n log(\"Error inside getItem() for key:\" + key);\n log(e);\n value = \"null\";\n }\n log(\"Returning value: \" + value);\n return value;\n}", "function getLocalStorage(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getLocal(id){\n return localStorage.getIndicator(id);\n }", "function getBank()\n{\n if (!localStorage.getItem('bank'))\n {\n localStorage.setItem('bank', 100);\n return localStorage.getItem('bank');\n }\n else\n {\n return localStorage.getItem('bank');\n }\n}", "function getFromStorage(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getStorage(key)\n{\n localStorage.length;\n var value = localStorage.getItem(key);\n if (value && (value.indexOf(\"{\") == 0 || value.indexOf(\"[\") == 0))\n {\n return JSON.parse(value);\n }\n return value;\n}", "function userFromLocal() {\n let user = localStorage.getItem(\"user\");\n return user;\n}", "function getItem(key) {\n return localStorageService.get(key);\n }", "function readFromLS(key) {\n \n if( !(\"localStorage\" in window) ) return;\n \n return window.localStorage.getItem(key); // podajemu co ma odczytac z LS\n \n }", "function getToken(){\n var token = localStorage.getItem('token', token);\n if (token != ''){\n document.getElementById(\"token\").value = token;\n }\n return token;\n}", "function valueToLStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj);\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tlocalStorage.setItem(aux.id, aux.value);\n\t\t}\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente');\n\t\t}\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage');}\n}", "function getitem(item, defaultvalue) {\r\r\n // get the item frm localstorage\r\r\n var value = defaultvalue;\r\r\n try {\r\r\n value = JSON.parse(localStorage.getItem(item));\r\r\n } catch (error) {\r\r\n // store the default value for next time\r\r\n value = defaultvalue;\r\r\n storeitem(item, defaultvalue);\r\r\n }\r\r\n if (value == null) {\r\r\n value = defaultvalue;\r\r\n storeitem(item, defaultvalue);\r\r\n }\r\r\n return value;\r\r\n}", "function getFromLocalStorage(keyname) {\n var stringedData = localStorage.getItem(keyname);\n var parsedData = JSON.parse(stringedData);\n return parsedData;\n}", "function savepage(){\r\n var mylog=window.localStorage.getItem('z')\r\nreturn mylog;\r\n}", "function getLocal(mode, key) {\n return localStorage.getItem(`${mode}-${key}`);\n}", "function myFunction6(){\nalert(localStorage.getItem(\"Token\"));\n\n}", "function returnString(key){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//return strings from the local Storage by key\n\treturn localStorage.getItem(localStorage.key(key));\n}", "function getObject(key) {\n\tvar storage = window.localStorage;\n\tvar value = storage.getItem(key);\n\treturn value && JSON.parse(value);\n}", "function getItem(key) {\n var result = null;\n try {\n var win = (0,_dom_getWindow__WEBPACK_IMPORTED_MODULE_0__.getWindow)();\n result = win ? win.localStorage.getItem(key) : null;\n }\n catch (e) {\n /* Eat the exception */\n }\n return result;\n}", "function getItem(key) {\n var result = null;\n try {\n var win = (0,_dom_getWindow__WEBPACK_IMPORTED_MODULE_0__.getWindow)();\n result = win ? win.localStorage.getItem(key) : null;\n }\n catch (e) {\n /* Eat the exception */\n }\n return result;\n}", "function getLocalData(key) {\n var retval = null;\n if (Modernizr.localstorage) {\n retval = localStorage.getItem(key);\n if (retval != null && retval.length > 0) {\n retval = JSON.parse(retval);\n }\n }\n\n return retval;\n }", "getField() {\n return JSON.parse(localStorage.getItem(FIELD_KEY));\n }", "function getLocalStorage() {\n if(localStorage.getItem(\"DSNV\")) {\n dsnv.arr = JSON.parse(localStorage.getItem(\"DSNV\"));\n taoBang(dsnv.arr);\n }\n}", "function getLocalStorage(location){\n console.log(location);\n return JSON.parse(localStorage.getItem(location));\n}", "function getKeyFromLocalStorage(key) {\n return localStorage.getItem(key);\n}", "function getLocalStorage (term) {\n\tvar localStorageItem = localStorage.getItem(\"searchTerm\");\n\n\treturn localStorageItem;\n}", "function get_item_database(key) {\n return localStorage.getItem(key);\n}", "function get_item_database(key) {\n return localStorage.getItem(key);\n}", "function getLocal(name){\n\n\tif (typeof(Storage) !== \"undefined\") {\n\t\treturn JSON.parse(localStorage.getItem(name));\n\t}else{\n\t\t//if we do not have local storage for some reason try to use cookies\n\t\treturn JSON.parse(getCookie(name));\n\t}\n\n}", "function GM_getValue (key, defaultValue) {\n\t\t\tvar value = window.localStorage.getItem(key);\n\t\t\tif (value == null) value = defaultValue;\n\t\t\treturn value;\n\t\t}", "function getItem(key) {\n var result = null;\n try {\n result = window.localStorage.getItem(key);\n }\n catch (e) {\n /* Eat the exception */\n }\n return result;\n}", "function obtener_localstorage(){\n\n if(localStorage.getItem(\"nombre\")){\n\n // se que exiate el nombre en el local storage\n // para obtener atributo\n let nombre = localStorage.getItem(\"nombre\");\n \n // para obtener string\n //let nombre = localStorage.getItem(\"persona\");\n\n // para obtener objeto\n let nombre = JSON.parse(localStorage.getItem(\"persona\")); \n\n console.log(nombre);\n // Con esto se esta obteniendo un string que tiene la fora de un objeto JSON\n console.log(persona);\n\n }else{\n console.log(\"No hay entradas en el local storage\")\n }\n \n \n }", "function getLocalStorage() {\n const favLocal = JSON.parse(localStorage.getItem(\"favorite\"));\n return favLocal;\n}", "function getData(name) {\n var text = localStorage.getItem(name);\n //console.log(text);\n return JSON.parse(text);\n\n}", "getLocalStorage() {\n if (localStorage.getItem(\"usuario\")) {\n this.lista_usuario = JSON.parse(localStorage.getItem(\"usuario\"));\n }\n }", "function getFromLocalStorage() {\n if (isLocalStorageNameSupported()) return JSON.parse(localStorage.getItem(\"hitlist\"));\n }" ]
[ "0.76647604", "0.7520878", "0.7473302", "0.7473302", "0.74034417", "0.73893595", "0.7374087", "0.7371265", "0.73617834", "0.7358599", "0.73564845", "0.7309971", "0.729305", "0.7292433", "0.72811455", "0.7243641", "0.7225212", "0.7213296", "0.72114694", "0.7208133", "0.7201163", "0.7175437", "0.7173176", "0.71616", "0.71597797", "0.71574783", "0.71530944", "0.7138717", "0.7135846", "0.71229565", "0.7115765", "0.7114925", "0.7105104", "0.7105104", "0.71002656", "0.70998394", "0.7082021", "0.7077846", "0.7077846", "0.7077846", "0.70752436", "0.70728296", "0.7070032", "0.7063147", "0.7060988", "0.70507056", "0.7040121", "0.7027079", "0.70249546", "0.7022912", "0.7000973", "0.69946957", "0.6993674", "0.6983442", "0.6980234", "0.6978387", "0.6971989", "0.6969946", "0.6958039", "0.6949384", "0.69372255", "0.6926251", "0.69228464", "0.6914487", "0.6902011", "0.687594", "0.6866735", "0.6857693", "0.6853082", "0.68294543", "0.6825263", "0.6820364", "0.68132985", "0.68042475", "0.6801464", "0.679589", "0.67953783", "0.679258", "0.6789689", "0.67849696", "0.67846024", "0.67823154", "0.67760694", "0.67760694", "0.67676723", "0.6763813", "0.6759022", "0.675683", "0.67514145", "0.6740711", "0.6739598", "0.6739598", "0.67377955", "0.6737119", "0.6736986", "0.67333585", "0.6729494", "0.6726204", "0.67139107", "0.6713524" ]
0.7051449
45
Sets the clicked on button in top nav to active
function setNavActive() { $('.nav-a.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleActive() {\n // On first render\n if (element.find(\"a\").attr(\"href\").indexOf($location.path()) >= 0) {\n element.addClass(\"active\");\n }\n else {\n element.removeClass(\"active\");\n }\n }", "function setBtnActive(id){\n const activeBtn = document.querySelector('.tab.active');\n if (activeBtn) activeBtn.classList.remove('active');\n \n const homeBtn = document.getElementById(id);\n homeBtn.classList.add('active');\n}", "function setActiveButton(button, rectTop) {\n button.classList.add('selected-button');\n window.scrollTo(0, rectTop);\n}", "function setActiveNavLink() {\n // clears the \"active\" class from each of the list items in the navigation\n document.querySelectorAll(\"li.nav-item\").forEach(function (listItem) {\n listItem.setAttribute(\"class\", \"nav-item\");\n });\n\n // add the \"active\" class to the class attribute of the appropriate list item\n document.getElementById(document.title).classList.add(\"active\");\n }", "function active() {\n $html.addClass('active');\n }", "function activateButton() {\n\t\t\t$(\"#cd-inittour-trigger\").addClass('clicked');\n\t\t}", "function setActiveButton(clickedButton) {\n\tconst buttonList = $(buttonsUl).children();\n\n\tfor (var i = 0; i < buttonList.length; i++) {\n\t\t$(buttonList[i]).children().removeClass(\"active\");\n\t}\n\n\t$(clickedButton).addClass(\"active\");\n\n}", "function setB1Active() {\n\tbuttonsUl.children[0].children[0].className += \"active\";\n}", "function handleActiveBtn(newBtn){\n\t\tpreviousPage = currentPage;\n\t\tcurrentPage = newBtn;\n\t\tpreviousBtn = previousPage + '-section';\n\t\t$(previousBtn).removeClass('active');\t\t\n\t\tcurrentBtn = newBtn + '-section';\n\t\t$(currentBtn).addClass('active');\t\t\n\t}", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function makeActive() {\n\n var header = document.getElementById(\"navbar\");\n var btns = header.getElementsByClassName(\"link\");\n for (var i = 0; i < btns.length; i++) {\n btns[i].addEventListener(\"click\", function() {\n var current = document.getElementsByClassName(\"activeLink\");\n current[0].className = current[0].className.replace(\" activeLink\", \"\");\n this.className += \" activeLink\";\n });\n }\n}", "function scrollToTopBtn() {\n\n\tlet topBtn = document.querySelector('.grid__footer--link'),\n\t\tnavLinks = document.querySelectorAll('.grid__header--nav--item');\n\n\ttopBtn.addEventListener('click', function() {\n\t\tnavLinks[0].classList.add('active');\n\t\tnavLinks[6].classList.remove('active');\n\t});\n}", "function onClick () {\n navCur && navCur.click();\n }", "function addActiveClass() {\n const selected = \".navbar-large li a\";\n $(selected).on(\"click\", function(e) {\n $(selected).removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n}", "function addactiveclass() {\n $(\"nav ul li a\").each(function () {\n var scrollPos = $(document).scrollTop();\n var currLink = $(this);\n var refElement = $(currLink.data(\"scroll\"));\n if (\n refElement.position().top <= scrollPos &&\n refElement.position().top + refElement.height() > scrollPos\n ) {\n $(\"nav ul li a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }", "function setMenuActive() {\n $('.menu-li.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function menuActive()\n {\n $('#menu-barr').find('a').removeClass('active-link');\n $('#menu-barr').find('.btn-box').removeClass('active-back');\n\n var url_activa = window.location.href;\n var lista_hash = url_activa.split('#');\n \n // agregar clase active-link a los 'a' del menu, cuando se seleccionan\n if(lista_hash[1])\n {\n $('#menu-barr').find('a[href=\"#'+lista_hash[1]+'\"]').addClass('active-link');\n\n }else{\n $('#menu-barr').find('a[href=\"#inicio\"]').addClass('active-link');\n }\n\n // agregar clase active-back a los contenedores de los a del menu, cuando se seleccionan\n if ($('#menu-barr').find('a').hasClass('active-link'))\n {\n $('.'+lista_hash[1]+'').addClass('active-back');\n } else {\n $('.'+lista_hash[1]+'').removeClass('active-back');\n }\n\n }", "function setActive() {\n var path = window.location.pathname;\n openerp.jsonRpc(\"/get_parent_menu\", \"call\", {\n 'url': path,\n }).done(function(data){\n $(\"#top_menu a\").each(function(){\n if ($(this).attr(\"href\") == data) {\n $(this).closest(\"li\").addClass(\"active\");\n }\n });\n });\n}", "function handleActive(selectedButton) {\n const buttons = document.querySelectorAll('button');\n buttons.forEach((button) => { button === selectedButton ? button.classList.add('active') : button.classList.remove('active'); });\n}", "clickHandler() {\r\n // remove active from all links\r\n const links = Array.from(this.element.closest('nav').querySelectorAll('a'));\r\n links.forEach(e => e.classList.remove('active'));\r\n // add active to current root link\r\n const parentNavGroup = this.element.closest('dxp-nav-group');\r\n parentNavGroup.removeAttribute('is-active');\r\n parentNavGroup.querySelector('.nav-level-one-link').classList.add('active');\r\n // add active to current link\r\n this.element.querySelector('.mega-menu-link').classList.add('active');\r\n }", "function scrollMenuActive() {\n\n\t\t\t\t\t$('nav ul li a[href^=\"#\"]').each(function() {\n\n\t\t\t\t\t\tvar btn = $(this);\n\n\t\t\t\t\t\tif (isScrolledIntoView(btn.attr('active'))) {\n\t\t\t\t\t\t\tbtn.closest('li').addClass('active');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbtn.closest('li').removeClass('active');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t}", "function ONCLICK() {\n const currentLocalisation = location.href;\n const menuItem = document.querySelectorAll(\"a\");\n const menuLength = menuItem.length;\n for (let i = 0; i < menuLength; i++) {\n if (menuItem[i].href === currentLocalisation) {\n menuItem[i].className = \"active\";\n }\n } \n }", "setActiveState(){\n let self = this;\n\t // Remove .active class\n\t\t[...document.querySelectorAll('.control-nav a')].forEach(el => el.classList.remove('active'));\n\n\t // Set active item, if not search\n\t if(!this.is_search){\n\t \tlet active = document.querySelector(`.control-nav li a.${this.orderby}`);\n\t \tactive.classList.add('active');\n \t}\n \tsetTimeout(function(){\n \tself.isLoading = false;\n \tself.container.classList.remove('loading');\n }, 1000);\n }", "function setActive(event) {\n var prev = document.querySelector(\".active\");\n\n prev.className = prev.className.replace(\" active\", \"\");\n\n event.target.className += \" active\";\n\n}", "function setNav() {\n\n\t\t\t\tvar $nav = _$parent.find('nav');\n\t\t\t\tvar $contents = _$parent.find('.contents');\n\t\t\t\tvar $btn = $nav.find('p');\n\n\t\t\t\t$btn.on('click',function() {\n\n\t\t\t\t\tvar $target = $(this);\n\n\t\t\t\t\tif ($target.hasClass('active')) return;\n\t\t\t\t\t$contents.removeClass('show');\n\t\t\t\t\t$btn.removeClass('active');\n\t\t\t\t\t$target.addClass('active');\n\t\t\t\t\tvar id = $target.prop('id').split('-')[1];\n\t\t\t\t\t$contents.filter('#contet-' + id).addClass('show');\n\n\t\t\t\t});\n\n\t\t\t\treturn false;\n\t\t\t}", "function setActive(current) {\n\n $(\".nav-link\").removeClass(\"current-section\");\n\n $(`.nav-link[href='#${current}']`).addClass('current-section');\n\n }", "activate(active)\n {\n if(active)\n {\n this.element.classList.add('active');\n }\n else\n {\n this.element.classList.remove('active');\n }\n }", "function setNavActive(navPosition){\n $(\".root > li a\").removeClass(\"active__current\");\n $( \".root > li a\" ).each(function( index ) {\n if(index==navPosition){\n $(this).addClass(\"active__current\");\n return;\n }\n });\n}", "function changeActive() {\n var pkmn = $(\".pkmn\");\n \n pkmn.click(function(){\n pkmn.removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n }", "function setActivePage(newActive){\n\tif(isHome){\n\t\t$('.home-a').removeClass('active');\n\t\tisHome = false;\n\t}\n\telse if(isEquipment){\n\t\t$('.equip-a').removeClass('active');\n\t\tisEquipment = false;\n\t}\n\telse if(isDistrict){\n\t\t$('.territory-a').removeClass('active');\n\t\tisDistrict = false;\n\t}\n\telse if(isTraining){\n\t\t$('.training-a').removeClass('active');\n\t\tisTraining = false;\n\t}\n\telse if(isBurglary){\n\t\t$('.burglary-a').removeClass('active');\n\t\tisBurglary = false;\n\t}\n\telse if(isHistory){\n\t\t$('.history-a').removeClass('active');\n\t\tisHistory = false;\n\t}\n\telse if(isStatistics){\n\t\t$('.stats-a').removeClass('active');\n\t\tisStatistics = false;\n\t}\n\t$('.' + newActive).addClass('active');\n}", "function showActive() {\n for (let i = 0; i < navItems.length; i++) {\n navItems[i].addEventListener(\"click\", function() {\n let current = document.getElementsByClassName(\"current\");\n current[0].className = current[0].className.replace(\" current\", \"\");\n this.className += \" current\";\n });\n // closing menu after link click\n toggleMenu();\n }\n}", "function button_active(button) {\n document.querySelectorAll('li[id^=\"button\"]').forEach(thing => {\n thing.className = \"page-item\"\n });\n document.querySelector(`#${button}`).className += \" active\";\n}", "function setActiveClass() {\n for (let i = 0; i < sections.length; i++) { // i used this for loop insted of \"of\" so i can get the button and section using the same index insted of using 2 for loops\n let section = sections[i];\n let rectTop = section.getBoundingClientRect().top\n if (rectTop < 300 && rectTop > -400) {\n console.log(section.id + \" \" + rectTop)\n resetActiveElements() \n activeElemet = section\n activeButton = buttons[i]\n section.classList.add(\"your-active-class\")\n activeButton.classList.add(\"selected-button\")\n //window.history.pushState(\"\", \"/\", section.id );\n return\n }\n }\n\n resetActiveElements() // rmove the active elements if we scroll top and there is no section showd\n\n}", "function updateNav(item) {\n $('button.navigation').removeClass('active');\n $('button.navigation[name=' + item + ']').addClass('active');\n}", "function activateButtonScrollTop() {\n\t\tvar\n\t\t\twindowHeight = $(window).height(),\n\t\t\tscrollTop = $(window).scrollTop();\n\n\t\tif ( scrollTop > (windowHeight * 0.5) ) {\n\t\t\t$(\"#js-button-top-scroll\").addClass(\"button-top-scroll--active\");\n\t\t} else {\n\t\t\t$(\"#js-button-top-scroll\").removeClass(\"button-top-scroll--active\");\n\t\t}\n\t}", "function button_view_active () {\n document.querySelector('.button_view').classList.add('button_view_active')\n document.querySelector('.button_view__img').classList.add('button_view_active')\n}", "function setActive(section) {\n // Add \"active\" state to the section\n section.classList.add('active');\n const navId = section.dataset.navId;\n // Add \"active\" state to the nav item\n document.querySelector('#'+navId).classList.add('active')\n}", "function setActiveMenu() {\n var pgurl = window.location.hash;\n var baseUrl = window.location.href;\n $(\"ul.menu li a\").each(function () {\n $(this).removeClass(\"active\");\n var urlMenu = $(this).attr(\"href\");\n if (baseUrl == urlMenu || (pgurl == \"/#/\" & urlMenu == \"/#/\"))\n $(this).parents(\"li\").find('a').addClass(\"active\");\n else if (pgurl.indexOf(urlMenu) >= 0 && urlMenu != \"#/\") {\n $(this).parents(\"li\").find('> a').addClass(\"active\");\n }\n })\n}", "function activeLink() {\n resetActiveLink();\n this.className = \"active\";\n}", "function changeActive(e) {\n\t$('.main-menu li').removeClass('active');\n\t$(e).addClass('active');\n}", "function setPopularSectionSelected(btnName){\n $('#popular').removeClass('active');\n $('#best').removeClass('active');\n $('#new').removeClass('active');\n $('#'+btnName).addClass('active');\n}", "function setActiveElement() {\n\tconst id = sessionStorage.getItem(ACTIVE_EL_STATE_KEY);\n\tif (id) {\n\t\tvar item = document.getElementById(id);\n\t\titem.classList.add('active');\n\t\t// focus element as well so tab\n\t\t// navigation can pick up where it left off\n\t\tif (item.firstElementChild && item.firstElementChild.tagName === 'A') {\n\t\t\titem.firstElementChild.focus();\n\t\t} else {\n\t\t\titem.focus();\n\t\t}\n\t}\n}", "function setActive(quoteNumber) {\n $(\"#button-\" + quoteNumber).toggleClass(\"active\");\n var previous = $(\"#quote\").data(\"previous\");\n if (previous != undefined) {\n\t$(\"#button-\" + previous).toggleClass(\"active\");\n }\n $(\"#quote\").data(\"previous\", quoteNumber);\n}", "function setActiveNavLink() {\n //Get url of page, in format: /MyFinancePal/...\n var pathname = window.location.pathname;\n\n //loop through all nav links\n $('ul > li > a').filter(function () {\n /*href is in format http://localhost.. substring removes http://localhost... \n from the link so it starts at /MyFinancePal.. and matches the pathname*/\n return this.href.substring(16) === pathname;\n }).addClass('active bg-primary');\n //^If this function returns true for a link set that link to active\n}", "function updateActiveStatus () {\n\t\tvar elm = $element.find(\"a\")[0];\n\t\t$timeout(function () {\n\t\t\tvar isActive = elm.classList.contains(\"tab-link--isActive\");\n\t\t\telm.setAttribute(\"aria-selected\", isActive);\n\t\t});\n\t}", "function changeActive() {\n var pkmn = $(\".pkmn1\");\n \n pkmn.click(function(){\n pkmn.removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n }", "function handleActive(e) {\r\n //REMOVE ACTIVE CLASS\r\n e.target.parentElement.querySelectorAll(\".active\").forEach((el) => {\r\n el.classList.remove(\"active\");\r\n });\r\n // Add class active\r\n e.target.classList.add(\"active\");\r\n}", "_isActive() {\n this._reset();\n \n this._button.classList.add( TabButton.CLASS.BUTTON_ACTIVE );\n this._content.classList.add( TabButton.CLASS.CONTENT_ACTIVE );\n }", "function onClickMenuIcon() {\n\t\t$(this).toggleClass(\"active\");\n\t\t$mobileNav.toggleClass(\"active\");\n\t}", "function ToggleActiveClass1(){\n\n const react = sections[0].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[0].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[0].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[0].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[0].style.background = \"\";\n }\n }", "function setColorLink(button) {\n const buttons = document.getElementsByClassName('traffic-nav-link');\n for (let i = 0; i < buttons.length; i++) {\n if (buttons[i].innerHTML === button) {\n buttons[i].className = 'traffic-nav-link active'\n } else {\n buttons[i].className = 'traffic-nav-link'\n }\n }\n}", "function active_nav(current) {\n\t$('#nav-'+locate).removeClass(\"active\");\n\t$('#nav-'+current).addClass(\"active\");\n\tlocate = current;\n}", "function topButtonClick(e) {\n for (let i = 0; i < policyAreasContainerButtons.length; i++) {\n buttonContainerArray[i].style.display = \"none\"\n }\n for (let j = 0; j < policyAreasContainerButtons.length; j++) {\n policyAreasContainerButtons[j].classList.remove(\"active\")\n e.target.classList.add(\"active\")\n if(policyAreasContainerButtons[j].classList.contains(\"active\")) {\n buttonContainerArray[j].style.display = \"block\"\n }\n }\n}", "function setActiveClassPrevButton() {\r\n\r\n if (slide == 0) {\r\n\r\n nav1.classList.add('active');\r\n nav2.classList.remove('active');\r\n }\r\n if (slide == 1) {\r\n nav3.classList.remove('active');\r\n nav2.classList.add('active');\r\n }\r\n if (slide == 2) {\r\n nav4.classList.remove('active');\r\n nav3.classList.add('active');\r\n }\r\n\r\n if (slide == 3) {\r\n nav5.classList.remove('active');\r\n nav4.classList.add('active');\r\n }\r\n\r\n if (slide == 4) {\r\n nav6.classList.remove('active');\r\n nav5.classList.add('active');\r\n }\r\n\r\n if (slide == -1) {\r\n\r\n nav1.classList.remove('active');\r\n nav6.classList.add('active');\r\n }\r\n\r\n TweenLite.from(\".active\", .5, {opacity:.5, scale:2.5});\r\n}", "function handleNavClick() {\n $(\"nav a\").removeClass(\"current\");\n $(this).addClass(\"current\");\n}", "function ToggleActiveClass3(){\n\n const react = sections[2].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[2].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[2].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[2].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[2].style.background = \"\";\n }\n }", "function ToggleActiveClass2(){\n\n const react = sections[1].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[1].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[1].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[1].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[1].style.background = \"\";\n }\n }", "function setActiveClassNxtButton() {\r\n\r\n slide = currentItem;\r\n if (slide == 0) {\r\n\r\n nav1.classList.add('active');\r\n nav6.classList.remove('active');\r\n }\r\n\r\n if (slide == 1) {\r\n nav1.classList.remove('active');\r\n nav2.classList.add('active');\r\n }\r\n\r\n if (slide == 2) {\r\n nav2.classList.remove('active');\r\n nav3.classList.add('active');\r\n }\r\n\r\n if (slide == 3) {\r\n nav3.classList.remove('active');\r\n nav4.classList.add('active');\r\n }\r\n\r\n if (slide == 4) {\r\n nav4.classList.remove('active');\r\n nav5.classList.add('active');\r\n }\r\n\r\n if (slide == 5) {\r\n nav5.classList.remove('active');\r\n nav6.classList.add('active');\r\n }\r\n\r\n TweenLite.from(\".active\", .5, {opacity:.5, scale:2.5});\r\n\r\n\r\n}", "function setCurrentSibarElem(){\r\n const elemNavBar = document.querySelectorAll('.sideBar>nav>ul>li')\r\n const url = window.location.href.split(\"/\")[3]\r\n elemNavBar.forEach(el =>{\r\n if(el.classList.contains('active')){\r\n el.classList.remove('active')\r\n }\r\n })\r\n switch (url) {\r\n case \"\":\r\n elemNavBar[0].classList.add('active')\r\n break;\r\n case \"favoris\":\r\n elemNavBar[1].classList.add('active')\r\n break;\r\n case \"historique\":\r\n elemNavBar[2].classList.add('active')\r\n break;\r\n case \"importation\":\r\n elemNavBar[3].classList.add('active')\r\n break;\r\n \r\n default:\r\n break;\r\n }\r\n}", "function addActive(){\t\t\n\t\t$(\".navbar-nav li\").each(function(index){\n\t\t\tvar currentSection = $(this).find(\"a\").attr(\"href\");\n\t\t\tif((window_scroll.scrollTop() > $(currentSection).offset().top - 150)){\t\t\t\t\t\n\t\t\t\t$(this).addClass(\"active\");\n\t\t\t\t$(\".navbar-nav li\").not(this).removeClass(\"active\");\t\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "function activateTab(tabToActivate){\n for (var item of topMenuTabs.children){\n item.classList.remove(\"is-active\");\n }\n tabToActivate.classList.add(\"is-active\");\n}", "[SET_MENU_ACTIVE] (state, button) {\n\n var menu = state[button['menu_name']]\n if( menu != undefined ){\n menu[menu.indexOf(button) ].active = !menu[ menu.indexOf(button) ].active\n }else{\n var menu = state[ button['owner_type'] ]\n for(var btn in menu){\n if(menu[btn].id == button.menu_id){\n var subMenu = menu[btn].submenu \n menu[btn].active = true\n subMenu[ subMenu.indexOf(button) ].active = !subMenu[ subMenu.indexOf(button) ].active\n }\n } \n } \n }", "function activeBtn(btnId) {\r\n\t\tvar btns = document.querySelectorAll('.main-nav-btn');\r\n\r\n\t\t// deactivate all navigation buttons\r\n\t\tfor (var i = 0; i < btns.length; i++) {\r\n\t\t\tbtns[i].className = btns[i].className.replace(/\\bactive\\b/, '');\r\n\t\t}\r\n\r\n\t\t// active the one that has id = btnId\r\n\t\tvar btn = document.querySelector('#' + btnId);\r\n\t\tbtn.className += ' active';\r\n\t}", "function makeActive(i){\n\tvar navitems=$('.nav').find('li');\n\tnavitems.removeClass('active');\n\tnavitems.eq(1).addClass('active');\n}", "function addActiveClass(element) {\n if (current === \"\") {\n //for root url\n if (element.attr('href').indexOf(\"index.html\") !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n }\n } else {\n //for other url\n if (element.attr('href').indexOf(current) !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n if (element.parents('.submenu-item').length) {\n element.addClass('active');\n }\n }\n }\n}", "function resetActiveClass($this) {\r\n \r\n // remove active class\r\n var $headers = $(document).find('div[data-role=\"header\"]');\r\n $headers.find('a').removeClass(\"ui-btn-active\");\r\n\r\n // set active class\r\n $this.addClass(\"ui-btn-active\");\r\n}", "function onClickMenu(index, element) {\r\n document.getElementById(_upObject.default.menuEleID).getElementsByClassName(\"active\")[0].className = \"\";\r\n element.className = \"active\";\r\n _upObject.LoadContentByIndex(index);\r\n}", "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "function activeNav() {\n nav.classList.toggle('active');\n\n}", "function activePage(selector) {\n\t$('#menu-'+selector).addClass('active');\n}", "function setActiveToIndexBtn(index) {\n if (btns.length > 0) {\n for (var i = 0; i < btns.length; i++) {\n btns[i].classList.remove('selected');\n }\n if (btns.length == 1) {\n index = 0\n }\n btns[index].classList.add('selected');\n }\n}", "setActive () {\n\t\tthis._active = true;\n\t\tthis.$element.addClass('screenlayer-active');\n\t}", "function activeMenu() {\n $('header').click(function() {\n $(this).toggleClass('active');\n })\n}", "function activateSelectedNav(nav, terminator){\n removeSelectedNavClass(\"terminus-selected\");\n\t//checkDocumentSubMenus(terminator);\n\tnav.classList.add(\"terminus-selected\");\n}", "function ToggleActiveClass4(){\n\n const react = sections[3].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[3].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[3].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[3].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[3].style.background = \"\";\n }\n }", "function activateLink(e){\n // remove/add .active\n let activeLink = document.getElementsByClassName('active')[0] ? \n document.getElementsByClassName('active')[0] : \n null;\n\n if(activeLink){\n activeLink.removeAttribute('class');\n }\n e.target.setAttribute('class', 'active');\n\n // get the paragraph\n let content = new Content();\n content.getParagraphByIndex(e.target.id);\n\n // change the url in the address bar\n window.history.pushState(\"\", \"\", e.target.id);\n}", "function updateHeaderActiveClass() {\n $('.header__pages a').each(function(i, val) {\n if ($(val).attr('href') == window.location.pathname.split('/').pop()) {\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "function anchorActiveState(me){\n\tif(me.closest('.main_menu').length > 0){\n\t\t$j('.main_menu a').parent().removeClass('active');\n\t}\n\n if(me.closest('.vertical_menu').length > 0){\n $j('.vertical_menu a').parent().removeClass('active');\n }\n\n\tif(me.closest('.second').length === 0){\n\t\tme.parent().addClass('active');\n\t}else{\n\t\tme.closest('.second').parent().addClass('active');\n\t}\n\tif(me.closest('.mobile_menu').length > 0){\n\t\t$j('.mobile_menu a').parent().removeClass('active');\n\t\tme.parent().addClass('active');\n\t}\n\t\n\t$j('.mobile_menu a, .main_menu a, .vertical_menu a').removeClass('current');\n\tme.addClass('current');\n}", "function putActiveClass(e) {\n removeActiveClass()\n e.classList.add(\"active\")\n}", "function changeActiveState(item) {\n $('a.active').removeClass('active');\n $(item).addClass('active');\n}", "function setURLandNav(){\n let\n s = document.querySelectorAll('nav ul li a'),\n a = document.querySelectorAll('section');\n \n if(s.length>0){\n Array.prototype.forEach.call(s, function(elm, idx){ \n removeClass(elm,'active');\n });\n \n Array.prototype.forEach.call(a, function(el, i){\n if(el.querySelector('h2')){\n if (elementInViewport(el.querySelector('h2'))) {\t\n console.log(el.querySelector('h2').textContent);\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n } else {\n if (elementInViewport(el)) {\t\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n }\n });\n if(Math.max(document.body.scrollTop,document.documentElement.scrollTop)<50){\n addClass(s[0],'active');\n }\n }\t \t\n }", "onClick(e){\n this.element.classList.toggle('active');\n }", "function makeActive\n(\n)\n{\n var menuItem = $.session.get('menuItem'); \n var pageName = window.location.pathname;\n pageName = pageName.slice(pageName.lastIndexOf('/') + 1);\n var attr = $.session.get('menuItem'); \n if(pageName.indexOf(attr) > -1)\n {\n $('.'+menuItem).addClass('active'); \n }\n else\n {\n $('.navList').not( $('.'+menuItem)).removeClass('active');\n }\n}", "function ahrefActive() {\n var loc = window.location.pathname;\n $('ul.nav.flex-column.main-vertical-menu').find('a').each(function () {\n $(this).toggleClass('active', $(this).attr('href') == loc);\n });\n\n}", "function pagerActive() {\n\t\tpagerPos = imgPos;\n\t\t$('#pager a.active').removeClass('active');\n\t\t$('#pager a[data-img=\"' + pagerPos + '\"]').addClass('active');\n\t}", "function setMenu(button) {\n var parent = button.parent(),\n active = parent.find('.active'),\n index = button.parent().index() + 1,\n target,\n wrapper;\n\n\n wrapper = parent.parent().parent().parent();\n target = wrapper.find('.carousel-content li:nth-child(' + index + ')');\n\n wrapper\n .find('.carousel-content li.active')\n .css({'opacity':0})\n .removeClass('active')\n .find('.popover')\n .hide();\n\n target\n .css({'opacity':1})\n .addClass('active');\n\n animatePin(target.find('.popover'));\n\n button.parent().parent().find('.active').removeClass('active');\n button.addClass('active');\n}", "function selectActiveClass(){\n\n $(document).on('click' , 'nav .nav__menu ul li a' , function() {\n\t\t$(this).addClass('color').siblings().removeClass('color')\n})\n}", "function handleTitleClick(){\n h1.className = \"active\";\n}", "function clickMenuInfo1(clickScope){\n objInfoView.base= clickScope;\n var idDiv = \"#\"+clickScope;\n $('.ui.small.buttons.infoMenu1 .ui.button').removeClass('active');\n $('.ui.small.buttons.infoMenu1 .ui.button').css({'background-color': 'white','color': 'black','font-weight' :'normal', 'font-size': 'small'});\n $(idDiv).css({'color': 'white','background-color': objSystemConf.infoColor,'font-weight' :'bold', 'font-size': 'medium'});\n $(idDiv).addClass('active');\n }", "activate() {\n this.active = true;\n }", "function currentMenu(obj){\r\n\t\tvar $active = $(obj);\t\r\n\t\r\n\t\t//Make menu link active\r\n\t\t$('.active').removeClass('active');\t\r\n\t\t$('#menu ul li a[href=#'+$active.attr('id')+']').addClass('active');\r\n\t}", "function setGoToTopBtn() {\n $toTopBtn.click(function( e ) {\n e.preventDefault();\n $( 'html, body' ).animate({ scrollTop: 0 }, 'slow' );\n });\n }", "function swapOnClick(event) {\n for (var j = 0; j < nav.length; j++) {\n nav[j].firstChild.classList.remove(\"active\");\n }\n\n this.classList.add(\"active\");\n swapImage(this.dataset.id);\n event.preventDefault();\n }", "function active() {\n\n let activeItem = document.getElementsByTagName(\"div\").item(8),\n activeLaunch = document.getElementsByTagName(\"li\").item(7);\n activeItem.setAttribute(\"class\", \"carousel-item active\");\n activeLaunch.setAttribute(\"class\", \"active\");\n}", "function simpleTabsactive() {\n \"use strict\";\n if ($('.tabbable').length > 0) {\n $('.tabbable').each(function() {\n var id = $(this).find('.nav-tabs li.active a').attr('href');\n $(this).find(id).addClass('active');\n });\n }\n }", "function makeButtonActive(self) {\n //go through each li in ul. if it has an \"active\" class, remove it\n $(\"#select ul\").find(\"li\").each(function( /*index, element*/ ) {\n if ($(this).hasClass(\"active\")) //element.hasClass instead of \"this\"?\n $(this).removeClass(\"active\");\n });\n\n //add \"active\" class to current li\n $(self).addClass(\"active\");\n}", "function active(){\n \n sections.forEach(section =>{\n \tlet rectangle = section.getBoundingClientRect();\n if( rectangle.top >= 0 && rectangle.top <= 400 ){\n // Set sections as active\n document.querySelector('.your-active-class')?.classList.remove('your-active-class');\n section.classList.add(\"your-active-class\");\n\n const linklist = document.querySelectorAll('a');\n\n linklist.forEach( a => {\n if( a.textContent == section.getAttribute(\"data-nav\") ){\n \t document.querySelector('.activelink')?.classList.remove('activelink');\n a.classList.add('activelink');\n \t }\n });\n }\n });\n }", "_setActiveClass(e) {\n\t\tlet className = e.target.className;\n\t\tlet els = document.getElementsByClassName(className)\n\n\t\tArray.from(els).forEach((el) => {\n\t\t\tel.parentElement.classList.remove(\"active\");\n\t\t});\n\n\t\te.target.parentElement.classList.add(\"active\");\n\t}" ]
[ "0.6968783", "0.6938113", "0.68505067", "0.6844241", "0.6789033", "0.6783069", "0.6775138", "0.67592806", "0.66775686", "0.6647133", "0.6647133", "0.6636395", "0.6616018", "0.65706956", "0.65584445", "0.6557393", "0.6556527", "0.65522313", "0.6543197", "0.6541593", "0.65260255", "0.6473471", "0.6465969", "0.64131033", "0.63999575", "0.638513", "0.6375142", "0.63742006", "0.6362812", "0.6345341", "0.6341767", "0.63369536", "0.6331415", "0.63265735", "0.6320068", "0.63187885", "0.6313486", "0.630668", "0.6303954", "0.62868696", "0.6286867", "0.62827414", "0.6278313", "0.6274653", "0.62733495", "0.6271712", "0.62599635", "0.62433624", "0.6233028", "0.61977655", "0.6197143", "0.6194947", "0.6187715", "0.6186169", "0.6183403", "0.61699474", "0.6167547", "0.6167067", "0.61669075", "0.61577606", "0.61423254", "0.6131415", "0.61229676", "0.61178833", "0.6115878", "0.61112475", "0.6095775", "0.6093181", "0.6093161", "0.60849804", "0.60782164", "0.6075696", "0.6072737", "0.6066667", "0.60645205", "0.60637444", "0.6061605", "0.6060023", "0.6053674", "0.6053022", "0.60499614", "0.60457104", "0.6035389", "0.603421", "0.6024904", "0.6020721", "0.60094714", "0.6008222", "0.60062045", "0.6004287", "0.60037386", "0.60022", "0.5996092", "0.5993935", "0.59828234", "0.5982236", "0.59792423", "0.59701294", "0.59691656", "0.596632" ]
0.7003854
0
Sets selected menu item to active
function setMenuActive() { $('.menu-li.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }", "setActive(menuItem) {\n if (this.activeItem === menuItem) {\n this.activeItem = '';\n }\n else {\n this.activeItem = menuItem;\n }\n }", "setActive(menuItem) {\n if (this.activeItem === menuItem) {\n this.activeItem = '';\n }\n else {\n this.activeItem = menuItem;\n }\n }", "function setActiveState(menu) {\n var active = menus[menu].find('.active').each(function(index, element) {\n select[menu]({ target: element });\n });\n }", "function makeMenuSelection(selectedItem) {\n $('nav li a').each(function() {\n $(this).removeClass('selected');\n });\n\n selectedItem.addClass('selected');\n }", "set selectedItem(aItem) {\n this._list.selectedItem = this._findListItem(aItem);\n if (this.isOpen) {\n this._list.ensureIndexIsVisible(this._list.selectedIndex);\n }\n this._updateAriaActiveDescendant();\n }", "function setActive() {\n var path = window.location.pathname;\n openerp.jsonRpc(\"/get_parent_menu\", \"call\", {\n 'url': path,\n }).done(function(data){\n $(\"#top_menu a\").each(function(){\n if ($(this).attr(\"href\") == data) {\n $(this).closest(\"li\").addClass(\"active\");\n }\n });\n });\n}", "function selectMenuItem(item) {\n self.selected = item;\n $state.go(item);\n self.toggleList();\n }", "setFirstItemActive() {\n this._setActiveItemByIndex(0, 1);\n }", "setFirstItemActive() {\n this._setActiveItemByIndex(0, 1);\n }", "setFirstItemActive() {\n this._setActiveItemByIndex(0, 1);\n }", "setFirstItemActive() {\n this._setActiveItemByIndex(0, 1);\n }", "function changeActiveState(item) {\n $('a.active').removeClass('active');\n $(item).addClass('active');\n}", "function setActiveNavLink() {\n // clears the \"active\" class from each of the list items in the navigation\n document.querySelectorAll(\"li.nav-item\").forEach(function (listItem) {\n listItem.setAttribute(\"class\", \"nav-item\");\n });\n\n // add the \"active\" class to the class attribute of the appropriate list item\n document.getElementById(document.title).classList.add(\"active\");\n }", "set selectedItem(aChild) {\n let menuArray = this._orderedMenuElementsArray;\n\n if (!aChild) {\n this._selectedItem = null;\n }\n for (let node of menuArray) {\n if (node == aChild) {\n this._getNodeForContents(node).classList.add(\"selected\");\n this._selectedItem = node;\n } else {\n this._getNodeForContents(node).classList.remove(\"selected\");\n }\n }\n }", "function set_menu_item(menu_items) {\n var pathname = document.location.pathname;\n menu_items.each(\n function(i, e) {\n e = $(e);\n var link = e.find('a');\n if (pathname.match(link.attr('href')) != null) {\n if (pathname == link.attr('href')) {\n e.addClass('active').siblings().removeClass('active');\n return false;\n } else {\n e.addClass('active');\n }\n }\n }\n );\n}", "function setActiveElement() {\n\tconst id = sessionStorage.getItem(ACTIVE_EL_STATE_KEY);\n\tif (id) {\n\t\tvar item = document.getElementById(id);\n\t\titem.classList.add('active');\n\t\t// focus element as well so tab\n\t\t// navigation can pick up where it left off\n\t\tif (item.firstElementChild && item.firstElementChild.tagName === 'A') {\n\t\t\titem.firstElementChild.focus();\n\t\t} else {\n\t\t\titem.focus();\n\t\t}\n\t}\n}", "function setCurrentItem(item)\n{\n selectedObject = item;\n}", "function changeActive(e) {\n\t$('.main-menu li').removeClass('active');\n\t$(e).addClass('active');\n}", "function highlight(menuItem) {\n resetActiveMenu();\n menuItem.parent().addClass('active');\n }", "function currentMenu(obj){\r\n\t\tvar $active = $(obj);\t\r\n\t\r\n\t\t//Make menu link active\r\n\t\t$('.active').removeClass('active');\t\r\n\t\t$('#menu ul li a[href=#'+$active.attr('id')+']').addClass('active');\r\n\t}", "function changeActiveMenu(){\n\tvar subpath = window.document.location.pathname;\n\tvar arr = subpath.split('/');\n\tif(arr.length==0)\n\t\treturn;\n\tvar match = false;\n\t$.each(arr, function(pi, pn){\n\t\tif(match) return;\n\t\t$.each($('.menu li'),function(i,n){\n\t\t\tif($(n).attr('data')==pn){\n\t\t\t\t$(n).addClass('current_page_item');\n\t\t\t\tmatch = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(n).removeClass('current_page_item');\n\t\t\t}\t\t\n\t\t})\n\t});\n}", "function activateMenuElement(name){\n \t\t\tif(options.menu){\n \t\t\t\t$(options.menu).find('.active').removeClass('active');\n \t\t\t\t$(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass('active');\n \t\t\t}\n \t\t}", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find('.active').removeClass('active');\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass('active');\n }\n }", "function setCurrentMenu(menu) {\n menuCurrent = menu;\n }", "function updateActiveStatus () {\n\t\tvar elm = $element.find(\"a\")[0];\n\t\t$timeout(function () {\n\t\t\tvar isActive = elm.classList.contains(\"tab-link--isActive\");\n\t\t\telm.setAttribute(\"aria-selected\", isActive);\n\t\t});\n\t}", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "[SET_MENU_ACTIVE] (state, button) {\n\n var menu = state[button['menu_name']]\n if( menu != undefined ){\n menu[menu.indexOf(button) ].active = !menu[ menu.indexOf(button) ].active\n }else{\n var menu = state[ button['owner_type'] ]\n for(var btn in menu){\n if(menu[btn].id == button.menu_id){\n var subMenu = menu[btn].submenu \n menu[btn].active = true\n subMenu[ subMenu.indexOf(button) ].active = !subMenu[ subMenu.indexOf(button) ].active\n }\n } \n } \n }", "function onClickMenu(index, element) {\r\n document.getElementById(_upObject.default.menuEleID).getElementsByClassName(\"active\")[0].className = \"\";\r\n element.className = \"active\";\r\n _upObject.LoadContentByIndex(index);\r\n}", "function setActive(id){\n document.querySelectorAll('.item').forEach(item => {\n item.classList.remove('active');\n })\n const itemid = \"#item\" + id;\n document.querySelector(itemid).classList.add('active');\n current = id;\n document.querySelector(\"#caption\").innerHTML = pageData[current-1].title;\n const display = document.querySelector(\"#display\");\n display.src = pageData[current-1].previewImage;\n display.alt = pageData[current-1].title;\n}", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function addClass () {\n $('.menu-item-just').removeClass('menu-item_active');\n $(`.menu-item-just[href=\"#${id}\"]`).addClass('menu-item_active');\n }", "function setSelectedItem(item) {\n\twindow.selectedItem = item;\n\tif (selectedItem < 0) {\n\t\t\t\tselectedItem = 0;\n\t\t\t\t}\n\tif (selectedItem >= noofpagelinks) {\n\t\t\t\tselectedItem = noofpagelinks-1;\n\t\t\t\t}\n\tif(selectedItem<$midup)\n\t\t{\n\tcreateslide(0);\n\thighlightSelection(selectedItem); // to highlight page in first slide\n\t\t}\n\telse if(selectedItem>(noofpagelinks-$midup))\n\t\t{\n\tcreateslide(selectedItem-$midup); // to middle selection to index 2\t\n\thighlightSelection($slidelength-(noofpagelinks-selectedItem)); // to highlight page in last slide\n\t\t}\n\telse\n\t\t{\n\tcreateslide(selectedItem-$middown); // to middle selection to index 2\n\thighlightSelection($middown);\t\n\t\t}\n\t$('.totalpages').html((selectedItem+1)+\"&nbsp;of&nbsp;\"+noofpagelinks+\"&nbsp;pages\"); // display pages\n\t\n}", "function activateMenuElement(name) {\n if (options.menu) {\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"' + name + '\"]').addClass(ACTIVE);\n }\n }", "function setActiveMenu() {\n var pgurl = window.location.hash;\n var baseUrl = window.location.href;\n $(\"ul.menu li a\").each(function () {\n $(this).removeClass(\"active\");\n var urlMenu = $(this).attr(\"href\");\n if (baseUrl == urlMenu || (pgurl == \"/#/\" & urlMenu == \"/#/\"))\n $(this).parents(\"li\").find('a').addClass(\"active\");\n else if (pgurl.indexOf(urlMenu) >= 0 && urlMenu != \"#/\") {\n $(this).parents(\"li\").find('> a').addClass(\"active\");\n }\n })\n}", "function makeActive\n(\n)\n{\n var menuItem = $.session.get('menuItem'); \n var pageName = window.location.pathname;\n pageName = pageName.slice(pageName.lastIndexOf('/') + 1);\n var attr = $.session.get('menuItem'); \n if(pageName.indexOf(attr) > -1)\n {\n $('.'+menuItem).addClass('active'); \n }\n else\n {\n $('.navList').not( $('.'+menuItem)).removeClass('active');\n }\n}", "setActiveItem(item, e) {\n var self = this;\n var eventName;\n var i, begin, end, swap;\n var last;\n if (self.settings.mode === 'single') return; // clear the active selection\n\n if (!item) {\n self.clearActiveItems();\n\n if (self.isFocused) {\n self.showInput();\n }\n\n return;\n } // modify selection\n\n\n eventName = e && e.type.toLowerCase();\n\n if (eventName === 'mousedown' && isKeyDown('shiftKey', e) && self.activeItems.length) {\n last = self.getLastActive();\n begin = Array.prototype.indexOf.call(self.control.children, last);\n end = Array.prototype.indexOf.call(self.control.children, item);\n\n if (begin > end) {\n swap = begin;\n begin = end;\n end = swap;\n }\n\n for (i = begin; i <= end; i++) {\n item = self.control.children[i];\n\n if (self.activeItems.indexOf(item) === -1) {\n self.setActiveItemClass(item);\n }\n }\n\n preventDefault(e);\n } else if (eventName === 'mousedown' && isKeyDown(KEY_SHORTCUT, e) || eventName === 'keydown' && isKeyDown('shiftKey', e)) {\n if (item.classList.contains('active')) {\n self.removeActiveItem(item);\n } else {\n self.setActiveItemClass(item);\n }\n } else {\n self.clearActiveItems();\n self.setActiveItemClass(item);\n } // ensure control has focus\n\n\n self.hideInput();\n\n if (!self.isFocused) {\n self.focus();\n }\n }", "function initMenu() {\n\n //removeSelectedClassForMenu();\n\n //$('.sub-menu > .sub-menu__item').eq(selectedIndex).addClass('sub-menu__item--active', 'active');\n \n }", "setNextItemActive() {\n this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }", "function setItem(){\n this.classList.toggle('profiles__item--selected');\n }", "function setNavActive() {\n $('.nav-a.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "setActiveState(){\n let self = this;\n\t // Remove .active class\n\t\t[...document.querySelectorAll('.control-nav a')].forEach(el => el.classList.remove('active'));\n\n\t // Set active item, if not search\n\t if(!this.is_search){\n\t \tlet active = document.querySelector(`.control-nav li a.${this.orderby}`);\n\t \tactive.classList.add('active');\n \t}\n \tsetTimeout(function(){\n \tself.isLoading = false;\n \tself.container.classList.remove('loading');\n }, 1000);\n }", "function setActive(current) {\n\n $(\".nav-link\").removeClass(\"current-section\");\n\n $(`.nav-link[href='#${current}']`).addClass('current-section');\n\n }", "function setActiveItemMenuRight(el){\n for(i = 0; i < listItems.length; i++) {\n listItems[i].classList.remove(\"active\");\n }\n el.classList.add(\"active\");\n}", "function menuActive()\n {\n $('#menu-barr').find('a').removeClass('active-link');\n $('#menu-barr').find('.btn-box').removeClass('active-back');\n\n var url_activa = window.location.href;\n var lista_hash = url_activa.split('#');\n \n // agregar clase active-link a los 'a' del menu, cuando se seleccionan\n if(lista_hash[1])\n {\n $('#menu-barr').find('a[href=\"#'+lista_hash[1]+'\"]').addClass('active-link');\n\n }else{\n $('#menu-barr').find('a[href=\"#inicio\"]').addClass('active-link');\n }\n\n // agregar clase active-back a los contenedores de los a del menu, cuando se seleccionan\n if ($('#menu-barr').find('a').hasClass('active-link'))\n {\n $('.'+lista_hash[1]+'').addClass('active-back');\n } else {\n $('.'+lista_hash[1]+'').removeClass('active-back');\n }\n\n }", "function selectNav() {\n $(this)\n .parents('ul:first')\n .find('a')\n .removeClass('selected')\n .end()\n .end()\n .addClass('selected');\n }", "setNextItemActive() {\n this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }", "setNextItemActive() {\n this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }", "setNextItemActive() {\n this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }", "selected(item){\n this._selected = true;\n this._prev = item;\n }", "function active() {\n $html.addClass('active');\n }", "function activePage(selector) {\n\t$('#menu-'+selector).addClass('active');\n}", "function activateSelectedNav(nav, terminator){\n removeSelectedNavClass(\"terminus-selected\");\n\t//checkDocumentSubMenus(terminator);\n\tnav.classList.add(\"terminus-selected\");\n}", "function activateMenuElement(name){\r\n var menu = $(options.menu)[0];\r\n if(options.menu && menu != null){\r\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\r\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\r\n }\r\n }", "function activeLink() {\n resetActiveLink();\n this.className = \"active\";\n}", "function makeActive(i){\n\tvar navitems=$('.nav').find('li');\n\tnavitems.removeClass('active');\n\tnavitems.eq(1).addClass('active');\n}", "function changeSelectedLink( $elem ) {\r\n // remove selected class on previous item\r\n $elem.parents('.option-set').find('.selected').removeClass('selected');\r\n // set selected class on new item\r\n $elem.addClass('selected');\r\n }", "function changeSelectedLink( $elem ) {\r\n // remove selected class on previous item\r\n $elem.parents('.option-set').find('.selected').removeClass('selected');\r\n // set selected class on new item\r\n $elem.addClass('selected');\r\n }", "setActiveItemClass(item) {\n var last_active = this.control.querySelector('.last-active');\n if (last_active) removeClasses(last_active, 'last-active');\n addClasses(item, 'active last-active');\n\n if (this.activeItems.indexOf(item) == -1) {\n this.activeItems.push(item);\n }\n }", "function updateActiveTab() {\n\t\tvar tabs = document.querySelectorAll(\n\t\t\ttoClassSelector(Class.Tabs.Item) + '[' + HashAttribute + ']'\n\t\t);\n\t\tvar regex = new RegExp('(\\\\s|^)' + Class.Tabs.ItemActive + '(\\\\s|$)');\n\t\tArray.prototype.forEach.call(tabs, function(tab, index) {\n\t\t\tvar link = tab.querySelector('.' + Class.Tabs.Link);\n\t\t\tif (tab.className.match(regex)) {\n\t\t\t\ttab.className = tab.className.replace(regex, ' ');\n\t\t\t\tlink.setAttribute('aria-selected', 'false');\n\t\t\t\tlink.setAttribute('tabindex', '-1');\n\t\t\t}\n\t\t\tif (isTabSelected(tab.getAttribute(HashAttribute), index)) {\n\t\t\t\ttab.className += ' ' + Class.Tabs.ItemActive;\n\t\t\t\tlink.setAttribute('aria-selected', 'true');\n\t\t\t\tlink.setAttribute('tabindex', '0');\n\t\t\t}\n\t\t});\n\t}", "function toggleActive() {\n // On first render\n if (element.find(\"a\").attr(\"href\").indexOf($location.path()) >= 0) {\n element.addClass(\"active\");\n }\n else {\n element.removeClass(\"active\");\n }\n }", "function setMyActiveItem(id/*:Object*/)/*:void*/ {\n this.activeItemId$EBEj = id;\n if (this.layoutInitialized$EBEj) {/*\n // we're only allowed the actually change the active item in the\n // card layout after it has been initialized in the ExtJs render process.\n // see onAfterlayout()\n const*/var cardLayout/*:CardLayout*/ = (AS3.as(this.getLayout(), Ext.layout.container.Card));\n if(cardLayout) {\n cardLayout.setActiveItem(id);\n }\n }\n }", "updateActiveLink() {\n if (!this._items) {\n return;\n }\n const items = this._items.toArray();\n for (let i = 0; i < items.length; i++) {\n if (items[i].active) {\n this.selectedIndex = i;\n this._changeDetectorRef.markForCheck();\n return;\n }\n }\n // The ink bar should hide itself if no items are active.\n this.selectedIndex = -1;\n this._inkBar.hide();\n }", "selectActive() {\n let active = this.node.querySelector(`.${ACTIVE_CLASS}`);\n if (!active) {\n this.reset();\n return;\n }\n this._selected.emit(active.getAttribute('data-value'));\n this.reset();\n }", "setActiveItem(index) {\n if (this.activeItem) {\n this.activeItem.setInactiveStyles();\n }\n super.setActiveItem(index);\n if (this.activeItem) {\n this.activeItem.setActiveStyles();\n }\n }", "_setActiveInDefaultMode(delta) {\n this._setActiveItemByIndex(this._activeItemIndex + delta, delta);\n }", "function initMenuItem() {\n $(\".navigation-menu a\").each(function () {\n var pageUrl = window.location.href.split(/[?#]/)[0];\n if (this.href == pageUrl) { \n $(this).parent().addClass(\"active\"); // add active to li of the current link\n $(this).parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n $(this).parent().parent().parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n }\n });\n }", "setActive () {\n\t\tthis._active = true;\n\t\tthis.$element.addClass('screenlayer-active');\n\t}", "function setCurrentActive(position) {\n var buttons = document.querySelectorAll(\".dropdownContent a\");\n buttons.forEach((element, index) => {\n if (element.firstChild.firstChild.innerText === position.name) {\n element.firstChild.style.color = \"#df6020\";\n buttons[index].style.color = \"#df6020\";\n document.querySelector(\".dropbtn\").innerText = position.name;\n }\n });\n}", "function activateMenuElement(name){\r\n $(options.menu).forEach(function(menu) {\r\n if(options.menu && menu != null){\r\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\r\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\r\n }\r\n });\r\n }", "getMenu(state){\n state.activeClass = !this.state.activeClass;\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function addActiveClass() {\n const selected = \".navbar-large li a\";\n $(selected).on(\"click\", function(e) {\n $(selected).removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n}", "focusItem(item) {\n this._itemNavigation.setCurrentItem(item);\n item.focus();\n }", "function setActivePage(newActive){\n\tif(isHome){\n\t\t$('.home-a').removeClass('active');\n\t\tisHome = false;\n\t}\n\telse if(isEquipment){\n\t\t$('.equip-a').removeClass('active');\n\t\tisEquipment = false;\n\t}\n\telse if(isDistrict){\n\t\t$('.territory-a').removeClass('active');\n\t\tisDistrict = false;\n\t}\n\telse if(isTraining){\n\t\t$('.training-a').removeClass('active');\n\t\tisTraining = false;\n\t}\n\telse if(isBurglary){\n\t\t$('.burglary-a').removeClass('active');\n\t\tisBurglary = false;\n\t}\n\telse if(isHistory){\n\t\t$('.history-a').removeClass('active');\n\t\tisHistory = false;\n\t}\n\telse if(isStatistics){\n\t\t$('.stats-a').removeClass('active');\n\t\tisStatistics = false;\n\t}\n\t$('.' + newActive).addClass('active');\n}", "function makeItemActive (elem) {\n // Remove existing classes\n var items = document.getElementsByTagName('li');\n for (item of items) {\n item.classList.remove('active');\n }\n // Add active class to the selected item\n elem.classList.add('active');\n}", "function changeActive() {\n var pkmn = $(\".pkmn\");\n \n pkmn.click(function(){\n pkmn.removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n }", "function updateNav(item) {\n $('button.navigation').removeClass('active');\n $('button.navigation[name=' + item + ']').addClass('active');\n}", "clearActive() {\n this.handleMenuItemChange(\"active\");\n }", "setCurrent(menu) {\n let url = window.location.href,\n $directBars = $('.js-direct-item', menu),\n $dropBars = $('.drop-down', menu),\n found = false;\n\n _.each($directBars, (val, i) => {\n if (i > 0 && ~url.indexOf($('a', val)[0].href)) {\n Dom.classlist.add(val, 'active');\n found = true;\n return false; // break\n }\n });\n\n if (found) return; //stop function\n\n _.each($dropBars, val => {\n _.each($('li', val), inVal => {\n let inHref = $('a', inVal)[0].href;\n if (~inHref.lastIndexOf('#')) {\n inHref = inHref.substring(0, inHref.lastIndexOf('#'));\n }\n\n if (~url.indexOf(inHref)) {\n Dom.classlist.add(val, 'active');\n $(':checkbox', val)[0].checked = true;\n // TODO: @DavidCzernin if you want add class to item inside drobdown menu then do \"Dom.classlist.add(inVal,'someClass');\"\n\n found = true;\n return false; // break\n }\n });\n if (found) return false; // break\n });\n\n }", "function selectCurrentMenuItem() {\n //strips protocol and host name from browser href\n var windowHref = window.location.href.replace(/^.*?\\/\\/[^\\/]*/, '');\n \n $(\".menu a\").each(function() {\n if (windowHref == $(this).attr('href')) {\n $(this).parent().addClass('selected');\n }\n });\n}", "function setNavActive(navPosition){\n $(\".root > li a\").removeClass(\"active__current\");\n $( \".root > li a\" ).each(function( index ) {\n if(index==navPosition){\n $(this).addClass(\"active__current\");\n return;\n }\n });\n}", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass(settings.classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass(settings.classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "[symbols.itemSelected](item, selected) {\n if (super[symbols.itemSelected]) { super[symbols.itemSelected](item, selected); }\n item.classList.toggle('selected', selected);\n }", "resetActiveItem() {\n this._keyManager.setActiveItem(-1);\n }", "function setB1Active() {\n\tbuttonsUl.children[0].children[0].className += \"active\";\n}", "function select_default_menu_item()\r\n{\r\n\tmenu_item_selected(document.getElementById('mi_home'));\r\n\t//menu_item_selected(document.getElementById('mi_custreqs'));\r\n}", "function setMenuActive(menuSectionId) {\n // get the current active menu item\n let currentActiveMenuItem = document.querySelector('.menu__active');\n\n // get the menu item that have the same section id (input parameter)\n let menuItemToActive = document.querySelector(`a[data-section-id=\"${menuSectionId}\"]`);\n\n // remove the active class from the old menu item (if any)\n if (currentActiveMenuItem)\n currentActiveMenuItem.classList.remove('menu__active');\n\n // add active class to the new menu item\n menuItemToActive.classList.add('menu__active');\n}", "_active() {\n this._sequence = [];\n this.tag(\"Items\").childList.clear();\n\n this._setState(\"Buttons\");\n }", "function activateMenuElement(name) {\n $(options.menu).forEach(function (menu) {\n if (options.menu && menu != null) {\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"' + name + '\"]', menu), ACTIVE);\n }\n });\n }" ]
[ "0.76044244", "0.7429572", "0.7429572", "0.7259269", "0.70615494", "0.7054481", "0.7020118", "0.6979382", "0.69325376", "0.6882961", "0.6882961", "0.6882961", "0.68644553", "0.68334115", "0.6811759", "0.6799273", "0.6761201", "0.6716108", "0.67077816", "0.6668017", "0.66424984", "0.6605335", "0.65956837", "0.6567526", "0.6567217", "0.6537465", "0.6491327", "0.6491327", "0.6491327", "0.6484736", "0.6484736", "0.6484736", "0.6484736", "0.6481409", "0.6478738", "0.6425501", "0.6415653", "0.6415653", "0.64141196", "0.6412215", "0.6398745", "0.6383965", "0.6359818", "0.6351843", "0.634826", "0.63397914", "0.6338761", "0.63344944", "0.63282526", "0.63112205", "0.63074845", "0.62853473", "0.62786996", "0.627227", "0.627227", "0.627227", "0.6265502", "0.62513757", "0.62485105", "0.62475413", "0.6245566", "0.6243144", "0.62340575", "0.62308794", "0.62308794", "0.6219003", "0.6205997", "0.6193301", "0.61899143", "0.6182433", "0.61813766", "0.61721057", "0.61707234", "0.6163712", "0.61607635", "0.61528486", "0.6147738", "0.6138293", "0.6132363", "0.6132363", "0.6132363", "0.6110638", "0.61064386", "0.60966444", "0.60928446", "0.6090537", "0.60834104", "0.6077455", "0.6075863", "0.60747707", "0.60731757", "0.6063879", "0.6063879", "0.6058654", "0.60576284", "0.6054392", "0.6040135", "0.60364676", "0.6031412", "0.60271645" ]
0.7510343
1
Removes any additional added changes to menu and sets menu to right
function setMenuRight() { removeMenuChanges(); $('.menu').addClass('menu-right'); $('.window').addClass('window-menu-right'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeMenuChanges() {\n let menu = document.getElementById('resizable');\n\n if (menu.style.right) {\n menu.style.right = null;\n }\n if (menu.style.left) {\n menu.style.left = null;\n }\n\n $('.menu').removeClass('menu-left');\n $('.menu').removeClass('menu-right');\n $('.window').removeClass('window-menu-right');\n $('.menu-bottom').addClass('hidden');\n $('.menu').removeClass('hidden');\n }", "function setMenuLeft() {\n removeMenuChanges();\n $('.menu').addClass('menu-left');\n }", "function fixReviewsMenu() {\n fixMenu(reviewsSectionMenu);\n }", "function RightMenu() {\n _super.call(this);\n var self = this;\n var iNotify = self.appContext.iNotificatonProps;\n // @create a scratch list of items.\n self.controlsList = [\n sTemplates.rightMenuCloseSearch(),\n sTemplates.headerButtonFullScreen(),\n sTemplates.otherMenuItem(iNotify.progRCount),\n sTemplates.notificationMenuItem(iNotify.alertCount),\n sTemplates.switchDepartmentsMenuItem()\n ];\n // @create ul\n self.ulList = eTemplates.ulMenu();\n // @append li per scratch list.\n self.controlsList.forEach(function (item) {\n self.ulList.append(item);\n });\n }", "editMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null:\n this.menuView.editButtonMenu.style.backgroundColor = \"#00C50D\";\n this.menuView.editButtonMenu.style.boxShadow = \"yellow 0px 0px 51px inset\";\n //this.accEdit.editAction();\n this.currentMenuChoices = MenuChoices.edit;\n break;\n case MenuChoices.edit:\n //this.accEdit.editAction();\n this.menuView.editButtonMenu.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.editButtonMenu.style.boxShadow = \"none\";\n this.menuView.contentsMenu.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n break;\n default:\n this.cleanMenu();\n this.menuView.editButtonMenu.style.backgroundColor = \"#00C50D\";\n this.menuView.editButtonMenu.style.boxShadow = \"yellow 0px 0px 51px inset\";\n //this.accEdit.editAction();\n this.menuView.contentsMenu.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.edit;\n break;\n }\n }", "function fixClientsMenu() {\n fixMenu(clientsSectionMenu);\n }", "function setMenuPosition() {\n // console.log('setMenuPosition');\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n\n if (PageData.MenuOpen) {\n menuGrip.title = 'Close menu';\n menuGrip.src = '/media/close.svg';\n menuPanel.style.right = 0;\n } else {\n menuGrip.title = 'Open menu';\n menuGrip.src = '/media/open.svg';\n menuPanel.style.right = -PageData.MenuOffset + 'px';\n }\n}", "function updateMenu() {\n // console.log('updateMenu');\n\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n const menuSave = document.getElementById('menuSave');\n const menuHighlight = document.getElementById('menuHighlight');\n const menuExportSvg = document.getElementById('menuExportSvg');\n const menuExportPng = document.getElementById('menuExportPng');\n\n if (Common.isIOSEdge) {\n const menuPrint = document.getElementById('menuPrint');\n menuPrint.style.display = 'none';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuHighlight.src = '/media/edit-on.svg';\n menuHighlight.title = 'Turn off highlighter';\n } else {\n menuHighlight.src = '/media/edit-off.svg';\n menuHighlight.title = 'Turn on highlighter';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuSave.style.display = 'inline';\n\n // menuExportSvg.style.display = 'inline';\n menuExportSvg.style.display = (Common.isIOSEdge ? 'none' : 'inline');\n\n // menuExportPng.style.display = (isIE ? 'none' : 'inline');\n menuExportPng.style.display = (Common.isIOSEdge || Common.isIE ? 'none' : 'inline');\n } else {\n menuSave.style.display = 'none';\n\n menuExportSvg.style.display = (!Common.isIOSEdge ? 'inline' : 'none');\n\n menuExportPng.style.display = (!Common.isIE && !Common.isIOSEdge ? 'inline' : 'none');\n }\n\n menuPanel.style.display = 'block';\n\n // 4px padding on div#menu\n PageData.MenuOffset = menuPanel.clientWidth - menuGrip.clientWidth - 4;\n}", "function closeMenu() {\n $('#menuContainer').css('right', '-300px');\n }", "function right() {\n\t\t\tvar role = getRole(), parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (role == \"menuitem\" && parentRole == \"menu\" && getAriaProp('haspopup')) {\n\t\t\t\tenter();\n\t\t\t} else {\n\t\t\t\tmoveFocus(1);\n\t\t\t}\n\t\t}", "function right() {\n\t\t\tvar role = getRole(), parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (role == \"menuitem\" && parentRole == \"menu\" && getAriaProp('haspopup')) {\n\t\t\t\tenter();\n\t\t\t} else {\n\t\t\t\tmoveFocus(1);\n\t\t\t}\n\t\t}", "function right() {\n\t\t\tvar role = getRole(), parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (role == \"menuitem\" && parentRole == \"menu\" && getAriaProp('haspopup')) {\n\t\t\t\tenter();\n\t\t\t} else {\n\t\t\t\tmoveFocus(1);\n\t\t\t}\n\t\t}", "saveMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n break;\n case MenuChoices.save:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.saveContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.saveButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n break;\n }\n }", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function showMenu(){\n navLinks.style.right = \"0\";\n}", "function setup_menu() {\n $('div[data-role=\"arrayitem\"]').contextMenu('context-menu1', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n $('div[data-role=\"prop\"]').contextMenu('context-menu2', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n }", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "function resetMenuItem () {\n \n $('.smart-phone li, #taskBar, .desktop-menu, .lang-select').removeClass('active');\n }", "function resetMenuBar() {\n\n\t$('#Overview').removeClass(\"active\");\n\t$('#ArticleAnalytics').removeClass(\"active\");\n\t$('#AuthorAnalytics').removeClass(\"active\");\n\n}", "function cleanMenu(menu) {\n var i;\n for (i = 0; i < commands.length; i++) {\n menu.removeMenuItem(commands[i]);\n }\n }", "function add_menu(){\n\t/******* add menu ******/\n\t// menu itsself\n\tvar menu=$(\"#menu\");\n\tif(menu.length){\n\t\trem_menu();\n\t};\n\n\tmenu=$(\"<div></div>\");\n\tmenu.attr(\"id\",\"menu\");\n\tmenu.addClass(\"menu\");\n\t\n\t//////////////// rm setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#rm_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"rules\",\"style\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"rm_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// rm setup //////////////////\n\n\t//////////////// area setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#areas_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"areas\",\"home\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"areas_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// area setup //////////////////\n\n\t//////////////// camera setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#cameras_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"units\",\"camera_enhance\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"cameras_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// camera setup //////////////////\n\n\t//////////////// user setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#users_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t\tlogin_entry_button_state(\"-1\",\"show\");\t// scale the text fields for the \"new\" entry = -1\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"users\",\"group\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"users_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// user setup //////////////////\n\n\n\t//////////////// logout //////////////////\n\tvar f=function(){\n\t\t\tg_user=\"nongoodlogin\";\n\t\t\tg_pw=\"nongoodlogin\";\n\t\t\tc_set_login(g_user,g_pw);\n\t\t\ttxt2fb(get_loading(\"\",\"Signing you out...\"));\n\t\t\tfast_reconnect=1;\n\t\t\tcon.close();\n\n\t\t\t// hide menu\n\t\t\trem_menu();\n\t};\n\tadd_sidebar_entry(menu,f,\"log-out\",\"vpn_key\");\n\t//////////////// logout //////////////////\n\n\t////////////// hidden data_fields /////////////\n\tvar h=$(\"<div></div>\");\n\th.attr(\"id\",\"list_cameras\");\n\th.hide();\n\tmenu.append(h);\n\n\th=$(\"<div></div>\");\n\th.attr(\"id\",\"list_area\");\n\th.hide();\n\tmenu.append(h);\n\t////////////// hidden data_fields /////////////\n\n\n\tmenu.insertAfter(\"#clients\");\n\t\n\n\tvar hamb=$(\"<div></div>\");\n\thamb.click(function(){\n\t\treturn function(){\n\t\t\ttoggle_menu();\n\t\t}\n\t}());\n\thamb.attr(\"id\",\"hamb\");\n\thamb.addClass(\"hamb\");\n\tvar a=$(\"<div></div>\");\n\tvar b=$(\"<div></div>\");\n\tvar c=$(\"<div></div>\");\n\ta.addClass(\"hamb_l\");\n\tb.addClass(\"hamb_l\");\n\tc.addClass(\"hamb_l\");\n\thamb.append(a);\n\thamb.append(b);\n\thamb.append(c);\n\thamb.insertAfter(\"#clients\");\n\t/******* add menu ******/\n}", "cleanMenu() {\n for (var i = 0; i < this.menuView.HTMLElementsMenu.length; i++) {\n this.menuView.HTMLElementsMenu[i].style.display = \"none\";\n }\n for (var i = 0; i < this.menuView.HTMLButtonsMenu.length; i++) {\n this.menuView.HTMLButtonsMenu[i].style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.HTMLButtonsMenu[i].style.zIndex = \"0\";\n }\n }", "function updateTopMenu(){\n\t\t\t\t$('.date-menu li.current').removeClass('current');\n\t\t\t\tvar page = myScroll.currPageX;\n\t\t\t\tvar pos = $datemenu.find('li')\n\t\t\t\t\t.eq(page)\n\t\t\t\t\t.addClass('current')\n\t\t\t\t\t.position()\n\t\t\t\t\t.left;\n\n\t\t\t\t//TODO:put the right number to be always on the left\n\t\t\t\tpos-=100; //I want the menu to be on the left\n\t\t\t\tpos = pos>0? pos : 0;\n\t\t\t\t$datemenu.css('left',pos * -1);\n\t\t\t}", "function menu(){\n\t\tvar menuCount = 1;\n\t\tvar menuTitle = ['.menu-title:nth-of-type(1)','.menu-title:nth-of-type(2)','.menu-title:nth-of-type(3)'];\n\t\tvar menuContent = ['.menu-content section:nth-of-type(1)','.menu-content section:nth-of-type(2)','.menu-content section:nth-of-type(3)'];\n\t\t$('#move-right').on('click', function(){\n\t\t\tif (menuCount <= 0) {\n\t\t\t\tmenuCount += 1;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount <= 2) {\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\tmenuCount += 1;\n\t\t\t\t\t}\n\t\t});\n\t\t$('#move-left').on('click', function(){\n\t\t\tif (menuCount >= 3) {\n\t\t\t\tmenuCount += -2;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount >= 1) {\n\t\t\t\t\t\tmenuCount += -1;\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t}\n\t\t});\n\t}", "function setCurrentMenu(menu) {\n menuCurrent = menu;\n }", "function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }", "function backToMenu() {\n location.reload();\n }", "function updateRoles(){\n console.log('update role')\n mainMenu();\n}", "changeActiveMenu(newMenu) {\n this.setState({ activeMenu: newMenu });\n this.changeEmployee(\"0\", \"\");\n this.changeTrip(\"0\");\n this.changePanel(newMenu);\n this.changeActiveSubMenu(\"Last Notifications\");\n }", "function rebuildMenu() {\n clearTimeout(rebuildTimerId);\n rebuildTimerId = setTimeout(buildMenu, 0);\n}", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function ModifyMenuPanel(editor) {\n\tthis.editor = editor;\n\tthis.menus = {};\n\tthis.menuColumn = null;\n\tthis.menuContainer = null;\n\t\n}", "function editor_tools_handle_right() {\n editor_tools_add_tags('[right]', '[/right]');\n editor_tools_focus_textarea();\n}", "function menuToggler() {\r\n\t\tif ($('.mobile-menu-closer').length) {\r\n\t\t\t$('.mobile-menu-closer').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '-150%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tif ($('.mobile-menu-opener').length) {\r\n\t\t\t$('.mobile-menu-opener').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '0%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t}", "function menuBtnChange() {\n if (sidebar.classList.contains(\"open\")) {\n closeBtn.classList.replace(\"bx-menu\", \"bx-menu-alt-right\"); //replacing the icons class\n } else {\n closeBtn.classList.replace(\"bx-menu-alt-right\",\"bx-menu\"); //replacing the icons class\n }\n }", "function createMenu() {\n var ui = SpreadsheetApp.getUi();\n\n ui.createMenu('Tools')\n .addItem('Fix Range Error', 'fixMe')\n .addSeparator()\n .addItem('About', 'about')\n .addToUi();\n}", "rebuildMenuStart() {\n this._rebuildingMenu = true;\n this._rebuildingMenuRes = {};\n this._mainLabel = {};\n\n this.disconnectSignals(false);\n\n let oldItems = this.menu._getMenuItems();\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n }", "_rebuildMenu() {\n\n this.refreshMenuObjects = {};\n\n this.disconnectSignals(false, true);\n\n let oldItems = this.menu._getMenuItems();\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n }", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function updateMenu() {\n 'use strict';\n\n // Get references to the menus:\n var os = document.getElementById('os');\n var os2 = document.getElementById('os2');\n\n // Determine the options:\n if (os.value == 'Windows') {\n var options = ['7 Home Basic', '7 Home Premium', '7 Professional', '7 Ultimate', 'Vista', 'XP'];\n } else if (os.value == 'Mac OS X') {\n options = ['10.7 Lion', '10.6 Snow Leopard', '10.5 Leopard', '10.4 Tiger'];\n } else options = null;\n\n // Update the menu:\n if (options) {\n os2.disabled = false;\n os2.style.visibility = 'visible';\n\n // Call populateMenu function to clear existing options and add new ones\n populateMenu(os2, options);\n\n } else { // No selection!\n // Disable the element\n os2.disabled = true;\n // Change visibility to hidden\n os2.style.visibility = 'hidden';\n }\n} // End of updateMenu() function.", "function initMenuUI() {\n clearMenu();\n let updateBtnGroup = $(\".menu-update-btn-group\");\n let modifyBtnGroup = $(\".menu-modify-btn-group\");\n let delBtn = $(\"#btn-delete-menu\");\n\n setMenuTitle();\n $(\"#btn-update-menu\").text(menuStatus == \"no-menu\" ? \"创建菜单\" : \"更新菜单\");\n menuStatus == \"no-menu\" ? hideElement(modifyBtnGroup) : unhideElement(modifyBtnGroup);\n menuStatus == \"no-menu\" ? unhideElement(updateBtnGroup) : hideElement(updateBtnGroup);\n menuStatus == \"no-menu\" ? setDisable(delBtn) : setEnable(delBtn);\n }", "function _rightNav() {\n let c = new createCvs(\"rightNav\", cvsConf.rightNav);\n this.cvs = c[0];\n this.ctx = c[1];\n //cvs[0].style.position = \"fixed\";\n }", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function resetEditMenuItemForm(){\r\n EMenuItemNameField.reset();\r\n \tEMenuItemDescField.reset();\r\n \tEMenuItemValidFromField.reset();\r\n EMenuItemValidToField.reset();\r\n \tEMenuItemPriceField.reset();\r\n \tEMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "function digglerClearTempMenuItems()\n{\n for (var i = 0; i < currentMenuItems.length; ++i)\n browser.menus.remove( currentMenuItems[i].id );\n currentMenuItems = [];\n globalMenuIndex = 0;\n}", "function showmenu(ev, category, deleted = false) {\n //stop the real right click menu\n ev.preventDefault();\n var mouseX;\n let element = \"\";\n if (ev.pageX <= 200) {\n mouseX = ev.pageX + 10;\n } else {\n let active_class = $(\"#sidebarCollapse\").attr(\"class\");\n if (active_class.search(\"active\") == -1) {\n mouseX = ev.pageX - 210;\n } else {\n mouseX = ev.pageX - 50;\n }\n }\n\n var mouseY = ev.pageY - 10;\n\n if (category === \"folder\") {\n if (deleted) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\"<i class='fas fa-undo-alt'></i> Restore\");\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-move\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html('<i class=\"fas fa-minus-circle\"></i> Delete All');\n $(menuFolder)\n .children(\"#folder-move\")\n .html('<i class=\"fas fa-external-link-alt\"></i> Move All');\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\"<i class='far fa-trash-alt fa-fw'></i>Delete\");\n $(menuFolder)\n .children(\"#folder-move\")\n .html('<i class=\"fas fa-external-link-alt\"></i> Move');\n $(menuFolder).children(\"#folder-move\").show();\n $(menuFolder).children(\"#reg-folder-rename\").show();\n $(menuFolder).children(\"#folder-description\").show();\n }\n }\n menuFolder.style.display = \"block\";\n $(\".menu.reg-folder\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n } else if (category === \"high-level-folder\") {\n if (deleted) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\"<i class='fas fa-undo-alt'></i> Restore\");\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html('<i class=\"fas fa-minus-circle\"></i> Delete All');\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\"<i class='far fa-trash-alt fa-fw'></i>Delete\");\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n }\n }\n menuHighLevelFolders.style.display = \"block\";\n $(\".menu.high-level-folder\")\n .css({ top: mouseY, left: mouseX })\n .fadeIn(\"slow\");\n } else {\n if (deleted) {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\"<i class='fas fa-undo-alt'></i> Restore\");\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-move\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFile)\n .children(\"#file-delete\")\n .html('<i class=\"fas fa-minus-circle\"></i> Delete All');\n $(menuFile)\n .children(\"#file-move\")\n .html('<i class=\"fas fa-external-link-alt\"></i> Move All');\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\"<i class='far fa-trash-alt fa-fw'></i>Delete\");\n $(menuFile)\n .children(\"#file-move\")\n .html('<i class=\"fas fa-external-link-alt\"></i> Move');\n $(menuFile).children(\"#file-rename\").show();\n $(menuFile).children(\"#file-move\").show();\n $(menuFile).children(\"#file-description\").show();\n }\n }\n menuFile.style.display = \"block\";\n $(\".menu.file\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n }\n}", "function reinitMenus(ulPath) { /* if(!jQueryBuddha(ulPath).is(\":visible\") && (typeof jQueryBuddha(ulPath).attr(\"style\")===typeof undefined || jQueryBuddha(ulPath).attr(\"style\").replace(/ /g, \"\").indexOf(\"display:none\")==-1 || (jQueryBuddha(ulPath).attr(\"style\").replace(/ /g, \"\").indexOf(\"display:none\")!=-1 && jQueryBuddha(ulPath).css(\"display\")==\"none\"))) { return; } */ jQueryBuddha(\".submenu-opened\").hide(); var previousItemTop; /* var horizontal = true; */ var verticalItemsNr = 1; jQueryBuddha(ulPath + \">.buddha-menu-item>a\").each(function () { /* .offset() is relative to document */ var currentItemTop = jQueryBuddha(this).offset().top; /* menuitems are positioned one below each other -> mobile rendering */ previousItemTop = (previousItemTop == undefined) ? currentItemTop : previousItemTop; if ((currentItemTop > (previousItemTop+5) ) || (currentItemTop < (previousItemTop-5))) { verticalItemsNr++; } previousItemTop = currentItemTop; }); /* var oldYPosition = 0; var oldXPosition = 0; var increment = 0; jQueryBuddha(ulPath+\">.buddha-menu-item\").each(function() { var positionY = jQueryBuddha(this).position().top; var positionX = jQueryBuddha(this).position().left; var differenceY = positionY - oldYPosition; var differenceX = positionX - oldXPosition; if(increment>0){ if(differenceY>3 || differenceX<3) { verticalItemsNr++; } } oldYPosition = positionY; oldXPosition = positionX; increment++; }); */ if ((verticalItemsNr != jQueryBuddha(ulPath + \">.buddha-menu-item\").length || (verticalItemsNr == 1 && jQueryBuddha(\"body\").width() > verticalMenuMaxWidth)) && forceMobile == false) { /* if ( verticalItemsNr==1 && forceMobile==false ) { */ jQueryBuddha(ulPath).addClass(\"horizontal-mega-menu\").removeClass(\"vertical-mega-menu\"); jQueryBuddha(ulPath + \" ul.mm-submenu\").removeAttr(\"style\"); jQueryBuddha(ulPath + \" .fa-minus-circle\").removeClass(\"fa-minus-circle\").addClass(\"fa-plus-circle\"); jQueryBuddha(ulPath + \" .submenu-opened\").removeClass(\"submenu-opened\"); jQueryBuddha(ulPath + \" .toggle-menu-btn\").hide(); jQueryBuddha(\".horizontal-mega-menu>li.buddha-menu-item\").off(); setTimeout(function () { jQueryBuddha(ulPath).find(\".buddha-menu-item\").each(function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); }); }, 1); jQueryBuddha(ulPath).find(\".buddha-menu-item\").unbind(\"onmouseover.simpleContactSubmenuResize\"); jQueryBuddha(ulPath).find(\".buddha-menu-item\").bind(\"onmouseover.simpleContactSubmenuResize\", function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); }); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").each(function () { if (jQueryBuddha(this).parent().find(\".tab-opened\").length == 0) { /* jQueryBuddha(this).parent().find(\".tab-opened\").removeClass(\"tab-opened\"); */ jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); } else if (jQueryBuddha(this).hasClass(\"tab-opened\")) { setTabbedSubmenuBoundries(jQueryBuddha(this)); } }); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").unbind(); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").hover(function () { jQueryBuddha(this).parent().find(\".tab-opened\").removeClass(\"tab-opened\"); jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); }); /* set first tab of every tabbed submenu be opened */ jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li:first-child\").each(function () { if (jQueryBuddha(this).parent().find(\".tab-opened\").length == 0) { jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); } }); jQueryBuddha(ulPath).find(\".buddha-menu-item\").unbind(\"mouseenter.resizeSubmenus\"); jQueryBuddha(ulPath).find(\".buddha-menu-item\").bind(\"mouseenter.resizeSubmenus\", function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); if (jQueryBuddha(this).find(\".tab-opened\").length > 0) { setTabbedSubmenuBoundries(jQueryBuddha(this).find(\".tab-opened\")); } }); } else { if (activateMegaMenu) { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); jQueryBuddha(\".buddha-menu-item.disabled\").removeClass(\"disabled\"); jQueryBuddha(ulPath).addClass(\"vertical-mega-menu\").removeClass(\"horizontal-mega-menu\"); jQueryBuddha(ulPath + \" .toggle-menu-btn\").show(); jQueryBuddha(ulPath).find(\"li.buddha-menu-item\").off(); jQueryBuddha(ulPath).find(\"li.buddha-menu-item a\").off(); var iconDistance = parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"font-size\")); var totalPaddingLeft = parseInt(jQueryBuddha(ulPath + \">li\").css(\"padding-left\")) + parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"padding-left\")); var paddingLeftSubSubmenus = totalPaddingLeft; if (totalPaddingLeft > 15) { paddingLeftSubSubmenus = 15; } var totalPaddingTop = parseInt(jQueryBuddha(ulPath + \">li\").css(\"padding-top\")) + parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"padding-top\")); jQueryBuddha(\"#verticalMenuSpacing\").remove(); var styleSheet = '<style id=\"verticalMenuSpacing\" type=\"text/css\">'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tree>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tree>li ul.mm-submenu li {padding-left:' + paddingLeftSubSubmenus + 'px !important;padding-right:' + paddingLeftSubSubmenus + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li ul.mm-submenu.simple>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tabbed>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tabbed>li>ul.mm-submenu>li {padding-left:' + paddingLeftSubSubmenus + 'px !important;padding-right:' + paddingLeftSubSubmenus + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li ul.mm-submenu.mm-contact>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += \"</style>\"; jQueryBuddha(\"head\").append(styleSheet); /* remove tab-opened classes */ jQueryBuddha(ulPath).find(\".tab-opened\").removeClass(\"tab-opened\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>a>.toggle-menu-btn\").unbind(\"click.resizeSubmenus\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>a>.toggle-menu-btn\").bind(\"click.resizeSubmenus\", function () { setSubmenuBoundries(jQueryBuddha(this).parent().parent()); setContactSubmenuBoundries(jQueryBuddha(this).parent().parent()); }); jQueryBuddha(ulPath).find(\".buddha-menu-item>.mm-submenu>li>a>.toggle-menu-btn\").unbind(\"click.resizeTabbedSubmenu\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>.mm-submenu>li>a>.toggle-menu-btn\").bind(\"click.resizeTabbedSubmenu\", function () { if (jQueryBuddha(this).parent().parent().hasClass(\"mm-hovering\")) { setTabbedSubmenuBoundries(jQueryBuddha(this).parent().parent()); } }); forceMobile = false; } } jQueryBuddha(\".submenu-opened\").show(); if (panelOpened) { jQueryBuddha(\".horizontal-mega-menu>.buddha-menu-item\").unbind(\"mouseenter.addMegaHoverClass\"); jQueryBuddha(\".horizontal-mega-menu>.buddha-menu-item\").bind(\"mouseenter.addMegaHoverClass\", function () { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); if (panelOpened) { jQueryBuddha(this).addClass(\"mega-hover\"); } }); } else { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); } }", "function clearMenu () {\n let menuClosed = false;\n\n if (myRBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRBkmkMenuStyle.visibility = \"hidden\";\n\tmyRBkmkMenu_open = false;\n }\n else if (myRShowBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRShowBkmkMenuStyle.visibility = \"hidden\";\n\tmyRShowBkmkMenu_open = false;\n }\n else if (myRFldrMenu_open) {\n\tmenuClosed = true;\n\tMyRFldrMenuStyle.visibility = \"hidden\";\n\tmyRFldrMenu_open = false;\n }\n else if (myRMultMenu_open) {\n\tmenuClosed = true;\n\tMyRMultMenuStyle.visibility = \"hidden\";\n\tmyRMultMenu_open = false;\n }\n else if (myBBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBBkmkMenuStyle.visibility = \"hidden\";\n\tmyBBkmkMenu_open = false;\n }\n else if (myBResBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBResBkmkMenuStyle.visibility = \"hidden\";\n\tmyBResBkmkMenu_open = false;\n }\n else if (myBFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBFldrMenuStyle.visibility = \"hidden\";\n\tmyBFldrMenu_open = false;\n }\n else if (myBResFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBResFldrMenuStyle.visibility = \"hidden\";\n\tmyBResFldrMenu_open = false;\n }\n else if (myBSepMenu_open) {\n\tmenuClosed = true;\n\tMyBSepMenuStyle.visibility = \"hidden\";\n\tmyBSepMenu_open = false;\n }\n else if (myBMultMenu_open) {\n\tmenuClosed = true;\n\tMyBMultMenuStyle.visibility = \"hidden\";\n\tmyBMultMenu_open = false;\n }\n else if (myBProtMenu_open) {\n\tmenuClosed = true;\n\tMyBProtMenuStyle.visibility = \"hidden\";\n\tmyBProtMenu_open = false;\n }\n else if (myBProtFMenu_open) {\n\tmenuClosed = true;\n\tMyBProtFMenuStyle.visibility = \"hidden\";\n\tmyBProtFMenu_open = false;\n }\n else if (myMGlassMenu_open) {\n\tmenuClosed = true;\n\tMyMGlassMenuStyle.visibility = \"hidden\";\n\tmyMGlassMenu_open = false;\n }\n\n myMenu_open = isResultMenu = false;\n return(menuClosed);\n}", "function hideEditMenu() {\n menu.style.display = 'none';\n removePageClickEvent();\n }", "function setMenu() {\n if (menuOpen) {\n menu.classList.remove('-translate-x-full');\n } else {\n menu.classList.add('-translate-x-full');\n }\n}", "function menuRight(){\n\t\tmenuItemsRight.forEach((item)=>{\n\n\t\t\t//creating li and a tags for menu elements \n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tvar a = document.createElement(\"a\");\n\t\t\t\n\t\t\t/* if item from 'menuItemsRight' array is equal to 'shopping_cart'\n\t\t\tthen add to 'a' tag: \"href='#modal1'\", \"id='myShoppingCard'\" ... etc.\n\t\t\tand create i element with 'material-icons-left' class. 'a' appends \n\t\t\t'i' as a child. */\n\t\t\tif(item == \"shopping_cart\"){\n\t\t\t\tvar i = document.createElement(\"i\");\n\t\t\t\ta.setAttribute(\"href\", \"#modal1\");\n\t\t\t\ta.setAttribute(\"id\", \"myShoppingCard\");\n\t\t\t\ta.setAttribute(\"class\", \"btn tooltipped waves-effect waves-light btn modal-trigger\");\n\t\t\t\ta.setAttribute(\"data-position\", \"bottom\");\n\t\t\t\ta.setAttribute(\"data-delay\", \"50\");\n\t\t\t\ta.setAttribute(\"data-tooltip\", \"My shopping card\");\n\t\t\t\ti.setAttribute(\"class\", \"material-icons left\" )\n\t\t\t\ti.innerHTML = item;\n\t\t\t\ta.appendChild(i);\n\t\t\t\t/* else use 'item' itself to create \"href\" */\n\t\t\t}else{\n\t\t\t\tli.setAttribute(\"class\", \"hide-on-med-and-down\");\n\t\t\t\ta.setAttribute(\"href\", item.toLowerCase()+\".html\");\n\t\t\t\ta.innerHTML = item;\n\t\t\t};\n\n\t\t\t//adding 'a' tag to 'li' tag as a child element\n\t\t\tli.appendChild(a);\n\n\t\t\t//rightMenu id appends 'li' as a child element\n\t\t\trightMenu.appendChild(li);\n\t\t});\n\t}", "function handleMenuClose() {\n setMenuOpen(null);\n }", "function rightClickMenu(ctx) {\n window.rightClickCtx = ctx\n $(fitStrechBtn).text(\n window\n .references[ctx.target.id]\n .data.metadata.ratio === 'fit' ? \n 'Strech ratio' : 'Fit ratio'\n )\n\n $(contextMenu).css({\n 'top': `${ctx.pageY - 15}px`, \n 'left': `${ctx.pageX + 15}px`\n }).show();\n ctx.preventDefault();\n}", "function menuBtnChange() {\n if (sidebar.classList.contains(\"open\")) {\n closeBtn.classList.replace(\"bx-menu\", \"bx-menu-alt-right\"); //replacing the iocns class\n // $('#collapseOne').show();\n } else {\n closeBtn.classList.replace(\"bx-menu-alt-right\", \"bx-menu\"); //replacing the iocns class\n // $('#collapseOne').toggleClass('d-none');\n }\n }", "function generateRigthClickMenu(menuMode){\n/* (debug?console.log(\"\\n________________________________________\\n\\tgenerateRigthClickMenu\"):null);\n $(\"#RightClickMenu\").remove();\n var strRight;\n switch (menuMode){\n case \"dir\" :\n strRight = \"<div id=\\\"RightClickMenu\\\">\" +\n \"<ul>\" +\n \"<li class='RightClickMenuElement' id='NewFile'><span class=\\\"glyphicon glyphicon-file\\\" aria-hidden=\\\"true\\\"></span> New File</li>\" +\n \"<li class='RightClickMenuElement' id='NewDir'><span class=\\\"glyphicon glyphicon-folder-open\\\" aria-hidden=\\\"true\\\"></span> New Directory</li>\" +\n \"<li class='RightClickMenuElement' id='delete'><span class=\\\"glyphicon glyphicon-trash\\\" aria-hidden=\\\"true\\\"></span> Delete</li>\" +\n \"<li class='RightClickMenuElement' id='rename'><span class=\\\"glyphicon glyphicon-pencil\\\" aria-hidden=\\\"true\\\"></span> Rename</li>\" +\n \"\" +\n \"</ul>\" +\n \"</div>\";\n break;\n case \"file\" :\n strRight = \"<div id=\\\"RightClickMenu\\\">\" +\n \"<ul>\" +\n \"<li class='RightClickMenuElement' id='delete'><span class=\\\"glyphicon glyphicon-trash\\\" aria-hidden=\\\"true\\\"></span> Delete</li>\" +\n \"<li class='RightClickMenuElement' id='rename'><span class=\\\"glyphicon glyphicon-pencil\\\" aria-hidden=\\\"true\\\"></span> Rename</li>\" +\n \"\" +\n \"</ul>\" +\n \"</div>\";\n break;\n };\n $('#main').append(strRight);\n\n (debug?console.log(\"mode :\" + menuMode + \"\\n\" + strRight):null);\n (debug?console.log(\"________________________________________\\n\"):null);\n */\n}", "function toggleMenu() {\n\tif (burgerMenu.style.right === '100vw') {\n\t\tburgerBars[0].style.transform = 'translateY(10px) rotate(45deg)';\n\t\tburgerBars[1].style.transform = 'translateX(727px)';\n\t\tburgerBars[2].style.transform = 'translateY(-10px) rotate(-46deg)';\n\t\tburgerMenu.style.right = 0;\n\t} else {\n\t\tburgerBars.forEach((bar) => (bar.style.transform = ''));\n\t\tburgerMenu.style.right = '100vw';\n\t}\n}", "function menuPosition() {\n\t\t\torg_menu_offset = $('#org-menu-toggle').position().left + ($('#org-menu-toggle').width() / 2) - 120; // 120 is half of the menu width of 240px\n\t\t\t$('#org-menu-toggle').next('ul').css('left',org_menu_offset+'px');\n\t\t}", "function menu_reverse() {\n\t$('#menu').addClass('menu_reverse');\n\t$('.ico_home').addClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'hidden');\n}", "function mobile_modifyMenu(){\r\n console.log('modifyMenu 1');\r\n var topMenu1 = '<ul class=\"topMenuModified\"> <li class=\"jg-item-mainmenu\"><a href=\"/commerce/profile/edit_profile.jsp?_bm_trail_refresh_=true&amp;navType=1\" id=\"jg-mainmenu-profile\" class=\"jg-linkbtn profile\" data-description=\"Profile\">Profile</a></li><li class=\"jg-item-mainmenu\"><a href=\"/commerce/display_company_profile.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-home\" class=\"jg-linkbtn home\" data-description=\"Home\">Home</a></li><li class=\"jg-item-mainmenu\"><a href=\"/admin/index.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-settings\" class=\"jg-linkbtn settings\" data-description=\"Settings\">Settings</a></li><li class=\"jg-item-mainmenu\"><a href=\"/logout.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-logout\" class=\"jg-linkbtn logout\" data-description=\"Logout\">Logout</a></li></ul>';\r\n // var topMenu2 = '';\r\n $('h2#jg-topbar-title').addClass('modified').after(topMenu1);\r\n /* $('.jg-list-tool')\r\n .append($('<li class=\"jg-item-tool\">')\r\n .append('<a href=\"/commerce/buyside/commerce_manager.jsp?bm_cm_process_id=36244034&amp;from_hp=true&amp;_bm_trail_refresh_=true\" id=\"jg-submenu-myorders\" class=\"my_order jg-linkbtn\">All Orders</a>'))\r\n .append($('<li class=\"jg-item-tool\">')\r\n .append('<a href=\"#\" id=\"jg-submenu-copyorder\" class=\"copy_order jg-linkbtn\" data-description=\"Copy Order\">Copy Order</a>'));\r\n\t\t*/\r\n }", "optionRight() {\n \n // add one\n this.currentVolumeOption++;\n\n // if it is more than the legnth of the menu array, it wraps to 0\n if (this.currentVolumeOption == this.volumeControlsArray.length) {\n this.currentVolumeOption = 0;\n }\n\n // then we update the y of the select sprite\n this.volumeSelect.x = this.placeVolumeOption(this.currentVolumeOption);\n\n // play the select sound\n this.selectSound.play();\n\n this.updateVolumeArrowsX();\n }", "function lgMenu() {\n\t\t// unbind click events\n\t\t$('.menu-toggle a').off('click');\n\n\t\t// remove dynamic classes and span tags\n\t\t$('.main-nav').find('span.indicator').remove();\n\t\t$('.menu-toggle a').remove();\n\n\t\t// return windowState\n\t\twindowState = 'large';\n\t}", "putDrawerToRight() {\n this.isReverse = true;\n }", "loadMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n break;\n case MenuChoices.load:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.loadContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.loadButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n break;\n }\n }", "function rightToLeft() {\n _displaymode &= ~LCD_ENTRYLEFT;\n command(LCD_ENTRYMODESET | _displaymode);\n}", "function itinFromHere(){\n\tremoveContextualMenu()\n}", "_updateHAXCEMenu() {\n this._ceMenu.ceButtons = [\n {\n icon: this.locked ? \"icons:lock\" : \"icons:lock-open\",\n callback: \"haxClickInlineLock\",\n label: \"Toggle Lock\",\n },\n {\n icon: this.published ? \"lrn:view\" : \"lrn:view-off\",\n callback: \"haxClickInlinePublished\",\n label: \"Toggle published\",\n },\n {\n icon: \"editor:format-indent-increase\",\n callback: \"haxIndentParent\",\n label: \"Move under parent page break\",\n disabled: !pageBreakManager.getParent(this, \"indent\"),\n },\n {\n icon: \"editor:format-indent-decrease\",\n callback: \"haxOutdentParent\",\n label: \"Move out of parent page break\",\n disabled: !pageBreakManager.getParent(this, \"outdent\"),\n },\n ];\n }", "onRightClick() {\n const menuConfig = Menu.buildFromTemplate([\n {\n label: 'Quit',\n click: () => app.quit()\n }\n ]);\n this.popUpContextMenu(menuConfig);\n }", "function updateMenus() {\n d3.select('#S7-y-axis-menu')\n .selectAll('li')\n .classed('selected', function(d) {\n return d === yAxis;\n });\n d3.select('#yLabel')\n .text(descriptions[yAxis]);\n }", "hideSubMenu_() {\n const items =\n this.querySelectorAll('cr-menu-item[sub-menu][sub-menu-shown]');\n items.forEach((menuItem) => {\n const subMenuId = menuItem.getAttribute('sub-menu');\n if (subMenuId) {\n const subMenu = /** @type {!Menu|null} */\n (document.querySelector(subMenuId));\n if (subMenu) {\n subMenu.hide();\n }\n menuItem.removeAttribute('sub-menu-shown');\n }\n });\n this.currentMenu = this;\n }", "function backToMenu() {\r\n //Hide the modal\r\n hideModal();\r\n\r\n //Show the menu again\r\n MENU.menu.classList.remove(\"hide-menu\");\r\n MENU.controlsCntr.classList.remove(\"hide-menu\");\r\n\r\n //Remove event listener\r\n removeListeners();\r\n }", "renderMenuItems () {\n const menuItems = []\n if (!this.state.isFirst) {\n menuItems.push(<MenuItem\n key='moveup'\n primaryText='Move Up'\n onClick={this.handleMoveUp}\n leftIcon={<FontIcon className='material-icons'>arrow_upward</FontIcon>} />)\n }\n if (!this.state.isLast) {\n menuItems.push(<MenuItem\n key='movedown'\n primaryText='Move Down'\n onClick={this.handleMoveDown}\n leftIcon={<FontIcon className='material-icons'>arrow_downward</FontIcon>} />)\n }\n if (!this.state.isFirst || !this.state.isLast) {\n menuItems.push(<Divider key='div-0' />)\n }\n menuItems.push(\n <MenuItem\n key='delete'\n primaryText='Delete'\n onClick={this.handleDelete}\n leftIcon={<FontIcon className='material-icons'>delete</FontIcon>} />)\n menuItems.push(<Divider key='div-1' />)\n menuItems.push(\n <MenuItem\n key='reload'\n primaryText='Reload'\n onClick={this.handleReload}\n leftIcon={<FontIcon className='material-icons'>refresh</FontIcon>} />)\n menuItems.push(\n <MenuItem\n key='insepct'\n primaryText='Inspect'\n onClick={this.handleInspect}\n leftIcon={<FontIcon className='material-icons'>bug_report</FontIcon>} />)\n return menuItems\n }", "function fixSubMenu(){\n\nj$('nav > .sf-js-enabled > li:not(.rd_megamenu)').mouseover(function(){\n\nvar wapoMainWindowWidth = j$(window).width();\n // checks if third level menu exist\n var subMenuExist = j$(this).children('.sub-menu').length;\n if( subMenuExist > 0){\n var subMenuWidth = j$(this).children('.sub-menu').width();\n var subMenuOffset = j$(this).children('.sub-menu').parent().offset().left + subMenuWidth;\n\n // if sub menu is off screen, give new position\n if((subMenuOffset + subMenuWidth) > wapoMainWindowWidth){\n var newSubMenuPosition = subMenuWidth ;\n\t\t\t j$(this).addClass('left_side_menu');\n\n }else{\n\t\t\t var newSubMenuPosition = subMenuWidth ;\n\n\t\t\t j$(this).removeClass('left_side_menu');\n\t\t}\n }\n });\n}", "static setRight(html) {\n console.log(\"set right nav called\")\n $('#right').html(html);\n }", "function itinToHere(){\n\tremoveContextualMenu()\n\n}", "function addRemoveFavMenuLeft (id,name,mode,type){\r\n var items=dojo.byId('ml-menu').querySelectorAll('#'+id);\r\n items.forEach(function(el){\r\n el.removeAttribute('class');\r\n el.removeAttribute('onclick');\r\n });\r\n if(mode=='add'){\r\n var isReport=(type==\"reportDirect\")?'true':'false';\r\n var func= \"addRemoveFavMenuLeft('\"+id+\"','\"+name+\"','remove','\"+type+\"')\";\r\n var menuName=(isReport=='true')?name:name.substr(4);\r\n var param=\"?operation=add&class=\"+menuName+\"&isReport=\"+isReport;\r\n dojo.xhrGet({\r\n url : \"../tool/saveCustomMenu.php\"+param,\r\n handleAs : \"text\",\r\n load : function(data, args) {\r\n \tmenuNewGuiFilter('menuBarCustom', null);\r\n },\r\n });\r\n items.forEach(function(el){\r\n el.setAttribute('onclick',func);\r\n el.setAttribute('class','menu__as__Fav');\r\n });\r\n }else{\r\n var isReport=(type==\"reportDirect\")?'true':'false';\r\n var func= \"addRemoveFavMenuLeft('\"+id+\"','\"+name+\"','add','\"+type+\"')\";\r\n var menuName=(isReport=='true')?name:name.substr(4);\r\n var param=\"?operation=remove&class=\"+menuName+\"&isReport=\"+isReport;\r\n dojo.xhrGet({\r\n url : \"../tool/saveCustomMenu.php\"+param,\r\n handleAs : \"text\",\r\n load : function(data, args) {\r\n \tmenuNewGuiFilter('menuBarCustom', null);\r\n },\r\n });\r\n items.forEach(function(el){\r\n el.setAttribute('onclick',func);\r\n el.setAttribute('class','menu__add__Fav');\r\n \r\n });\r\n }\r\n}", "function refreshContextMenu() {\n chrome.contextMenus.removeAll();\n createMainMenu();\n addChildrenToContextMenu();\n}", "_handleRight(){\n if(this._buttonIndex < this.buttons.length - 1){\n this._setIndex(this._buttonIndex + 1);\n }else{\n this._setIndex(0);\n }\n }", "function setModifyButtonClickListener() {\n $(\"#btn-modify-menu\").click(function () {\n unhideElement($(\".menu-update-btn-group\"));\n unhideAndEnableElement($(\"#btn-discard-menu\"));\n setEnable($(\"#btn-clear-menu\"));\n\n // Disable and hide modify button\n setDisable($(this));\n hideElement($(this));\n\n // Change delete button style and size\n removeOldClass($(\"#btn-delete-menu\"), \"col-md-6\");\n addNewClass($(\"#btn-delete-menu\"), \"col-md-12\");\n addNewClass($(\"#btn-delete-menu\"), \"left-radius\");\n\n // Enable edit area\n setMenuEditable(true);\n\n // Change label text and color\n $(\".menu-title\").text(\"修改中...请注意保存\");\n $(\".menu-title\").css(\"color\", \"#FFC107\");\n removeOldClass($(\".menu-status-bar\"), \"alert-success\");\n removeOldClass($(\".menu-status-bar\"), \"alert-dnager\");\n addNewClass($(\".menu-status-bar\"), \"alert-warning\");\n unhideElement($(\".menu-modify-icon\"));\n hideElement($(\".menu-exist-icon\"));\n hideElement($(\".no-menu-icon\"));\n });\n }", "mutateMenu(menu, project, success, failure, refresh) {\n throw new Error('Invalid Operation calling abstract BaseProject.mutateMenu');\n }", "function fixSubmenuRight(){\n\t\t\tvar submenus = $(menu).children(\"li\").children(\".dropdown, .megamenu\");\n\t\t\tif($(window).innerWidth() > mobileWidthBase){\n\t\t\t\tvar menu_width = $(menu_container).outerWidth(true);\n\t\t\t\tfor(var i = 0; i < submenus.length; i++){\n\t\t\t\t\tif($(submenus[i]).parent(\"li\").position().left + $(submenus[i]).outerWidth() > menu_width){\n\t\t\t\t\t\t$(submenus[i]).css(\"right\", 0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(menu_width == $(submenus[i]).outerWidth() || (menu_width - $(submenus[i]).outerWidth()) < 20){\n\t\t\t\t\t\t\t$(submenus[i]).css(\"left\", 0);\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($(submenus[i]).parent(\"li\").position().left + $(submenus[i]).outerWidth() < menu_width){\n\t\t\t\t\t\t\t$(submenus[i]).css(\"right\", \"auto\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function fixSubmenuRight(){\n\t\t\tvar submenus = $(menu).children(\"li\").children(\".dropdown, .megamenu\");\n\t\t\tif($(window).innerWidth() > mobileWidthBase){\n\t\t\t\tvar menu_width = $(menu_container).outerWidth(true);\n\t\t\t\tfor(var i = 0; i < submenus.length; i++){\n\t\t\t\t\tif($(submenus[i]).parent(\"li\").position().left + $(submenus[i]).outerWidth() > menu_width){\n\t\t\t\t\t\t$(submenus[i]).css(\"right\", 0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(menu_width == $(submenus[i]).outerWidth() || (menu_width - $(submenus[i]).outerWidth()) < 20){\n\t\t\t\t\t\t\t$(submenus[i]).css(\"left\", 0);\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($(submenus[i]).parent(\"li\").position().left + $(submenus[i]).outerWidth() < menu_width){\n\t\t\t\t\t\t\t$(submenus[i]).css(\"right\", \"auto\");\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}", "menuHandler(newMenuChoices) {\n this.help.stopVideo();\n switch (newMenuChoices) {\n case MenuChoices.library:\n this.libraryMenu();\n break;\n case MenuChoices.export:\n this.exportMenu();\n break;\n case MenuChoices.help:\n this.helpMenu();\n break;\n case MenuChoices.edit:\n this.editMenu();\n break;\n case MenuChoices.save:\n this.saveMenu();\n break;\n case MenuChoices.load:\n this.loadMenu();\n break;\n case MenuChoices.null:\n this.cleanMenu();\n this.closeMenu();\n break;\n }\n }", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "function menuOptions() {}", "helpMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: //case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.helpContent.style.display = \"block\";\n this.menuView.helpButtonMenu.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.helpButtonMenu.style.zIndex = \"1\";\n this.currentMenuChoices = MenuChoices.help;\n break;\n case MenuChoices.help:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.helpContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.helpButtonMenu.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.helpButtonMenu.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.helpButtonMenu.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.helpButtonMenu.style.zIndex = \"1\";\n this.menuView.helpContent.style.display = \"block\";\n this.currentMenuChoices = MenuChoices.help;\n break;\n }\n }", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "function menuSetup() {\n\t\t\tmenu.classList.remove(\"no-js\");\n\n\t\t\tmenu.querySelectorAll(\"ul\").forEach((submenu) => {\n\t\t\t\tconst menuItem = submenu.parentElement;\n\n\t\t\t\tif (\"undefined\" !== typeof submenu) {\n\t\t\t\t\tlet button = convertLinkToButton(menuItem);\n\n\t\t\t\t\tsetUpAria(submenu, button);\n\n\t\t\t\t\t// bind event listener to button\n\t\t\t\t\tbutton.addEventListener(\"click\", toggleOnMenuClick);\n\t\t\t\t\tmenu.addEventListener(\"keyup\", closeOnEscKey);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "_overriddenMenuHandler() { }", "function onPrefChange(prefName) {\n menu.items = createMenuItems();\n}", "function menuBtnChange() {\n if(sidebar.classList.contains(\"open\")){\n closeBtn.classList.replace(\"bx-menu\", \"bx-menu-alt-right\");//replacing the iocns class\n }else {\n closeBtn.classList.replace(\"bx-menu-alt-right\",\"bx-menu\");//replacing the iocns class\n }\n}", "function setItemMenu(menu) {\n\t\tthis.menu = menu;\n\t}", "async registerMenu() {\r\n this.activateDefaultMenu();\r\n // re-render menu list by changing state\r\n this.nestedMenus = [...this.getRenderedMenuItems()];\r\n }", "function menuBtnChange() {\r\n if(sidebar.classList.contains(\"open\")){\r\n closeBtn.classList.replace(\"bx-menu\", \"bx-menu-alt-right\");//replacing the iocns class\r\n }else {\r\n closeBtn.classList.replace(\"bx-menu-alt-right\",\"bx-menu\");//replacing the iocns class\r\n }\r\n}", "function setMenu(menuBar){\n Menu.setApplicationMenu(Menu.buildFromTemplate(menuBar));\n}", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "_clearWorkspaceHistory() {\n const menu = this.getWorkspaceHistoryMenu();\n const items = Array.from(menu.items);\n menu.clear();\n if (!items[2].visible) {\n items[2].visible = true;\n }\n for (let i = 0; i < 3; i++) {\n menu.append(items[i]);\n }\n }", "function removeContextualMenu(){\n\t$(\".contextualMenu\").remove();\n\tcontextualMenuEvtPosition = null;\n}", "_moveDropDownsToMenu() {\n const that = this;\n\n for (let i = 0; i < that._containersInBody.length; i++) {\n const container = that._containersInBody[i];\n\n container.$.unlisten('click');\n container.$.unlisten('mouseleave');\n container.$.unlisten('mouseout');\n container.$.unlisten('mouseover');\n\n container.style.left = '';\n container.style.right = '';\n container.style.top = '';\n container.style.marginLeft = '';\n container.style.marginTop = '';\n\n container.menuItemsGroup.appendChild(container);\n }\n\n for (let i = 0; i < that._containers.length; i++) {\n const container = that._containers[i];\n\n if (that.theme !== '') {\n container.classList.remove(that.theme);\n }\n\n container.classList.remove('jqx-drop-down-repositioned');\n container.removeAttribute('mode');\n container.removeAttribute('drop-down-position');\n container.removeAttribute('checkboxes');\n }\n }", "rebuildMenu() {\n\n let bridgeItems = [];\n let oldItems = this.menu._getMenuItems();\n\n this.refreshMenuObjects = {};\n\n this.bridesData = this.hue.checkBridges();\n\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n\n for (let bridgeid in this.hue.instances) {\n\n bridgeItems = this._createMenuBridge(bridgeid);\n\n for (let item in bridgeItems) {\n this.menu.addMenuItem(bridgeItems[item]);\n }\n\n this.menu.addMenuItem(\n new PopupMenu.PopupSeparatorMenuItem()\n );\n }\n\n let refreshMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Refresh menu\")\n );\n refreshMenuItem.connect(\n 'button-press-event',\n () => { this.rebuildMenu(); }\n );\n this.menu.addMenuItem(refreshMenuItem);\n\n let prefsMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Settings\")\n );\n prefsMenuItem.connect(\n 'button-press-event',\n () => {Util.spawn([\"gnome-shell-extension-prefs\", Me.uuid]);}\n );\n this.menu.addMenuItem(prefsMenuItem);\n\n this.refreshMenu();\n }", "function renderNavigationMenu() {\n\n }" ]
[ "0.7147932", "0.7004216", "0.6714349", "0.6509055", "0.64456993", "0.640683", "0.6341509", "0.6341391", "0.6314558", "0.6283051", "0.6283051", "0.6283051", "0.62635094", "0.6233958", "0.6103202", "0.607581", "0.6064757", "0.6061353", "0.60591567", "0.60373396", "0.60236144", "0.60147434", "0.6000613", "0.59692824", "0.59683186", "0.59643114", "0.5962643", "0.59601074", "0.5958621", "0.59464157", "0.592718", "0.59219325", "0.5897902", "0.58978474", "0.58853847", "0.5883321", "0.5879238", "0.58724034", "0.5860809", "0.5859584", "0.5837797", "0.58273494", "0.5821308", "0.5818521", "0.5816448", "0.58010757", "0.5796561", "0.57938206", "0.5775205", "0.5772165", "0.5771861", "0.57682717", "0.57658195", "0.57436097", "0.5739334", "0.57389945", "0.573834", "0.5736145", "0.57359993", "0.57351273", "0.5731907", "0.57205933", "0.57200176", "0.57118726", "0.57053286", "0.5697273", "0.56933033", "0.568578", "0.5677043", "0.5668586", "0.5654202", "0.5651247", "0.56485134", "0.56327254", "0.56320435", "0.56189406", "0.5617687", "0.56135744", "0.5612902", "0.5612296", "0.5612296", "0.560822", "0.5606921", "0.56031185", "0.5603106", "0.5602654", "0.55789304", "0.55778056", "0.5571541", "0.55709606", "0.5570585", "0.55677027", "0.5565488", "0.55643517", "0.5561349", "0.5557526", "0.5554788", "0.5549411", "0.5547201", "0.5543063" ]
0.8001773
0
Removes any prior added changes to the menu due to resizing or nav selection
function removeMenuChanges() { let menu = document.getElementById('resizable'); if (menu.style.right) { menu.style.right = null; } if (menu.style.left) { menu.style.left = null; } $('.menu').removeClass('menu-left'); $('.menu').removeClass('menu-right'); $('.window').removeClass('window-menu-right'); $('.menu-bottom').addClass('hidden'); $('.menu').removeClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "cleanMenu() {\n for (var i = 0; i < this.menuView.HTMLElementsMenu.length; i++) {\n this.menuView.HTMLElementsMenu[i].style.display = \"none\";\n }\n for (var i = 0; i < this.menuView.HTMLButtonsMenu.length; i++) {\n this.menuView.HTMLButtonsMenu[i].style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.HTMLButtonsMenu[i].style.zIndex = \"0\";\n }\n }", "resetNav() {\n $(\".nav-canvas\").css(\"position\", \"\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\")\n }", "_rebuildMenu() {\n\n this.refreshMenuObjects = {};\n\n this.disconnectSignals(false, true);\n\n let oldItems = this.menu._getMenuItems();\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n }", "function resetMenuBar() {\n\n\t$('#Overview').removeClass(\"active\");\n\t$('#ArticleAnalytics').removeClass(\"active\");\n\t$('#AuthorAnalytics').removeClass(\"active\");\n\n}", "function resetMenuItem () {\n \n $('.smart-phone li, #taskBar, .desktop-menu, .lang-select').removeClass('active');\n }", "function lgMenu() {\n\t\t// unbind click events\n\t\t$('.menu-toggle a').off('click');\n\n\t\t// remove dynamic classes and span tags\n\t\t$('.main-nav').find('span.indicator').remove();\n\t\t$('.menu-toggle a').remove();\n\n\t\t// return windowState\n\t\twindowState = 'large';\n\t}", "function startRepositioningOnResize(){var repositionMenu=function(target,options){return $$rAF.throttle(function(){if(opts.isRemoved)return;var position=calculateMenuPosition(target,options);target.css(animator.toCss(position));});}(element,opts);$window.addEventListener('resize',repositionMenu);$window.addEventListener('orientationchange',repositionMenu);return function stopRepositioningOnResize(){// Disable resizing handlers\n\t$window.removeEventListener('resize',repositionMenu);$window.removeEventListener('orientationchange',repositionMenu);};}", "function reinitMenus(ulPath) { /* if(!jQueryBuddha(ulPath).is(\":visible\") && (typeof jQueryBuddha(ulPath).attr(\"style\")===typeof undefined || jQueryBuddha(ulPath).attr(\"style\").replace(/ /g, \"\").indexOf(\"display:none\")==-1 || (jQueryBuddha(ulPath).attr(\"style\").replace(/ /g, \"\").indexOf(\"display:none\")!=-1 && jQueryBuddha(ulPath).css(\"display\")==\"none\"))) { return; } */ jQueryBuddha(\".submenu-opened\").hide(); var previousItemTop; /* var horizontal = true; */ var verticalItemsNr = 1; jQueryBuddha(ulPath + \">.buddha-menu-item>a\").each(function () { /* .offset() is relative to document */ var currentItemTop = jQueryBuddha(this).offset().top; /* menuitems are positioned one below each other -> mobile rendering */ previousItemTop = (previousItemTop == undefined) ? currentItemTop : previousItemTop; if ((currentItemTop > (previousItemTop+5) ) || (currentItemTop < (previousItemTop-5))) { verticalItemsNr++; } previousItemTop = currentItemTop; }); /* var oldYPosition = 0; var oldXPosition = 0; var increment = 0; jQueryBuddha(ulPath+\">.buddha-menu-item\").each(function() { var positionY = jQueryBuddha(this).position().top; var positionX = jQueryBuddha(this).position().left; var differenceY = positionY - oldYPosition; var differenceX = positionX - oldXPosition; if(increment>0){ if(differenceY>3 || differenceX<3) { verticalItemsNr++; } } oldYPosition = positionY; oldXPosition = positionX; increment++; }); */ if ((verticalItemsNr != jQueryBuddha(ulPath + \">.buddha-menu-item\").length || (verticalItemsNr == 1 && jQueryBuddha(\"body\").width() > verticalMenuMaxWidth)) && forceMobile == false) { /* if ( verticalItemsNr==1 && forceMobile==false ) { */ jQueryBuddha(ulPath).addClass(\"horizontal-mega-menu\").removeClass(\"vertical-mega-menu\"); jQueryBuddha(ulPath + \" ul.mm-submenu\").removeAttr(\"style\"); jQueryBuddha(ulPath + \" .fa-minus-circle\").removeClass(\"fa-minus-circle\").addClass(\"fa-plus-circle\"); jQueryBuddha(ulPath + \" .submenu-opened\").removeClass(\"submenu-opened\"); jQueryBuddha(ulPath + \" .toggle-menu-btn\").hide(); jQueryBuddha(\".horizontal-mega-menu>li.buddha-menu-item\").off(); setTimeout(function () { jQueryBuddha(ulPath).find(\".buddha-menu-item\").each(function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); }); }, 1); jQueryBuddha(ulPath).find(\".buddha-menu-item\").unbind(\"onmouseover.simpleContactSubmenuResize\"); jQueryBuddha(ulPath).find(\".buddha-menu-item\").bind(\"onmouseover.simpleContactSubmenuResize\", function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); }); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").each(function () { if (jQueryBuddha(this).parent().find(\".tab-opened\").length == 0) { /* jQueryBuddha(this).parent().find(\".tab-opened\").removeClass(\"tab-opened\"); */ jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); } else if (jQueryBuddha(this).hasClass(\"tab-opened\")) { setTabbedSubmenuBoundries(jQueryBuddha(this)); } }); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").unbind(); jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li\").hover(function () { jQueryBuddha(this).parent().find(\".tab-opened\").removeClass(\"tab-opened\"); jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); }); /* set first tab of every tabbed submenu be opened */ jQueryBuddha(ulPath).find(\"ul.mm-submenu.tabbed>li:first-child\").each(function () { if (jQueryBuddha(this).parent().find(\".tab-opened\").length == 0) { jQueryBuddha(this).addClass(\"tab-opened\"); setTabbedSubmenuBoundries(jQueryBuddha(this)); } }); jQueryBuddha(ulPath).find(\".buddha-menu-item\").unbind(\"mouseenter.resizeSubmenus\"); jQueryBuddha(ulPath).find(\".buddha-menu-item\").bind(\"mouseenter.resizeSubmenus\", function () { setSubmenuBoundries(jQueryBuddha(this)); setContactSubmenuBoundries(jQueryBuddha(this)); if (jQueryBuddha(this).find(\".tab-opened\").length > 0) { setTabbedSubmenuBoundries(jQueryBuddha(this).find(\".tab-opened\")); } }); } else { if (activateMegaMenu) { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); jQueryBuddha(\".buddha-menu-item.disabled\").removeClass(\"disabled\"); jQueryBuddha(ulPath).addClass(\"vertical-mega-menu\").removeClass(\"horizontal-mega-menu\"); jQueryBuddha(ulPath + \" .toggle-menu-btn\").show(); jQueryBuddha(ulPath).find(\"li.buddha-menu-item\").off(); jQueryBuddha(ulPath).find(\"li.buddha-menu-item a\").off(); var iconDistance = parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"font-size\")); var totalPaddingLeft = parseInt(jQueryBuddha(ulPath + \">li\").css(\"padding-left\")) + parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"padding-left\")); var paddingLeftSubSubmenus = totalPaddingLeft; if (totalPaddingLeft > 15) { paddingLeftSubSubmenus = 15; } var totalPaddingTop = parseInt(jQueryBuddha(ulPath + \">li\").css(\"padding-top\")) + parseInt(jQueryBuddha(ulPath + \">li>a\").css(\"padding-top\")); jQueryBuddha(\"#verticalMenuSpacing\").remove(); var styleSheet = '<style id=\"verticalMenuSpacing\" type=\"text/css\">'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tree>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tree>li ul.mm-submenu li {padding-left:' + paddingLeftSubSubmenus + 'px !important;padding-right:' + paddingLeftSubSubmenus + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li ul.mm-submenu.simple>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tabbed>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li>ul.mm-submenu.tabbed>li>ul.mm-submenu>li {padding-left:' + paddingLeftSubSubmenus + 'px !important;padding-right:' + paddingLeftSubSubmenus + 'px !important;}'; styleSheet += ulPath + '.vertical-mega-menu>li ul.mm-submenu.mm-contact>li{padding-left:' + totalPaddingLeft + 'px !important;padding-right:' + totalPaddingLeft + 'px !important;}'; styleSheet += \"</style>\"; jQueryBuddha(\"head\").append(styleSheet); /* remove tab-opened classes */ jQueryBuddha(ulPath).find(\".tab-opened\").removeClass(\"tab-opened\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>a>.toggle-menu-btn\").unbind(\"click.resizeSubmenus\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>a>.toggle-menu-btn\").bind(\"click.resizeSubmenus\", function () { setSubmenuBoundries(jQueryBuddha(this).parent().parent()); setContactSubmenuBoundries(jQueryBuddha(this).parent().parent()); }); jQueryBuddha(ulPath).find(\".buddha-menu-item>.mm-submenu>li>a>.toggle-menu-btn\").unbind(\"click.resizeTabbedSubmenu\"); jQueryBuddha(ulPath).find(\".buddha-menu-item>.mm-submenu>li>a>.toggle-menu-btn\").bind(\"click.resizeTabbedSubmenu\", function () { if (jQueryBuddha(this).parent().parent().hasClass(\"mm-hovering\")) { setTabbedSubmenuBoundries(jQueryBuddha(this).parent().parent()); } }); forceMobile = false; } } jQueryBuddha(\".submenu-opened\").show(); if (panelOpened) { jQueryBuddha(\".horizontal-mega-menu>.buddha-menu-item\").unbind(\"mouseenter.addMegaHoverClass\"); jQueryBuddha(\".horizontal-mega-menu>.buddha-menu-item\").bind(\"mouseenter.addMegaHoverClass\", function () { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); if (panelOpened) { jQueryBuddha(this).addClass(\"mega-hover\"); } }); } else { jQueryBuddha(\".mega-hover\").removeClass(\"mega-hover\"); } }", "rebuildMenuStart() {\n this._rebuildingMenu = true;\n this._rebuildingMenuRes = {};\n this._mainLabel = {};\n\n this.disconnectSignals(false);\n\n let oldItems = this.menu._getMenuItems();\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n }", "function cleanup () {\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "function digglerClearTempMenuItems()\n{\n for (var i = 0; i < currentMenuItems.length; ++i)\n browser.menus.remove( currentMenuItems[i].id );\n currentMenuItems = [];\n globalMenuIndex = 0;\n}", "cleanNavigation() {\n // clean hammer bindings\n if (this.navigationHammers.length != 0) {\n for (let i = 0; i < this.navigationHammers.length; i++) {\n this.navigationHammers[i].destroy();\n }\n this.navigationHammers = [];\n }\n\n // clean up previous navigation items\n if (\n this.navigationDOM &&\n this.navigationDOM[\"wrapper\"] &&\n this.navigationDOM[\"wrapper\"].parentNode\n ) {\n this.navigationDOM[\"wrapper\"].parentNode.removeChild(\n this.navigationDOM[\"wrapper\"]\n );\n }\n\n this.iconsCreated = false;\n }", "resize() {\n\t\t/* Update width and height just incase canvas size has changed */\n \tthis.menuWidth = $(\"#pixel-analysis-menu\").width();\n \tthis.menuHeight = $(\"#pixel-analysis-menu\").height();\n\t\tthis.menuSVG.attr(\"width\", this.menuWidth)\n\t\t\t\t\t\t.attr(\"height\", this.menuHeight);\n\n\t\tif (this.checkpoint == 0) {\n\t\t\tthis.rayTreeView.resize();\n\t\t\tthis.parallelBarView.resize();\n\t\t} else if (this.checkpoint = 1) {\n\t\t\tthis.parallelBarView.resize();\n\t\t\t\n\t\t\tthis.rayTreeView.resize();\n\t\t}\n\t\t\t\t\t\t\n\t\tthis.update()\n\t}", "resize() {\n const $activeTab = $('.admin-menu-tab.active');\n const $separator = this.getSeparator($('#adminmenu .wp-menu-separator'));\n\n if (!$activeTab.is(':visible')) {\n this.hideCollapseMenu($separator);\n } else if (!$('li.menu-top:visible').length) {\n const tab = $activeTab.hasClass('admin-menu-tab-edit') ? 'admin' : 'edit';\n this.hideMenuItems($separator, tab);\n }\n }", "function resetMobileNav() {\n $('#searchMobileContainer').removeClass('expanded');\n $(\"#predictive-container-small\").hide();\n $(\"#predictive-terms-small\").html(\"\");\n $(\"#mobileMenuList\").hide();\n }", "function rem_menu(){\n\tvar menu=$(\"#menu\");\n\tif(menu.length){\n\t\tmenu.remove();\n\t};\n\n\tvar hamb=$(\"#hamb\");\n\tif(hamb.length){\n\t\thamb.remove();\n\t};\n}", "function removeMenuDisplay() {\n body.classList.remove(\"noScroll\");\n iconContainer.classList.remove(\"changeColor\");\n closeMenus();\n}", "function clearStyleAttribute() {\r\n closeAllMenus();\r\n $(\".common-mobile-menu\").removeAttr(\"style\");\r\n $(\".footer-list-menu\").removeAttr(\"style\");\r\n}", "undoSiteAdjust() {\r\n\t\t$( '.main-header' ).removeClass( 'adjustedMargin' );\r\n\t}", "function destroyMenu() {\n $scope.overlayWindow.removeChildren();\n $scope.menuTitle = undefined;\n $scope.overlayBackground = new PIXI.Sprite($scope.texture.overlayBackground);\n $scope.overlayWindow.addChild($scope.overlayBackground);\n }", "function resizeMenuChecker(e) {\n if(e.relatedTarget === null) {\n document.getElementsByClassName('sidebar-open')[0].setAttribute('class', 'sidebar-closed');\n }\n if(window.innerWidth > 999) {\n if(document.getElementsByClassName('sidebar-closed')[0]) {\n document.getElementsByClassName('search-form-input')[0].removeEventListener('blur', resizeMenuChecker, false);\n document.getElementsByClassName('language-selector')[0].removeEventListener('blur', resizeMenuChecker, false);\n } else {\n document.getElementsByClassName('sidebar-open')[0].setAttribute('class', 'sidebar-closed');\n }\n }\n}", "clear() {\n this.Canvas.getLayerByName('menu').clear();\n }", "clear() {\n this.Canvas.getLayerByName('menu').clear();\n }", "_appendMinimizedContainerToMenu(itemsContainer, sibling) {\n const that = this;\n\n delete itemsContainer.ownerElement;\n that.$.container.insertBefore(itemsContainer, sibling);\n\n itemsContainer.removeAttribute('animation');\n\n if (that.theme !== '') {\n itemsContainer.$.removeClass(that.theme);\n }\n\n itemsContainer.$.removeClass('jqx-menu-drop-down jqx-drop-down');\n itemsContainer.$.removeClass('jqx-drop-down-repositioned');\n itemsContainer.removeAttribute('checkable');\n itemsContainer.removeAttribute('checkboxes');\n itemsContainer.removeAttribute('check-mode');\n itemsContainer.removeAttribute('drop-down-position');\n itemsContainer.removeAttribute('mode');\n itemsContainer.removeAttribute('loading-indicator-position');\n itemsContainer.removeAttribute('style');\n }", "_clearWorkspaceHistory() {\n const menu = this.getWorkspaceHistoryMenu();\n const items = Array.from(menu.items);\n menu.clear();\n if (!items[2].visible) {\n items[2].visible = true;\n }\n for (let i = 0; i < 3; i++) {\n menu.append(items[i]);\n }\n }", "function fixReviewsMenu() {\n fixMenu(reviewsSectionMenu);\n }", "function menuHide() {\n ui.languageContainer.removeClass('open');\n ui.appbarElement.removeClass('open');\n ui.mainMenuContainer.removeClass('open');\n ui.darkbgElement.removeClass('open');\n}", "function _onWindowResize () {\n var newMenuCollapsed = sidebarService.shouldMenuBeCollapsed()\n var newMenuHeight = _calculateMenuHeight()\n if (newMenuCollapsed !== sidebarService.isMenuCollapsed() || scope.menuHeight !== newMenuHeight) {\n scope.$apply(function () {\n scope.menuHeight = newMenuHeight\n sidebarService.setMenuCollapsed(newMenuCollapsed)\n })\n }\n }", "function menuSet(self){\n\t\tvar browserWidth = window.innerWidth;\n\t\tvar heightMenu = window.innerHeight - document.querySelector(\".main-menu\").getBoundingClientRect().bottom + \"px\";\n\t\tvar menuPosition = document.querySelector(\".main-menu\").getBoundingClientRect().bottom;\n\n\t\tif (browserWidth < 800 ) {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": heightMenu,\n\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\"top\": menuPosition +\"px\"\n\t\t\t});\n\n\t\t} else {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": \"\",\n\t\t\t\t\"top\": \"\",\n\t\t\t\t\"position\": \"\"\n\t\t\t});\n\t\t}\n\n\t}", "function cleanMenu(menu) {\n var i;\n for (i = 0; i < commands.length; i++) {\n menu.removeMenuItem(commands[i]);\n }\n }", "_onResize () {\n this.close();\n this._hideItems();\n this._submenuCloseAll();\n }", "function clearMapSubmenuOptionClicked() {\n\n clearMap();\n clearBackgroundData();\n reloadMenuOptionsAvailabilityForRiver(0, 4);\n reloadMenuOptionsAvailabilityForRiver(1, 4);\n reloadMenuOptionsAvailabilityForRiver(2, 4);\n reloadMenuOptionsAvailabilityForRiver(5, 4);\n\n}", "function rebuildMenu() {\n clearTimeout(rebuildTimerId);\n rebuildTimerId = setTimeout(buildMenu, 0);\n}", "_onMenuDisposed(menu) {\n this.removeMenu(menu);\n let index = ArrayExt.findFirstIndex(this._items, item => item.menu === menu);\n if (index !== -1) {\n ArrayExt.removeAt(this._items, index);\n }\n }", "_update_menu_min_size () {\n let work_area = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.findIndexForActor(this.menu.actor));\n let monitor = Main.layoutManager.findMonitorForActor(this.menu.actor);\n let scale_factor = St.ThemeContext.get_for_stage(global.stage).scale_factor;\n\n // @HACK\n // Some extensions enable autohiding of the panel and as a result the\n // height of the panel is not taken into account when computing the\n // work area. This is just a simple work around.\n let tweak = 0;\n if (monitor.height === work_area.height) tweak = Main.layoutManager.panelBox.height + tweak;\n\n let max_h = Math.floor((work_area.height - tweak) / scale_factor);\n let max_w = Math.floor((work_area.width - 16) / scale_factor);\n\n this.menu_max_w = max_w;\n this.menu_max_h = max_h;\n\n this.menu.actor.style = `max-height: ${max_h}px; max-width: ${max_w}px;`;\n }", "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "function delNav() {\n $(\"#navbar\").empty();\n}", "function deleteMenu() {\n randomize_button.remove();\n submit_num.remove();\n num_stars_input.remove();\n submit_num_planets.remove();\n num_planets_input.remove();\n if (set_stars != null) {\n set_stars.remove();\n }\n if (preset_binary != null) {\n preset_binary.remove();\n }\n if (tatooine != null) {\n tatooine.remove();\n }\n deleteInputInterface();\n}", "function removeNav() {\n $(\".nav-button\").removeClass(\"nav-button--open-nav\");\n $(\".nav-cover\").removeClass(\"nav-cover--open-nav\");\n $(\"nav\").removeClass(\"open-nav\");\n}", "function resizeListener() {\n window.onresize = function (e) {\n toggleMenuOff();\n selectedImg = null;\n };\n }", "function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n }\n }", "function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n }\n }", "function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n }\n }", "function clearMenu(){\n //get side nav container\n var container = document.getElementById(\"mySidenav\");\n\n //remove all text from sidenav\n var elements = container.getElementsByClassName(\"stations\");\n while (elements[0]) {\n elements[0].parentNode.removeChild(elements[0]);\n }\n //remove all pulse buttons from Main menu sidenav\n var elements = container.getElementsByClassName(\"pulse-button\");\n while (elements[0]) {\n elements[0].parentNode.removeChild(elements[0]);\n }\n //remove all breaks in between buttons\n var elements = container.getElementsByClassName(\"container\");\n while (elements[0]) {\n elements[0].parentNode.removeChild(elements[0]);\n }\n //remove all non pulse buttons from Main menu sidenav\n var elements = container.getElementsByClassName(\"no-pulse-button\");\n while (elements[0]) {\n elements[0].parentNode.removeChild(elements[0]);\n }\n //remove all button elements from sidenav\n var buttons = container.getElementsByClassName(\"accordion\");\n while (buttons[0]) {\n buttons[0].parentNode.removeChild(buttons[0]);\n }\n //remove all panel elements from sidenav\n var panels = container.getElementsByClassName(\"panel\");\n while (panels[0]) {\n panels[0].parentNode.removeChild(panels[0]);\n }\n}", "_refreshItemPathsAndSelection() {\n const that = this,\n oldSelectedIndexes = that.selectedIndexes.slice(0);\n\n that._menuItems = {\n };\n that._refreshItemPaths(that.$.mainContainer, true);\n that.selectedIndexes = [];\n that._applySelection(true, oldSelectedIndexes);\n }", "_handleResize() {\n if ($('.navigation-mobile').is(':hidden')) {\n this._toggleMobileNav(false);\n }\n\n this._positionNavigation();\n this._navigationScroll(true);\n }", "function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n };\n }", "function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n };\n }", "function cleanup () {\n if (!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = ['ul', 'scroller', 'scrollContainer', 'input'];\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "function removeContextualMenu(){\n\t$(\".contextualMenu\").remove();\n\tcontextualMenuEvtPosition = null;\n}", "function resetNavbar()\n {\n $(\"#nav-bar\").css(\"background-color\", navBarOriginCol);\n $(\"#nav-bar .link\").each(function(){\n $(this).find(\"div:first\").removeClass(\"hovered\");\n });\n }", "function resizeMenu () {\n _sw = window.innerWidth ? window.innerWidth : $(window).width()\n\n if (_sw < 992) {\n $('.menu-subtitle').next('ul').addClass('hidden')\n $('.cities').addClass('hidden')\n $('.menu-subtitle').addClass('menumobile')\n $('.cities').addClass('hidden').removeClass('open')\n\n $('ul.navbar-nav').find('.nav-link').bind('touchstart touchend').on('click', function (e) {\n e.preventDefault()\n $('.nav-item').removeClass('active')\n if ($(this).parents('.nav-item').find('> .menu-option').hasClass('open-option')) {\n $(this).parents('.nav-item').removeClass('active').find('> .menu-option').removeClass('open-option').stop().slideUp('fast')\n } else {\n $('.menu-option').removeClass('open-option').stop().slideUp('fast')\n $(this).parents('.nav-item').addClass('active').find('> .menu-option').addClass('open-option').stop().slideDown()\n }\n })\n } else {\n $('.menu-subtitle').next('ul').removeClass('hidden')\n $('.cities').addClass('hidden')\n $('.menu-subtitle').removeClass('menumobile')\n $('.cities').eq(0).removeClass('hidden').addClass('open')\n\n $('ul.navbar-nav').find('li.nav-item').on('mouseenter', function () {\n $('.admin-vuelo').removeClass('active')\n $(this).addClass('active')\n if ($('.country-list').hasClass('open')) {\n $('.language').children('.country-list').slideUp('fast').removeClass('open').addClass('close')\n $('.language').children('.arrow').removeClass('up').addClass('down')\n // resizeMenu()\n\n }\n if ($(this).hasClass('open-option')) {\n $(this).find('> .menu-option').removeClass('open-option').stop().slideUp('fast')\n } else {\n $(this).find('> .menu-option').addClass('open-option').stop().slideDown()\n }\n\n // se oculta user\n $('.userWrp .arrow').removeClass('up')\n $('.user-menu').stop().slideUp('fast')\n }).on('mouseleave', function () {\n $(this).removeClass('active')\n $(this).find('> .menu-option').removeClass('open-option').stop().slideUp('fast')\n }).on('click', function (e) {\n // e.preventDefault() IJ MAX CHANGE menu links\n })\n }\n\n $('.menu-option').hide()\n }", "function fixSubMenu() {\r\n\r\n j$('nav > .sf-js-enabled > li:not(.rd_megamenu)').mouseover(function () {\r\n\r\n var wapoMainWindowWidth = j$(window).width();\r\n // checks if third level menu exist\r\n var subMenuExist = j$(this).find('.menu-item-has-children').length;\r\n if (subMenuExist > 0) {\r\n var subMenuWidth = j$(this).children('.sub-menu').width();\r\n var subMenuOffset = j$(this).children('.sub-menu').parent().offset().left + subMenuWidth;\r\n\r\n // if sub menu is off screen, give new position\r\n if ((subMenuOffset + subMenuWidth) > wapoMainWindowWidth) {\r\n var newSubMenuPosition = subMenuWidth;\r\n j$(this).addClass('left_side_menu');\r\n\r\n } else {\r\n var newSubMenuPosition = subMenuWidth;\r\n\r\n j$(this).removeClass('left_side_menu');\r\n }\r\n }\r\n });\r\n\r\n\r\n j$('.rd_megamenu a').on('mouseenter mouseleave', function () {\r\n\r\n j$('.rd_megamenu ul').each(function () {\r\n if (j$(this).find('.mm_widget_area').length > 1) {\r\n var maxHeight = 0;\r\n j$(this).children('.mm_widget_area').css('min-height', 'auto');\r\n j$('.mm_widget_area').css('min-height', '0');\r\n j$(this).children('.mm_widget_area').each(function () {\r\n if (j$(this).height() > maxHeight) {\r\n maxHeight = j$(this).height();\r\n }\r\n j$(this).css(\"min-height\", maxHeight);\r\n })\r\n j$(this).children('.mm_widget_area').css(\"min-height\", maxHeight);\r\n }\r\n\r\n });\r\n\r\n\r\n });\r\n\r\n}", "function lrgMenu() {\n\t\n\t// Reset all menu items \n\t$('menu-toggle a').off('click');\n\t$('.menu h3').off('click');\n\t$('.menu > li').off('click');\n\t\n\t//remove any expanded menus\n\t$('#top-nav, #bottom-nav').find('*').removeClass('expand open focus');\n\t//remove the span tags inside\n\t$('.menu h3').find('span.indicator').remove();\n\t//remove menu toggle\n\t$('.menu-toggle').remove();\n\t//remove anchor tags from bottom navigation headings\n\t$('#bottom-nav h3 a').contents().unwrap();\n\t\n\t// --- end reset ---\n\n\t\n\t//MENUS - hide and show items when they get tab focus\n\t$('.menu > li').focusin(function () {\n\t\t$(this).addClass('focus');\n });\n\n\t$('.menu > li').focusout(function () {\n\t\t$(this).removeClass('focus');\n\t});\n\t\n\t//Toggle menu item open & closed\n\t$('#top-nav .menu > li').click(function() {\n\t\t//close other submenus by removing the expand class\n\t\t$('#top-nav .menu > li').removeClass('focus').not(this).removeClass('expand');\n\t\t//toggle this menu item\n\t\t$(this).toggleClass('expand');\n\t});\n\t\n\t// iPad workaround to get body element to recogize click event\n\tvar ua = navigator.userAgent,\n\tevent = (ua.match(/iPad/i)) ? \"touchstart\" : \"click\";\n\t\n\t//close submenus if users click outside the menu\n\t$('html').bind(event,function(e) {\n\t\t$('#top-nav .menu > li').removeClass('expand');\n\t});\n\t\n\t//stop clicks on the menu from bubbling up\n\t$('#top-nav').bind(event,function(e){\n\t\te.stopPropagation();\n\t});\n \n\t//set current window state\n\twindowState='large';\n}", "function resizingNav() {\n // at1400();\n if ($(window).width() < 480) {\n $('#account-links').hide(100);\n $(' div.arrow-down').show(200);\n $('div#welcome-message p').first().prependTo('#page-top');\n $($(\"nav.secondary-nav a\").get().reverse()).each(function(index) {\n $(this).detach().prependTo(\".hidden-menu-s\");\n })\n $(\"nav.secondary-nav\").addClass('hidden');\n $(\".ham-menu-s\").removeClass('hidden');\n\n $(\"nav.MainNav a\").each(function(index) {\n $(this).detach().appendTo(\".hidden-menu-m\");\n })\n $(\"nav.MainNav\").addClass('hidden');\n $(\".ham-menu-m\").removeClass('hidden');\n }\n else {\n $('#page-top p').first().prependTo('#welcome-message');\n $(\"nav.secondary-nav\").removeClass('hidden');\n $(\"nav.MainNav\").removeClass('hidden');\n if ($(window).width() < 1024) {\n $('#account-links').hide(100);\n $(' div.arrow-down').show(200);\n }\n else {\n $(' div.arrow-down').hide('easing');\n $('#account-links').show('easing');\n if ($(window).width() > 1400) {\n $('.hidden-menu-s a').each(function(index) {\n $(this).detach().appendTo(\"nav.secondary-nav\");\n })\n $(\".hidden-menu-s\").addClass('hidden');\n $(\".ham-menu-s\").addClass('hidden');\n\n $($('.hidden-menu-m a').get().reverse()).each(function(index) {\n $(this).detach().prependTo(\"nav.MainNav\");\n })\n $(\".hidden-menu-m\").addClass('hidden');\n $(\".ham-menu-m\").addClass('hidden');\n }\n }\n }\n\n\n}", "clearActive() {\n this.handleMenuItemChange(\"active\");\n }", "function clearSelecteds(menu) {\n\tvar list = document.getElementById(menu.id).getElementsByTagName(\"LI\");\n\tvar i = 0;\n\tfor( i; i<list.length; ++i){\n\t\tif( list[i].className == \"selected\" ){\n\t\t\tlist[i].className = \"\";\n\t\t\tif( list[i].parentNode.className == \"submenu\" )\n\t\t\t{\n\t\t\t\tif(!$(list[i]).hasClass('hovered')){\n\t\t\t\t\tvar tamano;\n\t\t\t\t\tvar a = list[i].getElementsByTagName(\"A\")[0];\n\t\t\t\t\tif($(list[i]).css('text-align') == \"right\"){\n\t\t\t\t\t\ttamano=$(a).innerWidth()-400;\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttamano=-400;\n\t\t\t\t\t}\n\t\t\t\t\t$(a).stop(true,true).animate({backgroundPosition:'('+tamano+'px 0px)'},(-350*(tamano/400)),\"easeInOutQuart\");\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n}", "function resMenu() {\n if ($(window).width() < 1023) {\n $('.main-menu ul li a').on(\"click\", function() {\n $(\".navbar-collapse\").removeClass(\"in\");\n $(\".navbar-toggle\").addClass(\"collapsed\").removeClass(\"active\");\n $(\"#header\").removeClass(\"headClr\");\n });\n }\n }", "function classRemover(){\r\n $(\"#snackNav\").removeClass();\r\n $(\"#drinkNav\").removeClass();\r\n $(\"#lunchNav\").removeClass();\r\n }", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "clear() {\n const that = this;\n\n that.$.mainContainer.innerHTML = '';\n that._removeContainersInBody();\n that._menuItems = {};\n that._containers = [];\n that._containersInBody = [];\n that._openedContainers = [];\n that._containersFixedHeight = [];\n that._menuItemsGroupsToExpand = [];\n that._additionalScrollButtons = [];\n }", "function updateMenu() {\n // console.log('updateMenu');\n\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n const menuSave = document.getElementById('menuSave');\n const menuHighlight = document.getElementById('menuHighlight');\n const menuExportSvg = document.getElementById('menuExportSvg');\n const menuExportPng = document.getElementById('menuExportPng');\n\n if (Common.isIOSEdge) {\n const menuPrint = document.getElementById('menuPrint');\n menuPrint.style.display = 'none';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuHighlight.src = '/media/edit-on.svg';\n menuHighlight.title = 'Turn off highlighter';\n } else {\n menuHighlight.src = '/media/edit-off.svg';\n menuHighlight.title = 'Turn on highlighter';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuSave.style.display = 'inline';\n\n // menuExportSvg.style.display = 'inline';\n menuExportSvg.style.display = (Common.isIOSEdge ? 'none' : 'inline');\n\n // menuExportPng.style.display = (isIE ? 'none' : 'inline');\n menuExportPng.style.display = (Common.isIOSEdge || Common.isIE ? 'none' : 'inline');\n } else {\n menuSave.style.display = 'none';\n\n menuExportSvg.style.display = (!Common.isIOSEdge ? 'inline' : 'none');\n\n menuExportPng.style.display = (!Common.isIE && !Common.isIOSEdge ? 'inline' : 'none');\n }\n\n menuPanel.style.display = 'block';\n\n // 4px padding on div#menu\n PageData.MenuOffset = menuPanel.clientWidth - menuGrip.clientWidth - 4;\n}", "function reset() {\n\t\t\t\t\tlists.removeClass(hover);\n\t\t\t\t\tlists.find('ul ul').hide();\n\t\t\t\t\titem.find('> li').unbind('mouseenter');\n\t\t\t\t\t$(document).unbind(that.click);\n\t\t\t\t}", "setSmallWindowModeSize(keepWidth) {\n\t\tthis.removeStyles(keepWidth);\n\t\tif (this.barPosition === 'top') {\n\t\t\tthis.setTopColapsedMenuSize();\n\t\t} else if (this.barPosition === 'bottom') {\n\t\t\tthis.setBottomColapsedMenuSize();\n\t\t} else if (this.barPosition === 'left') {\n\t\t\tthis.setLeftColapsedMenuSize();\n\t\t} else if (this.barPosition === 'right') {\n\t\t\tthis.setRightColapsedMenuSize();\n\t\t}\n\t}", "function removeMainMenuBg() {\n mainMenuBg.remove();\n mainMenuBg = '';\n }", "function activateResizing(){var debouncedOnResize=function(scope,target,options){return function(){if(options.isRemoved)return;var updates=calculateMenuPositions(scope,target,options);var container=updates.container;var dropDown=updates.dropDown;container.element.css(animator.toCss(container.styles));dropDown.element.css(animator.toCss(dropDown.styles));};}(scope,element,opts);var window=angular.element($window);window.on('resize',debouncedOnResize);window.on('orientationchange',debouncedOnResize);// Publish deactivation closure...\n\treturn function deactivateResizing(){// Disable resizing handlers\n\twindow.off('resize',debouncedOnResize);window.off('orientationchange',debouncedOnResize);};}", "function cleanup(){if(!ctrl.hidden){$mdUtil.enableScrolling();}angular.element($window).off('resize',positionDropdown);if(elements){var items=['ul','scroller','scrollContainer','input'];angular.forEach(items,function(key){elements.$[key].remove();});}}", "function updateMenu() {\n let list = nav.querySelector('ul'),\n height = list.offsetHeight,\n cssText = '.nav-toggle[aria-expanded=\"true\"]+.nav-collapse{max-height:' + height + 'px}';\n\n if (height) {\n if (style.styleSheet) {\n style.styleSheet.cssText = cssText;\n } else {\n style.innerHTML = cssText;\n }\n }\n\n if (!style.parentNode) {\n document.querySelector('head').appendChild(style);\n }\n\n // the list should be marked as hidden if the menu button is visible and not expanded\n list.hidden = (navButtonStyle.display == 'block' ? !nav.classList.contains('open') : false);\n }", "function eltdfOnWindowResize() {\n eltdfDropDownMenu();\n eltdfSetDropDownMenuPosition();\n eltdfInitDividedHeaderMenu();\n }", "function handleSidebarRemove() {\n /* Remove Menu Elements*/\n $('.menu-settings').on('click', '#remove-menu', function(e) {\n e.preventDefault();\n $(\".nav-sidebar\").sortable();\n $(\".nav-sidebar\").sortable(\"destroy\");\n $(\".nav-sidebar .children\").sortable().sortable(\"destroy\");\n $('.nav-sidebar').removeClass('remove-menu').addClass('remove-menu');\n $(this).attr(\"id\", \"end-remove-menu\").html('End remove menu');\n $('.reorder-menu').attr(\"id\", \"reorder-menu\").html('Reorder menu');\n });\n /* End Remove Menu Elements*/\n $('.menu-settings').on('click', '#end-remove-menu', function(e) {\n e.preventDefault();\n $('.nav-sidebar').removeClass('remove-menu');\n $(this).attr(\"id\", \"remove-menu\").html('Remove menu');\n });\n $('.sidebar').on('click', '.remove-menu > li', function() {\n $menu = $(this);\n if ($(this).hasClass('nav-parent')) $remove_txt = \"Are you sure to remove this menu (all submenus will be deleted too)?\";\n else $remove_txt = \"Are you sure to remove this menu?\";\n bootbox.confirm($remove_txt, function(result) {\n if (result === true) {\n $menu.addClass(\"animated bounceOutLeft\");\n window.setTimeout(function() {\n $menu.remove();\n }, 300);\n }\n });\n });\n}", "function removeGameChildren() {\n\tgame_menu.removeAllChildren();\n\tstage.update();\n}", "function fixClientsMenu() {\n fixMenu(clientsSectionMenu);\n }", "hideSubMenu_() {\n const items =\n this.querySelectorAll('cr-menu-item[sub-menu][sub-menu-shown]');\n items.forEach((menuItem) => {\n const subMenuId = menuItem.getAttribute('sub-menu');\n if (subMenuId) {\n const subMenu = /** @type {!Menu|null} */\n (document.querySelector(subMenuId));\n if (subMenu) {\n subMenu.hide();\n }\n menuItem.removeAttribute('sub-menu-shown');\n }\n });\n this.currentMenu = this;\n }", "function resize() {\n if ($window.width() < 600) {\n return $nav.addClass('mobile-nav');\n }\n\n $nav.removeClass('mobile-nav');\n }", "function remove(){\n let nav = document.querySelector(\".navvv\");\n if(nav.classList.contains(\"change\")){\n nav.classList.remove(\"change\");\n //remove burger-menu toggle\n document.querySelector(\"#line-1\").classList.remove(\"change1\");\n document.querySelector(\"#line-2\").classList.remove(\"change2\");\n document.querySelector(\"#line-3\").classList.remove(\"change3\");\n //paragrafo display none\n document.querySelector(\".paragrafo p\").classList.toggle(\"changep\"); \n }\n}", "_submenuCloseAll () {\n window.removeEventListener(\"resize\", this.resizeEventSubmenuOpen, { passive: true });\n this.submenus.forEach(submenu => submenu.classList.remove(\"submenu-open\"));\n this.submenuOpen = false;\n }", "function clearMenu () {\n let menuClosed = false;\n\n if (myRBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRBkmkMenuStyle.visibility = \"hidden\";\n\tmyRBkmkMenu_open = false;\n }\n else if (myRShowBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRShowBkmkMenuStyle.visibility = \"hidden\";\n\tmyRShowBkmkMenu_open = false;\n }\n else if (myRFldrMenu_open) {\n\tmenuClosed = true;\n\tMyRFldrMenuStyle.visibility = \"hidden\";\n\tmyRFldrMenu_open = false;\n }\n else if (myRMultMenu_open) {\n\tmenuClosed = true;\n\tMyRMultMenuStyle.visibility = \"hidden\";\n\tmyRMultMenu_open = false;\n }\n else if (myBBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBBkmkMenuStyle.visibility = \"hidden\";\n\tmyBBkmkMenu_open = false;\n }\n else if (myBResBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBResBkmkMenuStyle.visibility = \"hidden\";\n\tmyBResBkmkMenu_open = false;\n }\n else if (myBFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBFldrMenuStyle.visibility = \"hidden\";\n\tmyBFldrMenu_open = false;\n }\n else if (myBResFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBResFldrMenuStyle.visibility = \"hidden\";\n\tmyBResFldrMenu_open = false;\n }\n else if (myBSepMenu_open) {\n\tmenuClosed = true;\n\tMyBSepMenuStyle.visibility = \"hidden\";\n\tmyBSepMenu_open = false;\n }\n else if (myBMultMenu_open) {\n\tmenuClosed = true;\n\tMyBMultMenuStyle.visibility = \"hidden\";\n\tmyBMultMenu_open = false;\n }\n else if (myBProtMenu_open) {\n\tmenuClosed = true;\n\tMyBProtMenuStyle.visibility = \"hidden\";\n\tmyBProtMenu_open = false;\n }\n else if (myBProtFMenu_open) {\n\tmenuClosed = true;\n\tMyBProtFMenuStyle.visibility = \"hidden\";\n\tmyBProtFMenu_open = false;\n }\n else if (myMGlassMenu_open) {\n\tmenuClosed = true;\n\tMyMGlassMenuStyle.visibility = \"hidden\";\n\tmyMGlassMenu_open = false;\n }\n\n myMenu_open = isResultMenu = false;\n return(menuClosed);\n}", "function circloidResizeItems(){\n\t$(window).resize(function() {\n\t\tif(this.resizeTO) clearTimeout(this.resizeTO);\n\t\tthis.resizeTO = setTimeout(function() {\n\t\t\t$(this).trigger('resizeEnd');\n\t\t}, 500);\n\t});\n\n\t$(window).bind('resizeEnd', function() {\n\t\t/* Make Left Menu scroll if menu is fixed */\n\t\tif($(\"#column-left\").hasClass(\"fixed\")){\n\t\t\t// Destroy old scrollbar\n\t\t\t$(\"#menu\").mCustomScrollbar(\"destroy\");\n\n\t\t\t// Reset height of the Left Column\n\t\t\tvar windowHeight = $(window).height();\n\t\t\tvar headerHeight = $(\".header-bar\").height();\n\n\t\t\t// Set Height of the Left Column\n\t\t\t$(\"#menu\").height(windowHeight - headerHeight);\n\n\t\t\t// Create new scrollbar\n\t\t\t$(\"#menu\").mCustomScrollbar({\n\t\t\t\tautoHideScrollbar:true,\n\t\t\t\tscrollbarPosition: \"outside\",\n\t\t\t\ttheme:\"dark\"\n\t\t\t});\n\t\t}\n\n\n\t\t/* Adjust body if header is fixed */\n\t\tif($(\".header-bar\").hasClass(\"navbar-fixed-top\")){\n\t\t\tvar headerHeight = $(\".header-bar\").height();\n\t\t\t$(\"body\").css({\"padding-top\":headerHeight + \"px\"});\n\t\t}\n\n\t\t/* Return Notification alert area back to default state. */\n\t\t$(\".header-info\").removeClass(\"list-open\");\n\t\t$(\".header-profile\").removeClass(\"fade-out-item\").removeClass(\"hide-item\");\n\t\t$(\".navbar-toggle\").removeClass(\"fade-out-item\").removeClass(\"hide-item\");\n\t\t$(\".header-search\").removeClass(\"fade-out-item\").removeClass(\"hide-item\");\n\t\t$(\".header-language\").removeClass(\"fade-out-item\").removeClass(\"hide-item\");\n\t\t$(\"#header-container .header-bar .logo\").removeClass(\"fade-out-item\").removeClass(\"hide-item\");\n\t\t$(\"#header > .nav > li.dropdown.notifications-alert-mobile\").siblings(\"li.dropdown\").removeClass(\"show-item\");\n\t});\n}", "function itinFromHere(){\n\tremoveContextualMenu()\n}", "function onResizeARIA() {\n\t\tif ( 643 > _window.width() ) {\n\t\t\tbutton.attr( 'aria-expanded', 'false' );\n\t\t\tmenu.attr( 'aria-expanded', 'false' );\n\t\t\tbutton.attr( 'aria-controls', 'primary-menu' );\n\t\t} else {\n\t\t\tbutton.removeAttr( 'aria-expanded' );\n\t\t\tmenu.removeAttr( 'aria-expanded' );\n\t\t\tbutton.removeAttr( 'aria-controls' );\n\t\t}\n\t}", "function removeMenuOpenClass(){\n\tremoveClass(html, 'mobileMenuOpen');\n\taddClass(html, 'mobileMenuClosed');\n navClasses();//check if we need to put back 'desktopMenu' or 'mobileMenu'\n menuHeight();\n}", "_moveDropDownsToMenu() {\n const that = this;\n\n for (let i = 0; i < that._containersInBody.length; i++) {\n const container = that._containersInBody[i];\n\n container.$.unlisten('click');\n container.$.unlisten('mouseleave');\n container.$.unlisten('mouseout');\n container.$.unlisten('mouseover');\n\n container.style.left = '';\n container.style.right = '';\n container.style.top = '';\n container.style.marginLeft = '';\n container.style.marginTop = '';\n\n container.menuItemsGroup.appendChild(container);\n }\n\n for (let i = 0; i < that._containers.length; i++) {\n const container = that._containers[i];\n\n if (that.theme !== '') {\n container.classList.remove(that.theme);\n }\n\n container.classList.remove('jqx-drop-down-repositioned');\n container.removeAttribute('mode');\n container.removeAttribute('drop-down-position');\n container.removeAttribute('checkboxes');\n }\n }", "detached() {\n const that = this;\n\n super.detached();\n\n if (that._element === 'tree' || JQX.ListMenu && that instanceof JQX.ListMenu) {\n return;\n }\n\n that._close();\n\n if (that.dropDownAppendTo !== null) {\n if (that._minimized) {\n that._dropDownParent.removeChild(that.$.mainContainer);\n }\n else {\n that._removeContainersInBody();\n }\n }\n }", "function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}", "function stopResizingSidebar() {\n window.removeEventListener('mousemove', resizeSidebar);\n window.removeEventListener('mouseup', stopResizingSidebar);\n }", "function navbar_leave() {\n var $activeNavItem_width = $('.js-main-nav__item.is-active').width();\n var $activeNavItem_left = $('.js-main-nav__item.is-active').position().left;\n\n navBarAni($activeNavItem_width, $activeNavItem_left, 400);\n\n $(window).on('load resize', navbar_leave);\n }", "function fixSubMenu(){\n\nj$('nav > .sf-js-enabled > li:not(.rd_megamenu)').mouseover(function(){\n\nvar wapoMainWindowWidth = j$(window).width();\n // checks if third level menu exist\n var subMenuExist = j$(this).children('.sub-menu').length;\n if( subMenuExist > 0){\n var subMenuWidth = j$(this).children('.sub-menu').width();\n var subMenuOffset = j$(this).children('.sub-menu').parent().offset().left + subMenuWidth;\n\n // if sub menu is off screen, give new position\n if((subMenuOffset + subMenuWidth) > wapoMainWindowWidth){\n var newSubMenuPosition = subMenuWidth ;\n\t\t\t j$(this).addClass('left_side_menu');\n\n }else{\n\t\t\t var newSubMenuPosition = subMenuWidth ;\n\n\t\t\t j$(this).removeClass('left_side_menu');\n\t\t}\n }\n });\n}", "function resetContentResize() {\n $(window).off(\"resize\", contentResize);\n $(\"#music-content\").removeAttr(\"style\");\n }", "function unbindEvents(destroy) {\n\t\t\t$el.off('.menu');\n\n\t\t\tif (destroy) {\n\t\t\t\t$el.off('menu:show menu:hide');\n\t\t\t\t$list.off('.menu');\n\t\t\t}\n\t\t}", "function expandMainNavi() {\n\t$('header').removeClass('reduced');\n\t$('nav').removeClass('reduced');\n\n\t/* menu.js */\n\tsetMenuPosition();\n}", "function trx_addons_woocommerce_resize_actions() {\n \"use strict\";\n var cat_menu = jQuery('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');\n var sb = cat_menu.parents('.widget_area');\n if (sb.length > 0 && cat_menu.length > 0) {\n if (sb.width() == sb.parents('.content_wrap').width()) {\n if (cat_menu.hasClass('inited')) {\n cat_menu.removeClass('inited').addClass('plain').superfish('destroy');\n cat_menu.find('ul.animated').removeClass('animated').addClass('no_animated');\n }\n } else {\n if (!cat_menu.hasClass('inited')) {\n cat_menu.removeClass('plain').addClass('inited');\n cat_menu.find('ul.no_animated').removeClass('no_animated').addClass('animated');\n basekit_init_sfmenu('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');\n }\n }\n }\n }", "function closeNav() {\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '20px');\n $('#nav-list li').addClass('treelisthidden');\n storage.removeItem(treesettings);\n $('#sideNavigation').css('display', 'none');\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('#sidefoot').css('margin-left', '-250px');\n $('body.support_kb').find('.cover').css('display', 'block');\n //$('body.support_kb').find('#sideNavigation').css('margin-left','0');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '-250px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('#side-toggle').attr('class', 'fa fa-angle-double-right');\n $(\"#sidefoot\").css(\"width\", \"50px\");\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"disable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n }", "function resetMobileStyles() {\n var sidebar = $('.sidebar-offcanvas');\n var primary = $('#primary');\n var colophon = $('#colophon');\n var subMenu = $('.megamenu-sub.active');\n\n primary.removeClass('disabledMenu');\n primary.off();\n\n colophon.removeClass('disabledMenu');\n colophon.off();\n\n sidebar.removeAttr(\"style\");\n sidebar.removeClass('active').addClass('inactive');\n sidebar.off();\n\n subMenu.removeAttr('style');\n subMenu.removeClass('active');\n subMenu.off();\n \n }", "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "function collapseMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"\");\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"\");\n }\n pinIcon.css(\"opacity\", 0);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"0\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".subnav\").stop().hide();\n $(\".state-indicator\").removeClass('fa-caret-up').addClass('fa-caret-down');\n }", "function refreshMenu(clicked) {\n\t\t$('body > .container .nav').children().each(function(i, obj) {\n\t\t\tobj = $(obj);\n\t\t\tif (obj.hasClass('active')) {\n\t\t\t\tobj.removeClass('active');\n\t\t\t}\n\t\t});\n\n\t\tclicked.addClass('active');\n\n\t\tfor (var i = 0; i < experienceCards.length; i++) {\n\t\t\tif (!experienceCards[i].hasClass('hide')) {\n\t\t\t\texperienceCards[i].addClass('hide');\n\t\t\t}\n\t\t}\n\n\t\trefreshDisplay();\n\t}", "function removeInvisibility() {\r\n const menuElement = document.querySelector(\".main-menu\");\r\n menuElement.style.display = \"flex\";\r\n}", "function onResizeARIA() {\n\t\tif ( window.innerWidth < 910 ) {\n\t\t\tif ( menuToggle.hasClass( 'toggled-on' ) ) {\n\t\t\t\tmenuToggle.attr( 'aria-expanded', 'true' );\n\t\t\t} else {\n\t\t\t\tmenuToggle.attr( 'aria-expanded', 'false' );\n\t\t\t}\n\n\t\t\tif ( siteHeaderMenu.hasClass( 'toggled-on' ) ) {\n\t\t\t\tsiteNavigation.attr( 'aria-expanded', 'true' );\n\t\t\t\tsocialNavigation.attr( 'aria-expanded', 'true' );\n\t\t\t} else {\n\t\t\t\tsiteNavigation.attr( 'aria-expanded', 'false' );\n\t\t\t\tsocialNavigation.attr( 'aria-expanded', 'false' );\n\t\t\t}\n\n\t\t\tmenuToggle.attr( 'aria-controls', 'site-navigation social-navigation' );\n\t\t} else {\n\t\t\tmenuToggle.removeAttr( 'aria-expanded' );\n\t\t\tsiteNavigation.removeAttr( 'aria-expanded' );\n\t\t\tsocialNavigation.removeAttr( 'aria-expanded' );\n\t\t\tmenuToggle.removeAttr( 'aria-controls' );\n\t\t}\n\t}", "function destroyStructure(){\n $('html,body').css({\n 'overflow' : 'visible',\n 'height' : 'initial'\n });\n\n $('#pp-nav').remove();\n\n //removing inline styles\n $('.pp-section').css({\n 'height': '',\n 'background-color' : '',\n 'padding': '',\n 'z-index': 'auto'\n });\n\n container.css({\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n //removing added classes\n $('.pp-section').each(function(){\n $(this).removeData('index').removeAttr('style')\n .removeData('index').removeAttr('data-index')\n .removeData('anchor').removeAttr('data-anchor')\n .removeClass('pp-table active pp-easing pp-section');\n });\n\n if(options.menu){\n $(options.menu).find('[data-menuanchor]').removeClass('active');\n $(options.menu).find('[data-menuanchor]').removeData('menuanchor');\n }\n\n //removing previous anchor classes\n $('body')[0].className = $('body')[0].className.replace(/\\b\\s?pp-viewing-[^\\s]+\\b/g, '');\n\n //Unwrapping content\n container.find('.pp-tableCell').each(function(){\n //unwrap not being use in case there's no child element inside and its just text\n $(this).replaceWith(this.childNodes);\n });\n }" ]
[ "0.66702044", "0.66484255", "0.6647768", "0.66096056", "0.66072303", "0.6554772", "0.65308267", "0.6492136", "0.6454294", "0.6343421", "0.6317668", "0.630887", "0.6273935", "0.6241688", "0.6180856", "0.6145567", "0.6072706", "0.6031134", "0.6022506", "0.6005267", "0.6003781", "0.5987035", "0.598432", "0.598432", "0.5978", "0.59554946", "0.59503853", "0.5949357", "0.5946558", "0.5931892", "0.5915179", "0.59075916", "0.59065914", "0.59030235", "0.5902639", "0.5899318", "0.58933866", "0.58848614", "0.58710426", "0.58706474", "0.5868826", "0.5865959", "0.5865959", "0.5865959", "0.5853927", "0.58538884", "0.58515483", "0.5846175", "0.5846175", "0.5845831", "0.5833073", "0.58201927", "0.57996523", "0.579955", "0.5786108", "0.5784776", "0.5781602", "0.57675374", "0.57656914", "0.57613885", "0.57516754", "0.57444483", "0.5743409", "0.5740233", "0.57337326", "0.5732505", "0.57308125", "0.572775", "0.5703343", "0.5701718", "0.5700264", "0.56995887", "0.56977683", "0.5692326", "0.5691178", "0.56898683", "0.5684436", "0.5682522", "0.56774956", "0.56773543", "0.56757194", "0.5669231", "0.5668983", "0.5666321", "0.56654143", "0.5646354", "0.5645848", "0.56098795", "0.56002957", "0.5591045", "0.55829805", "0.55803686", "0.5575624", "0.5574893", "0.5574813", "0.55723655", "0.5569198", "0.5565546", "0.55654585", "0.55620515" ]
0.7978572
0
Sets menu to left side
function setMenuLeft() { removeMenuChanges(); $('.menu').addClass('menu-left'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth() > $window.width()) {\r\n\t\t\t\t\t$(this).addClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').addClass('on-left-side');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').removeClass('on-left-side');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t}", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "static setLeft(html) {\n console.log(\"set left nav called\")\n $('#left').html(html);\n }", "function leftNav() {\n\tapp.getView().render('content/folder/customerserviceaboutusleftnav');\n}", "function left() {\n\t\t\tvar parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(-1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (focusedControl.parent().submenu) {\n\t\t\t\tcancel();\n\t\t\t} else {\n\t\t\t\tmoveFocus(-1);\n\t\t\t}\n\t\t}", "function left() {\n\t\t\tvar parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(-1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (focusedControl.parent().submenu) {\n\t\t\t\tcancel();\n\t\t\t} else {\n\t\t\t\tmoveFocus(-1);\n\t\t\t}\n\t\t}", "function left() {\n\t\t\tvar parentRole = getParentRole();\n\n\t\t\tif (parentRole == \"tablist\") {\n\t\t\t\tmoveFocus(-1, getFocusElements(focusedElement.parentNode));\n\t\t\t} else if (focusedControl.parent().submenu) {\n\t\t\t\tcancel();\n\t\t\t} else {\n\t\t\t\tmoveFocus(-1);\n\t\t\t}\n\t\t}", "function LeftMenu(props) {\n return (\n <Menu mode={props.mode} style={{ padding: \"0 20px\",\n backgroundColor:\" rgba( 255, 255, 0.0, 0.0 )\"}}>\n <Menu.Item key=\"introduce\">\n <a\n href=\"https://github.com/solone313/nomadbook\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n 소개\n </a>\n </Menu.Item>\n <Menu.Item key=\"subscription\">\n <a href=\"/subscription\">내 구독</a>\n </Menu.Item>\n </Menu>\n );\n}", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function menuPosition() {\n\t\t\torg_menu_offset = $('#org-menu-toggle').position().left + ($('#org-menu-toggle').width() / 2) - 120; // 120 is half of the menu width of 240px\n\t\t\t$('#org-menu-toggle').next('ul').css('left',org_menu_offset+'px');\n\t\t}", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function withLeftMenuItems(f) {\n withId('top-menu', (topItems) => {\n const favoritesPanel =\n withId('left-menu-favorites-panel', (panel) => { return panel; });\n const projectsPanel =\n withId('left-menu-projects-panel', (panel) => { return panel; });\n withLeftMenuItemLinks([topItems, favoritesPanel, projectsPanel], f);\n });\n }", "function toggleMenusList() {\n $mdSidenav('left').toggle();\n }", "function setMenuPosition() {\n // console.log('setMenuPosition');\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n\n if (PageData.MenuOpen) {\n menuGrip.title = 'Close menu';\n menuGrip.src = '/media/close.svg';\n menuPanel.style.right = 0;\n } else {\n menuGrip.title = 'Open menu';\n menuGrip.src = '/media/open.svg';\n menuPanel.style.right = -PageData.MenuOffset + 'px';\n }\n}", "function panelMenuLeftOpened() {\n\tif (window.localStorage.getItem(\"pageNaveType\") === \"menu\") {\n\t\t$(\"#headerTitle\" + window.localStorage.getItem(\"divIdGlobal\")).attr(\"src\", \"./images/icons/ic_launcher_full_menu_opened.png\");\n\t}\n}", "function toggleMenu() {\n open = !open;\n let bars = this.children[0];\n if(open) {\n bars.style.color = '#ffffff';\n selectors.sideMenu.style.left = 0;\n } else {\n bars.style.color = '#000000';\n selectors.sideMenu.style.left = -400 + 'px';\n }\n}", "function setMenu() {\n\n\t\tvar w = parseInt($(\"nav\").css(\"width\"), 10);\n\n\t\tif (w < 1200) {\n\n\t\t\tif ($(\"#navigator2\").is(':empty')) {\n\t\t\t\t$(\"#navigator2\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#miniNavigator\").show();\n\t\t\t\t$(\"#miniNavigator\").effect(\"highlight\", { color: 'green' }, 500);\n\t\t\t\t$(\"#navigator2\").hide();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$(\"#navigator\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#miniNavigator\").hide();\n\t\t\t}\n\t}", "function showLeftFunction() {\n if(hasClass(menuLeft, \"mob-menu-open\")) {\n menuLeft.className = \"mob-menu\";\n } else {\n menuLeft.className += \" mob-menu-open\";\n }\n}", "function prevLeftMenuItem() {\n withLeftMenuItems((menuItems, current) => {\n // If on the first item, or no item, select the last item.\n if (current <= 0) {\n menuItems[menuItems.length - 1].click();\n // Otherwise, select the previous item.\n } else {\n menuItems[current - 1].click();\n }\n });\n }", "function openNav() {\ndocument.getElementById(\"sidenav\").style.left = \"0\";\n}", "function showMenu(){\n navLinks.style.right = \"0\";\n}", "function leftPageMenu() {\n \"use strict\";\n jQuery(\"#secondary .widget_pages ul\").addClass('page-list');\n jQuery(\"#secondary .widget_pages ul.page-list\").treeview({\n animated: \"slow\",\n collapsed: true,\n unique: true\n });\n}", "function setCurrentMenu(menu) {\n menuCurrent = menu;\n }", "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "function leftMenuClick() {\r\n\t// 左边菜单添加click事件及样式\r\n\t$(\"#cntLeft .nav\").find(\"a\").bind('click', function() {\r\n\t\t$(\"#cntLeft .nav\").find(\"li\").removeClass(\"lon\");\r\n\t\t$(\"#cntLeft .nav\").find(\"a\").removeClass(\"on\");\r\n\t\t$(\"#cntLeft .nav\").find(\"i\").each(function() {\r\n\r\n\t\t\tvar i_class = $(this).attr(\"class\");\r\n\t\t\tvar i_on_class = \"on\" + $.trim(i_class).substring(\"i\");\r\n\t\t\t$(this).removeClass(i_on_class);\r\n\t\t});\r\n\t\t$(this).addClass(\"on\");\r\n\t\t$(this).parent().addClass(\"lon\");\r\n\t\tvar i_class = $(this).find(\"i\").attr(\"class\");\r\n\t\tvar i_on_num = $.trim(i_class).substring(1);\r\n\t\t$(this).find(\"i\").addClass(\"on\" + i_on_num);\r\n\t\t// 添加右边菜单\r\n\t\taddRightMenu(i_on_num);\r\n\t\t// 添加导航\r\n\t\tvar cntLeftText = $(this).text();\r\n\t\t$('#cTnav').html('<a href=\"javascript:void(0);\">' + cntLeftText + '</a>');\r\n\t\tcRTnavBindClick();\r\n\t});\r\n\tinitMenu();\r\n}", "function setLeftPosition() {\n let leftPercentage = (-(initialSlideLengthQS - 1) * 100);\n initialLeftPercentage = leftPercentage;\n leftPercentage += '%';\n if ($(window).outerWidth() < 768) {\n $(sliderWrapperQS).css('left', leftPercentage);\n } else {\n // leftPercentage = (-(slides.length - 2) * ($(sliderWrapperQS + ' .slide').outerWidth() + tabMargin));\n // leftPercentage = 0;\n leftPercentage = -($(sliderWrapperQS + ' .slide').outerWidth() + tabMargin);\n initialLeftPercentage = leftPercentage;\n leftPercentage += 'px';\n $('#quickSwap .tabs-wrapper').css('left', leftPercentage);\n $('#quickSwap .slider-wrapper').css('left', '0%');\n }\n }", "changeLeftSidenavView(view) {\n this._chatService.onLeftSidenavViewChanged.next(view);\n }", "function setMenu() {\n if (menuOpen) {\n menu.classList.remove('-translate-x-full');\n } else {\n menu.classList.add('-translate-x-full');\n }\n}", "left() {\n switch (this.f) {\n case NORTH:\n this.f = WEST;\n break;\n case SOUTH:\n this.f = EAST;\n break;\n case EAST:\n this.f = NORTH;\n break;\n case WEST:\n default:\n this.f = SOUTH;\n }\n }", "function addLeftMenu(name, link, iscurrent)\n{\n\tvar style_current = 'background:url(theme/' + env['sys.theme'] + '/images/main_25.gif)';\n\tvar style_static = 'background:url(theme/' + env['sys.theme'] + '/images/main_36.gif)';\n\t\n\tvar h = '';\n\n\th += '\t <tr>';\n\th += '\t\t\t\t\t<td height=\"22\" style=\"' + (iscurrent ? style_current : style_static) + '\"> ';\n\th += '\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">';\n\th += '\t \t\t\t<tr>';\n\th += '\t \t\t <td width=\"13%\">&nbsp;</td>\t\t';\n\th += '\t \t\t\t <td width=\"72%\" height=\"20\"><div align=\"center\">\t\t';\n\th += '\t \t\t<table width=\"78%\" height=\"21px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';\n\th += '\t \t\t<tr>';\n\th += '\t \t\t <td><div align=\"center\"></div></td>';\n\th += '\t \t\t\t <td valign=\"middle\"><div align=\"center\"><a class=\"leftmenu\" href=\"' + link + '\"/>' + name + '</a></div></td>';\n\th += '\t \t</tr>';\n\th += '\t \t\t </table>';\n\th += '\t \t</div></td>';\n\th += '\t <td width=\"15%\">&nbsp;</td>';\n\th += '\t </tr>';\n\th += '\t </table></td>';\n\th += '\t </tr>\t\t';\n\treturn h;\n}", "toggleMenu() {\n var menuBar = document.querySelector('.side-menu');\n var mapWidth = document.querySelector('#map');\n if(menuBar.style.left !== \"-100%\") {\n menuBar.style.left = \"-100%\";\n mapWidth.style.left = \"0\";\n } else {\n menuBar.style.left = \"0\";\n mapWidth.style.left = \"268px\";\n }\n }", "function editor_tools_handle_left() {\n editor_tools_add_tags('[left]', '[/left]');\n editor_tools_focus_textarea();\n}", "function LeftMenu(props) {\n return (\n <Menu mode={props.mode}>\n <Menu.Item key=\"home\">\n <a href=\"/\">모아보기</a>\n </Menu.Item>\n <SubMenu key=\"category\" title=\"SNS 카테고리\">\n <Menu.Item key=\"blog\">\n <a href=\"/blog\">\n <BoldOutlined />\n 네이버 블로그\n </a>\n </Menu.Item>\n <Menu.Item key=\"instagram\">\n <a href=\"/instagram\">\n <InstagramOutlined />\n 인스타그램\n </a>\n </Menu.Item>\n <Menu.Item key=\"facebook\">\n <a href=\"/facebook\">\n <FacebookOutlined />\n 페이스북\n </a>\n </Menu.Item>\n <Menu.Item key=\"youtube\">\n <a href=\"/youtube\">\n <YoutubeOutlined />\n 유튜브\n </a>\n </Menu.Item>\n <Menu.Item key=\"clubhouse\">\n <a href=\"/clubhouse\">\n <BankOutlined />\n 클럽하우스\n </a>\n </Menu.Item>\n </SubMenu>\n <Menu.Item key=\"upload\">\n <a href=\"/article/upload\">게시물 등록</a>\n </Menu.Item>\n <Menu.Item key=\"manage\">\n <a href=\"/article/manage\">게시물 관리</a>\n </Menu.Item>\n <Menu.Item key=\"charge\">\n <a href=\"/charge\">충전하기</a>\n </Menu.Item>\n <Menu.Item key=\"setting\">\n <a href=\"/setting\">공지사항</a>\n </Menu.Item>\n </Menu>\n );\n}", "function leftmenu_switchchange() {\n if ($('body').hasClass('sidebar-collapsed')) {\n $('input[name=\"demo-collapseleftbar\"]').bootstrapSwitch('state', true, true);\n collapseNav = \"sidebar-collapsed\";\n Submit_data('changeCollapseNav',collapseNav);\n } else {\n collapseNav = \"\";\n Submit_data('changeCollapseNav',collapseNav);\n $('input[name=\"demo-collapseleftbar\"]').bootstrapSwitch('state', false, true);\n }\n }", "function setMenuRight() {\n removeMenuChanges();\n $('.menu').addClass('menu-right');\n $('.window').addClass('window-menu-right');\n }", "function openNav() {\n closeRightNav();\n document.getElementById(\"mySidenav\").style.width = \"550px\";\n document.getElementById(\"mySidenav\").style.left = \"0\";\n}", "function leftmenu_switchchange() {\n\t\t\tif ($('body').hasClass('sidebar-collapsed')) {\n\t\t \t$('input[name=\"demo-collapseleftbar\"]').bootstrapSwitch('state', true, true);\n\t\t } else {\n\t\t \t$('input[name=\"demo-collapseleftbar\"]').bootstrapSwitch('state', false, true);\n\t\t }\n\t\t}", "function showLeft() {\n\n document.querySelector('.frame').classList.remove('right');\n document.querySelector('.frame').classList.add('left');\n }", "get leftCollapsed() {\n return !this._leftHandler.sideBar.currentTitle;\n }", "function toggleMenu()\n{\n\t// Get the left panel\n\tvar menu = document.getElementById(\"mobile-menu\");\n\t\n\t// If the panel is visible (displayed), remove it\n\tif(menu.style.display == \"block\")\n\t{\n\t\tmenu.style.display = \"none\";\n\t}\n\t\n\t// If the panel is not displayed, display it\n\telse\n\t{\n\t\tmenu.style.display = \"block\";\n\t\tmenu.style.width = \"100%\";\n\t\t\n\t\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n\t}\n}", "function toggleNav() {\n $('#show-menu').toggleClass(\"is-active\");\n if ($('#site').css('margin-left') == '-300px') {\n $('#site').css('margin-left', '0');\n } else {\n $('#site').css('margin-left', '-300px');\n }\n}", "function updateTopMenu(){\n\t\t\t\t$('.date-menu li.current').removeClass('current');\n\t\t\t\tvar page = myScroll.currPageX;\n\t\t\t\tvar pos = $datemenu.find('li')\n\t\t\t\t\t.eq(page)\n\t\t\t\t\t.addClass('current')\n\t\t\t\t\t.position()\n\t\t\t\t\t.left;\n\n\t\t\t\t//TODO:put the right number to be always on the left\n\t\t\t\tpos-=100; //I want the menu to be on the left\n\t\t\t\tpos = pos>0? pos : 0;\n\t\t\t\t$datemenu.css('left',pos * -1);\n\t\t\t}", "function leftToRight() {\n _displaymode |= LCD_ENTRYLEFT;\n command(LCD_ENTRYMODESET | _displaymode);\n}", "function menuSet(self){\n\t\tvar browserWidth = window.innerWidth;\n\t\tvar heightMenu = window.innerHeight - document.querySelector(\".main-menu\").getBoundingClientRect().bottom + \"px\";\n\t\tvar menuPosition = document.querySelector(\".main-menu\").getBoundingClientRect().bottom;\n\n\t\tif (browserWidth < 800 ) {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": heightMenu,\n\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\"top\": menuPosition +\"px\"\n\t\t\t});\n\n\t\t} else {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": \"\",\n\t\t\t\t\"top\": \"\",\n\t\t\t\t\"position\": \"\"\n\t\t\t});\n\t\t}\n\n\t}", "collapseLeft() {\n this._leftHandler.collapse();\n this._onLayoutModified();\n }", "function sideMenu(){\n\t// SHOW THE MENU WHEN THE USER HOVERS OVER TO THE RIGHT OF THE WINDOW\n\t$('.menu-hover').mouseenter(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n\t\t\n\t// HIDE THE MENU WHEN THE USER LEAVES THE SIDEBAR\n\t$('.side-menu').mouseleave(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n}", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "function toggleLeftMenu()\n{\n // Get ID of the left menu\n // ---------------------------------------------------------------------------\n var menu_Left = document.getElementById(\"leftMenu\");\n\n // Show / hide the left menu\n // ---------------------------------------------------------------------------\n if (menu_Left.style.opacity == \"0\")\n {\n $(function()\n {\n $(\"#leftMenu\").animate({width: '170px', opacity: 1.0}, 200);\n $(\"#content\").animate({width: '73%', marginLeft: '210px'}, 200);\n });\n }\n else\n {\n $(function()\n {\n $(\"#leftMenu\").animate({width: '0px', opacity: 0.0}, 200);\n $(\"#content\").animate({width: '87%', marginLeft: '27px'}, 200);\n });\n }\n}", "function openNav() {\n document.getElementById(\"menubar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "function newPageLeft(newPage){\n\t\t newPageSides(newPage, false);\n\t\t}", "function slideLeftForMobile() {\n\t\tsliderContainer = \".mobile-menu-width\";\n\t\tremLength =\n\t\t\t$(sliderContainer)[0].scrollWidth - $(sliderContainer).width();\n\t\tscrollable = remLength - $(sliderContainer).scrollLeft();\n\t\t$(sliderContainer).animate(\n\t\t\t{\n\t\t\t\tscrollLeft: remLength,\n\t\t\t},\n\t\t\tspeed\n\t\t);\n\t}", "function scrollMenuLeft() {\n var items = document.getElementsByClassName(\"menuItem\");\n var i;\n for (i = 0; i < items.length; ++i) {\n var cpprp = window.getComputedStyle(items[i], null).getPropertyValue(\"display\");\n if (cpprp != \"none\") {\n items[i].style.display = \"none\";\n break;\n }\n }\n}", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "expandLeft() {\n this._leftHandler.expand();\n this._onLayoutModified();\n }", "function panelMenuLeftClosed() {\n\tif (window.localStorage.getItem(\"pageNaveType\") === \"menu\") {\n\t\t$(\"#headerTitle\" + window.localStorage.getItem(\"divIdGlobal\")).attr(\"src\", \"./images/icons/ic_launcher_full_menu.png\");\n\t}\n}", "function scrollLeft() {\n SidebarActions.scrollLeft()\n}", "showLeft() {\n this.setState({ activeFoot: 'left' });\n cadManager.setCurrentFoot(\"left\");\n this.forceUpdate();\n }", "function goLeft() {\n leftMargin = $(\".inner-liner\").css(\"margin-left\").replace(\"px\", \"\") * 1;\n newLeftMargin = (leftMargin + 650);\n $(\".inner-liner\").animate({ marginLeft: newLeftMargin }, 500);\n }", "_initMenu() {\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\n this.menu.direction = this.dir;\n this._setMenuElevation();\n this._setIsMenuOpen(true);\n this.menu.focusFirstItem(this._openedBy || 'program');\n }", "function openNav() {\n title.animate({\n left: \"+=250\"\n }, 0.3, \"linear\")\n // else title.css(\"left\", \"-=250\")\n sidebar.addClass(\"displaySidebar\")\n main.addClass(\"mainSidebar\")\n }", "function leftSelect() {\n vm.selectedIndex = (vm.selectedIndex - 1) % vm.duplexOptionsArray.length;\n if (-1 === vm.selectedIndex) {\n vm.selectedIndex = vm.duplexOptionsArray.length - 1;\n }\n updateSeletecItem();\n vm.trigger({'itemClass': vm.optionKeys[0], 'selectedItem': vm.duplexOptionsArray[vm.selectedIndex]});\n }", "setLeft(newLeft) {\n this.#leftChild = newLeft;\n }", "addLeftBar() {\n \n this.page.addBar(\"fixed\", 40, \"leftbar-menu\");\n this.page.addBar(\"splitter\", 300, \"leftbar\");\n }", "goLeft(data = {}){\n data.cameFrom = \"left\";\n this.launchSceneAt(\n this.activeScene.coordinate.x - 1, \n this.activeScene.coordinate.y,\n data\n );\n }", "toggleLeftBar() {\n this.openBar = !this.openBar;\n }", "function toggleSideMenu() {\n\t$( \".side-menu\" ).animate( {'width': 'toggle'});\n\tif ($('.side-menu').width()>1) {\n\t\t$( \".main-content\" ).animate( {'margin-left': '0'});\n\t}\n\telse {\n\t\t$( \".main-content\" ).animate( {'margin-left': '200px'});\n\t}\n}", "*directionHorizontalLeft() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 0 });\n }", "function navController(){\n if ( document.getElementById(\"mySidenav\").style.width == \"0px\" ){\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"250px\";\n }\n else {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"0px\";\n }\n }", "setLeft(_left) {\n this.left = _left;\n this.updateSecondaryValues();\n return this;\n }", "function menu(){\n\t\tvar menuCount = 1;\n\t\tvar menuTitle = ['.menu-title:nth-of-type(1)','.menu-title:nth-of-type(2)','.menu-title:nth-of-type(3)'];\n\t\tvar menuContent = ['.menu-content section:nth-of-type(1)','.menu-content section:nth-of-type(2)','.menu-content section:nth-of-type(3)'];\n\t\t$('#move-right').on('click', function(){\n\t\t\tif (menuCount <= 0) {\n\t\t\t\tmenuCount += 1;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount <= 2) {\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\tmenuCount += 1;\n\t\t\t\t\t}\n\t\t});\n\t\t$('#move-left').on('click', function(){\n\t\t\tif (menuCount >= 3) {\n\t\t\t\tmenuCount += -2;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount >= 1) {\n\t\t\t\t\t\tmenuCount += -1;\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t}\n\t\t});\n\t}", "function load_left_menu() {\n\tvar div = document.getElementById(\"left_menu\");\n\thr.open(\"POST\", \"/main/load_left_menu\", true);\n\thr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\thr.onreadystatechange = function() {\n\t\tif(hr.readyState == 4) {\n\t\t\tif(hr.status == 200) {\n\t\t\t\tdiv.innerHTML = hr.responseText;\n\t\t\t\t}\n\t\t\t}\n\t}\n\thr.send();\n}", "function setMenuActive() {\n $('.menu-li.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function moveLeft() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.left);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}", "function moveLeft() {\n $('._slider ul').animate({\n left: + slideWidth\n }, 200, function () {\n $('._slider ul li:last-child').prependTo('._slider ul');\n $('._slider ul').css('left', '');\n });\n }", "function menuToggler() {\r\n\t\tif ($('.mobile-menu-closer').length) {\r\n\t\t\t$('.mobile-menu-closer').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '-150%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tif ($('.mobile-menu-opener').length) {\r\n\t\t\t$('.mobile-menu-opener').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '0%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t}", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "function moveLeft() {\n moveOn();\n }", "function showIconLeftMenu(){\r\n var leftMenu=dojo.byId('ml-menu');\r\n var divMenuSearch=leftMenu.querySelector('.menu__searchMenuDiv ');\r\n var mode=dojo.byId('displayModeLeftMenu').value;\r\n display=(mode=='ICONTXT')?'none':'block';\r\n style=(mode=='ICONTXT')?\"float:left;max-width:180px;\":\"float:left;max-width:155px;\";\r\n style2=(mode=='ICONTXT')?\"float:left;max-width:200px;\":\"float:left;max-width:165px;\";\r\n leftMenu.menus = [].slice.call(leftMenu.querySelectorAll('.menu__level'));\r\n leftMenu.menus.forEach(function(menuEl, pos) {\r\n var items = menuEl.querySelectorAll('.menu__item');\r\n items.forEach(function(itemEl) {\r\n var iconDiv = itemEl.querySelector('.iconSize16');\r\n iconDiv.style.display=display;\r\n \r\n var posDiv = itemEl.querySelector('.divPosName');\r\n posDiv.style=(itemEl.querySelector('.menuPluginToInstlal'))?style2:style;\r\n });\r\n });\r\n if(dojo.byId('menuSearchDiv').value.trim()!=''){\r\n var menus=divMenuSearch.querySelectorAll('.menu__item');\r\n menus.forEach(function(menuCopyEl, pos) {\r\n var iconDivCopy = menuCopyEl.querySelector('.iconSize16');\r\n iconDivCopy.style.display=display;\r\n var posDivCopy = menuCopyEl.querySelector('.divPosName');\r\n posDivCopy.style=(menuCopyEl.querySelector('.menuPluginToInstlal'))?style2:style;\r\n });\r\n }\r\n\r\n if(dojo.byId('selectedViewMenu').value=='Parameter'){\r\n if(dojo.byId('parameterMenu')){\r\n var menuParam=dojo.byId('parameterMenu').querySelectorAll('.menu__item');\r\n menuParam.forEach(function(e){\r\n var icon=e.querySelector('.iconSize16');\r\n icon.style.display=display;\r\n });\r\n }\r\n }\r\n mode=(display=='block')?'ICONTXT':'TXT';\r\n dojo.setAttr('displayModeLeftMenu','value',mode);\r\n saveDataToSession('menuLeftDisplayMode',mode,true);\r\n}", "set LeftCenter(value) {}", "function moveLeft() {\n\n if (document.querySelector('.frame').classList.contains('right')) showMiddle();\n else showLeft();\n }", "function enableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" || typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"hidden\";\r\n\treturn 0;\r\n}", "function menuStuff() {\n if (toggle === 1) {\n menu.css('display', 'table');\n setTimeout(function() {\n // menu.css('opacity', 1);\n menu.stop().animate({opacity: 1}, 200);\n // menuLi.css('left', '0');\n menuLi.stop().animate({left: 0}, 200);\n toggle = 0;\n }, 100);\n }\n if (toggle === 0) {\n // menu.css('opacity', 0);\n menu.stop().animate({opacity: 0}, 200);\n // menuLi.css('left', '-40px');\n menuLi.stop().animate({left: '-40px'}, 200);\n setTimeout(function() {\n menu.css('display', 'none');\n }, 600);\n toggle = 1;\n }\n }", "function fireLeft(){\n\t\tconsole.log(\"firing\");\n\t\tdart1.style.left = \"-200px\";\n\t\tdart2.style.left = \"-400px\";\n\t\tdart3.style.left = \"-600px\";\n\t\tdart4.style.left = \"-550px\";\n\t}", "function toggleList() {\n $log.info(' NavbarController $mdSidenav=');\n $mdSidenav('left').toggle();\n }", "function onNavigateLeftClicked(event) {\n event.preventDefault();\n navigateLeft();\n }", "function onOpen() { CUSTOM_MENU.add(); }", "function nextLeftMenuItem() {\n withLeftMenuItems((menuItems, current) => {\n // If on the last item, or no item, select the first item.\n if (current >= menuItems.length - 1 || current < 0) {\n menuItems[0].click();\n // Otherwise, select the next item.\n } else {\n menuItems[current + 1].click();\n }\n });\n }", "function toggleLeft() {\n\tcontainer = calcContainer();\n\tcenter = calcCenter();\n\tleft = calcLeft();\n\tright = calcRight();\n\n\t$('#left').toggle(); // Toggle show/hide\n\tleftShow = !leftShow; // Toggle the boolean.\n\n\tmaximizeVideoPlayerResolution();\n\n\tif (leftShow && rightShow) {\n\t\tapplyResolutions();\n\t}\n}", "_handleLeft(){\n if(this._buttonIndex > 0){\n this._setIndex(this._buttonIndex - 1);\n }else{\n this._setIndex(this.buttons.length -1);\n }\n }", "function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }", "function StartMenu() {\n //this.menu = new Menu('start-menu');\n this.shutDownMenu = new Menu('shutdown-menu');\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\n Menu.apply(this, ['start-menu']);\n}", "function getLeftLocation(e) {\n var mouseWidth = e.pageX;\n var pageWidth = $(window).width();\n var menuWidth = $(settings.menuSelector).width();\n\n // opening menu would pass the side of the page\n if (mouseWidth + menuWidth > pageWidth &&\n menuWidth < mouseWidth) {\n return mouseWidth - menuWidth;\n }\n return mouseWidth;\n }", "function menu() {\n html.classList.toggle('menu-active');\n }", "function openMenuBar() {\n setOpen(!open)\n }", "function toggleNewsList() {\n $mdSidenav('left').toggle();\n }", "function onOpen() {\n createMenu();\n}", "_arrowLeftHandler(level, mode, focusedItem, lastOpenedContainer) {\n const that = this;\n\n if (level === 1) {\n if (mode === 'horizontal') {\n that._levelOneNavigate('_getLastEnabledChild', focusedItem, lastOpenedContainer);\n }\n }\n else if (level === 2) {\n that._levelOneNavigateFromLowerLevel('_getPreviousEnabledChild', focusedItem);\n }\n else {\n that._escapeHandler(focusedItem, level, lastOpenedContainer);\n }\n }" ]
[ "0.739949", "0.7246403", "0.7057252", "0.7042962", "0.695572", "0.695572", "0.695572", "0.6851523", "0.67294085", "0.6717853", "0.6677837", "0.66075015", "0.65854055", "0.6577361", "0.6538951", "0.6534131", "0.65103406", "0.6505403", "0.65028065", "0.64169276", "0.6393186", "0.6347102", "0.6330736", "0.6323146", "0.63071316", "0.6286124", "0.6235105", "0.62185514", "0.6192691", "0.61894", "0.6161797", "0.6157641", "0.6132266", "0.6123905", "0.611963", "0.6107727", "0.61062497", "0.6098612", "0.6082787", "0.60702825", "0.60649824", "0.60461617", "0.60449654", "0.6035757", "0.6030273", "0.6016994", "0.60167307", "0.6013934", "0.6001504", "0.599207", "0.5991783", "0.5990953", "0.5988522", "0.5988008", "0.59849864", "0.5978443", "0.597312", "0.5970298", "0.5969207", "0.5961133", "0.5954987", "0.5946889", "0.59450716", "0.593391", "0.59335285", "0.5933088", "0.5931885", "0.5924782", "0.5923788", "0.59203017", "0.591882", "0.5915762", "0.5907131", "0.5903662", "0.5902505", "0.5901822", "0.5900362", "0.5897536", "0.58905685", "0.588799", "0.5878649", "0.587415", "0.5873879", "0.58713686", "0.58617705", "0.58617234", "0.5851812", "0.5850133", "0.58392036", "0.58240324", "0.5822992", "0.5822622", "0.5822548", "0.58224463", "0.5819386", "0.58185494", "0.5818253", "0.58175707", "0.58158624", "0.58048445" ]
0.8560616
0
MENU BOTTOM Hides side menu
function hideSideMenu() { $('.menu').addClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}", "function disableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" && typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"visible\";\r\n\treturn 0;\r\n}", "function menuHide() {\n ui.languageContainer.removeClass('open');\n ui.appbarElement.removeClass('open');\n ui.mainMenuContainer.removeClass('open');\n ui.darkbgElement.removeClass('open');\n}", "HideMenus() {\n this.HideMenuSubs();\n this.HideMenusAuds();\n }", "function showHideVerticalMenu(){\n\n if($j('.vertical_menu_hidden').length) {\n var vertical_menu = $j('aside.vertical_menu_area');\n\t\tvar vertical_menu_bottom_logo = $j('.vertical_menu_area_bottom_logo');\n var hovered_flag = true;\n\n $j('.vertical_menu_hidden_button').on('click',function (e) {\n e.preventDefault();\n if(hovered_flag) {\n hovered_flag = false;\n current_scroll = $j(window).scrollTop(); //current scroll is defined in front of \"initSideMenu\" function\n vertical_menu.addClass('active');\n\t\t\t\t vertical_menu_bottom_logo.addClass('active');\n }else{\n hovered_flag = true;\n vertical_menu.removeClass('active');\n\t\t\t\t vertical_menu_bottom_logo.removeClass('active');\n }\n });\n\n $j(window).scroll(function() {\n if(Math.abs($scroll - current_scroll) > 400){\n hovered_flag = true;\n vertical_menu.removeClass('active');\n\t\t\t\tvertical_menu_bottom_logo.removeClass('active');\n }\n });\n\n //take click outside vertical left/rifgt area and close it\n (function() {\n var Outclick, outclick,\n _this = this;\n Outclick = (function() {\n Outclick.name = 'Outclick';\n function Outclick() {\n this.objects = [];\n }\n Outclick.prototype.check = function(element, event) {\n return !element.is(event.target) && element.has(event.target).length === 0;\n };\n Outclick.prototype.trigger = function(e) {\n var execute,\n _this = this;\n execute = false;\n return $j.each(this.objects, function(index, el) {\n if (_this.check(el.container, e)) {\n if (el.related.length < 1) {\n execute = true;\n } else {\n $j.each(el.related, function(index, relation) {\n if (_this.check(relation, e)) {\n return execute = true;\n } else {\n execute = false;\n return false;\n }\n });\n }\n if (execute) {\n return el.callback.call(el.container);\n }\n }\n });\n };\n return Outclick;\n })();\n outclick = new Outclick;\n $j.fn.outclick = function(options) {\n var _this = this;\n if (options == null) {\n options = {};\n }\n options.related || (options.related = []);\n options.callback || (options.callback = function() {\n return _this.hide();\n });\n return outclick.objects.push({\n container: this,\n related: options.related,\n callback: options.callback\n });\n };\n $j(document).mouseup(function(e) {\n return outclick.trigger(e);\n });\n }).call(this);\n $j(vertical_menu).outclick({\n callback: function() {\n hovered_flag = true;\n vertical_menu.removeClass('active');\n\t\t\t\tvertical_menu_bottom_logo.removeClass('active');\n }\n });\n }\n}", "function enableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" || typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"hidden\";\r\n\treturn 0;\r\n}", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function hiddenBarMenuConfig() {\n\t\tvar menuWrap = $('.hidden-bar .side-menu');\n\t\t// hidding submenu \n\t\tmenuWrap.find('.dropdown').children('ul').hide();\n\t\t// toggling child ul\n\t\tmenuWrap.find('li.dropdown > a').each(function () {\n\t\t\t$(this).on('click', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).parent('li.dropdown').children('ul').slideToggle();\n\t\n\t\t\t\t// adding class to item container\n\t\t\t\t$(this).parent().toggleClass('open');\n\t\n\t\t\t\treturn false;\n\t\n\t\t\t});\n\t\t});\n\t}", "function hideMenuOnBigScreen() {\n if (window.innerWidth > 555) {\n closeSideNav();\n }\n}", "function menuToggle() {\r\n if(maxHeight === \"0px\") {\r\n setMaxHeight(\"200px\");\r\n } else {\r\n setMaxHeight(\"0px\");\r\n }\r\n }", "function hideSideBar() {\n if (isMenuOpen) {\n setSideBarClass('hide');\n setMainScreenClass('col-sm-12');\n setArrowSide(openLogo);\n setIsMenuOpen(false);\n setMainScreenArrowClass('img-fluid arrow-img')\n } else {\n setSideBarClass('col-sm-2 sidebar-col');\n setMainScreenClass('col-sm-10');\n setArrowSide(closeLogo);\n setIsMenuOpen(true);\n setMainScreenArrowClass('hide')\n }\n\n }", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "function hideMenu()\n{\n\t\t\n\t\t//set a timeout and then kill all the menu's\n\t\t//we will check in menuHandler() to see if some stay lit.\n\t\tmenuTimeout= setTimeout(\"killMenu('all');\",800);\n\t\t\n\t\tflagMenuSwitch=\"off\";\n\t\t\n}//end hideMenu() function", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function menuSet(self){\n\t\tvar browserWidth = window.innerWidth;\n\t\tvar heightMenu = window.innerHeight - document.querySelector(\".main-menu\").getBoundingClientRect().bottom + \"px\";\n\t\tvar menuPosition = document.querySelector(\".main-menu\").getBoundingClientRect().bottom;\n\n\t\tif (browserWidth < 800 ) {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": heightMenu,\n\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\"top\": menuPosition +\"px\"\n\t\t\t});\n\n\t\t} else {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": \"\",\n\t\t\t\t\"top\": \"\",\n\t\t\t\t\"position\": \"\"\n\t\t\t});\n\t\t}\n\n\t}", "function toggleMenuLinks () {\n\t\tif (sitenavMinWidth < $(window).width()) {\n\t\t\t$(\"body\").removeClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t\telse {\n\t\t\t$(\"body\").addClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t}", "function adaptMainMenu(){\n\t\t\n\t\tif(mainMenuStatus == 'closed'){\n\t\t\t\n\t\t\t$('.mainMenuWrapper').css('margin-top', -$('.mainMenuWrapper').height());\n\t\t\t\n\t\t};\n\t\t\n\t}", "hideMenu () {\n try {\n const windowWidth = window.innerWidth\n // console.log(\"Window Width : \",windowWidth)\n if (windowWidth > MENU_HIDE_WIDTH) return\n\n // Veryfies if the sideba is open\n const sidebarEle = document.getElementsByClassName('main-sidebar')\n const style = window.getComputedStyle(sidebarEle[0])\n const transform = style.transform // get transform property\n\n // If the transform property has any\n // negative property, means that the menu\n // is not visible on the screen\n if (transform.match('-')) {\n // Returns if the menu is already hidden\n return\n }\n\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {\n // console.error(error)\n }\n }", "function lgMenu() {\n\t\t// unbind click events\n\t\t$('.menu-toggle a').off('click');\n\n\t\t// remove dynamic classes and span tags\n\t\t$('.main-nav').find('span.indicator').remove();\n\t\t$('.menu-toggle a').remove();\n\n\t\t// return windowState\n\t\twindowState = 'large';\n\t}", "function collapseMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"\");\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"\");\n }\n pinIcon.css(\"opacity\", 0);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"0\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".subnav\").stop().hide();\n $(\".state-indicator\").removeClass('fa-caret-up').addClass('fa-caret-down');\n }", "function onHiddenContextMenuHandler () {\n myMenu_open = false; // This sidebar instance menu closed, do not interpret onClicked events anymore\n}", "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "function centerMenu() {\r\n navHeight = nav.offsetHeight;\r\n winHeight = window.innerHeight;\r\n contentHeight = winHeight - (navHeight + header.offsetHeight);\r\n // check window width\r\n if (window.innerWidth > 1205) {\r\n // check window height\r\n // change the layout .. decrease the space bettween elements.. padding and margin\r\n if (winHeight > 710) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.3);\r\n sideMenu.querySelector('.data-container').style.marginBottom = '30px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '20px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '20px';\r\n } else if (winHeight <= 710 && winHeight > 600) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.2); \r\n } else if (winHeight <= 600 && winHeight >= 566) {\r\n sideMenu.querySelector('.data-container').style.marginBottom = '13px';\r\n sideMenu.querySelector('.title').style.marginBottom = '5px';\r\n sideMenu.querySelector('.title').style.paddingTop = '5px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '5px';\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.15);\r\n } else {\r\n num = 0;\r\n sideMenu.style.position = 'static';\r\n sideMenu.querySelector('.data-container').style.marginBottom = '20px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '15px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '15px';\r\n }\r\n if (num < 161) {\r\n num = 161.4;\r\n }\r\n sideMenu.style.top = num + 'px';\r\n } else {\r\n // set side menu to static position\r\n sideMenu.style.position = 'static';\r\n sideMenu.style.zIndex = 0;\r\n }\r\n }", "function menuForLargeScreen() {\n navMenuList.show();\n\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n }, 5000);\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleButtons();\n menuPanel.toggleClass(ClassName.MENU_PANEL__COMPRESSED);\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n\n menuPanel.mouseenter(function () {\n clearTimeout(timerObj);\n menuPanel.removeClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.removeClass(ClassName.NONE);\n showMenuBtn.addClass(ClassName.NONE);\n });\n menuPanel.mouseleave(function () {\n if (!menuPanel.hasClass(ClassName.MENU_PANEL__COMPRESSED)) {\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n toggleButtons();\n }, 2000);\n }\n });\n }", "function menuBottom(){\r\n\t\tmenu_bottom=$(\".avoid_jump\").offset().top;\r\n\t\tcurrent_menu_height=($(\".menu\").outerHeight());\r\n\t\t$(\".avoid_jump\").css({\"height\":current_menu_height+\"px\"});\r\n\t}", "function show_menu_bars(){\n if(window.innerWidth <= 1000){\n setAct(true)\n setNavs(false)\n }\n else{\n setAct(false)\n setNavs(true)\n }\n }", "function closeNavBottom() {\n document.getElementById(\"menu-bottom\").style.height = \"0\";\n document.getElementById(\"menu-bottom\").style.paddingTop = \"0px\";\n}", "function hiddenBarMenuConfig() {\n\t\tvar menuWrap = $('.hidden-bar .side-menu');\n\t\t// appending expander button\n\t\tmenuWrap.find('.dropdown').children('a').append(function () {\n\t\t\treturn '<button type=\"button\" class=\"btn expander\"><i class=\"icon fa fa-bars\"></i></button>';\n\t\t});\n\t\t// hidding submenu \n\t\tmenuWrap.find('.dropdown').children('ul').hide();\n\t\t// toggling child ul\n\t\tmenuWrap.find('.btn.expander').each(function () {\n\t\t\t$(this).on('click', function () {\n\t\t\t\t$(this).parent() // return parent of .btn.expander (a) \n\t\t\t\t\t.parent() // return parent of a (li)\n\t\t\t\t\t\t.children('ul').slideToggle();\n\t\n\t\t\t\t// adding class to expander container\n\t\t\t\t$(this).parent().toggleClass('current');\n\t\t\t\t// toggling arrow of expander\n\t\t\t\t$(this).find('i').toggleClass('fa-minus fa-bars');\n\t\n\t\t\t\treturn false;\n\t\n\t\t\t});\n\t\t});\n\t}", "function toggleSiteMenu ( )\r\n{\r\n\tif ($('#menuControl').hasClass('menuVisible'))\r\n\t{\r\n\t\t$('#menuControl').removeClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','none');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$('#menuControl').addClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','block');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n}", "function menu_close() {\r\n mySidebar.removeClass('show-menu');\r\n mySidebar.addClass('hide-menu');\r\n}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "function initHelpTextSideMenu() {\n\n\t//Defines the sizes for each button on the\n\t// side menu \n\thideCalSize = 45;\n\tgoogleLinkSize = 45;//Google link\n\ttransSize = 45;// Transparency button\n\televSize = 45;// Elevation options\n\tpaletteSize = 130;// Pallete button\n\ttransectSize = 45;// Transect tool button\n\tdownloadDataSize = 45;// Download data button\n\thelpSize = 60;// Help button\n\tmainmenuSize = 120; //Size of main menu TODO change depending on size\n\toptMenuSize = 140; //Size of optional menu TODO cahnge depending on size\n\n\tfirstTopPos = 70;//Initial position for main menu\n\n\toffset = firstTopPos;\n\tvar l1;\n\tvar t1;\n\n\tl1 = getleft(\"mainMenuParent\") - 215;\n\tt1 = getop(\"mainMenuParent\");\n\t$(\"#mainMenuParentHover\").css(\"top\", t1 + \"px\");\n\t$(\"#mainMenuParentHover\").css(\"left\", l1 + \"px\");\n\n\n\tif (testVisibility(\"transParent\")) {\n\n\t\tl1 = getleft(\"transParent\") - 215;\n\t\tt1 = getop(\"transParent\");\n\t\t$(\"#transParentHover\").css(\"top\", t1 + \"px\");\n\t\t$(\"#transParentHover\").css(\"left\", l1 + \"px\");\n\t}\n\n\n\tl1 = getleft(\"optionalMenuParent\") - 220;\n\tt1 = getop(\"optionalMenuParent\");\n\t$(\"#optionalMenuParentHover\").css(\"top\", t1 + \"px\");\n\t$(\"#optionalMenuParentHover\").css(\"left\", l1 + \"px\");\n\n\tif (testVisibility(\"elevationParent\")) {\n\t\tvar l, w, t;\n\t\tw = getwidth(\"elevationParent\");\n\t\tl = getleft(\"elevationParent\");\n\t\tl = l + w;\n\t\tt = getop(\"elevationParent\");\n\n\t\t$(\"#elevationParentHover\").css(\"top\", t + \"px\");\n\t\t$(\"#elevationParentHover\").css(\"left\", l + \"px\");\n\n\t}\n\tif (testVisibility(\"transectParent\")) {\n\t\tvar l, w, t;\n\t\tw = getwidth(\"transectParent\");\n\t\tl = getleft(\"transectParent\");\n\n\t\tl = l + w;\n\t\tt = getop(\"transectParent\");\n\n\t\t$(\"#transectParentHover\").css(\"top\", t + \"px\");\n\t\t$(\"#transectParentHover\").css(\"left\", l + \"px\");\n\n\t}\n\tif (testVisibility(\"palettesMenuParent\")) {\n\n\t\tvar l, w, t;\n\n\t\tw = getwidth(\"palettesMenuParent\");\n\t\tl = getleft(\"palettesMenuParent\");\n\n\t\tl = l + w;\n\t\tt = getop(\"palettesMenuParent\");\n\n\t\t$(\"#palettesHover\").css(\"top\", t + \"px\");\n\t\t$(\"#palettesHover\").css(\"left\", l + \"px\");\n\n\t}\n\tif (testVisibility(\"hideCalendarButtonParent\")) {\n\t\tvar l, w, t;\n\n\t\tl = getleft(\"hideCalendarButtonParent\");\n\t\tw = getwidth(\"hideCalendarButtonParent\");\n\n\t\tl = l + w;\n\t\tt = getop(\"hideCalendarButtonParent\");\n\n\t\t$(\"#hideCalendarHover\").css(\"top\", t + \"px\");\n\t\t$(\"#hideCalendarHover\").css(\"left\", l + \"px\");\n\n\t}\n}", "function mobileMenuHide() {\r\n\t\tvar windowWidth = $(window).width();\r\n\t\tif (windowWidth < 1024) {\r\n\t\t\t$('#site_header').addClass('mobile-menu-hide');\r\n\t\t}\r\n\t}", "function toggleMenu() {\n open = !open;\n let bars = this.children[0];\n if(open) {\n bars.style.color = '#ffffff';\n selectors.sideMenu.style.left = 0;\n } else {\n bars.style.color = '#000000';\n selectors.sideMenu.style.left = -400 + 'px';\n }\n}", "function fixClientsMenu() {\n fixMenu(clientsSectionMenu);\n }", "function SIDE$static_(){ToolbarSkin.SIDE=( new ToolbarSkin(\"side\"));}", "static closeNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"0px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"0px\");\n ElementHandler.showElementById('openSidebar');\n }", "function hideMenu() {\n if (isMobile()) {\n $('.menu-bar').toggleClass('menu-open');\n $('.menu').toggleClass('menu-list-open');\n }\n}", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth() > $window.width()) {\r\n\t\t\t\t\t$(this).addClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').addClass('on-left-side');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').removeClass('on-left-side');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t}", "function toggleMenu(e) {\n e.preventDefault();\n $mainNav.slideToggle(function (){\n if ($mainNav.is(':hidden')) {\n $mainNav.removeAttr('style');\n }\n });\n $menuToggle.toggleClass('open');\n }", "function HideMobileMenu(){\n\t\n}", "function setMenuBottomActive() {\n $('.menu-a-bottom.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function hideMenu($this){\n $this.css('display', '');\n $('#mobileMenu-'+$this.attr('id')).hide();\n }", "function toggle_sharing_menu(e){\n clickSound.play();\n\n if (sharing_menu_state == 1){\n $('#menu_partage').animate(\n {\n height: '0'\n },\n function(){\n $('#menu_partage').hide();\n }\n );\n \n sharing_menu_state = 0;\n }\n else if (sharing_menu_state == 0){\n $('#menu_partage').show(\n function(){\n $('#menu_partage').animate({\n height: $(window).height() - 44\n });\n }\n );\n\n sharing_menu_state = 1;\n }\n \n e.stopPropagation();\n}", "function togglePagesMenu() {\n var pending = $mdBottomSheet.hide() || $q.when(true);\n \n pending.then(function(){\n $mdSidenav('left').toggle();\n });\n }", "function sideMenu(){\n\t// SHOW THE MENU WHEN THE USER HOVERS OVER TO THE RIGHT OF THE WINDOW\n\t$('.menu-hover').mouseenter(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n\t\t\n\t// HIDE THE MENU WHEN THE USER LEAVES THE SIDEBAR\n\t$('.side-menu').mouseleave(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n}", "function openSlideMenuBottom() {\n document.getElementById('side-menu-bottom').style.height='250px';\n document.getElementById('side-menu-bottom').style.width='100%';\n document.getElementById('main').style.marginBottom='250px';\n}", "function hideMallNav() {\n classie.add(mallNav, 'mallnav--hidden');\n }", "function SideMenuHandler(){\n $('#side-pane')\n .transition('horizontal flip')\n ;\n $rootScope.side_menu = !$rootScope.side_menu;\n }", "function HB_ShowMenuMobile() {\n\t \t$( '.wr-mobile .hb-menu .has-children-mobile' ).click( function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.closest( '.item-link-outer' );\n\t \t\tvar parent_li = _this.closest( 'li' );\n\t \t\tvar submenu = parent_li.find( ' > ul:first' );\n\n\t \t\tif ( parent.hasClass( 'active-submenu' ) ) {\n\t \t\t\tsubmenu.stop( true, true ).slideUp( function() {\n\t \t\t\t\tvar menu = _this.closest( '.site-navigator-inner' );\n\t \t\t\t\tvar menu_inner = _this.closest( '.site-navigator' );\n\t \t\t\t\tvar menu_info = menu_inner[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\t\tif ( menu_info.height <= height_scroll ) {\n\t \t\t\t\t\tmenu.css( 'height', '' );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\tparent.removeClass( 'active-submenu' );\n\t \t\t} else {\n\t \t\t\tsubmenu.stop( true, true ).slideDown( function() {\n\t \t\t\t\tvar menu = _this.closest( '.site-navigator-inner' );\n\t \t\t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\t\tmenu.height( height_scroll );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\tparent.addClass( 'active-submenu' );\n\t \t\t}\n\t \t} );\n\n\t \t$( '.wr-mobile .hb-menu .menu-icon-action' ).click( function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.closest( '.hb-menu' );\n\t \t\tvar menu = parent.find( '.site-navigator-inner' );\n\n\t \t\tif ( _this.hasClass( 'active-menu' ) ) {\n\t \t\t\tmenu.stop( true, true ).slideUp();\n\t \t\t\t_this.removeClass( 'active-menu' );\n\t \t\t} else {\n\t \t\t\tWR_Click_Outside( _this, '.hb-menu', function( e ) {\n\t \t\t\t\tmenu.stop( true, true ).slideUp();\n\t \t\t\t\t_this.removeClass( 'active-menu' );\n\t \t\t\t} );\n\n\t \t\t\tmenu.stop( true, true ).slideDown( function() {\n\t \t\t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top\n\n\t \t\t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\t\t$( this ).height( height_scroll );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\t_this.addClass( 'active-menu' );\n\t \t\t}\n\t \t} );\n\n\t \t$.function_rotate_device.menu_mobile = function() {\n\t \t\t$.each( $( '.wr-mobile .hb-menu .menu-icon-action.active-menu' ), function( key, val ) {\n\t \t\t\tvar _this = $( val );\n\t \t\t\tvar parent = _this.closest( '.hb-menu' );\n\t \t\t\tvar menu = parent.find( '.site-navigator-inner' );\n\t \t\t\tmenu.css( 'height', '' );\n\n\t \t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\tvar height_broswer = $( window ).height();\n\t \t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\tmenu.height( height_scroll );\n\t \t\t\t} else {\n\t \t\t\t\tmenu.css( 'height', '' );\n\t \t\t\t}\n\t \t\t} );\n\t \t};\n\n\t }", "function menuHideAll() {\n\t$('#shop').hide();\n\t$('#highscore').hide();\n\t$('#milestones').hide();\n\t$('#options').hide();\n\t$('#chat').hide();\n}", "collapseMenu() {\r\n\t}", "function mainmenu(){\n\t\t\t\tJ(\"#main_menu ul li ul\").css({display: \"none\"}); // Opera Fix\n\t\t\t\t\tJ(\"#main_menu ul li\").hover(function(){\n\t\t\t\t\t\tJ(this).find('ul:first').css({visibility: \"visible\",display: \"none\"}).show(300);\n\t\t\t\t\t\t},function(){\n\t\t\t\t\t\tJ(this).find('ul:first').css({visibility: \"hidden\"});\n\t\t\t\t\t});\n\t\t\t\t}", "function hideMenu($this){\n $this.css('display', '');\n $('#mobileMenu_'+$this.attr('id')).hide();\n }", "function closemenu(){\n\t\t\tif ( $menu && timer ){\n\t\t\t\t$menu.children('a').removeClass( settings.parentMO ).siblings('ul')[ settings.hide ]();\n\t\t\t\ttimer = clearTimeout( timer );\n\t\t\t\t$menu = false;\n\t\t\t}\n\t\t}", "function closeNav() {\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '20px');\n $('#nav-list li').addClass('treelisthidden');\n storage.removeItem(treesettings);\n $('#sideNavigation').css('display', 'none');\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('#sidefoot').css('margin-left', '-250px');\n $('body.support_kb').find('.cover').css('display', 'block');\n //$('body.support_kb').find('#sideNavigation').css('margin-left','0');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '-250px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('#side-toggle').attr('class', 'fa fa-angle-double-right');\n $(\"#sidefoot\").css(\"width\", \"50px\");\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"disable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n }", "function hideEditMenu() {\n menu.style.display = 'none';\n removePageClickEvent();\n }", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function unPinMenu() {\n pinned = false;\n sessionStorage.setItem('offcanvas-pinned', false);\n $(\".sv-grid-ksgs12\").first().removeClass('pinned'); // So CSS can adjust padding rule accordingly\n $(\".ked-navigation .sidebar\").css({\n transition: ''\n });\n pinIcon.css({\n transform: \"none\"\n });\n collapseMenu();\n }", "function OnBack()\n{\n\t// don't show any special menus\n\tshowOptions = false;\n}", "function closeNav() {\r\n\tdocument.getElementById(\"mysidenav\").style.height = \"0\";\r\n\tmenuopen=false;\r\n}", "cleanMenu() {\n for (var i = 0; i < this.menuView.HTMLElementsMenu.length; i++) {\n this.menuView.HTMLElementsMenu[i].style.display = \"none\";\n }\n for (var i = 0; i < this.menuView.HTMLButtonsMenu.length; i++) {\n this.menuView.HTMLButtonsMenu[i].style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.HTMLButtonsMenu[i].style.zIndex = \"0\";\n }\n }", "function HB_Element_Menu() {\n\t \t$( 'body.wr-desktop' ).on( 'click', '.hb-menu .menu-icon-action', function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.parents( '.hb-menu' );\n\n\t\t\t// Add class active for icon\n\t\t\t_this.find( '.wr-burger-scale' ).addClass( 'wr-acitve-burger' );\n\n\t\t\t/*******************************************************************\n\t\t\t * Render HTML for effect *\n\t\t\t ******************************************************************/\n\t\t\t var menu_content = parent.find( '.site-navigator-outer' )[ 0 ].outerHTML;\n\n\t\t\t// Render menu content\n\t\t\tif ( !$( 'body > .hb-menu-outer' ).length ) {\n\t\t\t\t$( 'body' ).append( '<div class=\"hb-menu-outer\"></div>' );\n\t\t\t}\n\t\t\t$( 'body > .hb-menu-outer' ).html( menu_content );\n\n\t\t\t// Render overlay\n\t\t\tif ( !$( 'body > .hd-overlay-menu' ).length ) {\n\t\t\t\t$( 'body' ).append( '<div class=\"hd-overlay-menu\"></div>' );\n\t\t\t}\n\n\t\t\t/*******************************************************************\n\t\t\t * Animation *\n\t\t\t ******************************************************************/\n\t\t\t var layout = _this.attr( 'data-layout' );\n\t\t\t var effect = _this.attr( 'data-effect' );\n\t\t\t var position = _this.attr( 'data-position' );\n\t\t\t var animation = _this.attr( 'data-animation' );\n\t\t\t var wrapper_animation = $( 'body > .wrapper-outer' );\n\t\t\t var sidebar_animation = $( 'body > .hb-menu-outer .sidebar-style' );\n\t\t\t var sidebar_animation_outer = $( 'body > .hb-menu-outer' );\n\t\t\t var sidebar_animation_inner = $( 'body > .hb-menu-outer ul.site-navigator' );\n\t\t\t var overlay = $( 'body > .hd-overlay-menu' );\n\n\t\t\t var fullscreen = $( 'body > .hb-menu-outer .fullscreen-style' )\n\n\t\t\t var width_sidebar = sidebar_animation.innerWidth();\n\t\t\t var height_sidebar = sidebar_animation.innerHeight();\n\n\t\t\t// Add attributes general\n\t\t\t$( 'html' ).addClass( 'no-scroll' );\n\n\t\t\tif ( layout == 'fullscreen' ) {\n\n\t\t\t\tswitch ( effect ) {\n\n\t\t\t\t\tcase 'none':\n\t\t\t\t\tfullscreen.show();\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fade':\n\t\t\t\t\tfullscreen.fadeIn( 100 );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'scale':\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\tfullscreen.addClass( 'scale-active' );\n\t\t\t\t\t}, 100 );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( layout == 'sidebar' ) {\n\n\t\t\t\t// Add attributes for overlay\n\t\t\t\toverlay.attr( 'data-position', position );\n\t\t\t\toverlay.attr( 'data-animation', animation );\n\n\t\t\t\toverlay.fadeIn();\n\n\t\t\t\tsidebar_animation.css( 'opacity', 1 );\n\n\t\t\t\tvar admin_bar = $( '#wpadminbar' );\n\t\t\t\tif ( admin_bar.length ) {\n\t\t\t\t\tsidebar_animation.css( 'top', admin_bar.height() + 'px' );\n\t\t\t\t} else {\n\t\t\t\t\tsidebar_animation.css( 'top', '0px' );\n\t\t\t\t}\n\n\t\t\t\tswitch ( position ) {\n\t\t\t\t\tcase 'left':\n\n\t\t\t\t\tsidebar_animation.css( {\n\t\t\t\t\t\t'visibility': 'visible',\n\t\t\t\t\t\t'left': '-' + width_sidebar + 'px'\n\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\t\twrapper_animation.css( {\n\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t'left': width_sidebar + 'px'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tswitch ( animation ) {\n\t\t\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'push':\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'right':\n\n\t\t\t\t\t\tsidebar_animation.css( {\n\t\t\t\t\t\t\t'visibility': 'visible',\n\t\t\t\t\t\t\t'right': '-' + width_sidebar + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\t\t\twrapper_animation.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'right': width_sidebar + 'px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tswitch ( animation ) {\n\t\t\t\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'push':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\n$( 'body' ).on( 'click', '.fullscreen-style .close', function() {\n\n\t\t\t// Remove class active for icon\n\t\t\t$( '.wr-burger-scale' ).removeClass( 'wr-acitve-burger' );\n\n\t\t\tvar _this = $( this );\n\n\t\t\tvar parent = _this.parents( '.hb-menu-outer' );\n\n\t\t\tvar effect = _this.attr( 'data-effect' );\n\n\t\t\tswitch ( effect ) {\n\n\t\t\t\tcase 'none':\n\t\t\t\tparent.remove();\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'fade':\n\t\t\t\tparent.find( '.site-navigator-outer' ).fadeOut( 300, function() {\n\t\t\t\t\tparent.remove();\n\t\t\t\t} );\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'scale':\n\t\t\t\tparent.find( '.site-navigator-outer' ).removeClass( 'scale-active' );\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tparent.remove();\n\t\t\t\t}, 300 );\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t\t$( 'body > .wrapper-outer' ).removeAttr( 'style' );\n\t\t} )\n\n$( 'body' ).on( 'click', '.hd-overlay-menu', function() {\n\n\t\t\t// Remove class active for icon\n\t\t\t$( '.wr-burger-scale' ).removeClass( 'wr-acitve-burger' );\n\n\t\t\tvar _this = $( this );\n\t\t\tvar position = _this.attr( 'data-position' );\n\t\t\tvar animation = _this.attr( 'data-animation' );\n\t\t\tvar wrapper_animation = $( 'body > .wrapper-outer' );\n\t\t\tvar sidebar_animation = $( 'body > .hb-menu-outer .sidebar-style' );\n\t\t\tvar sidebar_animation_inner = $( 'body > .hb-menu-outer ul.site-navigator' );\n\t\t\tvar width_sidebar = sidebar_animation.innerWidth();\n\t\t\tvar height_sidebar = sidebar_animation.innerHeight();\n\n\t\t\t_this.fadeOut();\n\n\t\t\t// Remove all style\n\t\t\tsetTimeout( function() {\n\t\t\t\t$( 'body > .hb-menu-outer' ).remove();\n\t\t\t\t_this.remove();\n\t\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t\t\t$( 'body > .wrapper-outer' ).removeAttr( 'style' );\n\t\t\t}, 500 );\n\n\t\t\tswitch ( position ) {\n\t\t\t\tcase 'left':\n\n\t\t\t\tsidebar_animation.animate( {\n\t\t\t\t\t'left': '-' + width_sidebar + 'px'\n\t\t\t\t} );\n\n\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\twrapper_animation.animate( {\n\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\tswitch ( animation ) {\n\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'push':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'right':\n\n\t\t\t\tsidebar_animation.animate( {\n\t\t\t\t\t'right': '-' + width_sidebar + 'px'\n\t\t\t\t} );\n\n\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\twrapper_animation.animate( {\n\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\tswitch ( animation ) {\n\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'push':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t} );\n\n$( 'body' ).on( 'click', '.header .menu-more .icon-more', function( e ) {\n\tvar _this = $( this );\n\tvar parent = _this.closest( '.site-navigator-inner' );\n\tvar menu_more = _this.closest( '.menu-more' );\n\tvar nav = parent.find( '.site-navigator' );\n\tvar nav_more = parent.find( '.nav-more' );\n\tvar nav_item_hidden = parent.find( ' > .site-navigator .item-hidden' );\n\tvar index_current = $( '.header .menu-more' ).index( menu_more );\n\tvar element_item = _this.closest( '.element-item' );\n\n\t\t\t// Remove active element item more\n\t\t\t$( '.header .menu-more:not(:eq(' + index_current + '))' ).removeClass( 'active-more' );\n\n\t\t\tif ( menu_more.hasClass( 'active-more' ) ) {\n\t\t\t\tmenu_more.removeClass( 'active-more' );\n\t\t\t} else {\n\n\t\t\t\tWR_Click_Outside( _this, '.hb-menu', function( e ) {\n\t\t\t\t\tmenu_more.removeClass( 'active-more' );\n\t\t\t\t} );\n\n\t\t\t\t// Reset\n\t\t\t\tnav_more.html( '' );\n\t\t\t\tnav_more.removeAttr( 'style' );\n\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\tvar nav_info = nav_more[ 0 ].getBoundingClientRect();\n\n\t\t\t\t// Get offset\n\t\t\t\tvar offset_option = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t\t\t\t// Set left search form if hide broswer because small\n\t\t\t\tif ( width_content_broswer < ( nav_info.right + 5 ) ) {\n\t\t\t\t\tvar left_nav = ( nav_info.right + 5 + offset_option ) - width_content_broswer;\n\t\t\t\t\tnav_more.css( 'left', -left_nav + 'px' );\n\t\t\t\t} else if ( nav_info.left < ( 5 + offset_option ) ) {\n\t\t\t\t\tnav_more.css( 'left', '5px' );\n\t\t\t\t}\n\n\t\t\t\t// Remove margin top when stick or margin top empty\n\t\t\t\tvar margin_top = ( element_item.attr( 'data-margin-top' ) == 'empty' ) ? element_item.attr( 'data-margin-top' ) : parseInt( element_item.attr( 'data-margin-top' ) );\n\t\t\t\tvar menu_more_info = menu_more[ 0 ].getBoundingClientRect();\n\n\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar offset_bottom_current = menu_more_info.top + menu_more_info.height;\n\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\tvar offset_top = parseInt( padding_bottom + menu_more_info.height );\n\n\t\t\t\t\tnav_more.css( 'top', offset_top );\n\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\tnav_more.css( 'top', ( margin_top + menu_more_info.height ) );\n\t\t\t\t}\n\n\t\t\t\tif ( nav_item_hidden.length ) {\n\t\t\t\t\tvar nav_item_html = '';\n\t\t\t\t\t$.each( nav_item_hidden, function() {\n\t\t\t\t\t\tnav_item_html += $( this )[ 0 ].outerHTML;\n\t\t\t\t\t} );\n\t\t\t\t\tnav_more.html( '<ul class=\"animation-' + element_item.attr( 'data-animation' ) + ' ' + nav.attr( 'class' ) + '\">' + nav_item_html + '</ul>' );\n\t\t\t\t}\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tmenu_more.addClass( 'active-more' );\n\t\t\t\t}, 10 );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Hover normal animation\n\t\tif ( $.fn.hoverIntent ) {\n\t\t\t// For horizontal layout\n\t\t\t$( '.wr-desktop header.header.horizontal-layout' ).hoverIntent( {\n\t\t\t\tover: function() {\n\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\tvar style_animate = '';\n\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\tvar offset = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\t\t\t\t\tvar margin_top = ( _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) == 'empty' ) ? _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) : parseInt( _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) );\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) { // For megamenu\n\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar parent_info = _this.closest( '.container' )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\t\tvar width_parent = parent_info.width;\n\t\t\t\t\t\tvar right_parent = parent_info.right;\n\t\t\t\t\t\tvar width_megamenu = 0;\n\t\t\t\t\t\tvar left_megamenu = 0;\n\t\t\t\t\t\tvar width_type = menu_animate.attr( 'data-width' );\n\n\t\t\t\t\t\t// Full container\n\t\t\t\t\t\tif ( width_type === 'full' ) {\n\t\t\t\t\t\t\twidth_megamenu = width_parent;\n\n\t\t\t\t\t\t\tif ( ( width_megamenu + 10 + offset * 2 ) >= width_content_broswer ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_parent - 10;\n\t\t\t\t\t\t\t\tright_parent -= 5;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Full container\n\t\t\t\t\t\t} else if ( width_type === 'full-width' ) {\n\t\t\t\t\t\t\twidth_megamenu = width_content_broswer - 10 - ( offset * 2 );\n\t\t\t\t\t\t\tright_parent = 5 + offset;\n\n\t\t\t\t\t\t\t// Fixed width\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twidth_megamenu = parseInt( width_type ) ? parseInt( width_type ) : width_parent;\n\n\t\t\t\t\t\t\tif ( ( width_megamenu + 10 + offset * 2 ) >= width_content_broswer ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_content_broswer - 10 - ( offset * 2 );\n\t\t\t\t\t\t\t\tright_parent -= 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\n\t\t\t\t\t\tvar megamenu_info = menu_animate[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\t/* Convert numbers positive to negative */\n\n\t\t\t\t\t\tif ( width_type == 'full-width' ) {\n\t\t\t\t\t\t\tleft_megamenu = -( megamenu_info.left - right_parent );\n\t\t\t\t\t\t} else if ( width_type == 'full' ) {\n\t\t\t\t\t\t\tleft_megamenu = ( ( megamenu_info.right - right_parent ) > 0 ) ? -( parseInt( megamenu_info.right - right_parent ) ) : 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tleft_megamenu = ( megamenu_info.right > ( width_content_broswer - 5 - ( offset * 2 ) ) ) ? ( -( megamenu_info.right - ( width_content_broswer - 5 - offset ) ) ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu,\n\t\t\t\t\t\t\twidth: width_megamenu\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t/** * Set offset top for submenu ** */\n\t\t\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\t\t\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar offset_bottom_current = current_info.top + current_info.height;\n\t\t\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\t\t\tvar offset_top = parseInt( padding_bottom + current_info.height );\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = offset_top\n\n\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + ( offset_top - current_info.height ) + 'px\"></span>' );\n\t\t\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = margin_top + current_info.height;\n\n\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + margin_top + 'px\"></span>' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Add class col last row */\n\t\t\t\t\t\tvar mm_container_width = menu_animate.find( '.mm-container' ).width();\n\t\t\t\t\t\tvar width_col = 0;\n\n\t\t\t\t\t\t$.each( menu_animate.find( '.mm-container > .mm-col' ), function() {\n\t\t\t\t\t\t\tvar _this_col = $( this );\n\t\t\t\t\t\t\tvar width_current = _this_col.outerWidth();\n\n\t\t\t\t\t\t\twidth_col += width_current;\n\n\t\t\t\t\t\t\t_this_col.removeClass( 'mm-last-row' );\n\n\t\t\t\t\t\t\tif ( width_col == mm_container_width ) {\n\t\t\t\t\t\t\t\t_this_col.addClass( 'mm-last-row' );\n\t\t\t\t\t\t\t\twidth_col = 0;\n\t\t\t\t\t\t\t} else if ( width_col > mm_container_width ) {\n\t\t\t\t\t\t\t\t_this_col.prev().addClass( 'mm-last-row' );\n\t\t\t\t\t\t\t\twidth_col = width_current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else { // For menu normal\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > ul.sub-menu' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tif ( menu_animate.length == 0 )\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tvar megamenu_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\t\tvar left_megamenu = Math.round( megamenu_info.right - width_content_broswer + offset );\n\n\t\t\t\t\t\tif ( _this.hasClass( 'menu-default' ) ) { // For top menu normal\n\n\t\t\t\t\t\t\t// Convert numbers positive to negative\n\t\t\t\t\t\t\tleft_megamenu = ( left_megamenu > 0 ) ? ( -left_megamenu - 5 ) : 0;\n\n\t\t\t\t\t\t\t/** * Set offset top for submenu in row sticky ** */\n\t\t\t\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\n\t\t\t\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tvar offset_bottom_current = current_info.top + current_info.height;\n\t\t\t\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\t\t\t\tvar offset_top_menu_animate = parseInt( padding_bottom + current_info.height );\n\n\t\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + ( offset_top_menu_animate - current_info.height ) + 'px\"></span>' );\n\t\t\t\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\t\t\t\tvar offset_top_menu_animate = margin_top + current_info.height;\n\n\t\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + margin_top + 'px\"></span>' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else { // For sub menu normal\n\n\t\t\t\t\t\t\tvar submenu_parent = _this.closest( 'ul' );\n\n\t\t\t\t\t\t\t// Get left css current\n\t\t\t\t\t\t\tvar left = parseInt( submenu_parent.css( 'left' ) );\n\n\t\t\t\t\t\t\tif ( left < 0 ) { // Show all submenu to left\n\t\t\t\t\t\t\t\tvar submenu_parent_info = submenu_parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tleft_megamenu = ( megamenu_info.width < ( submenu_parent_info.left - offset ) ) ? -megamenu_info.width : megamenu_info.width;\n\t\t\t\t\t\t\t} else { // Show submenu normal\n\t\t\t\t\t\t\t\tleft_megamenu = ( left_megamenu > 0 ) ? -megamenu_info.width : megamenu_info.width;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/** * Set top when animate hide because broswer short ** */\n\t\t\t\t\t\t\tvar height_content_broswer = $( window ).height();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( megamenu_info.top + megamenu_info.height ) - offset;\n\t\t\t\t\t\t\tif ( megamenu_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( megamenu_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Set offset top for when animate hide because broswer short\n\t\t\t\t\t\tif ( typeof top_menu_animate !== 'undefined' )\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = top_menu_animate;\n\n\t\t\t\t\t\t// Set offset top for submenu in row sticky\n\t\t\t\t\t\tif ( typeof offset_top_menu_animate !== 'undefined' )\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = offset_top_menu_animate;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set style before run effect\n\t\t\t\t\tmenu_animate.css( style_animate );\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation = _this.closest( '.hb-menu' ).attr( 'data-animation' );\n\n\t\t\t\t\t switch ( animation ) {\n\t\t\t\t\t \tcase 'none':\n\t\t\t\t\t \tmenu_animate.css( {\n\t\t\t\t\t \t\topacity: '1'\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1'\n\t\t\t\t\t \t}, 150, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none',\n\t\t\t\t\t \t\tleft: ( left_megamenu - 50 ) + 'px'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none',\n\t\t\t\t\t \t\tleft: ( left_megamenu + 50 ) + 'px'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ); // Get offset top menu_animate\n\t\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\t\ttop: ( top_megamenu + 30 ) + 'px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\t\ttransform: 'scale(1)'\n\t\t\t\t\t\t\t}, 250, function() {\n\t\t\t\t\t\t\t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_this.addClass( 'menu-hover' );\n\t\t\t\t\t},\n\t\t\t\t\tout: function() {\n\t\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\t\t_this.children( '.hover-area' ).remove();\n\t\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar menu_animate = _this.find( 'ul.sub-menu' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Remove style hover-area in row sticky\n\t\t\t\t\t_this.find( ' > .menu-item-link .hover-area' ).removeAttr( 'style' );\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation = _this.closest( '.hb-menu' ).attr( 'data-animation' );\n\n\t\t\t\t\t switch ( animation ) {\n\t\t\t\t\t \tcase 'none':\n\t\t\t\t\t \t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \tmenu_animate.removeAttr( 'style' );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0'\n\t\t\t\t\t \t}, 150, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) - 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) + 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\t\t\t\t\t\t\t// Get offset top menu_animate\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ) + 50;\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t}, 250, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\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\ttimeout: 0,\n\t\t\t\t\tsensitivity: 1,\n\t\t\t\t\tinterval: 0,\n\t\t\t\t\tselector: '.site-navigator li.menu-item'\n\t\t\t\t} );\n\n\t\t\t// For vertical layout\n\t\t\t$( 'body' ).hoverIntent( {\n\t\t\t\tover: function() {\n\n\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\tvar style_animate = '';\n\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\tvar is_right_position = 0;\n\n\t\t\t\t\t// Check is right position for menu more\n\t\t\t\t\tif ( _this.closest( '.menu-more' ).length == 1 ) {\n\t\t\t\t\t\tvar menu_more = _this.closest( '.menu-more' );\n\t\t\t\t\t\tvar menu_more_info = menu_more[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar menu_more_right = width_content_broswer - menu_more_info.right;\n\n\t\t\t\t\t\tif ( menu_more_info.left > menu_more_right ) {\n\t\t\t\t\t\t\tis_right_position = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tis_right_position = _this.closest( '.vertical-layout.right-position-vertical' ).length || _this.closest( '.sidebar-style.right-position' ).length;\n\t\t\t\t\t}\n\t\t\t\t\tvar offset = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var height_content_broswer = $( window ).height();\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) { // For megamenu\n\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_megamenu = menu_animate.attr( 'data-width' );\n\n\t\t\t\t\t\tif ( is_right_position == 1 ) {\n\n\t\t\t\t\t\t\tvar width_content = current_info.left - offset;\n\n\t\t\t\t\t\t\t// Check setting full width\n\t\t\t\t\t\t\tif ( width_megamenu == 'full' || width_megamenu > width_content ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_content - 5;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\t\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\t\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\t\twidth: width_megamenu,\n\t\t\t\t\t\t\t\tleft: -width_megamenu,\n\t\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar width_content = width_content_broswer - current_info.right - offset;\n\n\t\t\t\t\t\t\t// Check setting full width\n\t\t\t\t\t\t\tif ( width_megamenu == 'full' || width_megamenu > width_content )\n\t\t\t\t\t\t\t\twidth_megamenu = width_content - 5;\n\n\t\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\t\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\n\t\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\t\twidth: width_megamenu,\n\t\t\t\t\t\t\t\tleft: parseInt( current_info.width ),\n\t\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // For menu normal\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > ul.sub-menu' );\n\n\t\t\t\t\t\tif ( !menu_animate.length ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\tif ( _this.hasClass( 'menu-default' ) ) { // For top\n\t\t\t\t\t\t\t// menu\n\t\t\t\t\t\t\t// normal\n\t\t\t\t\t\t\tif ( is_right_position == 1 ) {\n\t\t\t\t\t\t\t\tvar left_megamenu = -parseInt( menu_animate_info.width );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tvar left_megamenu = parseInt( current_info.width );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // For sub menu normal\n\t\t\t\t\t\t\tvar submenu_parent = _this.closest( 'ul' );\n\t\t\t\t\t\t\tvar submenu_parent_info = submenu_parent[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\t\tvar left_megamenu = ( menu_animate_info.width > ( width_content_broswer - submenu_parent_info.right - offset - 5 ) ) ? -menu_animate_info.width : menu_animate_info.width;\n\n\t\t\t\t\t\t\t// Get left css current\n\t\t\t\t\t\t\tvar left = parseInt( submenu_parent.css( 'left' ) );\n\n\t\t\t\t\t\t\tif ( left < 0 ) { // Show all submenu to left\n\t\t\t\t\t\t\t\tvar left_megamenu = ( menu_animate_info.width < submenu_parent_info.left - 5 - offset ) ? -menu_animate_info.width : menu_animate_info.width;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\n\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu,\n\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar animation_effect = ( _this.closest( '.menu-more' ).length == 1 ) ? _this.closest( '.element-item' ).attr( 'data-animation' ) : _this.closest( '.site-navigator-outer' ).attr( 'data-effect-vertical' );\n\n\t\t\t\t\t// Set style before run effect\n\t\t\t\t\tmenu_animate.css( style_animate );\n\n\t\t\t\t\tswitch ( animation_effect ) {\n\t\t\t\t\t\tcase 'none':\n\n\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\t\t\topacity: '1'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'fade':\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\topacity: '1'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'left-to-right':\n\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: ( left_megamenu - 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\tleft: left_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'right-to-left':\n\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: ( left_megamenu + 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\tleft: left_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'bottom-to-top':\n\n\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) );\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\ttop: ( top_megamenu + 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\ttransform: 'scale(1)'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_this.addClass( 'menu-hover' );\n\t\t\t\t},\n\t\t\t\tout: function() {\n\t\t\t\t\tvar _this = $( this );\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar menu_animate = _this.find( 'ul.sub-menu' );\n\t\t\t\t\t}\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation_effect = ( _this.closest( '.menu-more' ).length == 1 ) ? _this.closest( '.element-item' ).attr( 'data-animation' ) : _this.closest( '.site-navigator-outer' ).attr( 'data-effect-vertical' );\n\n\t\t\t\t\t switch ( animation_effect ) {\n\t\t\t\t\t \tcase 'none':\n\n\t\t\t\t\t \t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \tmenu_animate.removeAttr( 'style' );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) - 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) + 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\n\t\t\t\t\t\t\t// Get offset top menu_animate\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ) + 50;\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t},\n\t\t\t\t\ttimeout: 1,\n\t\t\t\t\tsensitivity: 6,\n\t\t\t\t\tinterval: 0,\n\t\t\t\t\tselector: '.vertical-layout .text-layout .animation-vertical-normal .site-navigator li.menu-item, .hb-menu-outer .sidebar-style.animation-vertical-normal .site-navigator li.menu-item, .menu-more .nav-more .site-navigator li.menu-item'\n\t\t\t\t} );\n}\n\nvar element_breadcrumbs = {};\n\n\t\t// Slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.mm-container .mm-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_ul = _this.closest( 'ul' );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\t\t\tvar parent_col = _this.closest( '.mm-col' );\n\t\t\tvar siblings_ul = parent_li.find( ' > ul' );\n\n\t\t\tparent_ul.addClass( 'slide-hide' );\n\t\t\tsiblings_ul.addClass( 'slide-show' );\n\n\t\t\tif ( ! parent_col.find( '.prev-slide' ).length ) {\n\t\t\t\tparent_col.find( ' > li > ul.sub-menu' ).prepend( '<li class=\"prev-slide\"><i class=\"fa fa-angle-left\"></i></li>' );\n\t\t\t}\n\n\t\t\tvar siblings_ul_top = _this.closest( '.mm-col' ).find( ' > li > ul' );\n\n\t\t\tvar height_siblings_ul = siblings_ul.height();\n\t\t\tvar height_sprev_slide = siblings_ul_top.find( '.prev-slide' ).outerHeight();\n\t\t\tvar height_set = height_siblings_ul + height_sprev_slide;\n\n\t\t\tif( siblings_ul_top.height() < height_set ) {\n\t\t\t\tsiblings_ul_top.height( height_set );\n\t\t\t}\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.mm-container .prev-slide', function( e ) {\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_ul = _this.closest( '.mm-col' );\n\t\t\tvar container = _this.closest( '.mm-container' );\n\t\t\tvar show_last = parent_ul.find( '.slide-show:last' ).removeClass( 'slide-show' );\n\t\t\tvar hide_last = parent_ul.find( '.slide-hide:last' );\n\n\t\t\tif ( parent_ul.find( '.slide-hide' ).length == 1 ) {\n\t\t\t\t_this.closest( 'ul' ).css( 'height', '' );\n\t\t\t\t_this.remove();\n\t\t\t}\n\n\t\t\thide_last.removeClass( 'slide-hide' );\n\t\t} );\n\n\t\t// Slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .hb-menu .animation-vertical-slide .icon-has-children, .hb-menu-outer .animation-vertical-slide .icon-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_menu_elment = _this.closest( '.site-navigator-outer' );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\t\t\tvar children_sub = parent_li.find( ' > ul > li' );\n\t\t\tvar parent_ul = _this.closest( 'ul' );\n\t\t\tvar children_parent_ul = parent_ul.find( ' > li ' );\n\t\t\tvar menu_level = Object.keys( element_breadcrumbs ).length + 1;\n\t\t\tvar text_title = _this.closest( 'a' ).find( '.menu_title' ).text();\n\t\t\tvar menu_show = parent_li.find( ( parent_li.hasClass( 'wrmm-item' ) ? ' .mm-container-outer ' : ' > ul ' ) );\n\t\t\tvar height_menu_show = menu_show.height();\n\t\t\tvar menu_outer = parent_menu_elment.find( '.site-navigator' );\n\t\t\tvar height_menu_outer = menu_outer.height();\n\t\t\tvar list_breadcrumbs = '';\n\n\t\t\t// Set height for menu if content hide\n\t\t\tif ( height_menu_show > height_menu_outer ) {\n\t\t\t\tmenu_outer.attr( 'style', 'height:' + height_menu_show + 'px;' );\n\t\t\t}\n\n\t\t\tparent_li.addClass( 'active-slide' ).addClass( 'slide-level-' + menu_level );\n\n\t\t\t// Add class no padding icon if not children\n\t\t\tif ( !parent_li.find( ' > ul > li.menu-item-has-children' ).length )\n\t\t\t\tparent_li.find( ' > ul ' ).addClass( 'not-padding-icon' );\n\n\t\t\t// Hide menu\n\t\t\tif ( children_parent_ul.length ) {\n\t\t\t\tvar length_slide = children_parent_ul.length;\n\t\t\t\tchildren_parent_ul.each( function( key, val ) {\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t$( val ).addClass( 'slide-left' );\n\n\t\t\t\t\t\t// To last\n\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\t\t\t\t\t\t\t// Animation for megamenu\n\t\t\t\t\t\t\tif ( parent_li.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\t\t\tparent_li.addClass( 'slide-normal' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, 100 * key );\n\t\t\t\t} );\n\t\t\t}\n\t\t\t;\n\n\t\t\t// Show menu\n\t\t\tif ( children_sub.length && !parent_li.hasClass( 'wrmm-item' ) ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tchildren_sub.each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).addClass( 'slide-normal' );\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\t\t\t}\n\t\t\t;\n\n\t\t\t/** * Add breadcrumbs ** */\n\n\t\t\t// Add item to list breadcrumbs\n\t\t\telement_breadcrumbs[ menu_level ] = text_title;\n\n\t\t\t// Show breadcrumbs\n\t\t\tparent_menu_elment.find( '.menu-breadcrumbs-outer' ).addClass( 'show-breadcrumbs' );\n\n\t\t\t// Remove all item breadcrumbs old\n\t\t\tparent_menu_elment.find( '.item-breadcrumbs' ).remove();\n\n\t\t\tif ( Object.keys( element_breadcrumbs ).length ) {\n\t\t\t\t$.each( element_breadcrumbs, function( key, val ) {\n\t\t\t\t\tlist_breadcrumbs += '<div class=\"element-breadcrumbs item-breadcrumbs\"><i class=\"fa fa-long-arrow-right\"></i><span class=\"title-breadcrumbs\" data-level=\"' + key + '\">' + val + '</span></div>';\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Add all new item breadcrumbs\n\t\t\tparent_menu_elment.find( '.menu-breadcrumbs' ).append( list_breadcrumbs );\n\n\t\t\t// Set width breadcrumbs for fullscreen style\n\t\t\tif ( parent_menu_elment.hasClass( 'fullscreen-style' ) ) {\n\n\t\t\t\tvar navigator_inner_info = _this.closest( '.navigator-column-inner' )[ 0 ].getBoundingClientRect();\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\tvar width_breadcrumbs = width_content_broswer - navigator_inner_info.left;\n\n\t\t\t\tparent_menu_elment.find( '.menu-breadcrumbs-outer' ).css( 'width', parseInt( width_breadcrumbs ) );\n\t\t\t\t_this.closest( '.navigator-column-inner' ).width( navigator_inner_info.width );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Breadcrumbs slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .menu-breadcrumbs .element-breadcrumbs .title-breadcrumbs, .hb-menu-outer .animation-vertical-slide .menu-breadcrumbs .element-breadcrumbs .title-breadcrumbs', function() {\n\n\t\t\tvar _this = $( this );\n\t\t\tvar level = _this.attr( 'data-level' );\n\t\t\tvar parent_top = _this.closest( '.site-navigator-outer' );\n\t\t\tvar length_breadcrumbs = Object.keys( element_breadcrumbs ).length;\n\t\t\tvar parent_breadcrumbs = _this.closest( '.menu-breadcrumbs' );\n\n\t\t\t// Disable item breadcrumbs last\n\t\t\tif ( level == length_breadcrumbs ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( parent_top.find( '.slide-level-' + length_breadcrumbs + '.wrmm-item' ).length ) {\n\t\t\t\tparent_top.find( '.slide-level-' + length_breadcrumbs + '.wrmm-item' ).removeClass( 'slide-normal' );\n\t\t\t} else {\n\t\t\t\t// Remove animate last level\n\t\t\t\tparent_top.find( '.slide-level-' + length_breadcrumbs + '> ul > li' ).each( function( key, val ) {\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t$( val ).removeClass( 'slide-normal' );\n\t\t\t\t\t}, 100 * key );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( level == 'all' ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tvar length_slide = parent_top.find( '.site-navigator > li' ).length;\n\t\t\t\t\tparent_top.find( '.site-navigator > li' ).each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).removeClass( 'slide-left' );\n\n\t\t\t\t\t\t\t// To last\n\t\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\n\t\t\t\t\t\t\t\t// Conver to heigh menu normal\n\t\t\t\t\t\t\t\t$( val ).closest( '.site-navigator' ).removeAttr( 'style' );\n\n\t\t\t\t\t\t\t\t/** * Remove all class releated ** */\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-normal' ).removeClass( 'slide-normal' );\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-left' ).removeClass( 'slide-left' );\n\t\t\t\t\t\t\t\tfor ( var i = 1; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + i ).removeClass( 'slide-level-' + i );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\t\tparent_top.find( '.active-slide' ).removeClass( 'active-slide' );\n\n\t\t\t\t\t\t\t\t// Hide breadcrumbs\n\t\t\t\t\t\t\t\t_this.closest( '.menu-breadcrumbs-outer' ).removeClass( 'show-breadcrumbs' );\n\n\t\t\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t\t\t// Remove item breadcrumbs\n\t\t\t\t\t\t\t\t\telement_breadcrumbs = {};\n\t\t\t\t\t\t\t\t\tparent_breadcrumbs.find( '.item-breadcrumbs' ).remove();\n\t\t\t\t\t\t\t\t}, 300 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\n\t\t\t} else {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tvar length_slide = parent_top.find( '.slide-level-' + level + ' > ul > li' ).length;\n\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' > ul > li' ).each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).removeClass( 'slide-left' );\n\n\t\t\t\t\t\t\t// To last\n\t\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\n\t\t\t\t\t\t\t\t// Remove class releated\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' ul ul .slide-normal' ).removeClass( 'slide-normal' );\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' ul ul .slide-left' ).removeClass( 'slide-left' );\n\t\t\t\t\t\t\t\tfor ( var i = level; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tif ( i != level ) {\n\t\t\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + i ).removeClass( 'slide-level-' + i );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' .active-slide' ).removeClass( 'active-slide' );\n\n\t\t\t\t\t\t\t\t// Remove item breadcrumbs\n\t\t\t\t\t\t\t\tfor ( var i = level; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tif ( i != level ) {\n\t\t\t\t\t\t\t\t\t\tdelete element_breadcrumbs[ i ];\n\t\t\t\t\t\t\t\t\t\tparent_breadcrumbs.find( '.title-breadcrumbs[data-level=\"' + i + '\"]' ).parent().remove();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Accordion animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .hb-menu .animation-vertical-accordion .icon-has-children, .hb-menu-outer .animation-vertical-accordion .icon-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\n\t\t\tif ( parent_li.hasClass( 'active-accordion' ) ) {\n\t\t\t\tparent_li.removeClass( 'active-accordion' );\n\t\t\t\tif ( parent_li.find( ' > .mm-container-outer' ).length ) {\n\t\t\t\t\tparent_li.find( ' > .mm-container-outer' ).stop( true, true ).slideUp( 300 );\n\t\t\t\t} else {\n\t\t\t\t\tparent_li.find( ' > .sub-menu' ).stop( true, true ).slideUp( 300 );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparent_li.addClass( 'active-accordion' );\n\t\t\t\tif ( parent_li.find( ' > .mm-container-outer' ).length ) {\n\t\t\t\t\tparent_li.find( ' > .mm-container-outer' ).stop( true, true ).slideDown( 300 );\n\t\t\t\t} else {\n\t\t\t\t\tparent_li.find( ' > .sub-menu' ).stop( true, true ).slideDown( 300 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tfunction get_width_menu_center( element ){\n\t\t\tvar width_all = 0;\n\n\t\t\t$.each( element, function(){\n\t\t\t\tvar _this = $(this);\n\t\t\t\tif( _this.hasClass( 'hb-menu' ) && _this.hasClass( 'text-layout' ) ) {\n\t\t\t\t\tvar width = ( _this.outerWidth( true ) - _this.find( '.site-navigator-outer' ).width() ) + 47;\n\t\t\t\t\twidth_all += width;\n\t\t\t\t} else {\n\t\t\t\t\tvar width = _this.outerWidth( true );\n\t\t\t\t\twidth_all += width;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn width_all;\n\t\t}\n\n\t\tfunction calc_element_center( el_prev, spacing_average, center_element ){\n\t\t\tvar width_all_el = 0;\n\t\t\tvar margin_left = 0;\n\n\t\t\t$.each( el_prev, function(){\n\t\t\t\tvar _this = $(this);\n\t\t\t\tvar width = _this.outerWidth( true );\n\t\t\t\twidth_all_el += width;\n\t\t\t} );\n\n\t\t\tif( width_all_el < spacing_average ) {\n\t\t\t\tmargin_left = spacing_average - width_all_el;\n\t\t\t}\n\n\t\t\tif( margin_left ) {\n\t\t\t\tvar lits_flex = center_element.prevAll( '.hb-flex' );\n\n\t\t\t\tif( lits_flex.length ) {\n\t\t\t\t\tvar width_flex = parseInt( margin_left/lits_flex.length )\n\t\t\t\t\tlits_flex.width( width_flex );\n\t\t\t\t\tlits_flex.addClass( 'not-flex' );\n\t\t\t\t} else {\n\t\t\t\t\tcenter_element.css( 'marginLeft', ( margin_left + parseInt( center_element.css( 'marginLeft' ) ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction resize_menu() {\n\t\t\t// Each rows\n\t\t\t$.each( $( '.wr-desktop .horizontal-layout .hb-section-outer' ), function() {\n\t\t\t\tvar row = $(this);\n\t\t\t\tvar menu_row = row.find( '.hb-menu.text-layout' );\n\t\t\t\tvar center_element = row.find( '.element-item.center-element' );\n\t\t\t\tvar list_flex = row.find( '.hb-flex' );\n\n\t\t\t\t// Set center element and menu more has menu element in row\n\t\t\t\tif ( menu_row.length ) {\n\n\t\t\t\t\t/* Reset */\n\t\t\t\t\tmenu_row.find( '.site-navigator > .menu-item' ).removeClass( 'item-hidden' );\n\t\t\t\t\tmenu_row.find( '.menu-more' ).remove();\n\t\t\t\t\trow.find( '.center-element' ).removeAttr( 'style' );\n\t\t\t\t\tlist_flex.removeAttr( 'style' );\n\t\t\t\t\tlist_flex.removeClass( 'not-flex' );\n\n\t\t\t\t\t// Menu element is center element\n\t\t\t\t\tif ( center_element.hasClass( 'hb-menu' ) && center_element.hasClass( 'text-layout' ) ) {\n\n\t\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\t\t\t\t\t\tvar next_menu = center_element.nextAll( ':not(\".hb-flex\")' );\n\t\t\t\t\t\tvar width_prev_menu = get_width_menu_center( prev_menu );\n\t\t\t\t\t\tvar width_next_menu = get_width_menu_center( next_menu );\n\t\t\t\t\t\tvar width_spacing_center = ( width_prev_menu > width_next_menu ) ? width_prev_menu : width_next_menu;\n\t\t\t\t\t\tvar width_menu_center = center_element.outerWidth( true );\n\t\t\t\t\t\tvar width_calc_center = width_parent - ( width_spacing_center * 2 );\n\n\t\t\t\t\t\tif( width_menu_center >= width_calc_center ) {\n\t\t\t\t\t\t\tresize_menu_list( center_element, width_calc_center );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\n\t\t\t\t\t\tresize_menu_list( prev_menu, spacing_average );\n\t\t\t\t\t\tresize_menu_list( next_menu, spacing_average );\n\n\t\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\n\t\t\t\t\t// Menu element isn't center element but has center element\n\t\t\t\t} else if ( center_element.length ) {\n\t\t\t\t\t/* Reset */\n\t\t\t\t\tcenter_element.removeAttr( 'style' );\n\n\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\t\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\t\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\t\t\t\t\tvar next_menu = center_element.nextAll( ':not(\".hb-flex\")' );\n\n\t\t\t\t\tresize_menu_list( prev_menu, spacing_average );\n\t\t\t\t\tresize_menu_list( next_menu, spacing_average );\n\n\t\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\n\t\t\t\t\t// Haven't center element\n\t\t\t\t} else {\n\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\t\tresize_menu_list( row.find( '.element-item:not(.hb-flex)' ), width_parent );\n\t\t\t\t}\n\n\t\t\t\t// Set center element not menu element in row\n\t\t\t} else if ( center_element.length ) {\n\t\t\t\t/* Reset */\n\t\t\t\trow.find( '.center-element' ).removeAttr( 'style' );\n\t\t\t\trow.find( '.hb-flex' ).removeAttr( 'style' );\n\t\t\t\tlist_flex.removeClass( 'not-flex' );\n\n\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\n\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\t\t\t\t}\n\t\t\t} );\n}\n\nfunction resize_menu_list( list_element, width_parent ) {\n\tvar list_menu = [];\n\tvar el_not_menu_flex = [];\n\n\t$.each( list_element, function() {\n\t\tvar _this = $( this );\n\t\tif ( _this.hasClass( 'hb-menu' ) && _this.hasClass( 'text-layout' ) ) {\n\t\t\tlist_menu.push( _this );\n\t\t} else {\n\t\t\tel_not_menu_flex.push( _this );\n\t\t}\n\t} )\n\n\tvar count_menu = list_menu.length;\n\n\t$.each( el_not_menu_flex, function() {\n\t\twidth_parent -= $( this ).outerWidth( true );\n\t} );\n\n\tvar width_rest = parseInt( width_parent / count_menu );\n\tvar width_rest_long = 0;\n\tvar is_plus_rest_long = false;\n\tvar menus_more = [];\n\n\t\t\t// Plus for width rest if menu not exceeds\n\t\t\tvar i = 0;\n\t\t\t$.each( list_menu, function() {\n\t\t\t\tvar width_menu = $( this ).outerWidth( true );\n\t\t\t\tif ( width_menu < width_rest ) {\n\t\t\t\t\twidth_rest_long += width_rest - width_menu;\n\t\t\t\t} else {\n\t\t\t\t\tmenus_more.push( i );\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t} );\n\n\t\t\twidth_rest += parseInt( width_rest_long / menus_more.length );\n\n\t\t\t$.each( menus_more, function( key, val ) {\n\t\t\t\tvar _this = $( list_menu[ val ] );\n\t\t\t\tvar menu_items = _this.find( '.site-navigator > .menu-item' );\n\n\t\t\t\tif ( ! menu_items.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar width_this = _this.outerWidth( true );\n\t\t\t\tvar width_outer = _this.find( '.site-navigator-outer' ).width();\n\t\t\t\tvar width_rest_item = width_rest - ( ( width_this - width_outer ) + 52 );\n\t\t\t\tvar width_menu_items = 0;\n\t\t\t\tvar show_menu_more = false;\n\n\t\t\t\t$.each( menu_items, function( key, val ) {\n\t\t\t\t\twidth_menu_items += $( this ).outerWidth( true );\n\t\t\t\t\tif ( width_menu_items >= width_rest_item ) {\n\t\t\t\t\t\t$( this ).addClass( 'item-hidden' );\n\t\t\t\t\t\tshow_menu_more = true;\n\t\t\t\t\t}\n\t\t\t\t\t;\n\t\t\t\t} );\n\n\t\t\t\tif ( show_menu_more ) {\n\t\t\t\t\t_this.find( '.site-navigator-inner' ).append( '<div class=\"menu-more\"><div class=\"icon-more\"><span class=\"wr-burger-menu\"></span><i class=\"fa fa-caret-down\"></i></div><div class=\"nav-more\"></div></div>' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tresize_menu();\n\n\t\t$( window ).resize( _.debounce( function() {\n\t\t\tresize_menu();\n\t\t}, 300 ) );\n\t}", "toggleMenu() {\n var menuBar = document.querySelector('.side-menu');\n var mapWidth = document.querySelector('#map');\n if(menuBar.style.left !== \"-100%\") {\n menuBar.style.left = \"-100%\";\n mapWidth.style.left = \"0\";\n } else {\n menuBar.style.left = \"0\";\n mapWidth.style.left = \"268px\";\n }\n }", "function clearMenu () {\n let menuClosed = false;\n\n if (myRBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRBkmkMenuStyle.visibility = \"hidden\";\n\tmyRBkmkMenu_open = false;\n }\n else if (myRShowBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRShowBkmkMenuStyle.visibility = \"hidden\";\n\tmyRShowBkmkMenu_open = false;\n }\n else if (myRFldrMenu_open) {\n\tmenuClosed = true;\n\tMyRFldrMenuStyle.visibility = \"hidden\";\n\tmyRFldrMenu_open = false;\n }\n else if (myRMultMenu_open) {\n\tmenuClosed = true;\n\tMyRMultMenuStyle.visibility = \"hidden\";\n\tmyRMultMenu_open = false;\n }\n else if (myBBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBBkmkMenuStyle.visibility = \"hidden\";\n\tmyBBkmkMenu_open = false;\n }\n else if (myBResBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBResBkmkMenuStyle.visibility = \"hidden\";\n\tmyBResBkmkMenu_open = false;\n }\n else if (myBFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBFldrMenuStyle.visibility = \"hidden\";\n\tmyBFldrMenu_open = false;\n }\n else if (myBResFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBResFldrMenuStyle.visibility = \"hidden\";\n\tmyBResFldrMenu_open = false;\n }\n else if (myBSepMenu_open) {\n\tmenuClosed = true;\n\tMyBSepMenuStyle.visibility = \"hidden\";\n\tmyBSepMenu_open = false;\n }\n else if (myBMultMenu_open) {\n\tmenuClosed = true;\n\tMyBMultMenuStyle.visibility = \"hidden\";\n\tmyBMultMenu_open = false;\n }\n else if (myBProtMenu_open) {\n\tmenuClosed = true;\n\tMyBProtMenuStyle.visibility = \"hidden\";\n\tmyBProtMenu_open = false;\n }\n else if (myBProtFMenu_open) {\n\tmenuClosed = true;\n\tMyBProtFMenuStyle.visibility = \"hidden\";\n\tmyBProtFMenu_open = false;\n }\n else if (myMGlassMenu_open) {\n\tmenuClosed = true;\n\tMyMGlassMenuStyle.visibility = \"hidden\";\n\tmyMGlassMenu_open = false;\n }\n\n myMenu_open = isResultMenu = false;\n return(menuClosed);\n}", "function AbreExpande(menu){\n\tif (menu.style.visibility==\"hidden\"){\n\t\tmenu.style.visibility=\"visible\";\n\t\treturn true;\n\t} else {\n\t\tmenu.style.visibility=\"hidden\";\n\t\treturn false;\n\t}\n}", "function toggleMenu(ele) {\n var menuHeight = ele.offsetHeight;\n if (menuHeight) {\n ele.style.height = 0;\n } else {\n ele.style.height = ele.scrollHeight + \"px\";\n }\n }", "function medMenu(){\n\t// reset menu items\n\t$('menu-toggle a').off('click');\n\t$('#top-nav, #bottom-nav').find('*').removeClass('expand open focus');\n\t$('.menu-toggle').remove();\n\t\n\t//create the menu toggle items\n\t$('#top-nav .menu').before('<div class=\"menu-toggle\"><a href=\"#\">menu <span class=\"indicator\">'+ menuOpenText +'</span></a></div>');\n\t$('#bottom-nav .menu').before('<div class=\"menu-toggle\"><a href=\"#\">Quick Links<span class=\"indicator\">'+ menuOpenText +'</span></a></div>');\n\t\n\t//add anchor tags to all bottom navigation headings\n\t$('#bottom-nav .menu h3').each(function(index, element){\n\t\tvar tn = $(element).text();\n\t\t$(element).html('<a href=\"#\">'+tn+'</a>');\n\t});\n\t\n\t//append the + indicator\n\t$('.menu h3 a').append('<span class=\"indicator\">'+ menuOpenText +'</span>');\n\t\n\t// --- end reset\n\t\n\t//Top - change top nav menu states\n\t$('#top-nav .menu-toggle a').click(function() {\n\t\t//expand the menu\n\t\t$(this).toggleClass('open');\n\t\t$('#top-nav .menu').toggleClass('expand');\n\t\t//figure out whether the indicator should be changed to + or -\n\t\tvar newValue = $(this).find('span.indicator').text() == menuOpenText ? menuCloseText : menuOpenText;\n\t\t//set the new value of the indicator\n\t\t$(this).find('span.indicator').text(newValue);\n\t\treturn false;\n\t});\n\t\n\t//Top - submenu items\n\t$('#top-nav .menu h3').click(function(){\n\t\t\n\t\t//find the current submenu\n\t\tvar currentItem = $(this).siblings('.submenu');\n\t\t//close other submenus by removing the expand class\n\t\t$('#top-nav ul.submenu').not(currentItem).removeClass('expand');\n\t\t//change the indicator of any closed submenus\n\t\t$('#top-nav .menu h3').not(this).removeClass('open').find('span.indicator:contains(menuCloseText)').text(menuOpenText);\n\t\t//open the selected submenu\n\t\t$(this).toggleClass('open').siblings('.submenu').toggleClass('expand');\n\t\t//change the selected submenu indicator\n\t\tvar newValue = $(this).find('span.indicator').text() == menuOpenText ? menuCloseText : menuOpenText;\n\t\t$(this).find('span.indicator').text(newValue);\n\t\treturn false;\t\t\n\t});\n\t\n\t//Bottom - change menu states\n\t$('#bottom-nav .menu-toggle a').click(function() {\n\t\t//expand the menu\n\t\t$(this).toggleClass('open');\n\t\t$('#bottom-nav .menu').toggleClass('expand');\n\t\t//figure out whether the indicator should be changed to + or -\n\t\tvar newValue = $(this).find('span.indicator').text() == menuOpenText ? menuCloseText : menuOpenText;\n\t\t//set the new value of the indicator\n\t\t$(this).find('span.indicator').text(newValue);\n\t\treturn false;\n\t});\n\t\n\t//Bottom - nav submenu items\n\t$('#bottom-nav .menu h3').click(function(){\n\t\t//find the current submenu\n\t\tvar currentItem = $(this).siblings('.submenu');\n\t\t//close other submenus by removing the expand class\n\t\t$('#bottom-nav ul.submenu').not(currentItem).removeClass('expand');\n\t\t//change the indicator of any closed submenus\n\t\t$('#bottom-nav .menu h3').not(this).removeClass('open').find('span.indicator:contains(menuCloseText)').text(menuOpenText);\n\t\t//open the selected submenu\n\t\t$(this).toggleClass('open').siblings('.submenu').toggleClass('expand');\n\t\t//change the selected submenu indicator\n\t\tvar newValue = $(this).find('span.indicator').text() == menuOpenText ? menuCloseText : menuOpenText;\n\t\t$(this).find('span.indicator').text(newValue);\n\t\treturn false;\t\t\n\t});\n\t\n\t//set current window state\n\twindowState='medium';\n}", "function openNav() {\r\n\tif(menuopen==false){\r\n\t\tdocument.getElementById(\"mysidenav\").style.height = \"300px\"; //This is how big it opens up to\r\n\r\n\t\tmenuopen=true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.getElementById(\"mysidenav\").style.height = \"0\"; //This makes it disappear\r\n\t\tmenuopen=false;\r\n\t}\r\n\t\r\n\t\r\n}", "function saveHideMenuSettings()\n{\n if(window.innerWidth > 991)\n {\n if($('body').hasClass('sidebar-collapse'))\n {\n guiLocalSettings.set('hideMenu', false);\n }\n else\n {\n guiLocalSettings.set('hideMenu', true);\n }\n }\n}", "function menuGripClick() {\n // console.log('menuGripClick');\n\n PageData.MenuOpen = !PageData.MenuOpen;\n setMenuPosition();\n\n if (!PageData.MenuOpen && PageData.ControlsOpen) {\n PageData.ControlsOpen = false;\n setControlsPosition();\n }\n}", "function closeNav() {\n$('#mySidenav').css('width', '0');\n$('#main').css('marginLeft','0');\n}", "function showMallNav() {\n classie.remove(mallNav, 'mallnav--hidden');\n }", "function hideAllMenuAction() {\n $$('.third-toolbar').removeClass('show');\n $$('.floating-product-color ').removeClass('show');\n}", "function toogleAsideMenu(state) {\n\t\t\tstate = (state === undefined) ? 'toggle' : state;\n\t\t\tif (state === 'toggle') {\n\t\t\t\tstate = !header.states.showAsidemenu;\n\t\t\t}\n\t\t\theader.states.showAsidemenu = state;\n\t\t}", "handleMouseDownOnMenu(e) {\n if (window.innerWidth <= 768) {\n this.toggleMenu();\n }\n e.stopPropagation();\n }", "hide() {\n this.backButtonOpen_ = false;\n chrome.accessibilityPrivate.setSwitchAccessMenuState(\n false, SAConstants.EMPTY_LOCATION, 0);\n this.menuPanel_.setFocusRing(SAConstants.BACK_ID, false);\n }", "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "function menuExpandedOnMouseOver(){\n scrolling = false;\n}", "function turnOffMenus() {\r\n\tif (edit_menu_visible) toggleMenu('edit-menu');\r\n\tif (element_menu_visible) toggleMenu('element-menu');\r\n\tif (pen_menu_visible) toggleMenu('pen-menu');\r\n\tif (shape_menu_visible) toggleMenu('shape-menu');\r\n\tif (text_menu_visible) toggleMenu('text-menu');\r\n\tif (profile_visible) toggleProfile();\r\n}", "function closeallmenus() {\n\t\tif (active_tabcontent != null) {\n\t\t\tblocknone(active_tabcontent,active_tab1,'none','#000000','#ABCDEF','pointer');\n\t\t}\n\t}", "function largeMenu() {\n $('#navigation-large').singlePageNav({\n offset: $('#navbar').outerHeight(),\n filter: ':not(.external)',\n speed: 750,\n currentClass: 'active',\n\n beforeStart: function() {},\n onComplete: function() {}\n });\n }", "function hideAllSubMenus_menuhdr() {\n\tfor ( x=0; x<totalButtons_menuhdr; x++) {\n\t\tmoveObjectTo_menuhdr(\"submenu\" + (x+1) + \"_menuhdr\",-500, -500 );\n\t}\n}", "function navCloseHandler() {\n if (!widthFlg) {\n $navigation.removeClass('show');\n $navigation.attr('style', '');\n $btnMenu.text(\"menu\");\n $dropdownItem.removeClass('active');\n $dropdownItem.attr('style', '');\n $dropdownListItem.find(\"ul\").removeAttr('style');\n $(\"body\").removeClass(\"push_right\");\n $(\"body\").removeAttr('style');\n $btnMenu.css('display', 'none');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\" \");\n $dropdownItem.find('i.material-icons').text(\" \");\n } else {\n $btnMenu.css('display', 'block');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\"remove\");\n $dropdownItem.find('i.material-icons').text(\"keyboard_arrow_right\");\n }\n }", "function closeMenuEvent() {\n // Vars\n var firstLevelMenuItem = '#tablet-mobile-menu ul.menu li a';\n var page = jQuery(\"body, html\");\n\n jQuery('#menu-btn-toggle').removeClass('open');\n jQuery(firstLevelMenuItem).parent().removeClass('active-open');\n\n //TODO Change the skin position only when present\n jQuery(page).css(\"background-position\", \"center top\").css(\"position\", \"initial\");\n}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function menuLayout() {\n if (homepage.width() > homepage.height()) {\n mobMenuItem.addClass(\"mobile-menu-horizontal\");\n mobMenuItem.removeClass(\"mobile-menu-vertical\");\n } else {\n mobMenuItem.addClass(\"mobile-menu-vertical\");\n mobMenuItem.removeClass(\"mobile-menu-horizontal\");\n }\n }", "function removeMenuChanges() {\n let menu = document.getElementById('resizable');\n\n if (menu.style.right) {\n menu.style.right = null;\n }\n if (menu.style.left) {\n menu.style.left = null;\n }\n\n $('.menu').removeClass('menu-left');\n $('.menu').removeClass('menu-right');\n $('.window').removeClass('window-menu-right');\n $('.menu-bottom').addClass('hidden');\n $('.menu').removeClass('hidden');\n }", "function closeMenu() {\n g_IsMenuOpen = false;\n}", "function closeMenuArea() {\n var trigger = $('.side-menu-trigger', menuArea);\n trigger.removeClass('side-menu-close').addClass('side-menu-open');\n if (menuArea.find('> .rt-cover').length) {\n menuArea.find('> .rt-cover').remove();\n }\n\n if( newfeatureObj.rtl =='yes' ) {\n $('.sidenav').css('transform', 'translateX(-100%)');\n }else {\n $('.sidenav').css('transform', 'translateX(100%)');\n }\n }", "function hideGoMenu() {\r\n var menu = document.getElementById(\"gameOverMenu\");\r\n menu.style.zIndex = -1;\r\n menu.style.visibility = \"hidden\";\r\n}", "function openMenuBar() {\n setOpen(!open)\n }", "function closeSideBar(){\n setVideochat(false);\n setPeoples(false);\n }", "function menuForSmallScreen() {\n navMenuList.hide();\n\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n\n function toggleSmallMenu() {\n navMenuList.fadeToggle();\n toggleButtons();\n }\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleSmallMenu();\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n menuEl.click(function () {\n setTimeout(toggleSmallMenu, 600);\n });\n }", "function removeMenuOpenClass(){\n\tremoveClass(html, 'mobileMenuOpen');\n\taddClass(html, 'mobileMenuClosed');\n navClasses();//check if we need to put back 'desktopMenu' or 'mobileMenu'\n menuHeight();\n}" ]
[ "0.6851475", "0.6823965", "0.6640691", "0.6632173", "0.6527594", "0.64515966", "0.6439914", "0.6384937", "0.6383023", "0.6374779", "0.63484186", "0.63368857", "0.6255914", "0.6218215", "0.62005925", "0.61936975", "0.6181428", "0.61752415", "0.61665326", "0.61537594", "0.6138406", "0.6097998", "0.60977143", "0.60954905", "0.60566646", "0.600524", "0.5994737", "0.59946996", "0.5990169", "0.5985388", "0.59837407", "0.59837407", "0.5974437", "0.59722453", "0.5968007", "0.59618765", "0.5957667", "0.59464", "0.59343284", "0.59331155", "0.592902", "0.5927168", "0.5920143", "0.5915824", "0.59142673", "0.59142673", "0.5906522", "0.59033346", "0.590121", "0.58927834", "0.58854955", "0.5871183", "0.5867885", "0.58622456", "0.5860414", "0.5858698", "0.5857606", "0.5849758", "0.5846834", "0.58416337", "0.5824457", "0.5821913", "0.58160424", "0.58107", "0.58013326", "0.57967657", "0.57919055", "0.578061", "0.5776302", "0.57750136", "0.5772882", "0.57658124", "0.5763132", "0.575278", "0.5748731", "0.5744698", "0.5744075", "0.57426715", "0.57328904", "0.5729816", "0.5728983", "0.5718781", "0.5718032", "0.571482", "0.5711452", "0.5709556", "0.57085556", "0.57073414", "0.56965643", "0.5695584", "0.5695584", "0.5694407", "0.5691391", "0.5688365", "0.5683622", "0.5677776", "0.56729484", "0.5672872", "0.56727266", "0.5669849" ]
0.69680154
0
Enables selecting a menu item in menu bottom
function setMenuBottomActive() { $('.menu-a-bottom.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_menubuttonTap(e) {\n this.shadowRoot.querySelector(\"#listbox\").style.display = \"inherit\";\n if (this.resetOnSelect) {\n this.selected = \"\";\n }\n }", "function selectMenuItem(item) {\n self.selected = item;\n $state.go(item);\n self.toggleList();\n }", "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAllActive()) { //Si on est dans la validation du delete\n\t\tdelAll();\n\t}\n}", "function setEnabledItemOfMenu(bdId, enabled) {\n\t\tvar item = this.getFutureItem(bdId);\n\t\tif (item != null) {\n\t\t\titem.setEnabled(enabled);\n\t\t\tthis.write(this.color);\n\t\t}\n\t}", "_levelOneOpenDropDown(focusedItem) {\n if (focusedItem && focusedItem instanceof JQX.MenuItemsGroup) {\n this._selectionHandler({ target: focusedItem, isTrusted: true });\n }\n }", "function markingMenuOnSelect(selectedItem) {\r\n\ttracker.recordSelectedItem(selectedItem.name);\r\n\tdocument.getElementById(\"selectedItem\").innerHTML = selectedItem.name;\r\n}", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "function Select() {\r\n setButtonDisable(add, true);\r\n setButtonDisable(edit, true);\r\n\r\n if (!list.selectedItem) {\r\n setButtonDisable(del, true);\r\n return false;\r\n }\r\n entry.value = list.selectedItem.getAttribute(\"label\");\r\n setButtonDisable(del, false);\r\n return true;\r\n}", "function selectClickOnLinkClick (e) {\n selectMenuItem('click-on-link-menu', 'click');\n e.preventDefault();\n}", "function select_default_menu_item()\r\n{\r\n\tmenu_item_selected(document.getElementById('mi_home'));\r\n\t//menu_item_selected(document.getElementById('mi_custreqs'));\r\n}", "function click_lyrMenu_1_조회() {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "function click_lyrMenu_1_조회() {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "onItemSelect(evt, item) {\n var self = this;\n if (self.isLocked) return;\n\n if (self.settings.mode === 'multi') {\n preventDefault(evt);\n self.setActiveItem(item, evt);\n }\n }", "function itemMenu(e) {\n\te.preventDefault();\n\tItemSelection = e.target;\n\tconst[idx, isSource] = findNode(ItemSelection);\n\tconst elemName = (isSource) ? \"sourceDropdown\" : \"deviceDropdown\";\n\tconst menu = document.getElementById(elemName);\n\tmenu.style.top = `${e.pageY}px`;\n\tmenu.style.left = `2rem`;\n\tmenu.classList.toggle(\"show\");\n}", "function menuOptions() {}", "function selectMenu ( menu ) {\n self.selected = angular.isNumber(menu) ? $scope.menus[menu] : menu;\n window.location.href = self.selected.goto;\n }", "function mouseSelect(e) {\r\n\tif (fActiveMenu) {\r\n\t\tif (oOverMenu == false) {\r\n\t\t\toOverMenu = false;\r\n\t\t\tdocument.getElementById(fActiveMenu).style.display = \"none\";\r\n\t\t\tfActiveMenu = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function menuSelect( item ) {\n var menuId = createId( \"menu_\", item );\n if ( menuSelected ) {\n if ( menuSelected.id == menuId ) {\n return false;\n }\n else {\n menuSelected.removeClassName( \"selected\" );\n }\n }\n menuSelected = $( menuId );\n menuSelected.addClassName( \"selected\" );\n return true;\n}", "[SET_MENU_ACTIVE] (state, button) {\n\n var menu = state[button['menu_name']]\n if( menu != undefined ){\n menu[menu.indexOf(button) ].active = !menu[ menu.indexOf(button) ].active\n }else{\n var menu = state[ button['owner_type'] ]\n for(var btn in menu){\n if(menu[btn].id == button.menu_id){\n var subMenu = menu[btn].submenu \n menu[btn].active = true\n subMenu[ subMenu.indexOf(button) ].active = !subMenu[ subMenu.indexOf(button) ].active\n }\n } \n } \n }", "function menuHighlightClick(event) {\n // console.log('menuHighlightClick');\n\n event.preventDefault();\n\n SvgModule.Data.Highlighting = !SvgModule.Data.Highlighting;\n\n updateMenu();\n}", "function OptionsMenu() {\n\tDisable();\n\toptionsMenu.SetActive(true);\n}", "function install_menu() {\n var config = {\n name: 'lesson_lock',\n submenu: 'Settings',\n title: 'Lesson Lock',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function selectMenuitem(evt) {\r\n\r\n var $this = $(this);\r\n\r\n var $element = $(evt.target);\r\n\r\n var container = $.radmenu.container;\r\n\r\n if (!$element.hasClass(container.itemClz))\r\n $element = $element.closest(\".\" + container.itemClz);\r\n\r\n var isInNested = $element.parents(\".\" + container.itemClz).length > 0;\r\n\r\n var index = $element.index();\r\n\r\n if (!isInNested)\r\n $this.parents(\".\" + container.clz).radmenu(index);\r\n\r\n else\r\n $this.radmenu(index);\r\n\r\n cancelBubble(evt);\r\n\r\n }", "function select_mode_in_menu(mode) {\n EventUtils.synthesizeMouseAtCenter(appmenu_button, {}, mc.window);\n mc.click_through_appmenu(\n [{ id: \"appmenu_View\" }, { id: \"appmenu_FolderViews\" }],\n { value: mode }\n );\n appmenu_popup.hidePopup();\n}", "function setCurrentMenu(menu) {\n menuCurrent = menu;\n }", "expandMenu() {\r\n\t}", "function click_lyrMenu_1_조회(ui) {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n\n }", "function enableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" || typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"hidden\";\r\n\treturn 0;\r\n}", "function makeMenuSelection(selectedItem) {\n $('nav li a').each(function() {\n $(this).removeClass('selected');\n });\n\n selectedItem.addClass('selected');\n }", "function setItemMenu(menu) {\n\t\tthis.menu = menu;\n\t}", "function showSelected() {\n const anchorList = document.querySelectorAll(\".main-flex-link\");\n for (let a = 0; a < anchorList.length; a++) {\n if (anchorList[a].textContent == (this.option ?? \"Home\")) {\n //con2 to prevent spam [ex: hitting menu over and over and forcing un-ness comps]\n if (lastLoaded != this.option) {\n anchorList[a].classList.add(\"menu-selected\");\n resetPage();\n lastLoaded = this.option;\n generatorHash[this.option]();\n }\n } else {\n anchorList[a].classList.remove(\"menu-selected\");\n }\n }\n}", "function enableFilingStatus(){\r\n\t\t$('select').selectmenu('enable');\t\r\n\t}", "activateDefaultMenu() {\r\n const activeMenus = this.getRenderedMenuItems() && this.getRenderedMenuItems().filter(menu => {\r\n return menu && menu['active'];\r\n });\r\n if (activeMenus && activeMenus.length === 0) {\r\n const firstMenu = this.getRenderedMenuItems()[0];\r\n if (firstMenu) {\r\n firstMenu['active'] = true;\r\n }\r\n }\r\n }", "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\r\n if(options.menu){\r\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\r\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\r\n }\r\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass(ACTIVE);\n }\n }", "openMenu() {\n this._itemContainer.visible = true;\n this.accessible.expanded = true;\n this._label.accessible.expanded = true;\n }", "function click_lyrMenu_조회(ui) {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "function click_lyrMenu_조회(ui) {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "current() {\n for (let path in menus) {\n menus[path].options.map(item => item.selected = item.url != '/' && ('#' + $location.path()).indexOf(item.url) != -1);\n }\n }", "function initMenu() {\n\n //removeSelectedClassForMenu();\n\n //$('.sub-menu > .sub-menu__item').eq(selectedIndex).addClass('sub-menu__item--active', 'active');\n \n }", "select(item = {}) {\n for (let path in menus) {\n menus[path].options.map(item => item.selected = false);\n }\n item.selected = true;\n }", "function selectedMenuOpenIfSelected() \n{\n {\n if(checkIfTextSelected() == true)\n {\n if(g_TextSelectionState == 0)\n showOrHideCategories('.selected');\n if($('#menu').is(':visible') == false) \n {\n //text is selected an menu is not visible (we do not want to close another menu if user is not in selected menu but somewhere else)\n \n $('#menu').fadeIn();\n }\n disableMenuWatchdog();\n g_TextSelectionState = 1;\n }\n else\n {\n if(g_TextSelectionState == 1) \n {\n //ensures that menu will not fade out in case if text selection is not involved (normal menu usage)\n g_TextSelectionState = 0;\n enableMenuWatchdog();\n }\n }\n }\n}", "function setActiveState(menu) {\n var active = menus[menu].find('.active').each(function(index, element) {\n select[menu]({ target: element });\n });\n }", "function setMenuActive() {\n $('.menu-li.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function activateMenuElement(name) {\n if (options.menu) {\n $(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE);\n $(options.menu).find('[data-menuanchor=\"' + name + '\"]').addClass(ACTIVE);\n }\n }", "_toggleMenuFocus(event) {\n const keyManager = this._keyManager;\n switch (event) {\n case 0 /* nextItem */:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setNextItemActive();\n break;\n case 1 /* previousItem */:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setPreviousItemActive();\n break;\n case 2 /* currentItem */:\n if (keyManager.activeItem) {\n keyManager.setFocusOrigin('keyboard');\n keyManager.setActiveItem(keyManager.activeItem);\n }\n break;\n }\n }", "function installMenu() {\n wkof.Menu.insert_script_link({\n name: script_name,\n submenu: \"Settings\",\n title: script_name,\n on_click: openSettings,\n });\n }", "menuButtonClicked() {}", "function select () {\r\n\t\t\t\tthis.tool.select();\r\n\t\t\t}", "function install_menu() {\n var config = {\n name: 'dashboard_level',\n submenu: 'Settings',\n title: 'Dashboard Level',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function handleMenuClick(event) {\n setMenuOpen(event.currentTarget);\n }", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "static addMenuOption(menuX, menuY, textContent, goto, context) {\n let textObj = context.add.text(menuX, menuY + 60 * context.menuSize,\n textContent, {fontSize: '32px', fill: '#fff'});\n context.menuSize++;\n textObj.setOrigin(0.5);\n textObj.setInteractive();\n textObj.on('pointerdown', function(pointer) {\n if (!context.lockControl) {\n context.lockControl = true;\n textObj.setColor('#737373');\n context.time.delayedCall(150, function (game) {\n game.scene.start(goto);\n }, [context], context);\n }\n }, context);\n textObj.on('pointerover', function(pointer) {\n if (!context.lockControl) {\n textObj.setColor('#C0C0C0');\n }\n }, context);\n textObj.on('pointerout', function(pointer) {\n if (!context.lockControl) {\n textObj.setColor('#fff');\n }\n }, context);\n }", "function handleMenu(id) {\n setCurrentRow(id);\n setVisible(!visible);\n }", "function activateMenuElement(name){\n if(options.menu){\n $(options.menu).find('.active').removeClass('active');\n $(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass('active');\n }\n }", "function enableOptions(arg) {\n var appearance = document.getElementById(\"propertypanel\");\n var selectedElement = document.getElementsByClassName(\"e-remove-selection\");\n if (arg.newValue) {\n if (arg.newValue[0] instanceof ej2_react_diagrams_1.Node) {\n selectedElement[0].classList.remove(\"e-remove-selection\");\n }\n else {\n if (!appearance.classList.contains(\"e-remove-selection\")) {\n appearance.classList.add(\"e-remove-selection\");\n }\n }\n }\n}", "function handleOpenMenu() {\n setOpenMenu(!openMenu);\n }", "function activateMenuElement(name){\r\n $(options.menu).forEach(function(menu) {\r\n if(options.menu && menu != null){\r\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\r\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\r\n }\r\n });\r\n }", "function setMenuEditable(willEditable) {\n $(\".combo-content\").each(function () {\n willEditable === false ? setDisable($(this)) : setEnable($(this));\n });\n }", "function activateMenuElement(name){\r\n var menu = $(options.menu)[0];\r\n if(options.menu && menu != null){\r\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\r\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\r\n }\r\n }", "function menuItemsHandler(e){\n if($(options.menu)[0] && (options.lockAnchors || !options.anchors.length)){\n preventDefault(e);\n moveTo(this.getAttribute('data-menuanchor'));\n }\n }", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n });\n }", "function testMenuPostion( menu ){\n \n }", "function activateMenuElement(name){\n \t\t\tif(options.menu){\n \t\t\t\t$(options.menu).find('.active').removeClass('active');\n \t\t\t\t$(options.menu).find('[data-menuanchor=\"'+name+'\"]').addClass('active');\n \t\t\t}\n \t\t}", "function click_lyrMenu_조회(ui) {\n\n if (ui.object == \"lyrMenu\" && ui.element == \"조회\") {\n var args = { target: [{ id: \"frmOption\", focus: true }] };\n gw_com_module.objToggle(args);\n } else {\n processRetrieve({});\n }\n\n }", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function selectNode(e) {\n\t\t\tvar item = dijit.getEnclosingWidget(e.target).item;\n\t\t\tif (item !== undefined) {\n\t\t\t\tgroupsTree.set(\"selectedItem\", item);\n\t\t\t\t//if (item.id !== 0) {\n\t\t\t\t//\tmnuRenameGroup.set(\"disabled\", false);\n\t\t\t\t//\tmnuDeleteGroup.set(\"disabled\", false);\n\t\t\t\t//\tctxMnuRenameGroup.set(\"disabled\", false);\n\t\t\t\t//\tctxMnuDeleteGroup.set(\"disabled\", false);\n\t\t\t\t//} else {\n\t\t\t\t//\tmnuRenameGroup.set(\"disabled\", true);\n\t\t\t\t//\tmnuDeleteGroup.set(\"disabled\", true);\n\t\t\t\t//\tctxMnuRenameGroup.set(\"disabled\", true);\n\t\t\t\t//\tctxMnuDeleteGroup.set(\"disabled\", true);\n\t\t\t\t//}\n\t\t\t\trefreshClientsGrid(item);\n\t\t\t}\n\t\t}", "function selectItem(e) {\n removeBorder();\n removeShow();\n this.classList.add('mood-selected');\n const moodContentItem = document.querySelector(`#${this.id}-content`);\n moodContentItem.classList.add('show');\n}", "select() { this.selected = true; }", "function MenuHandler(){\n /**@member {string} forceTouchFlow stores the value of type of module selected in forch touch*/\n this.forceTouchFlow =\"\";\n }", "function menuItemsHandler(e){\r\n if($(options.menu)[0] && (options.lockAnchors || !options.anchors.length)){\r\n preventDefault(e);\r\n /*jshint validthis:true */\r\n moveTo(this.getAttribute('data-menuanchor'));\r\n }\r\n }", "function menuItemsHandler(e){\n if($(options.menu)[0] && (options.lockAnchors || !options.anchors.length)){\n preventDefault(e);\n /*jshint validthis:true */\n moveTo(this.getAttribute('data-menuanchor'));\n }\n }", "function menuItemsHandler(e){\n if($(options.menu)[0] && (options.lockAnchors || !options.anchors.length)){\n preventDefault(e);\n /*jshint validthis:true */\n moveTo(this.getAttribute('data-menuanchor'));\n }\n }", "function showItemSelected(section, index, selected) {\n var item = section.getItemAt(index);\n //item.template = (true === selected) ? 'menuSelectedTemplate' : 'menuDeselectedTemplate';\n //item.selectedview.visible = selected;\n //item.subview.opacity = (true === selected) ? 1.0 : 0.85;\n section.updateItemAt(index, item);\n}", "setActive(menuItem) {\n if (this.activeItem === menuItem) {\n this.activeItem = '';\n }\n else {\n this.activeItem = menuItem;\n }\n }", "setActive(menuItem) {\n if (this.activeItem === menuItem) {\n this.activeItem = '';\n }\n else {\n this.activeItem = menuItem;\n }\n }", "function selectOrder(evt) {\n\t\t\tmnuEditOrder.set(\"disabled\", false);\n\t\t\tmnuDeleteOrder.set(\"disabled\", false);\n\t\t\tctxMnuEditOrder.set(\"disabled\", false);\n\t\t\tctxMnuDeleteOrder.set(\"disabled\", false);\n\t\t}", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function menuGripClick() {\n // console.log('menuGripClick');\n\n PageData.MenuOpen = !PageData.MenuOpen;\n setMenuPosition();\n\n if (!PageData.MenuOpen && PageData.ControlsOpen) {\n PageData.ControlsOpen = false;\n setControlsPosition();\n }\n}", "function enable() {\n _indicator = new DockerMenu.DockerMenu;\n Main.panel.addToStatusArea('docker-menu', _indicator, 5);\n}", "selectInMenu(scene, index, parentIndex) {\n this.index = index;\n this.parentIndex = parentIndex;\n\n const length = this.actionsGroup.getLength();\n\n for (let i = 0; i < length; i++) {\n this.actionsGroup.children.entries[i].setAlpha(0.5);\n }\n\n //Open Menu\n this.actionsGroup.children.entries[index].setAlpha(1);\n\n //Change alpha of category\n this.categoriesGroup.children.entries[parentIndex].setAlpha(0.75);\n }", "function selectMenu(index) {\n\n if (data.bShow_detal_menu == 1 && data.cur_menu_index == index) return;\n if (data.cur_menu_index != index) data.cur_detail_index = -1;\n\n var content_html = \"\";\n if (data.menu_info == undefined) return;\n\n // when menu is selected, shows selected status along the design\n $('#menuItem' + data.cur_menu_index).css({'border': 'none', 'color': 'black'});\n data.cur_menu_index = index;\n sessionStorage.setItem('cur_menu_index', index);\n $('#menuItem' + data.cur_menu_index).css({'color': '#38abff', 'border-bottom': '3px solid'});\n\n // shows the detail menu informations with popup format\n var height = document.body.clientHeight\n || document.documentElement.clientHeight\n || window.innerHeight;\n height -= parseInt($('#advertise_header').css('height'));\n height -= parseInt($('#horizontal_order_menu_bar').css('height'));\n $('#detail_menu_mask').css({'height': height});\n\n data.bShow_detal_menu = 1;\n\n display_product_infos(index);\n}", "function selectJumpMenuOption(){\n \n //default selection\n GselJumpMenus.selectedIndex = 0;\n \n if ( GarrJumpMenus.length == 1 )\n return;\n else {\n //check if it is possible to select a menu in the \n\t //same form as the current selection\n var selObj = dw.getDocumentDOM().getSelectedNode();\n var currFormObj = getFormObj(selObj);\n\t var nMenus = GselJumpMenus.length;\n \n for (i=0;i<nMenus;i++){\n\t if ( GarrJumpMenus[i].form == currFormObj ){\n\t\t GselJumpMenus.selectedIndex = i;\n\t\t\tbreak;\n\t\t } \n\t }\n }\n}", "handleMenuEDAndPositionClicked(ed,position) {\n this.setSelectedED(ed,position);\n }", "function TopMenuSelect(action) {\n var alreadyOn = $(this).hasClass('active');\n // Deselect old selected\n $('.optionMenuBtn').removeClass('active');\n $('.panelPane').css('display', 'none');\n // Select new if not already selected\n if (!alreadyOn) {\n $(this).addClass('active');\n var selectedPanel = $(this).attr('id');\n $('.canvas').css('width', $(window).width() * (1 - panelWidth));\n $('.panel').css('width', $(window).width() * panelWidth);\n $('.panel').css('display', 'block');\n $('#' + selectedPanel.replace(\"b\", \"p\")).css('display', 'block');\n $(window).trigger('resize');\n }\n // Hide Side Panel\n else {\n $('.panel').css('display', 'none');\n $('.canvas').css('width', '100%');\n $(window).trigger('resize');\n }\n}", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "function clickOptiontoSelect(){\n\n}", "function radialMenuOnSelect() {\r\n\ttracker.recordSelectedItem(this.id);\r\n\tvar radialmenu = document.getElementById('radialmenu');\r\n\tradialmenu.parentNode.removeChild(radialmenu);\r\n\r\n\tdocument.getElementById(\"selectedItem\").innerHTML = this.id;\r\n}" ]
[ "0.69176525", "0.6873769", "0.67140114", "0.67008716", "0.6627248", "0.65748805", "0.64745903", "0.6410071", "0.6407965", "0.6396996", "0.6386956", "0.6386956", "0.63793784", "0.6365093", "0.6354581", "0.63404286", "0.6335578", "0.6332524", "0.632574", "0.6317218", "0.63069487", "0.62802833", "0.6280156", "0.62625617", "0.62530136", "0.6232479", "0.622597", "0.62168825", "0.6205317", "0.6192899", "0.6186366", "0.6165709", "0.6144934", "0.6144652", "0.61439973", "0.61393076", "0.61381865", "0.613421", "0.613421", "0.613421", "0.61310947", "0.61310947", "0.61310947", "0.61310947", "0.61299276", "0.61152935", "0.61152935", "0.6109627", "0.6098684", "0.6094972", "0.60743797", "0.6072812", "0.60648364", "0.6036367", "0.60323274", "0.60319245", "0.6014109", "0.60118234", "0.60012364", "0.6001199", "0.5999917", "0.59988254", "0.59874296", "0.5979827", "0.59742117", "0.5972994", "0.5962351", "0.5959131", "0.5950027", "0.5940228", "0.59396225", "0.5937317", "0.59359866", "0.59359866", "0.59359866", "0.5934882", "0.59323066", "0.59188473", "0.5917748", "0.5914031", "0.5913583", "0.5912565", "0.5912008", "0.5904986", "0.58995646", "0.58995646", "0.589031", "0.5885874", "0.5885874", "0.58846605", "0.5880184", "0.58792907", "0.5877517", "0.58723474", "0.58702433", "0.5861079", "0.58600146", "0.5857989", "0.585782", "0.5854813", "0.5846834" ]
0.0
-1
Strict equality (===) is the counterpart to the equality operator (==). Unlike the equality operator, strict equality tests both the data type and value of the compared elements. Examples In the second example, 3 is a Number type and '3' is a String type. Use the strict equality operator in the if statement so the function will return "Equal" when val is strictly equal to 7 Setup
function testStrict(val) { if (val===7) { // Change this line   return "Equal"; } return "Not Equal"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) {\n // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n\tif (val === 7) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function testStrict(val) {\n if (val ===7) {\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n // check if val is strictly equal to 7:\n if (val === 7) {\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) {\n return \"equal\";\n }\n return \"Not equal\";\n}", "function testStrict(val) {\n\tif (val === '12') {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function testStrict(val) {\r\n if (val===12) { \r\n document.write (\"The value is Equal <br><br>\") ;\r\n }\r\n else{\r\n document.write (\"The value is Not Equal <br><br>\") ;\r\n }\r\n }", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n }", "function testEqual(val) {\n if (val == 3) {\n return \"Equal\";\n }\n\n return \"No Equal\";\n}", "function testStrictEqual(val){\n if (val === 7){\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testEqual(val) {\n if (val == 12) { // equality operator compares two values and returns true if value is equal or false if not equal\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testEqual(val) {\n\tif (val == 12) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function testEqual(val) {\n\tif (val == 12) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testTrueLooseEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return strOne == numOne;\n}", "function equalityTest(myVal) {\n if (myVal == 10) {\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function equalityTest(myVal) {\n if (myVal == 10) {\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrictNotEqual(val){\n if (val !== 17){\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function testEqual(val) {\n if (val == 12) {\n return \"equal\";\n }\n return \"not equal\";\n}", "function testTrueStrictEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return parseInt(strOne) === numOne;\n}", "function testStrictNotEqual(val) {\n\tif (val !== 17) {\n\t\treturn \"Not Equal\";\n\t}\n\treturn \"Equal\";\n}", "function testStrictNotEqual(val) {\n\tif (val !== 17) {\n\t\treturn \"Not Equal\";\n\t}\n\treturn \"Equal\";\n}", "function testEqual(val){\n if (val == 12){\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrictNotEqual(val)\r\n{\r\n if (val !== 70)\r\n {\r\n return \"Not-Equal\";\r\n }\r\n return \"Equal\";\r\n}", "function testFalseStrictEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return strOne === numOne;\n}", "function testStrictNotEqual(val) {\n if (val !== 17) {\n return \"not equal bitch\";\n }\n return \"equal\";\n}", "function testStrict (num) {\r\n if (num === \"12\") { // === matching the exact result\r\n return \"equal\";\r\n }\r\n return \"that was not equal\";\r\n}", "function testStrictNotEqual(val) {\n // Only Change Code Below this Line\n if (val !== 17) {\n // Only Change Code Above this Line\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function strictEquals(val1, val2) {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n}", "function testFalseStrictEqualityComparison(){\n var variableOne = 1;\n var variableTwo = \"1\";\n return variableOne === variableTwo;\n}", "function testStrictNotEqual(val) {\n // Only Change Code Below this Line\n\n if (val !== 17) {\n\n // Only Change Code Above this Line\n\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n }", "function testStrictNotEqual(val) {\n // Only Change Code Below this Line\n if (val !== 22) {\n // Only Change Code Above this Line\n return \"Not Equal\";\n }\n return \"Equal\";\n}", "function checkEqual(a, b) {\n return a == b ? \"Equal\" : \"Not Equal\";\n}", "function testNonEquality (val){\r\n if (val != 30) {\r\n return \"not equal\";\r\n }\r\n return \"equal\";\r\n}", "function useStrictEquality(b, a) {\n return a === b;\n }", "function equal(value1, value2) {\n return value1 === value2;\n}", "function compareEquality1(a, b) {\n\tif(a == b) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function funcInEqualOperator(val){\r\n if(val != '12'){\r\n return \"It is not Equal\";\r\n }\r\n return \"Equal\";\r\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function checkEqual(a, b) {\n\treturn a === b ? \"Equal\" : \"Not Equal\";\n}", "equals(equals , dependentVal){\n if(dependentVal == equals){\n return true;\n }else{\n return false;\n }\n}", "function equal (lhs, rhs) {\n return lhs === rhs;\n }", "function checkValueEquality (a, b) {\r\n return a === b;\r\n}", "function checkEquality(a, b) {\n return a === b;\n }", "function checkEqual(a,b){\n message1 = \"Values are equal and of same data type\";\n message2 = \"Values are equal but not of same data type\";\n message3 = \"Values don't match\";\n return a === b ? message1 : a==b ? message2 : message3;\n}", "function checkValueEquality (a, b) {\n return a === b;\n}", "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function areTheseTheSame( thing1, thing2 ){\n if( thing1 == thing2 ){\n console.log( 'the same with ==' );\n }\n else{\n console.log( 'different with ==' );\n }\n if( thing1 === thing2 ){\n console.log( 'the same with ===' );\n }\n else{\n console.log( 'different with ===' );\n }\n} // end isTheTruth", "function SameValue(x, y) {\n if (typeof x !== typeof y) return false;\n switch (typeof x) {\n case 'undefined':\n return true;\n case 'number':\n if (x !== x && y !== y) return true;\n if (x === 0 && y === 0) return 1/x === 1/y;\n return x === y;\n case 'boolean':\n case 'string':\n case 'object':\n default:\n return x === y;\n }\n }", "function compareEquality(a, b) {\n\tif (a === b) { // Change this line\n\t return \"Equal\";\n\t}\n\treturn \"Not Equal\";\n }", "function compareEquality(a, b) {\n if (a === b) {\n //typeconversion, === not converting\n return \"Equal\";\n }\n return \"Not equal\";\n}", "function true_tripe_equal() { \r\nA = \"Magnus\";\r\nB = \"Magnus\";\r\ndocument.write(A === B); //true\r\n}", "function checkValueEquality(a, b) {\n return a === b;\n}", "function testNotEqual(val) {\n if (val != 99) {\n // Comparison with the Strict Inequality Operator !==\n\n return \"not equal\";\n }\n\n return \" Equal\";\n}", "function strict(value,message){if(!value)fail(value,true,message,'==',strict);}", "function equal (fValue, wValue) {\n // equal two objects with serialize type\n if (fValue && fValue.constructor.name == 'RegExp')\n fValue = fValue.toString();\n if (fValue && wValue.constructor.name == 'RegExp')\n wValue = wValue.toString();\n return JSON.stringify(fValue) == JSON.stringify(wValue);\n }", "function testEqual (num) {\r\n if (num == 12) {\r\n return \"equal\";\r\n }\r\n return \"not equal\";\r\n}", "function useStrictEquality( b, a ) {\n\t\t\t\tif ( b instanceof a.constructor || a instanceof b.constructor ) {\n\t\t\t\t\t// to catch short annotaion VS 'new' annotation of a\n\t\t\t\t\t// declaration\n\t\t\t\t\t// e.g. var i = 1;\n\t\t\t\t\t// var j = new Number(1);\n\t\t\t\t\treturn a == b;\n\t\t\t\t} else {\n\t\t\t\t\treturn a === b;\n\t\t\t\t}\n\t\t\t}", "function isEqual(a,b){\n return a === b\n}", "function checkEqual(a, b) {\n //basic syntax example\n return a == b ? true : false;\n}" ]
[ "0.7602961", "0.7592505", "0.75663", "0.75502896", "0.7547867", "0.7545496", "0.74012995", "0.73176223", "0.69825166", "0.69384086", "0.69259346", "0.6925422", "0.68923634", "0.68684536", "0.68684536", "0.682787", "0.682787", "0.68186265", "0.67254347", "0.6722092", "0.6702426", "0.66684866", "0.6667378", "0.6664158", "0.66382444", "0.66382444", "0.6575013", "0.6551618", "0.6500675", "0.6481554", "0.6479391", "0.6386636", "0.63693815", "0.633039", "0.6318781", "0.62759703", "0.6267425", "0.6204011", "0.61878765", "0.6162662", "0.61530715", "0.6143292", "0.6116755", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.605226", "0.6038292", "0.60119486", "0.60052454", "0.5983782", "0.5978149", "0.5915074", "0.59066236", "0.5894845", "0.5894845", "0.5869384", "0.5840862", "0.5839865", "0.5817229", "0.5780094", "0.57640564", "0.57600147", "0.57457435", "0.57374597", "0.5733814", "0.57308036", "0.57203054", "0.57128906" ]
0.7531131
6
add any needed code to ensure that the smurfs collection exists on state and it has data coming from the server Notice what your map function is looping over and returning inside of Smurfs. You'll need to make sure you have the right properties on state and pass them down to props.
componentDidMount() { this.getSmurfs() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.props.getSmurfs();\n }", "FetchSmurfs() {\n axios\n .get(`${baseUrl}`)\n .then(res => {\n this.setState({ smurfs: res.data });\n })\n .catch(err => {\n console.log(console.log(err));\n this.setState({ errorMessage: err.statusText });\n });\n }", "componentDidMount() {\n axios.get('http://localhost:3333/smurfs')\n .then(response => {\n console.log(\"response\", response.data)\n this.setState({smurfs: response.data})\n })\n .catch(error => {\n console.log(\"Error retreiving smurfs\", error)\n })\n }", "componentDidMount() {\n fourSquareVenueSearch(FOURSQUARE, DEFAULT_CENTER)\n .then(res => {\n if (res.meta.code !== 200) return this.setFourSquareError(res);\n\n const { venues } = res.response;\n\n return this.setMarkerInfoArr(venues.map(makeMarker));\n })\n .catch(e => {\n console.log('foursquare fetch error', e);\n return this.setFourSquareError(e);\n });\n }", "componentDidMount() {\n axios\n .get(smurfUrl)\n .then(smurfs => this.updateSmurfs(smurfs.data))\n .catch(error => this.updateErrors(error.message));\n }", "function SSDCollection(props) {\n return (\n <div className=\"ssdCollection\">\n <div>SSD collection </div>\n <div className=\"ssds\">\n {false?\n props.ssds.map((ssd, i, ssdsList)=>{\n return(\n <div className=\"singleSSD\">\n {ssd.name}\n </div>\n )\n }):null\n }\n </div>\n </div>\n );\n}", "componentDidMount() {\n axios\n .get('http://localhost:3333/smurfs')\n .then(response => {\n // console.log(response)\n this.setState({ \n smurfs: response.data\n });\n })\n .catch(err => console.log(err));\n }", "function Friends(props) {\n const [friends, setFriends] = useState([])\n const [name, setName] = useState('')\n const [picture, setPicture] = useState('')\n const [id, setId] = useState('')\n const [addingFriend, setAddingFriend] = useState(false)\n //* be sure to parse id when it comes in because its an int in the DB id refs steam_account_id\n\n useEffect(() => {\n axios\n .get(`/user/me/friends/${props.dota_users_id}`)\n .then(res => {\n setFriends(res.data)\n })\n .catch(err => console.log(err))\n console.log('friends effect')\n }, [])\n\n const reset = () => {\n setName('')\n setPicture('')\n setId('')\n }\n\n const handleAddFriend = () => {\n const body = {\n name: name,\n picture: picture,\n steam_account_id: id\n }\n axios\n .post('/user/friends', body)\n .then(() => {\n axios\n .get(`/user/me/friends/${props.dota_users_id}`)\n .then(res => setFriends(res.data) )\n })\n }\n\n\n\n // !!!!!!!! MAP HERE !!!!!!!!\n\n const myFriends = friends.map(friend => {\n\n\n const deleteFriend = () => {\n axios\n .delete(`/user/me/friends/${friend.id}`)\n .then(() => {\n axios\n .get(`/user/me/friends/${props.dota_users_id}`)\n .then(res => {\n setFriends(res.data)\n })\n })\n }\n\n return (\n <div className='main-pro-div'>\n <Link to={`/recent-matches/${friend.steam_account_id}`}>\n <img className='proplayer-pic'\n src={friend.picture ? friend.picture : noImg}\n alt='no-picture' />\n </Link>\n <h3 className='pro-name'>{friend.name}</h3>\n <br></br>\n <p>Steam ID:</p>\n <br></br>\n <p>{friend.steam_account_id}</p>\n <br></br>\n <img className='delete-pro'\n alt='trashcan'\n src={trash}\n onClick={() => deleteFriend()}\n />\n </div>\n )\n })\n\n return (\n <div className='Friends-div'>\n\n {addingFriend ? (\n <div className='addFriend-form'>\n <img className='form-img'\n src={picture ? picture : noImg}\n alt=\"Link doesn't work\" />\n <div className='addfriend-inputs'>\n <button className='form-button'\n onClick={() => setAddingFriend(!addingFriend)}>X</button>\n <p>Name:</p>\n <input className='form-inputs'\n value={name}\n onChange={(e) => setName(e.target.value)} />\n <p>Picture:</p>\n <input className='form-inputs' \n value={picture}\n onChange={(e) => setPicture(e.target.value)} />\n <p>Steam Account ID:</p>\n <input className='form-inputs'\n type='number'\n value={id}\n onChange={(e) => setId(+e.target.value)} />\n <br></br>\n <div className='form-btns'>\n <button onClick={() => {\n handleAddFriend()\n reset()\n }}>Add!</button>\n <button onClick={() => reset()}>Reset</button>\n </div>\n </div>\n </div>\n\n ) : (\n <button className='addFriend-btn'\n onClick={() => setAddingFriend(!addingFriend)}>Add Friend to follow!</button>\n )}\n\n <h1 className='h1-friends'>My Friends</h1>\n <div className='myFriends-parent'>\n {myFriends}\n </div>\n </div>\n )\n}", "componentDidMount() {\n\t\tws.onopen = () => {\n\t\t\tws.onmessage = e => {\n\t\t\t\ttry {\n\t\t\t\t\tlet message = JSON.parse(e.data);\n\t\t\t\t\tconsole.log('message received');\n\t\t\t\t\tconsole.log(message);\n\t\t\t\t\tswitch (message.type) {\n\t\t\t\t\t\tcase 'roomInit':\n\t\t\t\t\t\t\tconsole.log('set room state');\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\troomId: message.roomId,\n\t\t\t\t\t\t\t\tturn: message.turn\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'shipLayoutFlat':\n\t\t\t\t\t\t\tthis._player2LocationArray(message.value);\n\t\t\t\t\t\t\tconsole.log('set state performed');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'shipLayoutDetailed':\n\t\t\t\t\t\t\tthis._player2SunkStatus(message.value);\n\t\t\t\t\t\t\tconsole.log('detailed object set');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'shotsFired':\n\t\t\t\t\t\t\tlet updatePlayerRender = this.state.player2Status.map(index => {\n\t\t\t\t\t\t\t\tif (index === 'tempX') {\n\t\t\t\t\t\t\t\t\treturn 'X'; // pass static image\n\t\t\t\t\t\t\t\t} else if (index === 'tempO') {\n\t\t\t\t\t\t\t\t\treturn 'O'; // pass static image\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn index;\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//will display player's ships that have been sunk\n\t\t\t\t\t\t\tconsole.log('message.sunkenShipsArr');\n\t\t\t\t\t\t\tconsole.log(message.sunkenShipsArr);\n\n\t\t\t\t\t\t\tthis.state.turn\n\t\t\t\t\t\t\t\t? this.setState(\n\t\t\t\t\t\t\t\t\t\t{ turn: false, player2Status: updatePlayerRender, player1SunkShips: message.sunkenShipsArr },\n\t\t\t\t\t\t\t\t\t\tconsole.log(this.state.turn)\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: this.setState(\n\t\t\t\t\t\t\t\t\t\t{ turn: true, player2Status: updatePlayerRender, player1SunkShips: message.sunkenShipsArr },\n\t\t\t\t\t\t\t\t\t\tconsole.log(this.state.turn)\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\tthis._setPlayer1Status(message.value);\n\n\t\t\t\t\t\t\tconsole.log('shotsFired data received');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'gameOver':\n\t\t\t\t\t\t\tconsole.log('You Lost');\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\tdidWin: false\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'chat':\n\t\t\t\t\t\t\tconsole.log('received a chat message');\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\tchat: message.value\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.log('conditionals broken');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.log('catch ran');\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\n\t\tlet newArr = new Array(100).fill(0);\n\t\tthis.setState({\n\t\t\tplayer1Status: newArr,\n\t\t\tplayer2Status: newArr\n\t\t});\n\t}", "componentDidMount() {\n SquareAPI.search({\n near: \"Encinitas, CA\",\n intent: \"checkin\",\n query: \"beach\",\n limit: 7,\n \n }).then(results => {\n \n const {venues} = results.response;\n const {center} = results.response.geocode.feature.geometry;\n \n const markers = venues.map(venue => {\n return {\n lat: parseFloat(venue.location.lat),\n lng: parseFloat(venue.location.lng),\n isOpen: false,\n isVisible: true,\n id: venue.id\n\n }; \n \n });\n this.setState({venues,center,markers});\n console.log(results);\n });\n }", "componentDidMount() {\n // GET \n axios\n .get('http://localhost:3333/smurfs')\n .then( res => {\n console.log(res)\n this.setState( () => (\n {\n smurfs: res.data\n }\n ))\n })\n .catch( err => {\n console.log('TOTAL FAILURE IN GETTING DATA FROM SERVER')\n })\n }", "processWishlists(wishlists) {\n if(!wishlists.length) {\n return <h5 style={{marginTop: '2.5vh'}} className='center grey-text'>No wishlists available</h5>;\n }\n return wishlists.map(wishlist => {\n return (\n <WishlistCard\n key={wishlist.wishlistId}\n username={this.props.username}\n wishlist={wishlist}\n updateHandler={this.props.updateHandler}\n deleteHandler={this.props.deleteHandler}\n editable={this.props.editable} \n />\n );\n });\n }", "renderSeenMoviesList() {\n if(this.state.userMovieDataLoaded) {\n return this.state.userMovieData.map(seenMovie => {\n return ( \n <SingleSeenMovie key={seenMovie.id} \n seenMovie={seenMovie}\n userMovieData={this.state.userMovieData}\n userMovieDataLoaded={this.state.userMovieDataLoaded}\n posterResults={this.props.posterResults}\n handleSingleMovie={this.props.handleSingleMovie}\n deleteSeenMovie={this.deleteSeenMovie}/>\n ) \n })\n }\n }", "render(props) {\n let paired_ids=[];\n let student_helpers = [];\n this.props.userList.forEach(student => {\n student.paired?\n paired_ids.push(student.paired)\n :'';\n })\n this.props.mentorList.forEach(student => {\n student.waiting_type === 'helping'?\n student_helpers.push(student)\n :'';\n })\n const mentors = this.props.mentorList.map((mentor, index) => {\n if(paired_ids.includes(mentor.user_id) || student_helpers.includes(mentor)){\n return (\n null\n )}else return <Avatar av_user={mentor} key={index}/>;\n });\n const helpers = student_helpers.map((student, index) => {\n return <Avatar av_user={student} key={index}/>;\n });\n\n\n return (\n <div className=\"userlist-main-container m10 shadowed\">\n <h4 style={{margin: '5px 0 0 0', color: 'white'}}>Mentors</h4>\n {mentors[0] === null?\n <h6 style={{ color: 'white'}}>Room Is Empty</h6>\n :!mentors.length?\n <h6 style={{ color: 'white'}}>Room Is Empty</h6>:\n mentors\n }\n {helpers[0] === null?\n null\n :!helpers.length?\n null:\n <div>\n <h4 style={{margin: '5px 0 0 0', color: 'white'}}>Student Helpers</h4>\n {helpers}\n </div>\n }\n </div>\n )\n }", "componentDidMount(){\n let update = []\n fetch(\"http://localhost:3000/movie_users\")\n .then(res => res.json())\n .then(mus=>(\n mus.map(mu => {\n if(mu.favorite){\n update.push(mu)\n }\n this.setState({\n favorites: update\n })\n })\n ))\n }", "componentDidMount(){\n // the name of the newly signed up user is retrieved and saved in the state \n database().ref('/users/' + this.state.user.uid).once(\"value\").then(snapshot => {\n\n let name = snapshot.val().name\n this.setState({name})\n }).catch((error) =>{\n console.log(error)\n })\n \n //this gathers the interests (defined as chips) from the imported list and assigns them a boolean 'isSelected'\n var newChips = []\n chips.map((item,index) =>{\n var chip ={}\n chip[\"value\"] = item\n chip[\"isSelected\"] = false\n newChips.push(chip)\n })\n this.setState({chips: newChips})\n\n //this gathers the genres from the imported list and assigns them a boolean 'isSelected'\n var genre =[]\n genres.map((item,index) =>{\n var chip ={}\n chip[\"value\"] = item\n chip[\"isSelected\"] = false\n genre.push(chip)\n })\n this.setState({genres: genre})\n \n }", "componentDidMount() {\r\n window.initMap = this.initMap\r\n loadMapJS(\r\n \"https://maps.googleapis.com/maps/api/js?key=AIzaSyBE4q1RHUOzaCYgbbT8qV27MK9IJurUQF8&callback=initMap\"\r\n )\r\n let images = []\r\n this.state.myLocations.forEach((location) => {\r\n let url = \"\"\r\n const arg = { \"venue_id\": location.venue_id }\r\n foursquare.venues.getVenuePhotos(arg).then((res) => {\r\n url = `${res.response.photos.items[0].prefix}${res.response.photos.items[0].height}x${res.response.photos.items[0].width}${res.response.photos.items[0].suffix}`\r\n images.push({\"url\": url, \"title\": location.title})\r\n }).then(()=> {\r\n this.setState({ images })\r\n })\r\n })\r\n }", "componentDidMount(){\n var user = fire.auth().currentUser.email;\n \n //get info into database\n db.collection('school').where(\"Email\", \"==\", user)\n .get()\n .then(snapshot => {\n\n snapshot.forEach(doc =>{\n var id = doc.id\n var email = doc.data().Email \n var fname = doc.data().FirstName\n var lname = doc.data().LastName\n var school = doc.data().School\n var num = doc.data().Num\n var proof = doc.data().Proof\n\n //store info from database to a state\n this.setState({\n email:email,\n fname:fname,\n lname:lname,\n school:school,\n proof:proof,\n num:num,\n id:id\n\n\n\n })\n \n \n })\n this.setState({\n loading:false\n })\n\n })\n .catch(function(error){\n console.log(error);\n })\n\n\n }", "mapUnreadStudents() {\n\n //var unreadStudents = [];\n //var user = this.state.students;\n //// filtering the this.state.students\n //for (let i = 0; i < user.length; i++) {\n // console.log(\"the user we want: \" , user);\n // if (!user[i].Reports == [0]) {\n // for (let r = 0; r < user[i].Reports.length; r++) {\n // if (user[i].Feedbacks !== [0] && user[i].Feedbacks.length != user[i].Reports.length) {\n // for (let f = 0; f < user[i].Feedbacks.length; f++) {\n // if (user[i].Reports[r].WeeklyReportFormId != user[i].Feedbacks[f].WeeklyReportId) {\n // unreadStudents.push(user[i]);\n // break;\n // }\n // }\n // break;\n // }\n // }\n // }\n //}\n\n const unreadStudents = this.state.students.reduce((newList, item) => {\n if(item.Reports.length > item.Feedbacks.length) newList.push(item)\n return newList;\n \n }, []);\n\n \n // building a list of cards of those student's whose daily reports hasn't been responded \n const studentMap = unreadStudents.map((student, i) => {\n let userInfo = [\n student.Name,\n student.Id,\n student.Location\n ]\n\n return (\n <div className=\"col-sm-4 col-12 page\" key={i}>\n <Link to={`/instructorWeeklyReportResult/${userInfo}`}>\n <div className=\"card\" style={{ height: \"auto\", padding: \"5px\" }}>\n <div className=\"card-block spaCourseBox text-center\">\n <h6>{student.Name}</h6>\n <p>{student.Location || \"not listed\"}</p>\n </div>\n </div>\n </Link>\n </div>\n );\n })\n return studentMap;\n }", "componentDidMount() {\n if (this.props.collections.length) {\n for (let i = 0; i < this.props.collections.length; i++) {\n if (this.props.collections[i].isExpense) {\n this.setState({ canAddExpense: true });\n }\n }\n }\n }", "constructor(props) {\n super(props);\n this.state = {\n sponsors: [\n {\n id: 0,\n rank: 1,\n nameEn: 'Re:boot',\n nameIs: 'Re:boot',\n sponsor: [\n {\n id: 0,\n name: 'Origo',\n // photoURL: './images/sponsors/reboot/OrigoLogo.png',\n photoURL: './images/sponsors/reboot/OrigoSVG.svg',\n website: 'https://www.origo.is/'\n },\n {\n id: 1,\n name: 'Kvika',\n // photoURL: './images/sponsors/reboot/Merki_Liggjandi_Gull_x1.jpg',\n photoURL: './images/sponsors/reboot/KvikaSVG.svg',\n website: 'https://www.kvika.is/'\n },\n {\n id: 2,\n name: 'Auður',\n // photoURL: './images/sponsors/reboot/audur_merki_transparent_Svart.png',\n photoURL: './images/sponsors/reboot/AudurSVG.svg',\n website: 'https://www.audur.is/'\n },\n {\n id: 3,\n name: 'KPMG',\n // photoURL: './images/sponsors/reboot/KPMG_NoCP_RGB.png',\n photoURL: './images/sponsors/reboot/KPMGSVG.svg',\n website: 'https://home.kpmg/is/is/home.html'\n },\n ]\n },\n {\n id: 1, \n rank: 2,\n nameEn: 'Re:start',\n nameIs: 'Re:start',\n sponsor: [\n {\n id: 0,\n name: 'Byggðastofnun',\n photoURL: './images/sponsors/restart/Byggst_1800x600px_transp.png',\n website: 'https://www.byggdastofnun.is/'\n },\n {\n id: 1,\n name: 'Ölgerðin Egill Skallagrímsson',\n // photoURL: './images/sponsors/restart/OES_logo_png.png',\n // photoURL: './images/sponsors/restart/olgerdinLogoSVG.svg',\n // photoURL: './images/sponsors/restart/olgerdinLogoSVGResizedV1.svg',\n photoURL: './images/sponsors/restart/olgerdinLogoSVGResizedV2.svg', \n website: 'https://www.olgerdin.is/'\n },\n {\n id: 2,\n name: 'Vörður',\n // photoURL: './images/sponsors/restart/Vordur_logo_outline.png',\n // photoURL: './images/sponsors/restart/vordurLogoSVG.svg',\n photoURL: './images/sponsors/restart/VordurLogoGraySVG.svg',\n website: 'https://vordur.is/'\n },\n {\n id: 3,\n name: 'Awarego',\n photoURL: './images/sponsors/restart/awarego.png',\n website: 'https://www.awarego.com/'\n },\n ]\n },\n {\n id: 2,\n rank: 3,\n nameEn: 'Re:load',\n nameIs: 'Re:load',\n sponsor: [\n {\n id: 2,\n name: null,\n photoURL: null,\n website: null\n },\n {\n id: 0,\n name: 'Deloitte',\n // photoURL: './images/sponsors/reload/DEL_PRI_RGB.png',\n photoURL: './images/sponsors/reload/DeloitteLogoSVGBlack.svg',\n website: 'https://www2.deloitte.com/is/is.html'\n },\n {\n id: 1,\n name: 'Marel',\n // photoURL: './images/sponsors/reload/marel_logo.png',\n photoURL: './images/sponsors/reload/MarelLogoSVG.svg',\n\n website: 'https://marel.com/is'\n },\n {\n id: 3,\n name: null,\n photoURL: null,\n website: null\n },\n ]\n },\n {\n id: 3,\n rank: 4,\n nameEn: 'Other Sponsors',\n nameIs: 'Aðrir Styrktaraðilar',\n sponsor : [\n {\n id: 0,\n name: 'Dominos',\n photoURL: './images/sponsors/other/DominosLogoSVG.svg',\n website: 'https://www.dominos.is/'\n },\n {\n id: 1,\n name: 'Hostelling International',\n photoURL: './images/sponsors/other/HostellingLogoSVG.svg',\n website: 'https://www.hostel.is/'\n },\n {\n id: 2,\n name: 'ENNEMM',\n photoURL: './images/sponsors/other/ennemm.png',\n website: 'https://www.ennemm.is/'\n },\n {\n id: 3, \n name: 'Ráðuneytið',\n photoURL: './images/sponsors/other/raduneytid.png',\n website: 'https://www.stjornarradid.is/'\n },\n {\n id: 4, \n name: 'Nýsköpunarmiðstöð',\n photoURL: './images/sponsors/other/nmitrans.png',\n website: 'https://www.nmi.is/'\n },\n {\n id: 5,\n name: 'Utmessan',\n photoURL: './images/sponsors/other/Utmessan_logo.png',\n website: 'https://utmessan.is/'\n },\n {\n id: 6,\n name: 'Ský',\n photoURL: './images/sponsors/other/skylogo2leleggaedi.png',\n website: 'https://www.sky.is/'\n },\n {\n id: 7,\n name: 'H-Berg',\n photoURL: './images/sponsors/other/HBERG_LOGO_svg.svg',\n website: 'https://hberg.is/'\n },\n {\n id: 8,\n name: 'FabLab Reykjavík',\n photoURL: './images/sponsors/other/FabLabReykjavik.png',\n website: 'https://www.fablab.is/reykjavik.html'\n },\n {\n id: 9,\n name: 'Ferró Skiltagerð',\n photoURL: './images/sponsors/other/Ferro_Logo_PNG.png',\n website: 'http://www.ferroskilti.is/'\n },\n ]\n }\n\n ]\n }\n }", "showPopularArtists(genre) {\n fetch(`http://localhost:8080/genrePopularArtists/${genre}`, {\n method: 'GET' // The type of HTTP request.\n }).then(res => {\n return res.json();\n }, err => {\n console.log(err);\n }).then(popularArtists => {\n if (!popularArtists) return;\n let artists = popularArtists.map((obj, i) =>\n <GenreArtistsDiv \n key={i}\n performer={obj.performer} \n weeks={obj.weeks_in_top}\n /> \n );\n \n this.setState({\n popularArtists: artists\n });\n });\n }", "componentDidMount() {\n let initChampions = this.state.champions.map((champion) => {\n return champion;\n });\n\n this.setState({\n filteredChampions: initChampions\n });\n\n }", "function Mine() {\n const [state, dispatch] = useStoreContext();\n const { filter, queue, items, user } = state;\n\n let newGems = itemizer(items);\n const [gems, setGems] = useState(newGems);\n\n let flexbox = {\n display: \"flex\",\n flexDirection: \"row\",\n };\n\n useEffect(() => {\n // console.log(filter);\n loadItems();\n }, [filter]);\n\n useEffect(() => {\n Database.getUserQueue(user.username).then((res) => {\n dispatch({\n type: UPDATE_QUEUE,\n queue: res.data.queue,\n });\n });\n }, []);\n\n useEffect(() => {\n let newGems = itemizer(items);\n setGems(newGems);\n }, [items[0]]);\n\n async function loadItems() {\n let arr = [];\n if (filter) {\n arr = await API.getItems(filter);\n } else {\n arr = await API.getItems();\n }\n const items = [];\n arr.map(async (element) => {\n var topic = element;\n topic.data.value.forEach((newsObject) => {\n items.push(newsObject);\n });\n });\n shuffle(items);\n dispatch({\n type: NEW_ITEMS,\n items: items,\n });\n }\n\n // knuth shuffle\n function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue,\n randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }\n\n function itemizer(items) {\n let newGems = Object.keys(items).map((key) => (\n <Gems key={key} details={items[key]} />\n ));\n return newGems;\n }\n\n return (\n <div>\n <MainNav />\n <div className='flexbox-containter' style={flexbox}>\n <LeftNav>\n <SavedGems />\n </LeftNav>\n\n {gems}\n </div>\n </div>\n );\n}", "componentDidMount() {\r\n\r\n this._loadFontsAsync();\r\n\r\n const { uid } = firebase.auth().currentUser;\r\n this.setState({ uid });\r\n\r\n this.dbCollection = Backend.shared.firestore\r\n .collection(\"favorites\").where(\"uid\", \"==\", uid)\r\n .get().then\r\n (onSnapShot => {\r\n const firebaseData = [];\r\n onSnapShot.forEach((doc) => {\r\n const { favoriteTitle, favoritePrice, favoriteMaterial, favoriteCategory, favoriteDescription, favoriteImage1, favoriteImage2, favoriteImage3, favoriteImage4, userRating, timestamp } = doc.data();\r\n firebaseData.push({\r\n key: doc.id,\r\n favoriteTitle,\r\n favoritePrice,\r\n favoriteMaterial,\r\n favoriteCategory,\r\n favoriteDescription,\r\n favoriteImage1,\r\n favoriteImage2,\r\n favoriteImage3,\r\n favoriteImage4,\r\n userRating,\r\n timestamp\r\n });\r\n });\r\n this.setState({\r\n item: firebaseData,\r\n isFetching: false\r\n });\r\n });\r\n }", "getMediInfo() {\n var drugName = this.props.navigation.state.params.drugName;\n var tempData = [];\n firestore()\n .collection('Drugs')\n .where('Name', '==', drugName)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n tempData.push(doc.data());\n });\n this.setState({\n mediImages: tempData[0]['Image'],\n });\n this.setState({\n organ: tempData[0]['Organ'],\n });\n this.setState({\n mediDescription: tempData[0]['Description'],\n });\n this.setState({\n mediType: tempData[0]['Type'],\n });\n this.setState({\n mediName: drugName,\n });\n this.setState({\n mediAmount: tempData[0]['Dosage'],\n });\n this.setState({\n mediCompany: tempData[0]['Company'],\n });\n this.setState({\n warnings: tempData[0]['Warning'],\n });\n this.setState({\n warningsText: tempData[0]['WarningText'],\n });\n this.setState({\n sideEffects: tempData[0]['SideEffect'],\n });\n this.setState({\n sideEffectsText: tempData[0]['SideEffectText'],\n });\n });\n }", "componentDidMount() {\n\t\t//indoor or outdoor seating depends on rain and temp (temp<15, then indoor ... rain depends)\n\t\tlet inOut = \"outdoor\";\n\t\t//chance of rain, if greater than 20 indoor\n\t\tif (this.props.rain.charAt(0) === 'x') {\n\t\t\tif (parseInt(this.props.rain.substring(1), 10) >= 20 || parseInt(this.props.temp, 10) < 15) {\n\t\t\t\tinOut = \"indoor\";\n\t\t\t}\n\t\t//amount of rain, if raining at all indoor\n\t\t} else if (parseInt(this.props.rain, 10) > 0 || parseInt(this.props.temp, 10) < 15) {\n\t\t\tinOut = \"indoor\";\n\t\t}\n\t\t//based on time, generate query for meal at that time of day\n\t\tlet type = \"\";\n\t\tlet time = this.props.time;\n\t\tif (4 < time && time < 12) {\n\t\t\ttype += \"breakfast \";\n\t\t}\n\t\tif (10 < time && time < 18) {\n\t\t\ttype += \"lunch \";\n\t\t}\n\t\tif (16 < time && time < 24) {\n\t\t\ttype += \"dinner \";\n\t\t}\n\t\tif (20 < time && time < 25 || -1 < time && time < 6) {\n\t\t\ttype += \"late night \";\n\t\t}\n\t\tconst foursquare = (require('foursquarevenues'))('HJTXFPU0B2WFEZZTCN4223VERJBRELYL53TLIV2OEAIXMJBT', '23T2KUXPDQAYVKRG5JZILOHMBIWGOVKXNEIN0RGNXVUCR3VB');\n\t\t//query based on location, meal, seating, within 1 mile\n\t\tconst params = {\n\t\t\t\"ll\": this.props.loc.coords.latitude + \",\" + this.props.loc.coords.longitude,\n\t\t\t\"query\": type + inOut + \" seating\",\n\t\t\t\"venuePhotos\": 1,\n\t\t\t\"section\": \"food\",\n\t\t\t\"radius\": 1609.344,\n\t\t\t\"limit\": 15\n\t\t};\n\t\tlet itemsArray = [];\n\t\tconst self = this;\n\t\tfoursquare.exploreVenues(params, function(error, venues) {\n\t\t\tif (!error) {\n\t\t\t\t//keep track of total results, in case none found\n\t\t\t\tlet count = 0;\n\t\t\t\t//fill div with results\n\t\t\t\tvenues.response.groups[0].items.forEach(function(place) {\n\t\t\t\t\t//skip restaurants that do not meet certain data requirements\n\t\t\t\t\tif (place.venue.location.distance === undefined || place.venue.categories[0].name === undefined || place.venue.price === undefined || place.venue.photos.groups[0] === undefined || place.venue.location.city === undefined || place.venue.location.address === undefined) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t//fake start and end times based on name of restaurant\n\t\t\t\t\t//foursquare does not allow to search for restaurants based on time\n\t\t\t\t\tlet hourSt = helper.fakeTime(place, 0, 5);\n\t\t\t\t\tlet hourE = helper.fakeTime(place, 1, 17);\n\t\t\t\t\t//check if restaurant open during selected time\n\t\t\t\t\tif (hourE > 23) {\n\t\t\t\t\t\thourE -= 24;\n\t\t\t\t\t\tif (time < hourSt && time >= hourE) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (time >= hourE || time < hourSt) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t//push data to itemsArray\n\t\t\t\t\tconst toPush = {\n\t\t\t\t\t\tname: place.venue.name,\n\t\t\t\t\t\tphoto: place.venue.photos.groups[0].items[0].prefix + place.venue.photos.groups[0].items[0].width + \"x\" + place.venue.photos.groups[0].items[0].height + place.venue.photos.groups[0].items[0].suffix,\n\t\t\t\t\t\tkeyword: place.venue.categories[0].name,\n\t\t\t\t\t\tprice: place.venue.price.message,\n\t\t\t\t\t\thourStart: hourSt,\n\t\t\t\t\t\thourEnd: hourE,\n\t\t\t\t\t\taddress: place.venue.location.address + \", \" + place.venue.location.city,\n\t\t\t\t\t\tdistance: Math.round(0.000621371 * parseInt(place.venue.location.distance, 10) * 10) / 10 + \" Miles\",\n\t\t\t\t\t\tsite: place.venue.url,\n\t\t\t\t\t\tx: self.props.loc.coords.latitude,\n\t\t\t\t\t\ty: self.props.loc.coords.longitude,\n\t\t\t\t\t\ttemp: self.props.temp,\n\t\t\t\t\t\tcon: self.props.con\n\t\t\t\t\t};\n\t\t\t\t\titemsArray.push(toPush);\n\t\t\t\t\t//increment count if found restaurant\n\t\t\t\t\tcount++;\n\t\t\t\t});\n\t\t\t\t//conditionally render results if results obtained\n\t\t\t\tif (count > 0) {\n\t\t\t\t\tself.setState({\n\t\t\t\t\t\titems: itemsArray\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tself.setState({\n\t\t\t\t\t\titems: 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tself.forceUpdate();\n\t\t\t}\n\t\t});\n\t}", "render() {\n if (this.state.spinner) {\n return (\n <StyledDiv>\n Loading...\n </StyledDiv>\n );\n }\n\n if (this.state.error) {\n return (\n <StyledDiv>\n <div>Argh! This failed rather miserably. {this.state.error.message}</div>\n </StyledDiv>\n );\n }\n return (\n <StyledDiv>\n <nav>\n <NavLink exact to=\"/smurfs\" >Smurfs</NavLink>\n <NavLink to=\"/smurf_form\" >Smurf Form</NavLink>\n </nav>\n <Route exact path=\"/\"\n component={LoginPage} />\n <Route exact path=\"/smurfs\"\n render={() => <Smurfs\n smurfs={this.state.smurfs}\n deleter={this.deleteSmurf}\n updater={this.update} />} />\n <Route path=\"/smurf_form\" render={() =>\n <SmurfForm addNewSmurf={this.addSmurf} />} />\n {this.state.smurfs.map(smurf =>\n <Route path={`/smurf_${smurf.name}`}\n render={() =>\n <Smurf name={smurf.name}\n height={smurf.height}\n age={smurf.age} />}\n />)}\n <form className={this.state.form === 'off' ? \"off\" : \"on\"}>\n <input\n onChange={this.handleInputChange}\n placeholder=\"name\"\n value={this.state.name}\n name=\"name\"\n />\n <input\n onChange={this.handleInputChange}\n placeholder=\"age\"\n value={this.state.age}\n name=\"age\"\n />\n <input\n onChange={this.handleInputChange}\n placeholder=\"height\"\n value={this.state.height}\n name=\"height\"\n />\n <button type=\"submit\"\n onClick={event => this.updateSmurf(event)}>\n Update\n </button>\n </form>\n <input onChange={this.handleInputSearch}\n placeholder=\"search\"\n value={this.state.search}\n name=\"search\"></input>\n <button onClick={this.back}>Back</button>\n </StyledDiv>\n );\n }", "_renderTickets() {\n\n // if not tickets just render an alert\n if (_.isEmpty(this.state.filtered_tickets)) {\n return (\n <Alert color=\"warning\">\n No Tickets found ...\n </Alert>\n )\n }\n\n return this.state.filtered_tickets.map((t) => (\n <TicketGist\n key={t.id} \n {...t}\n navigateHandler={this._navigateToTicket}\n />\n ))\n }", "componentDidMount() {\n //convert the date object to string format yyyy-mm-dd\n //because hotels would not let me push a date object into to hotels array\n //startDate string\n if (this.props.reservation.startDate !== null) {\n //update the local state\n const sDateMonmet = moment(this.props.reservation.startDate);\n this.setState({ startDate: sDateMonmet });\n }\n if (this.props.reservation.endDate !== null) {\n const eDateMoment = moment(this.props.reservation.endDate);\n this.setState({ endDate: eDateMoment });\n }\n this.setState({ rooms: this.props.reservation.rooms });\n\n const db = firebase.firestore();\n\n // if the home page pass the place to search page\n if (this.props.reservation.place !== null) {\n this.setState({ place: this.props.reservation.place });\n\n const searchKey = this.props.reservation.place.name;\n\n db.collection(\"testingHotels\")\n .where(\"city\", \"==\", searchKey)\n .get()\n .then(collection => {\n var hotels = [];\n // console.log(\"hotels ----->\" + hotels);\n //map all the needed hotel information to the state\n collection.forEach(doc => {\n // doc.data() is never undefined for query doc snapshots\n //-----testing-----\n // console.log(doc.id, \" => \", doc.data());\n\n hotels.push({\n name: doc.data().name,\n hID: doc.id,\n photoUrl: doc.data().photoURL,\n type: doc.data().type,\n price: doc.data().price,\n rating: doc.data().rating,\n address:\n doc.data().street +\n \", \" +\n doc.data().city +\n \", \" +\n doc.data().state +\n \", \" +\n doc.data().zip,\n gym: doc.data().gym,\n bar: doc.data().bar,\n swimmingPool: doc.data().swimmingPool\n });\n });\n\n this.setState({ hotels });\n this.setState({isLoading: false});\n });\n } else {\n //uery the hotel data from firestore\n db.collection(\"testingHotels\")\n .get()\n .then(collection => {\n var hotels = [];\n // console.log(\"hotels -----\" + hotels);\n\n //map all the needed hotel information to the state\n collection.forEach(doc => {\n // doc.data() is never undefined for query doc snapshots\n //-----testing-----\n // console.log(doc.id, \" => \", doc.data());\n hotels.push({\n name: doc.data().name,\n hID: doc.id,\n photoUrl: doc.data().photoURL,\n type: doc.data().type,\n price: doc.data().price,\n rating: doc.data().rating,\n address:\n doc.data().street +\n \", \" +\n doc.data().city +\n \", \" +\n doc.data().state +\n \", \" +\n doc.data().zip,\n gym: doc.data().gym,\n bar: doc.data().bar,\n swimmingPool: doc.data().swimmingPool\n });\n });\n\n this.setState({ hotels });\n this.setState({isLoading: false});\n });\n }\n\n this.checkReservationConflicts();\n }", "componentDidMount(){\n axios.get(\"students.json\").then((response)=>{\n if(response.data!=null){\n let keys = Object.keys(response.data)\n let listEtudiant = keys.map(k=>{\n \n let ns = new StudentModel(k,\n response.data[k].nom,\n response.data[k].prenom,\n response.data[k].email,\n response.data[k].avatar,\n response.data[k].ispresent\n );\n return ns; \n }) \n \n this.setState({List_students_data:listEtudiant}) \n \n } \n })\n \n \n \n }", "render() {\n if (this.state.spinner) {\n return <PageLoader />;\n } else {\n return (\n <div>\n <Navbar />\n <div className=\"App\">\n {this.state.smurfs && (\n <Route\n exact\n path=\"/\"\n render={routeProps => (\n <Smurfs\n {...routeProps}\n smurfs={this.state.smurfs}\n selectSmurf={this.selectSmurf}\n deleteSmurf={this.deleteSmurf}\n />\n )}\n />\n )}\n <Route\n path=\"/smurf-form\"\n render={routeProps => (\n <SmurfForm\n {...routeProps}\n postSmurf={this.postSmurf}\n updateSmurf={this.updateSmurf}\n selectedSmurf={this.state.selectedSmurf}\n />\n )}\n />\n <Route\n path=\"/smurf/:id\"\n render={routeProps => (\n <Smurf\n {...routeProps}\n smurfs={this.state.smurfs}\n selectSmurf={this.selectSmurf}\n deleteSmurf={this.deleteSmurf}\n />\n )}\n />\n </div>\n </div>\n );\n }\n }", "componentDidMount() {\n axios\n .get(url)\n .then(res => {\n console.log(res);\n this.setState({\n smurfs: res.data\n });\n })\n .catch(err => console.log(err));\n }", "componentDidMount() {\n const newArr = [];\n const promisesArr = this.state.placesArr.map(place => {\n return foursquare.venues.getVenues({\"ll\": `${this.lat},${this.lng}`,\n \"query\": place})\n .then(res => {\n if (res.meta.code === 400) {\n alert('Authentication error. The Foresquare API Keys are not correct, please contact the Webmaster')\n }\n else if(res && res.meta.code === 200 && res.response.venues[0])\n newArr.push(res.response.venues[0])\n else if (res.response.venues && !res.response.venues[0]) {\n console.log(`venue ${place} not found`)\n }\n else {\n console.log(res) // Api Errors are shown in the console\n }\n })\n });\n\n Promise.all(promisesArr)\n .then(() => this.setState({\n placesData: newArr\n }))\n }", "function Season() {\n\n let [allShows, setAllShows] = useState(null)\n\n\n async function seeAllShows() {\n\n const showsRef = firestore.collection('shows')\n const showSnapshot = await showsRef.where('status', '!=', 'Proposal').get()\n\n\n const allShowsArray = showSnapshot.docs.map(collectAllIdsAndDocs)\n if (!allShows) {\n console.log('allShowsArray =', allShowsArray)\n setAllShows(allShowsArray)\n }\n\n }\n\n seeAllShows()\n\n return (\n <div className=\"season_container\">\n <h1>Season 2020</h1>\n { allShows ? allShows.map(show => {\n\n return <SeasonEvent\n key={show.id}\n id={show.id}\n title={show.title}\n dates={show.dates}\n type={show.type}\n artist={show.artist}\n blurb={show.blurb}\n artist={show.displayName}\n imageLg={show.imageLg}\n\n ></SeasonEvent>\n\n }) : 'loading'\n\n }\n \n </div>\n );\n}", "render() {\n console.log(this.props.favourites);\n //If all the favourites haven't been added in.\n if (this.state.favourites.length === 0) {\n return <p>There doesn't seem to be anything here...</p>;\n }\n return (\n <ul className=\"favourites__container\">\n {this.state.favourites.map(fav => (\n <Remove\n key={fav.id}\n imdb={fav.imdb_id}\n removeFavourite={this.removeFavourite}\n receiveRemoveFavourite={this.props.receiveRemoveFavourite}\n id={fav.id}\n title={fav.title}\n />\n ))}\n </ul>\n );\n }", "getInitialData() {\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\n if (error) {\n console.log(error);\n } else if (item == null) {\n // Gallery not found.\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\n } else {\n this.setState({ gallery: item,\n editGallery : {\n name: item.name,\n description: item.description\n }});\n\n // Get medias\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ images: [...items] });\n }\n });\n }\n });\n }", "render() {\n return (\n <Wrapper>\n \n <Title>Remember The Wine List</Title>\n \n <Scores\n scores={this.state.currentScore} \n highscore={this.state.highscore}\n message={this.state.message}\n />\n \n <div className = \"row\">\n \n {this.state.friends.map(friend => (\n <FriendCard className=\"col-4\"\n removeFriend={this.removeFriend}\n id={friend.id}\n key={friend.id}\n name={friend.name}\n image={friend.image}\n handleClick={this.handleClick}\n handleReset={this.handleReset}\n />\n ))}\n </div>\n \n \n </Wrapper>\n );\n }", "render() {\n let uploads = this.state.uploads;\n\n return (\n <div>\n <div className=\"row\">\n <div className=\"col s12\">\n <h5 className=\"center\">Uploads</h5>\n </div>\n </div>\n\n <div className=\"divider\" />\n\n <div className=\"section\">\n <div className=\"row\">\n <div className=\"col s12\">\n {this.state.message !== null ? (\n <div\n style={{ padding: \"0.5em\" }}\n className={this.state.messagestyle}\n >\n <i className=\"left close material-icons\">error</i>\n {this.state.message}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n\n <div className=\"row\">\n {uploads.map((upload) => (\n <Upload\n key={upload.UploadName}\n name={upload.UploadName}\n studentid={upload.StudentID}\n assignmentid={upload.AssignmentID}\n />\n ))}\n </div>\n </div>\n );\n }", "componentWillMount() {\n //let bankNames = [];\n // this._isMounted = true;\n // this.banksRef = firebase.database().ref('banks');\n // this.banksRef.on('value', (snapshot) => {\n // //this.setState({bankNames: snapshot.val(), loading: false});\n // this.setState({bankNames: snapshot.val()});\n // })\n\n this._isMounted = true;\n\n let banksKeys = Object.keys(this.props.bankNames);\n let bankNames = banksKeys.map((key) => {\n let bank = this.props.bankNames[key];\n bank.key = key;\n return bank.bankInfo.handle;\n });\n \n for (var i=0; i < bankNames.length; i++) {\n let key = banksKeys[i];\n let element = bankNames[i];\n let bankName = element.split(\" \");\n let bankNameStr = bankName[0];\n for(let j=1; j<bankName.length; j++) {\n bankNameStr = bankNameStr + \"%20\" + bankName[j];\n }\n //Get the url information from google maps api\n let url = \"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\"+bankNameStr+\"&inputtype=textquery&fields=formatted_address,name,opening_hours,geometry,place_id&key=AIzaSyA3-dO5SwXlolulr_KzS2rxXU2IUas_YjE\";\n fetch(url)\n .then(response => response.json())\n .then((myJson) => {\n //Parse the json recieved from the url\n if(myJson.candidates[0]) {\n let curPlaceID = myJson.candidates[0].place_id;\n fetch(\"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/details/json?placeid=\" + curPlaceID + \"&fields=opening_hours,formatted_phone_number,address_components,geometry,name&key=AIzaSyA3-dO5SwXlolulr_KzS2rxXU2IUas_YjE\")\n .then(placeResponse => {\n return placeResponse.json();\n }).catch(err => {\n console.log(err);\n }).then((data) => {\n let currentArr = this.state.bankDetails;\n data.key = key;\n currentArr.push(data);\n if (this._isMounted) {\n this.setState({bankDetails: currentArr});\n }\n })\n }\n })\n }\n }", "function renderCollectionList(state){\n\n if (state.collections !== null) {\n var collections = Object.keys(state.collections).map(function(key){\n return `\n <div class=\"mdl-card mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-shadow--2dp collection-card\" data-id=\"${key}\">\n <div class=\"mdl-card__title mdl-card--expand\">\n <h4>${state.collections[key].name}</h4>\n </div>\n\n <div class=\"mdl-card__actions mdl-card--border\">\n <a href=\"#\" class=\"mdl-button view-collection\">View Collection</a>\n </div>\n </div>\n `\n });\n } else {\n var message = `\n <h4>You don't have any collections. Add a collection by pressing the + button.</h4>\n `\n }\n\n return `\n <section class=\"mdl-grid collection-list\">\n <div class=\"mdl-cell mdl-cell--12-col collections-title\">\n <h2>Collections</h2>\n </div>\n ${collections ? collections.join('') : message}\n </section>\n `\n\n}", "async fetchArtist(value) {\n let collection = [];\n\n const res = await fetch(`//ws.audioscrobbler.com/2.0/?method=artist.search&artist=${value}&api_key=77730a79e57e200de8fac0acd06a6bb6&format=json`)\n const data = await res.json()\n console.log(data);\n if (data.results) {\n for (let i = 0; i < 9; i++) {\n collection.push(data.results.artistmatches.artist[i]);\n }\n console.log(collection);\n this.setState({ collection });\n return collection;\n }\n }", "renderPage() {\n const interests = _.pluck(Interests.collection.find().fetch(), 'name');\n const interestData = interests.map(interest => getInterestData(interest));\n return (\n <Container id=\"interests-page\">\n <Card.Group>\n {_.map(interestData, (interest, index) => <MakeCard key={index} interest={interest}/>)}\n </Card.Group>\n </Container>\n );\n }", "showFavorites() {\n if (this.state.favoriteSources.length === 0) {\n this.alertModal(\"No favorites have been added.\");\n return;\n }\n\n let faves = this.state.favoriteSources.slice();\n\n let results = [];\n faves.map((source) => {\n axios\n .get(\n `https://api.thenewsapi.com/v1/news/top?api_token=${process.env.NEWS_API_KEY}&domains=${source}&locale=us&limit=1`\n )\n .then((res) => {\n const found = res.data.data;\n results.push(found[0]);\n this.setState({\n displayedNews: results,\n favoriteSourcesArticles: results,\n newsHeadline: \"Favorite News Sources\",\n displayFavorites: true,\n displayBookmarks: false,\n });\n console.log(this.state.favoriteSourcesArticles)\n })\n .catch((err) => {\n if (err) console.error(err);\n });\n });\n }", "renderList() {\n if (this.props.items.length === 0) {\n return <li key=\"default\">No people match your search.</li>\n }\n\n const items = this.props.items.map(item => {\n return <li key={item.name}>\n <div className=\"card-list\">\n <Card className=\"card-wics\" style={{ width: '18rem' }}>\n <Card.Img variant=\"top\" src={imgs[item.imgIndex]} />\n <Card.Body>\n <Card.Title className=\"card-wics-title\">{item.name}</Card.Title>\n <Card.Text>{item.year}-{item.death}</Card.Text>\n <div>\n <Badge className=\"card-wics-badge\" id=\"badge-left\">\n {item.field}\n </Badge>\n <Badge className=\"card-wics-badge\">{item.country}</Badge>\n </div>\n </Card.Body>\n </Card>\n </div>\n </li>\n });\n\n return items;\n }", "render() {\n return (\n <div className=\"App\">\n <nav className='Nav'>\n <NavLink to='/'>Smurfs List</NavLink>\n <NavLink className='Add' to ='/smurf-form' >Add New Smurfs</NavLink>\n </nav>\n\n <Route path='/' exact render={() => <Smurfs smurfs={this.state.smurfs} />} />\n <Route path='/smurf-form' exact render={(props) => <SmurfForm {...props} updateSumrfs={this.updateSumrfs} />} />\n <Route path='/edit/:id' exact render={(props) => <SmurfFormEdit {...props} updateSumrfs={this.updateSumrfs} />} />\n </div>\n );\n }", "listGyms(){\n if(this.props.openMats === undefined) return []\n\n this.props.refreshMap(true)\n\n let gymResults= [] //will store an array of objects, each object has a 'id', 'lat', 'lng' and 'name' key\n\n this.props.openMats.forEach(mat=>{\n let newGym = true //gets set to false if the gym is found in the gymResults array\n gymResults.forEach(gym=>{\n if(gym.name===mat.name) newGym=false\n })\n if(newGym===true){ //if gym is not found in the gymResults array, add it\n gymResults.push({name: mat.name, id:mat.gym_id, lat: mat.lat, lng: mat.lng})\n }\n })\n\n return gymResults\n }", "workoutList(){\n return this.state.workouts.map((currentWorkout, i) => {\n return (<Workout workout={currentWorkout} key={currentWorkout._id} />)\n })\n }", "componentDidMount(){\n //console.log(this.props.statusNew)\n // Goal: Save every document in the workshops collection\n // get data from specific docs when needed\n var dbRef = db.ref('processedOrders/' + this.props.userId);\n var numTimes = parseInt(this.props.numberOfItems)\n const processedOrders = []\n var foodItems = []\n var cnt = 0;\n //console.log(dbRef.child(key))\n\n // Get the data from the firestore\n dbRef.once(\"value\", function(snapshot) {\n // gets all docs in menu collection and maps array of docs to querySnapshot\n // docs. Puts every docs data into data variable\n snapshot.forEach(function(doc) {\n var processedItems = doc.val();\n var numItems = parseInt()\n if (cnt < numItems){\n var processedItems = doc.val();\n console.log(\"item\" + processedItems)\n foodItems.push(doc.val())\n //console.log(orderItemDetails.doc.key)\n cnt++;\n }\n })\n // component data is now an array of ordered wksp objects\n this.setState({componentData: foodItems});\n }.bind(this));\n\n // here is where you declar const user with useAuth?\n }", "render(){\n\n\t\tconst shelves = this.props.shelves;\n\n\t\treturn (\n\t\t\t <div className=\"list-books\">\n\t <div className=\"list-books-title\">\n\t\t <h1>MyReads</h1>\n\t\t </div>\n\t\t \t<div className=\"list-books-content\">\n\t\t <div>\n\t\t \t{shelves.map((shelf) => (\n\t\t \t\t<BookShelf shelf={shelf} key={shelf.title} updateBooks={this.props.updateBooks}/>\n\t\t \t))}\n\t\t </div>\n\t\t </div>\n\t\t <div className=\"open-search\">\n\t\t <Link to=\"/search\">Add a book</Link>\n\t </div>\n \t</div>\n\n\n\t\t\t);\n\n\n \t}", "componentDidMount() {\n\n this.auth.authantication();\n this.auth.reconnection();\n\n setTimeout(() => {\n map = new window.google.maps.Map(document.getElementById('map'), {\n zoom: 11\n });\n bounds = new window.google.maps.LatLngBounds();\n this.getAllLocations()\n this.defaultLocData();\n\n }, 1000)\n\n let decryptedData_code = localStorage.getItem('invitecode');\n var bytes_code = CryptoJS.AES.decrypt(decryptedData_code.toString(), 'Location-Sharing');\n var code = JSON.parse(bytes_code.toString(CryptoJS.enc.Utf8));\n\n let decryptedData_uid = localStorage.getItem('uid');\n var bytes_uid = CryptoJS.AES.decrypt(decryptedData_uid.toString(), 'Location-Sharing');\n var uid = JSON.parse(bytes_uid.toString(CryptoJS.enc.Utf8));\n\n\n this.setState({\n sharelink: this.auth.services.domail + code,\n uid: uid\n })\n\n this.services.senddata('GetGroupsList', '');\n this.services.getdata().subscribe((res) => {\n switch (res.event) {\n case 'GroupList':\n this.setState({\n groups: res.data\n })\n break;\n }\n });\n\n this.services.getdata().subscribe((res) => {\n switch (res.event) {\n case 'UserLocationUpdate':\n\n if (userGroupids.indexOf(res.data.uid) > -1) {\n\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n\n var data = {\n uid: this.state.uid,\n GroupId: currentGroupid\n }\n\n this.services.senddata('GetMemeberList', data);\n this.services.getdata().subscribe((res) => {\n switch (res.event) {\n case 'GroupMemberList':\n\n userGroupids = \"\";\n\n userGroupids = res.data.members;\n\n res.data.MemberList.forEach((item, i) => {\n\n // var uluru = { lat: parseFloat(item.latitude), lng: parseFloat(item.longitude) };\n\n let decryptedData_lat = item.latitude;\n var bytes_lat = CryptoJS.AES.decrypt(decryptedData_lat.toString(), 'Location-Sharing');\n var lat = JSON.parse(bytes_lat.toString(CryptoJS.enc.Utf8));\n\n let decryptedData_long = item.longitude;\n var bytes_long = CryptoJS.AES.decrypt(decryptedData_long.toString(), 'Location-Sharing');\n var long = JSON.parse(bytes_long.toString(CryptoJS.enc.Utf8));\n\n var uluru = { lat: parseFloat(lat), lng: parseFloat(long) };\n\n marker = new window.google.maps.Marker({\n position: uluru,\n map: map,\n title: item.username\n })\n\n var content = '<div id=\"content\">' +\n '<h6>' + item.username + '</h6>' +\n '</div>';\n var infowindow = new window.google.maps.InfoWindow();\n\n window.google.maps.event.addListener(marker, 'click', (function (marker, content, infowindow) {\n return function () {\n\n if (lastWindow) lastWindow.close();\n\n infowindow.setContent(content);\n infowindow.open(map, marker);\n map.setCenter(marker.getPosition());\n\n lastWindow = infowindow;\n };\n })(marker, content, infowindow));\n\n\n markers.push(marker)\n })\n\n break;\n }\n });\n\n } else {\n console.log(\"not inarray\", currentGroupid);\n }\n\n break;\n }\n });\n\n }", "render() {\n //console.log(this.state.books);\n\t\treturn (\n\t\t\t<div className=\"list-books\"> \n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n \n <div className=\"list-books-content\">\n \n {\n //pass books to their shelf\n } \n { this.state.books && \n (<div> <Shelf books={ this.state.books.filter((book)=> book.shelf === \"currentlyReading\")} name=\"Currently Reading\" onShelfChange={this.shelfChange}/>\n <Shelf books={ this.state.books.filter((book)=> book.shelf === \"read\")} name=\"Read\" onShelfChange={this.shelfChange}/>\n <Shelf books={ this.state.books.filter((book)=> book.shelf === \"wantToRead\")} name=\"Want To Read\" onShelfChange={this.shelfChange}/>\n </div> )\n }\n \n </div>\n\n <div className=\"open-search\">\n \t<Link to=\"/search\">Add Contact</Link>\n </div>\n </div>\n\t\t\t)\n\t}", "componentDidMount() {\n BooksAPI.getAll().then(data => {\n this.setState({\n // filter returned array by shelf\n currentlyReading: data.filter(item => item.shelf === 'currentlyReading'),\n wantToRead: data.filter(item => item.shelf === 'wantToRead'),\n read: data.filter(item => item.shelf === 'read')\n })\n })\n }", "renderMeals() {\n return this.state.meals.map((meal, i) =>\n <MealSearchItem\n key={i}\n cook={meal.name}\n cuisine={meal.cuisine_type}\n ingredients={meal.ingredients}\n description={meal.description}\n counter={meal.counter}\n id={meal.id}\n pickup_time={meal.pickup_time}\n pickup_day={meal.pickup_day}\n price={meal.price}\n token={this.props.state.currentToken}\n consumerID={this.props.state.consumerID}\n getUpcomingMeals={this.getUpcomingConsumerMeals}\n />\n );\n }", "componentDidMount() {\n teamsRef.doc(teamId).onSnapshot((doc) => {\n const docData = doc.data();\n this.setState({\n members: docData.teamMembers,\n privacy: docData.privacy,\n isDataFetched: true,\n social: docData.social,\n });\n });\n }", "componentDidMount () {\n collectionService.getCollections()\n .then(response => {\n const { formulaName } = this.props;\n this.setState({\n collections: response.listOfCollections,\n formulaName\n })\n }) \n }", "renderNewsList() {\n const { newsListItems } = this.state;\n\n const itemsNew = newsListItems.map(\n item => (\n <NewsListItem\n key={item.objectID}\n item={item}\n upvoteHandler={this.upvoteHandler}\n hideNewHandler={this.hideNewHandler}\n />\n ),\n );\n\n return itemsNew;\n }", "componentDidMount() {\n Axios\n .get(`/api/gigs/${this.props.match.params.id}`)\n .then(res => this.setState({ gig: res.data.results }), ()=> {\n console.log(this.state.gig);\n })\n .catch(err => console.log(err));\n\n\n\n // gets users gigs (favourited gigs) in order to allow us to see wether this gig is in the users favourites down below\n Axios\n .get('/api/profile', {\n headers: { Authorization: `Bearer ${Auth.getToken()}`}\n })\n .then(res => this.setState({\n user: res.data\n }))\n .catch(err => console.log(err));\n\n\n }", "async fetchAlbum(value) {\n //collection to be set to state later in fucntion\n let collection = [];\n\n console.log(value);\n //removed http for cors issue github pages\n const res = await fetch(`//ws.audioscrobbler.com/2.0/?method=album.search&album=${value}&api_key=77730a79e57e200de8fac0acd06a6bb6&format=json`)\n const data = await res.json()\n //if data results exist\n if (data.results) {\n //this is gonna be a problem\n for (let i = 0; i < 9; i++) {\n collection.push(data.results.albummatches.album[i]);\n }\n //collection=data.results.albummatches.album;\n console.log(collection);\n //setting state\n this.setState({ collection });\n console.log('exist');\n console.log(data.results.albummatches.album[0]);\n return collection;\n\n }\n }", "componentDidMount() {\n fetch(baseURL)\n .then(response => response.json())\n .then(data => {\n this.setState({ objects: data });\n });\n\n this.socket.on('stocks', (message) => {\n this.setState({ withPrices: [] })\n message.map((cake) => {\n\n this.state.objects.forEach((item) => {\n if (cake.nr === item.nr) {\n this.setState({\n withPrices: [...this.state.withPrices, cake] })\n }\n });\n });\n });\n }", "componentDidMount() {\n /*\n According to the universal rule of not mutating the original data,\n here, we convert it into a Map().\n So we can make changes to the \"copy\" (we can put it like that) of the data.\n */\n const activeStudents = new Map(\n STUDENTS.map(i => [\n i.id,\n {\n id: i.id,\n name: i.name,\n active: i.active\n }\n ])\n );\n\n this.setState({\n activeStudents\n });\n }", "render() {\n return (\n <div>\n \t\t<h3>Newfeeds</h3>\n {this.state.messages.map((message, index)=>(\n <NewsfeedEntryView student={message.firstname+ ' ' + message.lastname} teacher={message.teacher_id} lesson={message.lesson} />\n ))}\n </div>\n )\n }", "getAllShelves() {\n \t\tthis.props.model.getShelves((shelves) => {\n\t\t\tif (shelves === 'error'){\n\t\t\t\tthis.setState({\n\t\t\t\t\tstatus: 'ERROR'\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Shelf is the actual book object which we get with the book id\n\t\t\t\tvar shelf = this.props.model.getShelfByID(shelves, parseInt(this.state.id, 10));\n\t\t\t\tthis.setState({\n\t\t\t\t\tshelf: shelf,\n\t\t\t\t\tstatus: 'LOADED'\n\t\t\t\t})\n\t\t\t}\n \t\t})\n\t}", "async componentDidMount() {\n\n const { claims, uid } = this.props.logStatus\n\n if (claims !== 'guest') {\n\n let siteFavorites = this.props.siteFavorites\n let trailFavorites = this.props.trailFavorites\n\n if (siteFavorites.length === 0) {\n siteFavorites = await getFavoritesIDs(uid)\n this.props.setSiteFavorites(siteFavorites)\n } \n\n if (trailFavorites.length === 0) {\n trailFavorites = await getTrailFavoritesIDs(uid)\n this.props.setTrailFavorites(trailFavorites)\n }\n }\n }", "componentDidMount() {\n\t\t//fetch online REST service for fake placeholder data\n\t\tfetch('https://jsonplaceholder.typicode.com/users')\n \t\t.then(response => response.json())\n \t\t.then(users => this.setState({monsters: users}));\n\t}", "render() {\n\n const { venues, query } = this.state\n //console.log(venues)\n\n let filteredVenues\n if(query) {\n const match = new RegExp(escapeRegExp(query), 'i')\n filteredVenues = venues.filter((venue)=> {\n const isMatch = match.test(venue.venue.name);\n console.log(venue);\n if (isMatch) {\n venue.marker.setMap(this.map);\n } else {\n venue.marker.setMap(null);\n }\n return isMatch;\n \n //match.test(venue.venue.name))\n //}\n });} else {\n filteredVenues = venues\n }\n\n return (\n \n\n \n \n \n <div id=\"App\">\n \n <ErrorBoundary>\n<Menu tabIndex=\"0\">\n<input type={\"search\"} id={\"search\"} placeholder={\"filter Venues\"} \nonChange={(event)=> this.updateQuery(event.target.value)} \naria-label = \"Search Venues\" tabIndex = \"0\" role=\"search\"/>\n \n {filteredVenues.map((venue, index) => (\n <ListItem \n className=\"bm-item\"\n key={index}\n venue={venue}\n aria-label = {venue.venue.name}\n \n />\n \n ))}\n </Menu>\n </ErrorBoundary>\n <div id=\"map\"></div>\n \n </div>\n \n \n \n\n\n );\n }", "render() {\n let offWhiteShoe = this.state.offWhiteShoes.map(offWhiteShoe => {\n return (\n <OffWhiteShoes\n offWhiteShoes = {offWhiteShoe} />)\n })\n\n return (\n <div>\n <h3>Off-White</h3>\n {offWhiteShoe}\n </div>\n )\n }", "componentWillMount() {\n fetch('https://secure.toronto.ca/cc_sr_v1/data/swm_waste_wizard_APR?limit=1000').then(res => {\n return res.json();\n }).then(lookupData => {\n this.setState({ lookupData }, () => {\n // Check if there is a pending search and apply it now that the JSON has loaded\n if (this.state.pendingSearch)\n this.handleSearch(this.state.pendingSearch);\n });\n }).catch(err => {\n console.log(err);\n });\n\n // Get the saved favourites from the local storage, if they exist\n let favouritesJSON = localStorage.getItem('favourites');\n let favouriteIdsJSON = localStorage.getItem('favouriteIds');\n\n console.log(favouritesJSON);\n\n let favourites;\n let favouriteIds;\n // Set these variables to empty arrays if they are null\n if (!favouritesJSON)\n favourites = [];\n else\n favourites = JSON.parse(favouritesJSON);\n \n if (!favouriteIdsJSON)\n favouriteIds = [];\n else\n favouriteIds = JSON.parse(favouriteIdsJSON);\n\n this.setState({\n favourites,\n favouriteIds\n });\n }", "componentDidMount() {\n const db = firebase.database().ref()\n const eventsRef = db.child('events')\n const scenesRef = db.child('scenes')\n const concertsRef = db.child('concerts')\n const bandsRef = db.child('bands')\n const profilesRef = db.child('staff/profiles')\n\n eventsRef.on('value', snap => {\n const events = snap.val()\n Object.keys(events).forEach(eventKey => {\n const event = events[eventKey]\n if (event.staff.organizer.includes(this.props.user.uid)) {\n // Fetch event staff information\n const {staff} = event\n Object.keys(staff).forEach(roleKey => {\n const roleMembers = staff[roleKey]\n staff[roleKey] = []\n roleMembers.forEach(roleMember => {\n profilesRef.child(`${roleMember}`).on('value', snap => {\n staff[roleKey].push(snap.val())\n })\n })\n })\n\n // Fetch scenes information\n const {scenes} = event\n event.scenes = {}\n scenes.forEach(sceneKey => {\n scenesRef.child(sceneKey).on('value', snap => {\n const scene = snap.val()\n event.scenes[sceneKey] = scene\n const {concerts} = scene\n concerts.forEach(concertKey => {\n delete event.scenes[sceneKey].concerts\n scene.bands = []\n concertsRef.child(concertKey).on('value', snap => {\n let {band, from, to, technicians} = snap.val()\n Object.keys(technicians).forEach(technicianKey => {\n profilesRef.child(technicianKey).on('value', snap => {\n technicians[technicianKey].name = snap.val().name\n })\n })\n bandsRef.child(`${band}/name`).on('value', snap => {\n scene.bands.push({\n name: snap.val(), from, to,\n technicians: {\n ...technicians\n }})\n this.setState({events, value: Object.keys(events)[0]})\n })\n })\n })\n })\n })\n } else {\n delete events[eventKey]\n }\n })\n })\n }", "componentDidMount() {\r\n const { updateCollections } = this.props;\r\n const collectionRef = firestore.collection(\"collections\");\r\n // when using fetch option the url to fetch is always the same for every project but changing crwn-clothing-rad for your project id\r\n // https://firestore.googleapis.com/v1/projects/crwn-clothing-rad/database/(default)/documents/ to this url we have to add the collection we want to get in this case \"collections\"\r\n fetch(\r\n \"https://firestore.googleapis.com/v1/projects/crwn-clothing-rad/database/(default)/documents/collections\"\r\n )\r\n .then(response => response.json())\r\n // the fetch method does not give back a reference object or a snapshot object since we are not using firebase api\r\n // it retruns us an object that has the documents of the collection in one array\r\n // each document inside the array is the document with the fields we have in our firestore db with its items\r\n // the structure inside the fields property does not have the same structure, it is more nested inside objects\r\n .then(collections => console.log(collections));\r\n // because of the nested nature and the difference in the structure of the data we cannot use the same convertCollectionSnapshotToMap and we would have to refactor that function\r\n\r\n // collectionRef.get().then(snapshot => {\r\n // const collectionsMap = convertCollectionSnapshotToMap(snapshot);\r\n // updateCollections(collectionsMap);\r\n // this.setState({ loading: false });\r\n // });\r\n }", "async componentDidMount(){\n\n try {\n const response = await strapi.request('POST', '/graphql',{\n data:{\n query:`query{\n brands{\n _id\n description\n name\n image{\n url\n }\n }\n }`\n }\n });\n //setting state after fetching data from query\n this.setState({ brands: response.data.brands , loader: false });\n } catch(err){\n console.log(err);\n this.setState({loader: false})\n }\n }", "render() {\n if(!this.state.isLoaded){\n return <h1>Loading...</h1>\n }else {\n return (\n <div className='cardSection'>\n <h1>Beer-topia!</h1>\n <div className='section'>\n {this.state.beers.map((beer)=>{ //my mapping function and return\n return (\n <Card beer={beer} key={beer.id}/>\n )\n })}\n </div> \n </div>\n )\n }\n }", "componentDidMount() {\n db.collection(\"Communities\").onSnapshot(snapshot => {\n snapshot.forEach(community => {\n var communityJSON = {\n name: community.id,\n lat: community.data().Location.latitude,\n lng: community.data().Location.longitude\n }\n \n var tempArray = this.state.places.slice()\n tempArray[tempArray.length] = communityJSON\n this.setState({places: tempArray})\n\n })\n })\n }", "componentDidMount() {\n\n API.getDogsOfBreed('corgi')\n .then(res => {\n console.log(res.data.message)\n this.setState({ breeds: res.data.message })\n\n API.getEmployeesOfId(this.state.search)\n .then(res => {\n if (res.data.status === \"error\") {\n throw new Error(res.data);\n }\n res.data.map(e => e.image = this.state.breeds[Math.floor(Math.random() * 50)])\n this.setState({ results: res.data, error: \"\" });\n })\n .catch(err => this.setState({ error: err }));\n\n })\n .catch(err => console.log(err));\n\n API.getBaseEmployeesList()\n .then(res => this.setState({ employees: res.data.message }))\n .catch(err => console.log(err));\n }", "performSearch() {\n const\n thiz = this,\n url = spotyfySearch + this.state.inputValue + '&type=artist&limit=10';\n\n if(this.state.inputValue !== '') {\n fetchArtists(url)\n .then(function(res) {\n let artistsName;\n let data = res.artists.items;\n\n // Map artists from the API call into an array and set the state in the main component\n artistsName = data.map(result => result.name );\n thiz.setState({\n dataSource: artistsName\n });\n thiz.props.upArtists(data);\n })\n .catch(function(err){\n console.log(\"could not resolve promise with error: \", err)\n })\n }\n }", "componentDidMount(){\n this.setState({ loading: true });\n\n const userId = firebase.auth().currentUser.uid;\n // get users information from user/uid node\n firebase.database().ref('/users/' + userId).once('value').then((snapshot) => {\n let instrumentsObject = [];\n let genresObject = [];\n let avatar = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png';\n let currentUserObject = snapshot.val();\n // if the instruments or genre nodes exists, set the state of selected instruments or genres to those currently in the DB\n if(currentUserObject.instruments) {\n instrumentsObject = Object.keys(currentUserObject.instruments)\n }\n if(currentUserObject.genres) {\n genresObject = Object.keys(currentUserObject.genres)\n }\n let name = '';\n let email = '';\n let description = '';\n let twitter = '';\n let instagram = '';\n let soundcloud = '';\n let youtube = '';\n // if node exists, change state to value in DB, otherwise leave as empty string\n if(currentUserObject.name) {\n name = currentUserObject.name\n }\n if(currentUserObject.email) {\n email = currentUserObject.email\n }\n if(currentUserObject.description) {\n description = currentUserObject.description\n }\n if(currentUserObject.social_media) {\n if(currentUserObject.social_media.twitter) {\n twitter = currentUserObject.social_media.twitter;\n }\n if(currentUserObject.social_media.youtube) {\n youtube = currentUserObject.social_media.youtube;\n }\n if(currentUserObject.social_media.instagram) {\n instagram = currentUserObject.social_media.instagram;\n }\n if(currentUserObject.social_media.soundcloud) {\n soundcloud = currentUserObject.social_media.soundcloud;\n }\n }\n if(currentUserObject.picture) {\n if(currentUserObject.picture.large) {\n avatar = currentUserObject.picture.large;\n }\n }\n // set profile attributes\n this.setState({\n selectedInstruments: instrumentsObject,\n selectedGenres: genresObject,\n name: name,\n email: email,\n avatar: avatar,\n description: description,\n loading: false,\n twitter: twitter,\n soundcloud: soundcloud,\n instagram: instagram,\n youtube: youtube,\n })\n });\n }", "componentDidMount() { \n // Send an HTTP request to the server.\n fetch(\"http://localhost:8081/Account\",\n {\n method: 'GET' // The type of HTTP request.\n }).then(res => {\n // Convert the response data to a JSON.\n return res.json();\n }, err => {\n console.log(err);\n }).then(recipesList => {\n if (!recipesList) return;\n const recipeDivs = recipesList.map((recipeObj, i) =>\n <CartRow \n name={recipeObj.Recipe_name} \n img={recipeObj.Recipe_photo} \n rating={recipeObj.Rate} \n author={recipeObj.Author}\n totalcooktime={recipeObj.Ingredients}\n /> \n );\n\n this.setState({\n recipes: recipeDivs\n });\n\n }, err => {\n // Print the error if there is one.\n console.log(err);\n });\n }", "render() {\n return (\n <div className=\"app\">\n <Route path=\"/search\" render={() => (\n <div className=\"search-books\">\n <div className=\"search-books-bar\">\n <div className=\"search-books-input-wrapper\">\n <input\n type=\"text\"\n placeholder=\"Search by title or author\"\n value={this.state.query}\n onChange={(event) => this.updateQuery(event.target.value)}\n />\n </div>\n </div>\n <div className=\"search-books-results\">\n <ol className=\"books-grid\">\n {this.state.searchResults.map(result => {\n // compare result.id against book.id\n // if a match, change the result.shelf = book.shelf\n // if no match, set to \"none\"\n // need to initialize shelf to \"none\"\n result.shelf = \"none\"\n console.log(result) // TESTING\n // check to see if results already has a shelf assigned, if not, assign default\n this.state.books.map(book => (\n book.id === result.id ? result.shelf = book.shelf : \"none\"\n ))\n // display the book - copied from Shelf.js\n return (\n <li key={result.id}>\n <Books book={result} shelfChanger={this.shelfChanger}/>\n </li>\n )\n })}\n </ol>\n </div>\n </div>\n )}/>\n <Route exact path=\"/\" render={() => (\n <div className=\"list-books\">\n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n <div className=\"list-books-content\">\n <Shelf\n shelfChanger={this.shelfChanger}\n books={this.state.books}\n shelfHeader=\"Currently Reading\"\n shelfValue=\"currentlyReading\"\n />\n <Shelf\n shelfChanger={this.shelfChanger}\n books={this.state.books}\n shelfHeader=\"Want to Read\"\n shelfValue=\"wantToRead\"\n />\n <Shelf\n shelfChanger={this.shelfChanger}\n books={this.state.books}\n shelfHeader=\"Read\"\n shelfValue=\"read\"\n />\n </div>\n <div className=\"open-search\">\n <Link to=\"search\">Add a book</Link>\n </div>\n </div> \n )}/>\n </div>\n )\n }", "async fetchWorkouts() {\n await axios//get all workouts and set to data\n .get(ROUTES.get_workouts)\n .then(results => {\n console.log(results);\n this.setState({data: results.data, loading: false});\n })\n .catch(error => {\n console.log(error.response);\n this.setState({loading: false});\n });\n }", "render() {\r\n\r\n let collections = [\r\n {\r\n name:'Sunday Brunch',\r\n image:require('./images/sb.jpg')\r\n\r\n },\r\n {\r\n name:'Frozen Delight',\r\n image:require('./images/fd.jpg')\r\n },\r\n {\r\n name:'Street Food',\r\n image:require('./images/street.jpg')\r\n },\r\n {\r\n name:'Fine Dine',\r\n image:require('./images/street.jpg')\r\n },\r\n {\r\n name:'Barbeque & Grills',\r\n image:require('./images/bb.jpg')\r\n },\r\n {\r\n name:'Breakfast',\r\n image:require('./images/bf.jpg')\r\n }\r\n ]\r\nreturn (\r\n <div className=\"wrapper1\" id=\"collections\">\r\n <br />\r\n\r\n <div className=\"row text-center\">\r\n {\r\n collections.map(function(item, index){\r\n return (\r\n <div className=\"col-md-4\">\r\n <div className=\"img-thumbnail\">\r\n <div className=\"img-responsive\">\r\n <div className=\"img-rounded\">\r\n <a href=\"#\"><img src={item.image} alt=\"Paris\" /></a>\r\n </div>\r\n </div>\r\n <p><i>{item.name}</i></p>\r\n </div>\r\n </div>\r\n )\r\n })\r\n }\r\n </div>\r\n </div>\r\n );\r\n }", "async componentDidMount() {\n try {\n db.collection('points').get()\n .then(snapshot => {\n snapshot.forEach(doc => {\n dsList.push(doc.id);\n });\n this.setState({\n diseaseList: dsList\n })\n console.log(this.state.diseaseList)//LET IT BE FUCKING KNOWN THAT THIS TOOK ME 2 HOURS TO IMPLEMENT KUTTE KA BACHA\n })\n .catch(err => {\n console.log('Error getting documents', err);\n });\n }\n\n catch (error) {\n console.log(error)\n }\n\n }", "render() {\n //If there is a query, only matched monuments are listed\n let showingMonuments\n if (this.state.query) {\n const match = new RegExp(escapeRegExp(this.state.query), 'i')\n showingMonuments = this.props.markers.filter((monument) => match.test(monument.name))\n } else {\n showingMonuments = this.props.markers\n }\n\n //Before rendering the list of monuments, they are sorted by name\n showingMonuments.sort(sortBy('name'))\n\n return (\n <div className=\"List-view\" aria-label=\"Map with all the markers and a list of these monuments\">\n <div className=\"List-view-header-map\">\n <header className=\"App-header\">\n <div className=\"Light-box\">\n <Link className=\"List-view-link\" to=\"/\" tabIndex=\"0\">\n <h1 className=\"App-title\">Gaudi's Tour</h1>\n </Link>\n </div>\n </header>\n <MyMapComponent role=\"Application\" \n googleMapURL=\"https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places\"\n loadingElement={<div style={{ height: `100%` }} />}\n containerElement={<div style={{ height: `86.5vh` }} />}\n mapElement={<div style={{ height: `100%` }} />}\n defaultZoom={12.7}\n defaultCenter={{lat: 41.3968849, lng: 2.1587406}}>\n {showingMonuments.map(marker => (\n <Marker\n key={marker.id}\n position={{lat: parseFloat(marker.lat), lng: parseFloat(marker.lng)}}\n onClick={(e) => this.handleClick(`/listview/${marker.path}`, e)}\n />\n ))}\n </MyMapComponent>\n </div>\n <aside className=\"List-view-search\" aria-label=\"List of all the monuments marked in the map\">\n <Link className=\"List-view-link-aside\" to=\"/\">\n <span role=\"img\" aria-label=\"close\">❌</span>\n </Link>\n <br/>\n <input type='text' placeholder='Search monuments' value={this.state.query}\n onChange={(event) => this.updateQuery(event.target.value)}/>\n <ul className=\"Markers-list\" aria-label=\"List of monuments marked in the map\">\n {showingMonuments.map((marker, index) => (\n <li key={marker.id}>\n <Link className=\"List-view-link\" to={`/listview/${marker.path}`}>\n {marker.name}\n </Link>\n </li>\n ))}\n </ul>\n </aside>\n </div>\n );\n }", "componentDidMount() {\n axios.get('http://localhost:3333/smurfs')\n .then(response => {\n console.log(response);\n this.setState({ smurfs: response.data });\n console.log(`Put Request: ${response.data}`)\n\n })\n .catch(error => {\n console.log(error);\n })\n }", "function getSchools() {\n setLoading(true)\n ref.onSnapshot((querySnapshot) => {\n const items = []\n querySnapshot.forEach((document) => {\n items.push(document.data())\n })\n setSchools(items)\n setLoading(false)\n })\n }", "constructor(props) {\n super(props);\n this.state = {\n \"Brastlewark\": []\n }//state\n \n var keys = Object.keys( this.state );\n this.townName = keys[0];\n this.ItemNotFound = -1;\n this.urlDataProvider = \"https://raw.githubusercontent.com/rrafols/mobile_test/master/data.json\";\n \n this.searchByName = this.searchByName.bind(this);\n this.searchByAge = this.searchByAge.bind(this);\n this.searchByWeight = this.searchByWeight.bind(this);\n this.searchByHeight = this.searchByHeight.bind(this);\n this.searchByHairColor = this.searchByHairColor.bind(this);\n this.searchByProfessions = this.searchByProfessions.bind(this);\n this.findFriendIdByName = this.findFriendIdByName.bind(this);\n }", "renderPage() {\n console.log(this.props.followers)\n console.log(this.props.routinesOfFollower)\n return (\n <Container>\n <Header as=\"h2\" textAlign=\"center\">Followers</Header>\n \n {this.props.followers.map((follower) => <StuffItemAdmin key={follower._id} stuff={follower} routines={this.props.routinesOfFollower[follower._id]} />)}\n </Container>\n );\n }", "bookList() {\n if (this.state.mounted) {\n return this.state.filteredBookList.map(currentBook => {\n if (\n currentBook.unread == true &&\n this.props.location.pathname == \"/books/unread\"\n ) {\n return (\n <BookCover key={currentBook._id} currentBookCover={currentBook} />\n );\n } else if (\n currentBook.unread == false &&\n this.props.location.pathname == \"/books/finished\"\n ) {\n return (\n <BookCover key={currentBook._id} currentBookCover={currentBook} />\n );\n }\n });\n } else {\n return (\n <div className=\"center-align\">\n There have not been any books uploaded yet!\n </div>\n );\n }\n }", "componentDidMount() {\n fetch('https://jsonplaceholder.typicode.com/users')\n .then(response => {\n //console.log(response);\n response.json()\n .then(users => {\n //console.log(users);\n this.setState( \n {monsters: users}, \n () => {\n this.addGoodMonsters(this.state.monsters);\n console.log(this.state.monsters);\n this.setState({monsters: this.state.monsters});\n } \n ); \n })\n }); \n }", "componentDidMount() {\n fetch('https://jsonplaceholder.typicode.com/users')\n .then(response => response.json())\n .then(users => this.setState({ monsters: users }));\n }", "getFeatures() { \n var context = this;\n var ratings = [];\n var features = [];\n\n axios.get('/api/session')\n .then((res) => {\n if (res.data) {\n context.setState({ userId: res.data.id });\n }\n axios.get('/api/simpleRating', {\n params: {\n userId: res.data.id\n }\n })\n .then(function(results) {\n\n for (var j = 0; j < results.data.length; j++) {\n var ratingObj = {\n parkId: results.data[j].parkId,\n rating: results.data[j].ratingVal\n }\n ratings.push(ratingObj);\n }\n\n // Run through each parkObject\n for (var k = 0; k < context.state.parkObjects.length; k++) {\n for (var l = 0; l < ratings.length; l++) {\n // If user has rated that park, add the rating to the parkObject\n if (ratings[l].parkId === context.state.parkObjects[k].id) {\n context.state.parkObjects[k].rating = ratings[l].rating;\n context.state.parkObjects[k].ratingDescription = \"You gave this park \" + ratings[l].rating + \" stars!\";\n }\n }\n features.push({\n \"type\": \"Feature\",\n \"properties\": {\n \"description\": \"<p>\" + context.state.parkObjects[k].parkLink + \"</p><p>\" + context.state.parkObjects[k].ratingDescription + \"</p>\",\n \"icon\": \"triangle\"\n },\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": context.state.parkObjects[k].coordinates\n }\n });\n }\n // Set component state and create map\n // Fill features array with map layer script for each park\n context.setState({locationData: features});\n context.createMap();\n });\n });\n\n }", "render() {\n \n if (this.state.candidates)\n {\n return ( \n <div>\n <Link to={\"/newcandidate/\"}>Create new candidate's profile </Link>\n\n </div>\n <h1> List of candidates </h1>\n <Row>\n {this.state.candidates.map(c => { return <Col sx=\"3\" sm=\"3\" md=\"3\" lg=\"3\" xl=\"3\"> <Link to={`/candidates/${c.id}`}> {c.firstName + c.lastName} </Link>\n <img s> </img>\n </Col> })}\n )}\n </Row>\n );\n }\n else \n { return (\n <h1>No Movies!</h1> );\n \n } \n}", "render() {\n console.log(this.state);\n // var rolesArray = this.state.politicianRoles;\n\n // const listRoles = rolesArray.map((role) =>\n // <li>{role}</li>\n // );\n \n return (\n <div>\n <h4>{this.state.politicianName}</h4>\n <div className=\"divider\"></div>\n <div className=\"section\">\n <div className=\"row\">\n <h5>Information on this fine statesman</h5>\n <br></br>\n <div className=\"col s12 m8 l4\">\n <h5>Take a good look at {this.state.politicianFirstName}</h5>\n <img src={this.state.twitterPicURL} alt={this.state.politicianName} className=\"circle responsive-img\" width=\"300\" height=\"300\"></img>\n </div>\n <div className=\"col s12 m8 l4\">\n <h4>Details on {this.state.politicianFirstName}</h4>\n <ol>\n <li>{this.state.politicianParty}</li>\n <li>{this.state.politicianPosition} for the state of {this.state.politicianState}</li>\n <li>Current term ends on {this.state.politicianEndOfTerm}</li>\n <li>Twitter handle: <a href={this.state.twitterURL} target=\"_blank\">{this.state.politicianTwitterHandle}</a></li>\n </ol>\n <br></br>\n <h5>Member of the following committees:</h5>\n <p>{this.state.politicianRoles}</p>\n {/*<ol>{this.state.politicianRoles.map((role) =>\n <li>{role}</li>\n )}\n </ol>*/}\n \n </div>\n <div className=\"col s12 m8 l4\">\n <img src={this.state.partyPic} alt={this.state.politicianName} className=\"circle responsive-img\" width=\"300\" height=\"300\"></img>\n </div>\n </div>\n </div>\n <div className=\"divider\"></div>\n <div className=\"section\">\n <h5>Contributions for most recent election cycle by industry</h5>\n <Chart\n chartType=\"ColumnChart\"\n data={this.state.politicianDonors}\n options={{\n // title: \"Contributions for most recent election cycle by industry\",\n // legend: { position: 'top' },\n }}\n width=\"100%\"\n />\n </div>\n <div className=\"divider\"></div>\n <div className=\"section\">\n <h5>Section 3</h5>\n <p>Stuff</p>\n </div>\n \n </div>\n \n );\n }", "componentDidMount() {\n WindChimeApiService.getUser()\n .then(res => {\n this.context.setId(res.id)\n WindChimeApiService.findStoredUser()\n .then(res => {\n let user = res.filter(user => user.id === this.context.id);\n if (user === undefined || user.length === 0) {\n WindChimeApiService.postUser(user[0].id)\n .then(res => {\n console.log(`${res.id} added`);\n this.context.setId(res.id)\n })\n } else {\n this.context.setId(user[0].id)\n console.log('User found')\n }\n })\n })\n .catch(err => {\n this.context.setError(err)\n })\n\n WindChimeApiService.getUserArtists()\n .then(res => {\n this.context.setArtists(res.items)\n })\n .catch(err => {\n this.context.setError(err)\n })\n\n WindChimeApiService.getPlaylists()\n .then(res => {\n if(res.length !== 0){\n this.context.setUserPlaylists(res)\n }})\n .catch(err => {\n this.context.setError(err)\n })\n }", "function LandListings(props) {\n useEffect(() => {\n if (localStorage.getItem(\"token\")) {\n props.getUser(props.user.id);\n }\n }, []);\n useEffect(() => {\n props.getListing();\n }, []);\n\n //originally props.listing.map, changing to data.map because props.listing doesn't have picture\n\n return (\n <div className=\"Land-List-Parent\">\n <h1 className=\"Land-List-Parent-h1\">Available Listings</h1>\n\n <section className=\"land-list\">\n {props.listing.map(land => (\n <ListingsCard key={land.listing_id} land={land} />\n ))}\n </section>\n </div>\n );\n}", "function AddSuppliers(props) {\n \n const { useState } = React;\n const [columns, setColumns] = useState([\n { title: 'Supplier ID', field: 'sId' },\n { title: 'First Name', field: 'firstName' },\n { title: 'Last Name', field: 'lastName' },\n { title: 'Email', field: 'email' },\n { title: 'Phone', field: 'phone' },\n { title: 'Supplier Item Type', field: 'itemtype'},\n {title: 'Unit Price', field: 'unitprice'},\n { title: 'Location', field: 'location'},\n { title: 'Department', field: 'department'},\n { title: 'Date', field: 'date'},\n ]); \n\n const validateData___ = (data) => {\n if (data.sId == null || data.sId == \"\") {\n return \"ID field Cannot be null\"\n }\n else if (data.sId.length != 5) {\n return \"Field ID should contain 5 characters\"\n }\n else if (data.firstName == null || data.firstName == \"\") {\n return \"First Name Cannot be null\"\n }\n else if (data.lastName == null || data.lastName == \"\") {\n return \"Last Name cannot be null\"\n }\n else if (data.email == null || data.email == \"\") {\n return \"Email field cannot be null\"\n }\n else\n return null\n }\n\n const [state, setState] = React.useState({\n open: false,\n vertical: 'bottom',\n horizontal: 'right',\n });\n\n const { vertical, horizontal, open ,error} = state;\n \n const handleClose = () => {\n setState({ ...state, open: false });\n };\n \n const feedBackToast = (<Snackbar \n autoHideDuration={200000}\n anchorOrigin={{ vertical, horizontal }}\n open={open}\n onClose={handleClose}\n key={vertical + horizontal}\n >\n <div >\n \n <Alert variant=\"filled\" severity=\"error\" style={{display: \"flex\",alignItems: \"center\"}}>\n <h3>{error}</h3>\n \n </Alert>\n </div>\n </Snackbar>)\n\n const supplier = useSelector(state => state.firestore.ordered.supplier)\n const data = supplier ? (supplier.map(sup => ({...sup}))) : (null)\n const table = data ? (\n <MaterialTable\n title=\"Current Suppliers\"\n columns={columns}\n data={data}\n editable={{\n // onRowAdd: newData =>\n // new Promise((resolve, reject) => {\n // setTimeout(() => {\n // props.insertSupplierInfo(newData) \n // resolve();\n // }, 1000)\n // }),\n onRowUpdate: (newData, oldData) =>\n new Promise((resolve, reject) => {\n const error = validateData___(newData);\n if (error != null){\n setState({ ...state,open: true,error:error});\n reject();\n }\n else{\n setTimeout(() => {\n const dataUpdate = [...data];\n const index = oldData.tableData.sId;\n dataUpdate[index] = newData;\n console.log(newData,oldData)\n props.updateSupplierInfo(newData)\n resolve();\n }, 1000)}\n }),\n onRowDelete: oldData =>\n new Promise((resolve, reject) => {\n setTimeout(() => {\n const dataDelete = [...data];\n const index = oldData.tableData.sId;\n dataDelete.splice(index, 1);\n console.log(oldData)\n props.deleteSupplierInfo(oldData.sId)\n resolve()\n }, 1000)\n }),\n }}\n options={{\n exportButton: true\n } \n }\n />\n ) : (<div>Loading</div>)\n\n\n \n\n \n return(\n <div>\n {table}\n {feedBackToast}\n </div>\n \n )\n }", "render () {\n return (\n\n <Fragment>\n {/*Test Senator*/}\n {this.state.senatorsToDisplay}\n {/*will have function here that maps a our senators json to Senator components */}\n </Fragment>\n )\n}", "componentDidMount() {\n API.getRandomUser().then((res) => {\n console.log(res.data.results);\n // mapping to get only relevant data from the call\n const mappedRes = res.data.results.map((apiData) => ({\n first: apiData.name.first,\n last: apiData.name.last,\n thumbnail: apiData.picture.large,\n email: apiData.email,\n phone: apiData.phone,\n dob: formatDate(apiData.dob.date),\n }));\n this.setState({\n results: mappedRes,\n filtered: mappedRes,\n });\n });\n }", "componentWillMount() {\n this.fetchMembers();\n }", "renderEvents() {\n // If events were pulled from the database\n if (this.state.events && this.state.events.length) {\n return this.state.events.map(event => {\n return (<Preview contentType=\"event\" content={event} key={event._id} />);\n });\n }\n\n // If no events were found\n return (\n <div className=\"col-12\">\n <Blurb message=\"No events were found. Check back soon for more content!\" />\n </div>\n );\n }", "function WasteCollectionView() {\n const [waste, setWaste] = useState({});\n\n useEffect(() => {\n (async () => {\n try {\n const today = formatDate(new Date(), 'yyyyMMdd');\n const now = shortTime();\n // ritorna il ritiro per la data indicata (sempre) e il successivo (se c'è)\n const res = await axios.get(\n `${SERVER_BASE_URL}/waste/${today}`\n );\n // ritorna un array\n // come primo elemento la data richiesta\n // come seoncdo il ritiro successivo alla data richiesta, se esiste\n const { data } = res;\n // console.log(data);\n\n // se non è ancora passata l'ora del ritiro cerco oggi\n const index =\n now <= WASTE_COLLECTION_END_TIME && data[0] ? 0 : 1;\n if (data[index]) {\n // data[index].waste = 'S';\n setWaste({\n title: humanDate(parseDate(data[index].date)), // TODO: formattare\n items: data[index].waste.split('').map((wt) => ({\n icon: 'waste-icon-' + wt,\n type: wt,\n description: WASTE_DESCR[wt],\n })),\n });\n } else {\n setWaste({\n title: 'NULLA',\n itmes: [],\n });\n }\n } catch (e) {\n console.error(e);\n }\n })();\n }, []);\n\n return (\n <div className=\"waste-collection-view box\">\n <div className=\"box-header text-center place-center text-uppercase text-ellipsis text-2x\">\n {waste.title}\n </div>\n <div className=\"item-container\">\n {waste.items &&\n waste.items.map((item, index) => (\n <div key={index} className=\"item\">\n <div className=\"descr text-uppercase\">\n {item.description}\n </div>\n <div className=\"icon\">\n <div\n className=\"waste-icon\"\n type={item.type}\n ></div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}" ]
[ "0.63221604", "0.6131576", "0.59023124", "0.5834316", "0.5821248", "0.57196486", "0.5716349", "0.5657892", "0.56429493", "0.56177115", "0.55641407", "0.5518442", "0.549542", "0.5489891", "0.548708", "0.5474417", "0.54593337", "0.5457613", "0.54330695", "0.5429547", "0.5425852", "0.5421768", "0.5385591", "0.53855526", "0.53503805", "0.53453183", "0.53405493", "0.5329285", "0.5328825", "0.5322168", "0.5317845", "0.5314983", "0.529475", "0.5288876", "0.52856755", "0.52772605", "0.5276909", "0.5275792", "0.52710897", "0.52585465", "0.5234832", "0.52319956", "0.52316356", "0.52238715", "0.52232903", "0.5210284", "0.5208662", "0.5191274", "0.51866716", "0.51832116", "0.5176884", "0.5176765", "0.5170876", "0.5169693", "0.5166954", "0.5163535", "0.51608396", "0.51562977", "0.5155498", "0.5153688", "0.51518387", "0.5148076", "0.5144634", "0.51418215", "0.51409525", "0.513841", "0.5134308", "0.5131685", "0.5120629", "0.5119679", "0.51184803", "0.51095676", "0.5107537", "0.5104318", "0.5096891", "0.5094617", "0.5092431", "0.5084377", "0.5084326", "0.508163", "0.507461", "0.5071988", "0.50702274", "0.50655425", "0.50646436", "0.50591564", "0.50536567", "0.5052028", "0.5051419", "0.50503916", "0.5045387", "0.5041672", "0.5037464", "0.5037102", "0.5036609", "0.5036207", "0.5036203", "0.5033673", "0.50333685", "0.50320756" ]
0.629228
1
Helper Functions Dropdown Open
function dropdownOpen(object) { if(is_auto_align){ autoAlign(object); } if ((options.hover && !object.hasClass('active')) || (!options.hover && !object.hasClass('open'))){ if(!object.hasClass("active")){ object.addClass('active'); object.stop(true,false).slideDown({ duration: options.inDuration, easing: "easeOutQuart", queue: false, complete: function() { object.addClass('open'); $(this).css('height', ''); } }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openDropdown() {\n $('#metroAreaDropdownButton').trigger('open');\n }", "_open() {\n this.$.dropdown.open();\n this.$.cursor.setCursorAtIndex(0);\n Polymer.dom.flush();\n this.$.cursor.target.focus();\n }", "open () {\n\t\t\tthis.el.classList.add('dropdown_open');\n\t\t this.trigger(\"open\");\n\t\t\tdocument.addEventListener('click', this._documentClick);\n\t\t}", "open() {\n var self = this;\n if (self.isLocked || self.isOpen || self.settings.mode === 'multi' && self.isFull()) return;\n self.isOpen = true;\n setAttr(self.control_input, {\n 'aria-expanded': 'true'\n });\n self.refreshState();\n applyCSS(self.dropdown, {\n visibility: 'hidden',\n display: 'block'\n });\n self.positionDropdown();\n applyCSS(self.dropdown, {\n visibility: 'visible',\n display: 'block'\n });\n self.focus();\n self.trigger('dropdown_open', self.dropdown);\n }", "function openDropdownFn() {\n // position menu element below toggle button\n var wrapperRect = wrapperEl.getBoundingClientRect(),\n toggleRect = toggleEl.getBoundingClientRect();\n\n // menu position\n if (jqLite.hasClass(wrapperEl, upClass)) {\n // up\n jqLite.css(menuEl, {\n 'bottom': toggleRect.height + toggleRect.top - wrapperRect.top + 'px'\n });\n } else if (jqLite.hasClass(wrapperEl, rightClass)) {\n // right\n jqLite.css(menuEl, {\n 'left': toggleRect.width + 'px',\n 'top': toggleRect.top - wrapperRect.top + 'px'\n });\n } else if (jqLite.hasClass(wrapperEl, leftClass)) {\n // left\n jqLite.css(menuEl, {\n 'right': toggleRect.width + 'px',\n 'top': toggleRect.top - wrapperRect.top + 'px'\n });\n } else {\n // down\n jqLite.css(menuEl, {\n 'top': toggleRect.top - wrapperRect.top + toggleRect.height + 'px'\n });\n }\n\n // menu alignment\n if (jqLite.hasClass(menuEl, bottomClass)) {\n jqLite.css(menuEl, {\n 'top': 'auto',\n 'bottom': toggleRect.top - wrapperRect.top + 'px'\n });\n }\n \n // add open class to wrapper\n jqLite.addClass(menuEl, openClass);\n\n setTimeout(function() {\n // close dropdown when user clicks outside of menu or hits escape key\n jqLite.on(doc, 'click', closeDropdownFn);\n jqLite.on(doc, 'keydown', handleKeyDownFn);\n }, 0);\n }", "function open_dropdown(btn, list) {\n btn.addClass('list-open');\n list.slideDown(150, function() {\n list.addClass('open');\n });\n}", "open() {\n // var _this = this;\n /**\n * Fires to close other open dropdowns, typically when dropdown is opening\n * @event Dropdown#closeme\n */\n this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id'));\n this.$anchor.addClass('hover')\n .attr({'aria-expanded': true});\n // this.$element/*.show()*/;\n this._setPosition();\n this.$element.addClass('is-open')\n .attr({'aria-hidden': false});\n\n if(this.options.autoFocus){\n var $focusable = Foundation.Keyboard.findFocusable(this.$element);\n if($focusable.length){\n $focusable.eq(0).focus();\n }\n }\n\n if(this.options.closeOnClick){ this._addBodyHandler(); }\n\n if (this.options.trapFocus) {\n Foundation.Keyboard.trapFocus(this.$element);\n }\n\n /**\n * Fires once the dropdown is visible.\n * @event Dropdown#show\n */\n this.$element.trigger('show.zf.dropdown', [this.$element]);\n }", "function dropdownList() {\n $dropdownItem.click(function() {\n if (widthFlg) {\n $(this).toggleClass('active');\n if ($(this).hasClass('active')) {\n $(this).next(\"ul\").stop().slideDown({duration: 300, easing: \"easeOutBack\"});\n $(this).find('.material-icons').text('keyboard_arrow_down');\n\n } else {\n $(this).next(\"ul\").stop().slideUp({duration: 300, easing: \"easeOutBack\"});\n $(this).find('.material-icons').text('keyboard_arrow_right');\n\n }\n }\n });\n }", "function menu_dropdown_open() {\r\n var width = $(window).width();\r\n if (width > 991) {\r\n if ($(\".ow-navigation .nav li.ddl-active\").length) {\r\n $(\".ow-navigation .nav > li\").removeClass(\"ddl-active\");\r\n $(\".ow-navigation .nav li .dropdown-menu\").removeAttr(\"style\");\r\n }\r\n } else {\r\n $(\".ow-navigation .nav li .dropdown-menu\").removeAttr(\"style\");\r\n }\r\n }", "function dropdownToggle($dropdown) {\n if ($dropdown.hasClass(\"open\")) {\n dropdownClose($dropdown);\n } else {\n dropdownOpen($dropdown);\n }\n }", "function OCM_simpleDropdownOpen() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#mobile-menu').show();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle > div > a').removeClass('animating');\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function open(obj) {\r\n\r\n var $this = obj.find('.dd-select'),\r\n ddOptions = $this.siblings('.dd-options'),\r\n ddPointer = $this.find('.dd-pointer'),\r\n wasOpen = ddOptions.is(':visible');\r\n\r\n //Close all open options (multiple plugins) on the page\r\n $('.dd-click-off-close').not(ddOptions).slideUp(50);\r\n $('.dd-pointer').removeClass('dd-pointer-up');\r\n\r\n if (wasOpen) {\r\n ddOptions.slideUp('fast');\r\n ddPointer.removeClass('dd-pointer-up');\r\n }\r\n else {\r\n ddOptions.slideDown('fast');\r\n ddPointer.addClass('dd-pointer-up');\r\n }\r\n\r\n //Fix text height (i.e. display title in center), if there is no description\r\n adjustOptionsHeight(obj);\r\n }", "function galleryFilterOpen(){\n\n if($('#dropdown-container').hasClass('open')) {\n $('#dropdown-container').removeClass('open');\n $('#dropdown-container').find('.dropdown a').attr('tabindex', -1);\n } else {\n $('#dropdown-container').addClass('open');\n $('#dropdown-container').find('.dropdown a').attr('tabindex', 0);\n }\n }", "function openDropdown(e){\n\n // if has 'closed' class...\n if(hasClass(this, 'closed')){\n // prevent link from being visited\n e.preventDefault();\n // remove 'closed' class to enable link\n this.className = this.className.replace('closed', '');\n // add 'open' close\n this.className = this.className + ' open';\n }\n}", "function open(obj) {\n\n var $this = obj.find(\".dd-select\"),\n ddOptions = $this.siblings(\".dd-options\"),\n ddPointer = $this.find(\".dd-pointer\"),\n wasOpen = ddOptions.is(\":visible\"),\n settings = settingsMap[obj.attr(\"data-settings-id\")];\n\n //Close all open options (multiple plugins) on the page\n $(\".dd-click-off-close\").not(ddOptions).slideUp(settings.animationTime);\n $(\".dd-pointer\").removeClass(\"dd-pointer-up\");\n $this.removeClass(\"dd-open\");\n\n if (wasOpen) {\n ddOptions.slideUp(settings.animationTime);\n ddPointer.removeClass(\"dd-pointer-up\");\n $this.removeClass(\"dd-open\");\n }\n else {\n $this.addClass(\"dd-open\");\n ddOptions.slideDown(settings.animationTime);\n ddPointer.addClass(\"dd-pointer-up\");\n }\n\n //Fix text height (i.e. display title in center), if there is no description\n adjustOptionsHeight(obj);\n }", "open() {\n const that = this,\n //NOTE: Will not close other DropDown's on page ! For example, DropDownList, DateTimePickers, etc ...\n dropDownsInDOM = document.querySelectorAll('jqx-drop-down-button, jqx-color-picker');\n\n //Make sure all dropDownButton popups are closed before openning this one\n for (let i = 0; i < dropDownsInDOM.length; i++) {\n if (dropDownsInDOM[i] !== that && dropDownsInDOM[i].opened) {\n dropDownsInDOM[i].close();\n }\n }\n\n that._open();\n that.$.scrollViewer.refresh();\n }", "function showDropdown() {\n\t$('.dropdown-toggle').click(function(){\n\t\tvar dropdown = $(this).parent().find('.m-dropdown-menu');\n\t\tif( dropdown.css('display') == 'none' )\n\t\t\tdropdown.show();\n\t\telse\n\t\t\tdropdown.hide();\n\n\t\t// clicks out the dropdown\n\t $('body').click(function(event){\n\t \tif(!$(event.target).is('.m-dropdown-menu a')) {\n\t \t\t$(this).find('.m-dropdown-menu').hide();\n\t \t}\n\t });\n\t\tevent.stopPropagation();\n\t});\n}", "get dropdown_menu() {return browser.element('#user_info_dropdown')}", "function _open(e) {\n e.preventDefault();\n e.stopPropagation();\n\n // Find any other opened instances of select and close it\n $('.' + classOpen + ' select')[pluginName]('close');\n\n isOpen = true;\n itemsHeight = $items.outerHeight();\n\n _isInViewport();\n\n // Prevent window jump when focusing original select\n var scrollTop = $win.scrollTop();\n e.type == 'click' && $original.focus();\n $win.scrollTop(scrollTop);\n\n $doc.on(clickBind, _close);\n\n // Delay close effect when openOnHover is true\n if (options.openOnHover){\n clearTimeout(closeTimer);\n $outerWrapper.off(bindSufix).on('mouseleave' + bindSufix, function(){\n closeTimer = setTimeout(_close, 500);\n });\n }\n\n // Toggle options box visibility\n $outerWrapper.addClass(classOpen);\n _detectItemVisibility(selected);\n\n // options.onOpen.call(this, element);\n options.onOpen(element);\n }", "open() {\n const that = this,\n getFirstFocusableItem = function () {\n for (let i = 0; i < that.items.length; i++) {\n if (!that.items[i].disabled) {\n return that.items[i];\n }\n }\n };\n\n if (that.disabled || !that.offsetHeight) {\n return;\n }\n\n if (!that.$dropDownContainer.hasClass('jqx-visibility-hidden')) {\n return;\n }\n\n if (that.$dropDownContainer.hasClass('not-in-view')) {\n that.$dropDownContainer.removeClass('not-in-view');\n }\n\n that.$.dropDownContainer.style.transition = null;\n\n if (that.dropDownAppendTo && that.dropDownAppendTo.length > 0) {\n const rect = that.getBoundingClientRect();\n\n // handles the case, when the dropdown is opened, while it is still part of the dropdownlist's tree. \n if (that.$.container.contains(that.$.dropDownContainer)) {\n let iterations = 0;\n const interval = setInterval(function () {\n const rect = that.getBoundingClientRect();\n\n iterations++;\n\n if (rect.top === that._positionTop && iterations < 10) {\n return;\n }\n\n that.open();\n clearInterval(interval);\n that._positionTop = rect.top;\n }, 100);\n\n return;\n }\n else if (rect.top !== that._positionTop) {\n that._positionTop = rect.top;\n }\n }\n\n const isOpeningEventPrevented = that.$.fireEvent('opening').defaultPrevented;\n\n if (isOpeningEventPrevented) {\n return;\n }\n\n if (that._shadowDOMStylesDelay) {\n that._setDropDownSize();\n delete that._shadowDOMStylesDelay;\n }\n\n that.opened = true;\n\n that._positionDetection.placeOverlay();\n that._positionDetection.checkBrowserBounds('vertically');\n that._positionDetection.positionDropDown();\n that._positionDetection.checkBrowserBounds('horizontally');\n\n that.$dropDownContainer.removeClass('jqx-visibility-hidden');\n that.$.fireEvent('open');\n\n if (that.$.dropDownButton) {\n if (that.dropDownOpenMode === 'dropDownButton') {\n that.$.dropDownButton.setAttribute('selected', '');\n }\n else {\n that.$.dropDownButton.removeAttribute('selected');\n }\n }\n\n if (that.$.listBox && !that._focusedItem || (that._focusedItem && !that._focusedItem._focused)) {\n if (that.selectedIndexes.length > 0) {\n that._focus(that.items[that.selectedIndexes[0]]);\n }\n else {\n that._focus(getFirstFocusableItem);\n }\n }\n\n if (that.$.input && !JQX.Utilities.Core.isMobile) {\n that.$.input.focus();\n }\n }", "function McDropdownPanel() { }", "function dropdown(ar) { \n/*//console.log(\"dd clicked\")*/ }", "function activateDropdown(elem) {\n var menu = elem.parents('.dropdown-menu');\n if ( menu.length ) {\n var toggle = menu.prev('button, a');\n toggle.text ( elem.text() );\n }\n }", "function activateDropdown(elem) {\n var menu = elem.parents('.dropdown-menu');\n if ( menu.length ) {\n var toggle = menu.prev('button, a');\n toggle.text ( elem.text() );\n }\n }", "function openViewDropdown() {\n document.getElementById(\"viewDropdown\").classList.toggle(\"show\");\n}", "handleDropdownOpening() {\n window.addEventListener('click', (e) => {\n const el = e.target;\n const isNotDropdownOrChild = this.el && el !== this.el && !this.el.contains(el);\n const isNotDropdownBtn = this.btn && el !== this.btn && !this.btn.contains(el);\n\n if (isNotDropdownOrChild && isNotDropdownBtn && this.state.open) {\n this.setState({ open: false });\n }\n }, false);\n }", "function dropDown() {\n\tdocument.getElementById( \"dropdown\" ).classList.toggle( \"show\" );\n}", "function dropdownFunc() {\n document.getElementById(\"infoDrop\").classList.toggle(\"show\");\n }", "function _open(e) {\n e.preventDefault();\n e.stopPropagation();\n\n // Find any other opened instances of select and close it\n $('.' + classOpen + ' select')[pluginName]('close');\n\n isOpen = true;\n itemsHeight = $items.outerHeight();\n\n _isInViewport();\n\n var scrollTop = $win.scrollTop();\n e.type == 'click' && $original.focus();\n $win.scrollTop(scrollTop);\n\n $doc.off(bindSufix).on(clickBind, _close);\n\n clearTimeout(closeTimer);\n if (options.openOnHover){\n $outerWrapper.off(bindSufix).on('mouseleave' + bindSufix, function(e){\n closeTimer = setTimeout(function(){ $doc.click() }, 500);\n });\n }\n\n $outerWrapper.addClass(classOpen);\n _detectItemVisibility(selected);\n\n options.onOpen.call(this);\n }", "function selectOpenList(e) {\n var target;\n if (e.target) {\n target = e.target;\n } else {\n target = e;\n }\n var expandedState = target.getAttribute('aria-expanded');\n if (expandedState === 'true') {\n expandedState = 'false';\n } else {\n expandedState = 'true';\n }\n target.setAttribute('aria-expanded', expandedState);\n\n // second toggle here is a compromise to allow animation on opening\n // while still providing good tab focus behavior\n setTimeout(function(){\n target.classList.toggle('is-open');\n },50);\n }", "function dropdownOn() {\n $(dropdownList).fadeIn(25);\n $(dropdown).addClass(\"active\");\n }", "function showDropdown(btn) {\n var str = '',\n id = '';\n // $common.hideFbPageList();\n $('.dropdown, .select-list').hide();\n $('.dropdown')\n .parents('li:not(' + btn + ')').removeClass('on')\n .children('.on:not(' + btn + ')').removeClass('on');\n $(btn).toggleClass('on');\n str = $(btn).attr('id');\n if (str.search('btn') === 0) {\n // slice(4) for btn-xxx\n str = $(btn).attr('id').slice(4);\n }\n id = '#' + str + '-dropdown';\n if ($(btn).hasClass('on')) {\n $(id).show();\n } else {\n $(id).hide();\n }\n}", "function dropDown() {\n\t\t$navButton = $('.navbar-toggler');\n\t\t$navButton.on('click', () => {\n\t\t\t$('#navbarTogglerDemo03').toggle('collapse');\n\t\t});\n\t}", "dropdownToggle(newValue){\n\t if (this._forceOpen){\n\t this.setState({ menuOpen: true });\n\t this._forceOpen = false;\n\t } else {\n\t this.setState({ menuOpen: newValue });\n\t }\n\t}", "dropdownToggle(newValue){\n\t if (this._forceOpen){\n\t this.setState({ menuOpen: true });\n\t this._forceOpen = false;\n\t } else {\n\t this.setState({ menuOpen: newValue });\n\t }\n\t}", "function btn_show() {\n document.getElementById(\"dropdown-content\").classList.toggle(\"show\");\n}", "function OCM_dropdownMarkup() {\r\n\t\t\t\t\tvar $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $offCanvasEl.attr('data-dropdown-func') : 'default';\r\n\t\t\t\t\tif ($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children').append('<span class=\"ocm-dropdown-arrow\"><i class=\"fa fa-angle-down\"></i></span>');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "handleInputClick() {\n\t\tthis.showDropdown();\n\t}", "function loadDropdown() {\n $('.rf-dropdown')\n .empty()\n .append(reportDropdown);\n\n var x;\n for (x in options) {\n var opts = options[x];\n if (options.hasOwnProperty(x)) {\n $('#rf-dropdown-list').append(\n $('<li>')\n .attr('id', 'vstf-report-' + x)\n .attr('class', 'wds-global-navigation__dropdown-link')\n .on('click',loadForm)\n .text(opts.buttonText)\n );\n }\n }\n }", "function CloseDropdown() {\n if ($(this).parent(\".n-search\").hasClass(\"open\")) {\n $(this).parent(\".n-search\").removeClass(\"open\");\n $(this).prev(\".dropdown-toggle\").attr(\"aria-expanded\", \"false\");\n }\n }", "function Info_Function() {\n\t\tdocument.getElementById(\"Info_myDropdown\").classList.toggle(\"show\");\n\t}", "function openDropDown() {\n document.getElementById('submenu').classList.toggle('mostrar');\n}", "function loadDropdown() {\n $('.rf-dropdown')\n .empty()\n .append(reportDropdown);\n\n var x;\n for (x in options) {\n var opts = options[x];\n if (options.hasOwnProperty(x)) {\n $('#rf-dropdown-list').append(\n $('<li>')\n .attr('id', 'soap-report-' + x)\n .attr('class', 'wds-global-navigation__dropdown-link')\n .on('click',loadForm)\n .text(opts.buttonText)\n );\n }\n }\n }", "onToggleLanguagesDropdown() {\n $('#select-languages').on('click', function () {\n $(this).siblings('#dropdown-languages').toggleClass('show')\n });\n }", "function myFunction() {\n\t\t\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t\t\t}", "function dropdown() {\n document.getElementById(\"all-versions\").classList.toggle(\"show\");\n}", "function myFunction() {\n \t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t}", "function openMenu () {\n $(this).toggleClass('open');\n $('ul, .social-links').toggleClass('active open');\n }", "function initDropdown(){\r\n let cddActive = false;\r\n if($('.custom_dropdown').length){\r\n var dd = $('.custom_dropdown');\r\n var ddItems = $('.custom_dropdown ul li');\r\n var ddSelected = $('.custom_dropdown_selected');\r\n \r\n dd.on('click', function(){\r\n dd.addClass('active');\r\n cddActive = true;\r\n $(document).one('click', function cls(e){\r\n if($(e.target).hasClass('cdd')){\r\n $(document).one('click', cls);\r\n }\r\n else{\r\n dd.removeClass('active');\r\n cddActive = false;\r\n }\r\n });\r\n });\r\n ddItems.on('click', function(){\r\n var sel = $(this).text();\r\n ddSelected.text(sel);\r\n });\r\n }\r\n }", "function toggleQuestionDropdown() {\n // if the dropdown is disabled and the user presses on the dropdown\n if(partyIsOpen == false) {\n\n // show the dropdown and sets partyIsOpen to true\n questionPartyDropdown.style.display = \"block\";\n partyIsOpen = true;\n } else {\n\n // if the dropdown is enabled and the user presses on the dropdown, disable the dropdown and sets partyIsOpen back to false\n questionPartyDropdown.style.display = \"none\";\n partyIsOpen = false;\n }\n}", "function placeDropdown() {\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n }\n var offset = 0;\n if (options.belowOrigin === true) {\n offset = origin.height();\n }\n\n // Handle edge alignment\n var offsetLeft = origin.offset().left;\n var width_difference = 0;\n var gutter_spacing = options.gutter;\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n width_difference = origin.innerWidth() - activates.innerWidth();\n gutter_spacing = gutter_spacing * -1;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + offset,\n left: origin.position().left + width_difference + gutter_spacing\n });\n\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function () {\n $(this).css('height', '');\n }\n })\n .animate({\n opacity: 1\n }, {\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutSine'\n });\n }", "[_externalClick](evt) {\n const src = evt.srcElement;\n let isDropdown = false;\n let i = 0;\n do {\n if(this.elements[i]) {\n const target = document.getElementById(this.elements[i].getAttribute(_SELECTOR));\n if(target) {\n if(this.elements[i] === src || target === src) {\n isDropdown = true;\n }\n }\n }\n i++;\n } while (!isDropdown && i < this.elements.length);\n if(!isDropdown) {\n _EVENT_BUS.emit('vjs-dropdown:open', { id: '' });\n }\n }", "function dropdown() {\n glumacNameContainer.classList.toggle(\"show\");\n\n if (arrow.classList.contains('fa-arrow-down')) {\n arrow.classList.remove('fa-arrow-down');\n arrow.classList.add('fa-arrow-up');\n } else {\n arrow.classList.add('fa-arrow-down');\n }\n}", "get enginesDropDownOpen()\n {\n var popup = this.getElement({type: \"searchBar_dropDownPopup\"});\n return popup.getNode().state != \"closed\";\n }", "organiccultureselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Organic Culture').then(option => {\n cy.wrap(option).contains('Organic Culture');\n option[0].click();\n \n })\n \n }", "showDropdown(event) {\n event.stopPropagation();\n this.setState({dropdownOpen: true});\n }", "DropDown() {}", "_levelOneOpenDropDown(focusedItem) {\n if (focusedItem && focusedItem instanceof JQX.MenuItemsGroup) {\n this._selectionHandler({ target: focusedItem, isTrusted: true });\n }\n }", "function placeDropdown() {\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n }\n var offset = 0;\n if (options.belowOrigin === true) {\n offset = origin.height();\n }\n\n // Handle edge alignment\n var offsetLeft = origin.offset().left;\n var width_difference = 0;\n var gutter_spacing = options.gutter;\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n width_difference = origin.innerWidth() - activates.innerWidth();\n gutter_spacing = gutter_spacing * -1;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + offset,\n left: origin.position().left + width_difference + gutter_spacing\n });\n\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n }", "_dropDownClick (event) {\n switch (event.target) {\n case this._containerHeader.querySelector('#configure'):\n if (!this._mainDropDownActive) {\n this._mainDropDownActive = true\n this._containerHeader.querySelector('.dropdown-content').style.display = 'block'\n } else {\n this._closeDropDown()\n }\n break\n case this._containerHeader.querySelector('#gameSize'):\n if (!this._sizeDropDownActive) {\n this._sizeDropDownActive = true\n this._containerHeader.querySelector('.dropdown-sub1-content').style.display = 'inline-block'\n } else {\n this._sizeDropDownActive = false\n this._containerHeader.querySelector('.dropdown-sub1-content').style.display = 'none'\n }\n break\n case this._containerHeader.querySelector('#twox2'):\n this._clearActiveDropdownElements()\n this._containerHeader.querySelector('#twox2').classList.add('elementActive')\n this._closeDropDown()\n this._setupNewGame(2, 2)\n break\n case this._containerHeader.querySelector('#twox4'):\n this._clearActiveDropdownElements()\n this._containerHeader.querySelector('#twox4').classList.add('elementActive')\n this._closeDropDown()\n this._setupNewGame(2, 4)\n break\n case this._containerHeader.querySelector('#fourx2'):\n this._clearActiveDropdownElements()\n this._containerHeader.querySelector('#fourx2').classList.add('elementActive')\n this._closeDropDown()\n this._setupNewGame(4, 2)\n break\n case this._containerHeader.querySelector('#fourx4'):\n this._clearActiveDropdownElements()\n this._containerHeader.querySelector('#fourx4').classList.add('elementActive')\n this._closeDropDown()\n this._setupNewGame(4, 4)\n break\n case this._containerHeader.querySelector('#dropdown-name'):\n this._closeDropDown()\n if (!this._userNameWindowOpen) {\n let userNameView = new InputView('username')\n let userNameWindow = new SubWindow(userNameView, false)\n this._windowHandler.addWindow(userNameWindow, userNameView.getWidthRequired(),\n userNameView.getHeightRequired())\n this._dragger.startListening()\n this._userNameWindowOpen = true\n userNameView.addEventListener('changeInput', e => {\n this._playerName = userNameView.getInput()\n this._playerNameArea.textContent = 'Name: ' + this._playerName\n })\n }\n }\n }", "_renderDropDownPage() {\n if(this.props.item.pages && this.props.item.expand) {\n return (\n <li className={ this._isMenuItemActive() + \" dropdown\"}>\n <a title={ this.props.item.title } onClick={ e => this._bindDropMenuClick(e) }>\n { this.props.item.name } \n <span className=\"caret\"></span>\n </a>\n <Menu pages={ this.props.item.pages } styleClass={ this._isDropdownMenuOpen() }/>\n </li>\n )\n }\n }", "function dropdownTeam() {\n document.getElementById('myDropdown-team').classList.toggle('show');\n}", "function CloseDropdown() {\n\t\t\tif ( $( this ).parent( \".n-search\" ).hasClass( \"open\" ) ) {\n\t\t\t\t$( this ).parent( \".n-search\" ).removeClass( \"open\" );\n\t\t\t\t$( this ).prev( \".dropdown-toggle\" ).attr( \"aria-expanded\", \"false\" );\n\t\t\t}\n\t\t}", "function open_options() {\r\n $('.options').slideToggle(400, 'swing');\r\n $('.info').slideUp();\r\n if ($('.navbar-left').text() != \"INSTRUCTIONS\")\r\n $('.navbar-left').text(\"DOT CONNECT\");\r\n}", "_openRadix() {\n const that = this,\n openingEvent = that.$.fireEvent('opening');\n\n if (openingEvent.defaultPrevented) {\n that.opened = false;\n return;\n }\n\n if (that._initialDropDownOptionsSet === false) {\n that._setDropDownOptions();\n that._initialDropDownOptionsSet = true;\n }\n\n if (that._dropDownParent !== null) {\n that.$.dropDown.style.width = that.offsetWidth + 'px';\n }\n\n that.$radixDisplayButton.addClass('jqx-numeric-text-box-pressed-component');\n that.$dropDown.removeClass('jqx-visibility-hidden');\n that.$.dropDown.style.marginTop = null;\n\n that.opened = true;\n that._positionDetection.positionDropDown();\n\n const windowHeight = window.devicePixelRatio === 1 ? document.documentElement.clientHeight : window.innerHeight,\n dropDownBoundingRect = that.$.dropDown.getBoundingClientRect(),\n verticalCorrection = windowHeight - dropDownBoundingRect.top - that.$.dropDown.offsetHeight - parseFloat(getComputedStyle(that.$.dropDown).marginBottom);\n\n if (verticalCorrection < 0) {\n that.$.dropDown.style.marginTop = verticalCorrection + 'px';\n }\n\n that.$.fireEvent('open', { dropDown: that.$.dropDown });\n }", "function clickDropdown(e) {\r\n\r\n const dropdown = e.target;\r\n const wrapper = dropdown.parentNode.parentNode;\r\n const input_search = wrapper.querySelector(\".selected-input\");\r\n const select = wrapper.querySelector(\"select\");\r\n dropdown.classList.toggle(\"active\");\r\n\r\n if (dropdown.classList.contains(\"active\")) {\r\n removePlaceholder(wrapper);\r\n input_search.focus();\r\n\r\n if (!input_search.value) {\r\n populateAutocompleteList(select, \"\", true);\r\n } else {\r\n populateAutocompleteList(select, input_search.value);\r\n\r\n }\r\n } else {\r\n clearAutocompleteList(select);\r\n addPlaceholder(wrapper);\r\n }\r\n}", "function dropDownShowClick(){\n document.getElementById(\"forDropDown\").style.display=\"block\";\n document.getElementById(\"dropDownShowBtn\").style.display=\"none\";\n document.getElementById(\"dropDownHideBtn\").style.display=\"block\";\n}", "function showMenu() {\n $('.dropbtn').click(function () {\n console.log('clicked');\n $('#myDropdown').toggle();\n })\n}", "function settingsMenuOpen(event) {\n // document.getElementById(\"wrapperBtn\").classList.add(\"wrapperBtnOpening\");\n settingsDropdown.classList.toggle(\"showDropdown\");\n document.getElementsByClassName('slide-in')[0].classList.toggle('show');\n closeAllModals(event);\n // console.log(\"closeem\");\n toggleChangeNameInput.value = `Change name, ${username}?`;\n }", "function init_dash() {\n dropDown();\n}", "function myFunction() {\n \tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "function populateDropdowns() {\n}", "function loadThePatterns() {\n document.getElementById(\"load_dropdown\").classList.toggle(\"show\");\n}", "function dropdown() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function onWindowClick() {\n\n // If not hover the dropdown, close it\n if (!scope.isHover) {\n methods.onClick();\n\n // Required to refresh the DOM and see the change\n Methods.safeApply(scope);\n }\n }", "function DropDown() {\n document.getElementById(\"dropdowmenu\").classList.toggle(\"show\");\n}", "function handleShowLiist(name_class,options) { \n\n var elems = document.querySelectorAll(name_class);\n \n M.Dropdown.init(elems, options);\n }", "function _open(e) {\n _utils.triggerCallback('BeforeOpen', _this);\n\n if (e){\n e.preventDefault();\n e.stopPropagation();\n }\n\n if (isEnabled){\n _calculateOptionsDimensions();\n\n // Find any other opened instances of select and close it\n $('.' + _this.classes.hideselect, '.' + _this.classes.open).children()[pluginName]('close');\n\n isOpen = true;\n itemsHeight = $items.outerHeight();\n itemsInnerHeight = $items.height();\n\n // Give dummy input focus\n $input.val('').is(':focus') || $input.focus();\n\n $doc.on('click' + bindSufix, _close).on('scroll' + bindSufix, _isInViewport);\n _isInViewport();\n\n // Prevent window scroll when using mouse wheel inside items box\n if ( _this.options.preventWindowScroll ){\n $doc.on('mousewheel' + bindSufix + ' DOMMouseScroll' + bindSufix, '.' + _this.classes.scroll, function(e){\n var orgEvent = e.originalEvent,\n scrollTop = $(this).scrollTop(),\n deltaY = 0;\n\n if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }\n if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }\n if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }\n if ( 'deltaY' in orgEvent ) { deltaY = orgEvent.deltaY * -1; }\n\n if ( scrollTop == (this.scrollHeight - itemsInnerHeight) && deltaY < 0 || scrollTop == 0 && deltaY > 0 )\n e.preventDefault();\n });\n }\n\n // Toggle options box visibility\n $outerWrapper.addClass(_this.classes.open);\n _detectItemVisibility(selected);\n\n _utils.triggerCallback('Open', _this);\n }\n }", "function Window_Dropdown() {\n this.initialize.apply(this, arguments);\n}", "function dropdownClick(selection) {\n var dropdown = selection.children('.dropdown');\n dropdown.toggleClass('active');\n}", "function dropdown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownMenu() {\n\tdocument.getElementById(\"dropDownMenu\").classList.toggle(\"show\");\n}", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function oceanwpDropDownSearch() {\n\t\"use strict\"\n\n\t// Return if is the not this search style\n\tif ( 'drop_down' != oceanwpLocalize.menuSearchStyle ) {\n\t\treturn;\n\t}\n\n\tvar $searchDropdownToggle = $j( 'a.search-dropdown-toggle' ),\n\t\t$searchDropdownForm = $j( '#searchform-dropdown' );\n\n\t$searchDropdownToggle.click( function( event ) {\n\t\t// Display search form\n\t\t$searchDropdownForm.toggleClass( 'show' );\n\t\t// Active menu item\n\t\t$j( this ).parent( 'li' ).toggleClass( 'active' );\n\t\t// Focus\n\t\tvar $transitionDuration = $searchDropdownForm.css( 'transition-duration' );\n\t\t$transitionDuration = $transitionDuration.replace( 's', '' ) * 1000;\n\t\tif ( $transitionDuration ) {\n\t\t\tsetTimeout( function() {\n\t\t\t\t$searchDropdownForm.find( 'input.field' ).focus();\n\t\t\t}, $transitionDuration );\n\t\t}\n\t\t// Return false\n\t\treturn false;\n\t} );\n\n\t// Close on doc click\n\t$j( document ).on( 'click', function( event ) {\n\t\tif ( ! $j( event.target ).closest( '#searchform-dropdown.show' ).length ) {\n\t\t\t$searchDropdownToggle.parent( 'li' ).removeClass( 'active' );\n\t\t\t$searchDropdownForm.removeClass( 'show' );\n\t\t}\n\t} );\n\n}", "function homeDropdown() {\n\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "myFunction() {\n const dropdown = document.querySelector(\"#myDropdown\");\n dropdown.classList.toggle(\"show\");\n }", "function toggleDropdown(dropdown) {\n document.getElementById(dropdown).classList.toggle(\"show\");\n}", "function clickOptiontoSelect(){\n\n}", "function menuOptions() {}", "function test_dialog_dropdown_ui_values_in_the_dropdown_should_be_visible_in_edit_mode() {}", "function drop() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function openMenu(object) {\r\n if ($(document).width() > $responsiveWidth) {\r\n if (!object.closest(\".menu__dropdown__control\").hasClass(\"active\")) {\r\n // Closes all other open menus.\r\n $menuDropDown.slideUp().closest(\".menu__dropdown__control\").removeClass(\"active\");\r\n // Open the menu being hovered.\r\n object.closest(\".menu__dropdown__control\").addClass(\"active\")\r\n .find(\".menu__dropdown\").slideDown().attr(\"aria-hidden\",\"false\");\r\n }\r\n }\r\n }", "function dropBox() {\n\tconst drop_btn = document.querySelector(\".drop-btn\");\n\tconst menu_wrapper = document.querySelector(\".combo-box\");\n\tconst icon = document.querySelector(\"#settings-icon\");\n\n\tdrop_btn.onclick = () => {\n\t\tmenu_wrapper.classList.toggle(\"show\");\n\t\ticon.classList.toggle(\"show\");\n\t};\n}", "function showBtnDropdownList(ob,event,list_div_id) {\r\n\t// Prevent $(window).click() from hiding this\r\n\ttry {\r\n\t\tevent.stopPropagation();\r\n\t} catch(err) {\r\n\t\twindow.event.cancelBubble=true;\r\n\t}\r\n\t// Set drop-down div object\r\n\tvar ddDiv = $('#'+list_div_id);\r\n\t// If drop-down is already visible, then hide it and stop here\r\n\tif (ddDiv.css('display') != 'none') {\r\n\t\tddDiv.hide();\r\n\t\treturn;\r\n\t}\r\n\t// Set width\r\n\tif (ddDiv.css('display') != 'none') {\r\n\t\tvar ebtnw = $(ob).width();\r\n\t\tvar eddw = ddDiv.width();\r\n\t\tif (eddw < ebtnw) ddDiv.width( ebtnw );\r\n\t}\r\n\t// Set position\r\n\tvar btnPos = $(ob).offset();\r\n\tddDiv.show().offset({ left: btnPos.left, top: (btnPos.top+$(ob).outerHeight()) });\r\n}", "function myButton() {\r\n document.getElementById(\"mydropdown\").classList.toggle(\"show\");\r\n}", "function dropDown() {\n document.getElementById(\"myTopnav\").classList.toggle(\"show\");\n }", "function myFunction() {\n\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function dropdownClickToggle() {\n var menuItems = verticalNavObject.find('ul li.menu-item-has-children');\n\n menuItems.each(function() {\n var elementToExpand = $(this).find(' > .second, > ul');\n var menuItem = this;\n var dropdownOpener = $(this).find('> a');\n var secondLevelItems = $(this).find('ul li a');\n var slideUpSpeed = 'fast';\n var slideDownSpeed = 'slow';\n\n dropdownOpener.on('click tap', function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if(elementToExpand.is(':visible')) {\n $(menuItem).removeClass('open');\n elementToExpand.slideUp(slideUpSpeed, function() {\n resizeVerticalArea();\n });\n } else {\n if(!$(this).parents('li').hasClass('open')) {\n menuItems.removeClass('open');\n menuItems.find(' > .second, > ul').slideUp(slideUpSpeed);\n }\n\n $(menuItem).addClass('open');\n elementToExpand.slideDown(slideDownSpeed, function() {\n resizeVerticalArea();\n });\n }\n });\n\n secondLevelItems.on('click tap', function(e) {\n if ( $(this).attr('href') == '#' || $(this).attr('href') == '' ) {\n return;\n }\n if ( $(this).attr('href') !== window.location.href ) {\n $(this).closest('.second').slideUp(slideUpSpeed);\n }\n });\n });\n }", "function dropdownToggle() {\n document.getElementById(\"ProjectDropdown\").classList.toggle(\"show\");\n}" ]
[ "0.7301799", "0.7111102", "0.70105845", "0.7008019", "0.7001923", "0.6990401", "0.698814", "0.6898997", "0.6882055", "0.6820082", "0.67546654", "0.67482877", "0.6734401", "0.673249", "0.67316073", "0.6683926", "0.66683596", "0.6629569", "0.66192245", "0.6616531", "0.66032064", "0.6599451", "0.65826166", "0.65826166", "0.6573177", "0.6554932", "0.6440763", "0.6432607", "0.64170074", "0.6402925", "0.6398687", "0.63787276", "0.6352486", "0.63153666", "0.63153666", "0.63109654", "0.63024986", "0.6287746", "0.6258886", "0.6240758", "0.6239381", "0.623124", "0.62297755", "0.6227226", "0.62271947", "0.62229836", "0.6212584", "0.62118393", "0.62087876", "0.6198432", "0.61954254", "0.6193508", "0.61884046", "0.6172467", "0.61601037", "0.61513186", "0.6146134", "0.61359274", "0.6135277", "0.6134933", "0.6132901", "0.61258256", "0.6122334", "0.611573", "0.6099126", "0.60931194", "0.60815585", "0.608123", "0.6080435", "0.60708255", "0.6066892", "0.6059165", "0.6055932", "0.604393", "0.60423946", "0.6040416", "0.6037125", "0.60343534", "0.60287553", "0.6024186", "0.6017109", "0.60141397", "0.6012766", "0.6012131", "0.6011257", "0.6008461", "0.600331", "0.59942466", "0.59888023", "0.59887135", "0.59875935", "0.5986613", "0.59834284", "0.5982446", "0.5981626", "0.59801507", "0.5977779", "0.5977336", "0.5972423", "0.5967041" ]
0.70078427
4
START Fill Applicant Publications
function ApplicantPublications_GenerateButton(){ var clickEvent = function (e) { ApplicantPublications_FillForm(); } var inputBootstrap = createBootstrapButtonElement('GM Fill Form', 'NEWPortal_ApplicantExperience_FillButton'); inputBootstrap.onclick = clickEvent; insertAfter(document.getElementById('save'), inputBootstrap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeSelectedApplicant() {\n\tofferToApplicant = getURLParameter(\"AID\");\n\n\tvar username = tmpApplicantUserName; // wird in function\n\t// markOfferSelected(id)\n\t// initialisiert\n\n\t// alert(\"username: \"+username);\n\n\tconnect(\"/hiwi/Provider/js/takeSelectedApplicant\", \"aid=\"\n\t\t\t+ offerToApplicant + \"&usernameTakenApplicant=\" + username,\n\t\t\thandleTakeSelectedApplicantResponse);\n\n}", "function applicantChoice() {\n\tvar aid = getURLParameter(\"AID\"); //\n\t// alert(\"id= \"+aid);\n\t// reset selectedID (account could have been deleted in meantime)\n\tselectedOffer = null;\n\n\tdocument.getElementById(\"annehmen_button\").disabled = \"disabled\";\n\ttoggleWarning(\"error_noAppSelected\", true, \"Kein Bewerber selektiert!\");\n\tconnect(\"/hiwi/Provider/js/applicantChoice\", \"aid=\" + aid,\n\t\t\thandleApplicantChoiceResponse);\n}", "function submit() {\n saveForm(applicant)\n}", "function initApp() {\n\n $('.loading').hide();\n $('#pdf').on('click', function () { getPdf('sdk'); });\n $('#pdfRest').on('click', function () { getPdf('rest'); });\n\n\n var token = getParameterByName('token');\n if (token) {\n $('.info').hide();\n getPublicItems()\n .then(auth)\n .then(getAuthedItems)\n .then(capturePDF)\n .catch(renderError);\n }\n}", "function mainProcess() {\n\tlogDebug(\"This process inactivates Prequal license records that have been sitting in Additional Info Required, Pending, or Open status for longer than 6 months.\" + br);\n\t\n\tdtToday = new Date();\t\n\tdtSixMonthDate = new Date(dateAdd(dtToday, -183));\n\tstrSixMonthDate = jsDateToMMDDYYYY(dtSixMonthDate);\t\t\n\tlogDebug(\"6 Months Past Date: \" + strSixMonthDate);\n\t\n\tvar lpResult = aa.cap.getByAppType(\"Licenses\", \"Engineering\", \"Prequalified Contractor\", \"Na\");\n\t\n\tif (lpResult.getSuccess()) {\n\t\tlps = lpResult.getOutput();\n\t\tlogDebug(\"Number of Prequal records found: \" + lps.length + br);\n\t} else {\n\t\tlogDebug(\"ERROR: Retrieving permits: \" + lpResult.getErrorType() + \":\" + lpResult.getErrorMessage());\n\t\treturn false;\n\t}\n\t\t\n\tlogDebug(\"List of Prequal records set to Inactive: \" + br);\n\t\n\tfor (lp in lps) {\t\n\n\t\tif (elapsed() > maxSeconds){ // only continue if time hasn't expired\t\t\t\n\t\t\tlogDebug(\"A script timeout has caused partial completion of this process. Please re-run. \" + elapsed() + \" seconds elapsed, \" + maxSeconds + \" allowed.\") ;\n\t\t\ttimeExpired = true ;\n\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\tb1App = lps[lp];\t\t\n\t\tvar b1CapId = b1App.getCapID();\t\t\n\t\tcapId = aa.cap.getCapID(b1CapId.getID1(), b1CapId.getID2(), b1CapId.getID3()).getOutput();\n\t\taltId = capId.getCustomID();\n\t\tcap = aa.cap.getCap(capId).getOutput();\n\t\tcapMod = cap.getCapModel();\t\t\n\t\t\n\t\tif (cap) {\n\t\t\tappStatus = cap.getCapStatus();\n\t\t\tappStatusDate = capMod.capStatusDate;\t\t\t\n\t\t\t\n\t\t\tif (appStatus == \"Additional Info Required\" || appStatus == \"Pending\" || appStatus == \"Open\" ) {\n\t\t\t\t//if (altId == \"LPC2010000-00445\") {\t\t\t\t\t\n\t\t\t\t\tstrRecStatusDate = (appStatusDate.getMonth() + 1) + \"/\" + appStatusDate.getDate() + \"/\" + (appStatusDate.getYear() + 1900);\t\t\t\t\t\n\t\t\t\t\tdtAppStatusDate = new Date(strRecStatusDate);\t\t\t\t\t\n\n\t\t\t\t\tif (dtAppStatusDate < dtSixMonthDate){\n\t\t\t\t\t\tgetContactInfo();\n\t\t\t\t\t\tlogDebug(\"Contractor Business Name: \" + contactBizName)\n\t\t\t\t\t\tlogDebug(\"Prequal License: \" + altId);\n\t\t\t\t\t\tlogDebug(\"Record Status & Status Date: \" + appStatus + \", \" + strRecStatusDate);\t\t\t\t\t\t\n\t\t\t\t\t\t//logDebug(\"Record Status Date is older than 6 months, so inactivate record\");\n\t\t\t\t\t\tupdateAppStatus(statusInactive, \"Updated by batch script\");\n \tlicEditExpInfo(statusInactive, null);\n\t\t\t\t\t\tlogDebug(\"Updated Record & Renewal Expiration status to \" + statusInactive + \".\");\n\t\t\t\t\t\trecsInactivatedCnt++;\t\t\t\t\t\t\n\t\t\t\t\t\tlogDebug(\"\");\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t//} //End specific rec test.\n\t\t\t}\n\t\t}\n\t}\n\tlogDebug(\"Total Prequal records set to Inactive: \" + recsInactivatedCnt);\n}", "function viewWaterApplication(applicationId){\n\t\n\tvar Id = applicationId;\n\tdocument.getElementById(\"applicationIdPdf\").value = Id;\n\t\n\t$('#generatePreview').submit();\n\t\n}", "function seedDB(){\n var source = \"http://dblp.org/search/publ/api?q=wondoh+john&format=json\";\n request(source, function(error, response, body){\n if(!error && response.statusCode==200){\n var data = JSON.parse(body);\n var dataArray = data.result.hits.hit;\n for(var i=0; i<dataArray.length; i++){\n \n var dataObject = {\n title: dataArray[i].info.title,\n authors: buildString(dataArray[i].info.authors.author),\n venue: dataArray[i].info.venue,\n year: dataArray[i].info.year,\n type: dataArray[i].info.type,\n doi: dataArray[i].info.doi,\n url: dataArray[i].info.url\n };\n Publication.create(dataObject, function(err, createdPublication) {\n if(err){\n console.log(err);\n } else {\n console.log(createdPublication);\n }\n });\n }\n }\n });\n}", "function beginProcess() {\n checkArrays((checkArraysErr) => {\n if (checkArraysErr) {\n course.error(checkArraysErr);\n callback(null, course, item);\n return;\n }\n\n checkPages();\n callback(null, course, item);\n });\n }", "function run_app()\n {\n putAppVersionToFrontPage();\n methods.buildDocDef();\n methods.makeChartsOptions();\n //return; //skips sending charts to cloud-service\n methods.loadCharts( function() {\n var button = document.getElementById( 'generate-pdf' );\n if( fconf.setAnOpenButton ) {\n button.addEventListener( 'click', function() {\n ////solution works without timeout, but\n ////this timeout does not hurt\n setTimeout( createDoc, 1 );\n });\n button.style.opacity = \"1\";\n button.title = \"Click to generate document\";\n button.innerHTML = \"Generate Report\";\n pdfMake_is_in_busy_state = false;\n } else {\n pdfMake_is_in_busy_state = false;\n button.innerHTML = \"Data loaded\";\n button.title = \"Generating document ...\";\n createDoc();\n }\n })\n }", "function launchPublications(pub) {\n var Win1 = open(pub,\"\",\"height=800,width=1000,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes\");\n Win1.focus();\n }", "function applicationDocuments() {\n\tUser = getURLParameter(\"User\");\n\tAid = getURLParameter(\"AID\");\n\tselectedItem = null;\n\tselectedDocument = null;\n\tconnect(\"/hiwi/Clerk/js/applicationDocuments\", \"User=\" + User + \"&AID=\"\n\t\t\t+ Aid, handleApplicationDocumentsResponse);\n}", "getPublications() {\n return this.perform('get', '/publications');\n }", "_updatePublisher(uPCs) {\t\t\n\t\tvar key = this._loaderAndLoads(uPCs);\t\t\t \n\t\tif(key !== null && uPCs[key].situation === \"CONTRIBUTING\"){\n\t\t\tthis.$.content.readonly = false;\n\t\t\tthis.$.content.focus();\n\t\t\tthis.$.save.style.display = \"inline\";\n\t\t\tthis.$.check.disabled = true;\n\t\t} else {\n\t\t\tthis.$.content.readonly = true;\n\t\t\tthis.$.save.style.display = \"none\";\n\t\t\tthis.$.check.disabled = false;\n\t\t}\n\t}", "function populateAppointmentWithNewData(data){\n // hide reschedule form\n const rescheduleForm = document.getElementById('reschedule-form')\n rescheduleForm.setAttribute('style', 'display: none;')\n\n // populate page with updated data optimistically\n const appointmentInfo = document.getElementById('info')\n appointmentInfo.setAttribute('style', '')\n\n const startDate = appointmentInfo.querySelectorAll('li')[2]\n startDate.textContent = `Start Date: ${data.start_date}`\n \n const endDate = document.getElementById('info').querySelectorAll('li')[3]\n endDate.textContent = `End Date: ${data.end_date}`\n}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"dept_area\", gw_com_api.getPageParameter(\"dept_area\"));\n gw_com_api.setValue(\"frmOption\", 1, \"yyyy\", gw_com_api.getPageParameter(\"yyyy\"));\n gw_com_api.setValue(\"frmOption\", 1, \"rev\", gw_com_api.getPageParameter(\"rev\"));\n gw_com_api.setValue(\"frmOption\", 1, \"item_no\", gw_com_api.getPageParameter(\"item_no\"));\n gw_com_api.setValue(\"frmOption\", 1, \"item_nm\", gw_com_api.getPageParameter(\"item_nm\"));\n processRetrieve({});\n //----------\n gw_com_module.startPage();\n\n }", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"dept_area\", gw_com_api.getPageParameter(\"dept_area\"));\n gw_com_api.setValue(\"frmOption\", 1, \"yyyy\", gw_com_api.getPageParameter(\"yyyy\"));\n gw_com_api.setValue(\"frmOption\", 1, \"rev\", gw_com_api.getPageParameter(\"rev\"));\n gw_com_api.setValue(\"frmOption\", 1, \"item_no\", gw_com_api.getPageParameter(\"item_no\"));\n gw_com_api.setValue(\"frmOption\", 1, \"item_nm\", gw_com_api.getPageParameter(\"item_nm\"));\n processRetrieve({});\n //----------\n gw_com_module.startPage();\n\n }", "function populatePersonalData(json){\n\t/* update the email anchor in the resume iFrame */\n\tvar iframeBody = $('#resume-iframe').contents().find('body');\n\tvar emailItem = iframeBody.contents().find('#resume-email');\n\t\n\tif(json[\"errMessage\"]){\n\t\tconsole.log(json[\"errMessage\"]);\n\t\treturn;\n\t}\n\t\n\tif(json[\"email\"]){\n\t\tuserIsValidated = true;\n\t\t\n\t\temailItem.attr({\n\t\t\t\"href\" : \"mailto:\" + json[\"email\"],\n\t\t\t\"itemprop\" : \"email\"\n\t\t});\n\t\temailItem.hide().html(json[\"email\"]).fadeIn('slow');\t// fade in for dramatic effect\n\t\t\n\t\t/* update information on the contact page\n\t\t cannot be streamlined because of the iFrame */\n\t\temailItem = $('#contact-email');\n\t\temailItem.attr({\n\t\t\t\"href\" : \"mailto:\" + json[\"email\"],\n\t\t\t\"itemprop\" : \"email\"\n\t\t});\n\t\temailItem.hide().html(json[\"email\"]).fadeIn('slow');\n\t\t\n\t\t/* remove 'show contact info' buttons after user has passed the captcha */\n\t\t$('.validate-button').hide('slow', function() { validateButton.remove(); });\n\t\tvar validateButton = getValidateButtonFromIFrame();\n\t\tvalidateButton.hide('slow', function() { validateButton.remove(); });\n\t}\n}", "function preProcess(){\n\t\t$(\".progress-bar\").css(\"width\",\"75%\");\n\t\t\n\t\t// group data by recipients\n\t\tRecipients = d3.group(aidData, d => d.Recipient);\n\t\tRecipientKeys = Array.from(Recipients.keys());\n\t\t\n\t\t// update recipient dropdown list\n\t\tPlotly.d3\n\t\t\t.select('#recipient')\n\t\t\t.selectAll('option')\n\t\t\t.data(RecipientKeys)\n\t\t\t.enter()\n\t\t\t.append('option')\n\t\t\t.text(function(d) {return d;})\n\t\t\t.attr('value', function(d) {return d;});\t\n\t\t\n\t\t// set default recipient to the first\n\t\t$(\"#recipient\").val(RecipientKeys[1]);\n\t\n\t\tRecipients = Array.from(Recipients);\n\t\t\n\t\t// initialize dashboard based on default recipient\n\t\trecipientPlots( $(\"#recipient\").val(), $(\"#aidType\").val(), $(\"#year\").val());\n\t\t\n\t}", "function main() {\n var managerAccount = AdsApp.currentAccount();\n var centralSpreadsheet = validateAndGetSpreadsheet(CONFIG.CENTRAL_SPREADSHEET_URL);\n validateEmailAddresses(CONFIG.RECIPIENT_EMAILS);\n var timeZone = AdsApp.currentAccount().getTimeZone();\n var now = new Date();\n\n centralSpreadsheet.setSpreadsheetTimeZone(timeZone);\n\n var processStatus = centralSpreadsheet.getRangeByName(CONFIG.PROCESS_STATUS_RANGE).getValue();\n var runDateString = centralSpreadsheet.getRangeByName(CONFIG.RUN_DATE_RANGE).getValue();\n var runDate = getDateStringInTimeZone('M/d/y', runDateString);\n\n var dateString = getDateStringInTimeZone('M/d/y', now);\n var folderName = \"Disapproved Ads : \" + dateString;\n var folder = createDriveFolder(folderName);\n\n // This is the first execution today, so reset status to PROCESS_NOT_STARTED\n // and clear any old data.\n if (runDate != dateString) {\n processStatus = CONFIG.PROCESS_NOT_STARTED;\n setProcessStatus(centralSpreadsheet, processStatus);\n clearSheetData(centralSpreadsheet);\n }\n\n centralSpreadsheet.getRangeByName(CONFIG.RUN_DATE_RANGE).setValue(dateString);\n\n if (processStatus != CONFIG.PROCESS_COMPLETED) {\n ensureAccountLabels([CONFIG.LABEL]);\n } else {\n removeLabelsInAccounts();\n removeAccountLabels([CONFIG.LABEL]);\n Logger.log(\"All accounts had already been processed.\");\n return;\n }\n\n // Fetch the managed accounts that have not been checked and process them.\n var accountSelector = getAccounts(false);\n processStatus = processAccounts(centralSpreadsheet, accountSelector, folder);\n\n if (processStatus == CONFIG.PROCESS_COMPLETED) {\n setProcessStatus(centralSpreadsheet, processStatus);\n removeLabelsInAccounts();\n\n AdsManagerApp.select(managerAccount);\n removeAccountLabels([CONFIG.LABEL]);\n Logger.log(\"Process Completed without any errors\");\n sendEmailNotification(centralSpreadsheet);\n }\n}", "function FillSupplyKeys()\n{\n try\n {\n var bSuccess = SetActiveSheet(\"SupplyKeys\");\n /**/\n if(bSuccess)\n {\n var pHandle = SpreadsheetApp.getActiveSpreadsheet();\n var pSheet = pHandle.getSheetByName(\"SupplyKeys\");\n var pSearch =\n {\n 'LibId': g_pHandle.Handle.LibraryId,\n 'ClassId': g_pHandle.Handle.SupplyId,\n 'SecurityCode': g_pHandle.SecurityCode,\n 'PageSize': 10000\n };\n var pDocList = ListDocuments(pSearch);\n /* register log */\n Logger.log(pDocList.Handle);\n /**/\n pSheet.clear();\n /**/\n for(var i in pDocList.Handle.documentList)\n {\n var pDoc = pDocList.Handle.documentList[i];\n /* append in sheet */\n pSheet.appendRow([pDoc.title, pDoc.id, pDoc.fields[0].values[0]]);\n }\n }\n else\n {\n throw \"Sheet SupplyKeys is not found!\";\n }\n }\n catch(e)\n {\n Logger.log(e.message);\n SpreadsheetApp.getUi().alert(e.message);\n throw e;\n }\n}", "function showApplicants(job, i) {\n currJobIndex = i;\n currJob = job;\n renderApplicants(Object.values(allApplicants[Number(i)]), i);\n showContainer(\"applicant-container\");\n hideContainer(\"job-container\");\n var jobTitle = document.getElementById(\"job-title\");\n jobTitle.innerHTML = job;\n}", "selectAndContactApplicant () {\n var selectedApplicant = this.props.selectedApplicant;\n this.props.multiSelectDeselectAll();\n this.props.multiSelectAdd(selectedApplicant.student_id);\n this.openConfirmMultiApplicantContactModal();\n }", "function setupPersonFullView() {\r\n populatePersonFullData();\r\n}", "function onPublisherPresReq() {\n if (!uuid) return;\n socket.emit(\"publisher-pres-req-sub\", uuid);\n socket.on(\"publisher-pres-req-done\", () => {\n socket.emit(\"publisher-pres-req-unsub\", uuid);\n setPublisherPresentationRequest(false);\n mutate(`${PUBLICATION_PATH}/${id}`);\n });\n setPublisherPresentationRequest(true);\n }", "function findApplicantProfiles() {\n return db(\"applicant_profiles\");\n}", "function showApplicants(applicants){\n\tfor(var i = 0;i < applicants.length;i++){\n\t\tconsole.log((i+1) + \": name: \" + applicants[i].name)\n\t\tconsole.log(' team: ' + applicants[i].teamName)\n\t}\n}", "static populateAmsUi() {\r\n //populate select options for streaming formats/protectionType\r\n const select = document.getElementById(\"protectionType\");\r\n let option;\r\n const formats = this.formats;\r\n formats.forEach((item, index) => {\r\n option = document.createElement(\"option\");\r\n option.value = item;\r\n option.innerHTML = item;\r\n select.appendChild(option);\r\n })\r\n\r\n //populate default source URL\r\n document.getElementById(\"sourceUrl\").value = AMS_CONST.DEFAULT_URL;\r\n\r\n //populate App Cert URL\r\n document.getElementById(\"appCert\").value = AMS_CONST.APP_CERT_URL;\r\n }", "function fillMain() {\n if (formExistsInPage()) {\n console.log(\"Filling in main form\");\n getMainData(function(icrdata) {\n\n ELEMENTS.forEach(function (field) {\n console.log(\"populating \" + field.id);\n\n switch (field.type) {\n case \"text\" || \"textarea\":\n fillText(field.id, icrdata[field.name]);\n break;\n case \"select\":\n if (field.ref) {\n select(field.id, icrdata[field.name]);\n if (field.id == \"requestExpirationDateLabel\") {\n document.getElementById(\"otherDateArea\").style.display = \"block\";\n }\n document.getElementById(field.ref_id).value = icrdata[field.ref];\n } else {\n select(field.id, icrdata[field.name]);\n }\n break;\n case \"radio\":\n radio(field.id, icrdata[field.name], field.options);\n break;\n case \"checkbox\":\n check(field.id, icrdata[field.name]);\n break;\n case \"custom\":\n fillWithAssumption(field.id, icrdata[field.name]);\n break;\n case \"complex\":\n fillComplex(field, icrdata[field.name]);\n break;\n case \"modal\":\n fillModal(field, icrdata[field.name]);\n break;\n }\n highlight(field);\n });\n hasICs(function(has_ics) {\n if(has_ics) {\n console.log(\"it has ICs\");\n setNextAction(ACTIONS.ADD_IC);\n clickLinkToICs();\n }\n });\n });\n }\n}", "function autoFillAppForm(pat_ssn) {\n for (var field in jsonPatInfo) {\n if (jsonPatInfo[field].SSN == pat_ssn) {\n document.getElementById(\"app-fname\").value = jsonPatInfo[field].Fname;\n document.getElementById(\"app-lname\").value = jsonPatInfo[field].Lname;\n document.getElementById(\"app-pat_id\").value = jsonPatInfo[field].PatientID;\n }\n }\n}", "function initPersonalArea(){\n\ttop.cleanPersonalArea(CAFEAPP.CAFE_ENCRYPT_LOGIN_USERID);\n getAllPersonalCount(); //메일, 쪽지 갯수 불러오기\n loadMyArticleFeedback(); //내글 반응 불러오기\n}", "function SetUpAppointment(indexDoc) {\n let chatbot = SetUpAppointmentLayout(indexDoc);\n let insertChatbot = document.getElementById(\"chatbot\").innerHTML = chatbot;\n document.getElementById(\"chatbot\").style.display = \"block\";\n}", "function loadData() {\n bootcampsFactory.getAllBootcamps()\n .success(function(model) {\n $scope.bootcamps = model.Bootcamps;\n $scope.locations = model.Locations;\n $scope.technologies = model.Technologies;\n })\n .error(function(status) {\n alert(\"Error! Status: \" + status);\n });\n }", "function ShowSendForApproval(documentTypeCode) {\n \n if ($('#LatestApprovalStatus').val() == 3) {\n var documentID = $('#ID').val();\n var latestApprovalID = $('#LatestApprovalID').val();\n ReSendDocForApproval(documentID, documentTypeCode, latestApprovalID);\n BindSupplierPayment();\n }\n else {\n $('#SendApprovalModal').modal('show');\n }\n}", "function launchProcess() {\r\n searchNames();\r\n $('#content-main').append('<span id=\"politicians\"></div>');\r\n }", "function mkdfOnDocumentReady() {\n mkdfPropertyAddToWishlist();\n mkdfShowHideEnquiryForm();\n mkdfSubmitEnquiryForm();\n mkdfAddEditProperty();\n mkdfMortgageCalculator();\n mkdfDeleteProperty();\n }", "function showMFForm(pageIdToLoad) {\n\n console.log(\"show Benefit to fit your life form\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").html(\"\");\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"newMF\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n }, \n \"headerTitle\": {\n \"type\": \"string\",\n \"title\": \"headerTitle\"\n },\n \"callout1\": {\n \"type\": \"string\",\n \"title\": \"callout1\"\n },\n \"callout2\": {\n \"type\": \"string\",\n \"title\": \"callout2\"\n },\n \"accordions\": {\n \"type\": \"array\",\n \"title\": \"accordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"accordionItem\",\n \"properties\": {\n \"accordionName\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"headerText\": {\n \"type\": \"string\",\n \"title\": \"Header Text\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Upper Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n },\n \"subAccordions\": {\n \"type\": \"array\",\n \"title\": \"subaccordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"subaccordion\",\n \"properties\": {\n \"subAccordionName\": {\n \"type\": \"string\",\n \"title\": \"Sub Accordion Name\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Sub Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"_parent\": \"n:node\",\n \"items\": {},\n \"description\": \"custom:pagebtfy0\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\"\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.headerTitle = value.headerTitle;\n node.callout1 = value.callout1;\n node.callout2 = value.callout2;\n node.accordions = value.accordions;\n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"headerTitle\": {\n \"type\": \"text\"\n },\n \"callout1\": {\n \"type\": \"ckeditor\" \n },\n \"callout2\": {\n \"type\": \"ckeditor\" \n },\n \"accordions\": {\n \"options\": {\n \"actionBarType\": \"right\"\n }\n }\n }\n }\n });\n}", "function PopulateDPFInstallments() {\n \n console.info(\"MultiPaymentMethodController:PopulateDPFInstallments:PopulateDPFInstallmentsFromObject\");\n Visualforce.remoting.Manager.invokeAction(\n \"taOrderController.PopulateDPFInstallmentsFromObject\", $scope.bpTree.response,\n function(result) {\n console.info('installmentDPF: ', result.options);\n mpmc.installmentDPF = result.options;\n },\n {escape: false} // No escaping, please\n );\n }", "function populatelawyers(comp_id){\n if (comp_id==\"\"){\n jQuery('#productdiv').html(\"\");\n jQuery('#empdiv').html(\"\");\n return false\n }\n loader.prependTo(\"#empdiv\");\n jQuery.ajax({\n type: \"GET\",\n url: \"/assign_licence/\"+comp_id,\n dataType: 'script',\n data: {\n 'comp_id' : comp_id,\n 'populate' : \"employees\"\n },\n success: function(){\n loader.remove();\n }\n });\n}", "function populatePatientInformation(data) {\n visible.patientFirstName = data.patientFirstName;\n visible.patientLastName = data.patientLastName;\n visible.patientAge = data.patientAge;\n visible.patientGender = data.patientGender;\n visible.nihiiOrg = data.nihiiOrg;\n }", "function populate() {\n apiService.genre.query().$promise.then(function (res) {\n $scope.genres = res;\n });\n apiService.author.query().$promise.then(function (result) {\n authors = result;\n });\n }", "function Shareemailbyemail() {\n var publicationtitle = $.trim($('#publicationTitle').val());\n var publicationdate = $.trim($('#publicationDate').val());\n var imageid = $.trim($('#ImageID').val());\n openPopup(\"http://\" + DomainName + \"/commonpopup/sharenewspaperbyemail?publicationdate=\" + publicationdate + \"&publicationtitle=\" + publicationtitle + \"&imageid=\" + imageid + \"&r=\" + Math.floor(Math.random() * 10001), 800);\n}", "function beginApp() {\n console.log('Please build your team');\n newMemberChoice();\n}", "function RequestLoadPersonalData() {\n\n}", "function launchEmail()\n{\n launchApplication(\"/luminis/luminisService/mailAccountServices/mailAccount/getMailAppLaunchData\");\n}", "async function addApplicantProfile(id) {\n const defaultData = {\n applicant_id: id,\n first_name: \"\",\n last_name: \"\",\n city: \"\",\n state: \"\",\n country: \"\",\n zip: \"\",\n bio: \"\",\n org_name: \"\",\n sector: \"\",\n website: \"\",\n };\n\n const [profileId] = await db(\"applicant_profiles\").insert(\n defaultData,\n \"id\"\n );\n\n return findApplicantProfileById(profileId);\n}", "function getAllCertificationAPI(){\n\t\n\tvar userId = document.getElementById(\"uId\").value;\n\t\n\tfetch(path+\"/getAllCertificationsDashboard/\"+userId,{\n\t\t\n\t\tmethod: \"GET\",\n\t headers: {\n\t \"Content-Type\": \"application/json\",\n\t },\n\t\t\n\t})\n\t.then((response)=>response.json())\n\t.then((certifications)=>{\n\t\tconsole.log(\"successfully fecth all data\", certifications);\n\t\tif(certifications){\n\t\t\tpopulateCertification(certifications);\n\t\t}\n\t})\n\t.then((error)=>{\n\t\t\n\t\treturn null;\n\t\t\n\t});\n\t\n}", "function newTaskFillProjects(selectedProjectID) {\n pubSub.publish('fillNewTaskPrjLst', { projectArr, selectedProjectID });\n}", "apaga(){\n if(this._listaPessoas.length > 0){\n this._listaPessoas = [];\n this._pessoaView.update(this._listaPessoas);\n this._mensagemView.update(\"Pessoas apagadas com sucesso!\");\n }else{\n this._mensagemView.update(\"Não possui registros para ser apagados!\");\n }\n \n }", "function fillAuthData() {\n var authData = localStorageService.get('authorizationData');\n if (authData) {\n authentication.isAuth = true;\n authentication.userName = authData.userName;\n authentication.roleId = authData.roleId;\n aclService.getAllAccessControlListAndPermissions('name').then(function (result) {\n authentication.accessControlList = result.accessControlList;\n authentication.domainObjectList = [];\n for (var i = 0; i < authentication.accessControlList.length; i++) {\n authentication.domainObjectList.push(authentication.accessControlList[i].domainObject.description);\n }\n\n $rootScope.currentUser = authentication;\n });\n }\n }", "function setupProgramList(prgms) {\n\t$(\"#prgm_list\").autocomplete({\n\t\tminLength : 0,\n\t\tdelay : 0,\n\t\tsource : prgms,\n\t\tfocus: onAutoCompleteFocus,\n\t\tselect: onAutoCompleteSelection\n\t}).data(\"ui-autocomplete\")._renderItem = renderAutoCompleteItem;\n\n\t$(\"#zip\").keydown(onFormKeyDown);\n\t$(\"#prgm_list\").keydown(onFormKeyDown);\n\tenableProgramList();\n\n\t// Check if a zip code and program id is provided in the URL.\n\t// If so, then display that data...\n\tvar zipCode = getParameterByName(\"zip\");\n\tvar prgmId = formatInteger(getParameterByName(\"prgm\"));\n\tif (zipCode && prgmId) {\n\t\t$(\"#zip\").val(zipCode);\n\t\tfor (var ctr=0; ctr < prgms.length; ctr++) {\n\t\t\tif (prgms[ctr].id == prgmId) {\n\t\t\t\t$(\"#prgm_list\").val(prgms[ctr].label);\n\t\t\t\tselectedPrgm = prgms[ctr];\n\t\t\t\tupdateTaxmap();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tshowWelcomeDialog();\n\t}\n}", "function reservation() {\n API.makeAppoint(catId).then(data => {\n getDatasDate(appointmentDate = getDate(data.appointment))\n getHourDate(appointmentHour = getHour(data.appointment))\n togglePopup(!showPopup);\n })\n .catch(error => { console.log(error)})\n }", "initializePrincipal(){\n const { context, schemas, href, setIsSubmitting } = this.props;\n const { edit, create } = this.state;\n const initContext = {};\n const contextID = object.itemUtil.atId(context) || null;\n var principalTypes = context['@type'];\n if (principalTypes[0] === 'Search' || principalTypes[0] === 'Browse'){\n // If we're creating from search or browse page, use type from href.\n let typeFromHref = url.parse(href, true).query.type || 'Item';\n if (Array.isArray(typeFromHref)) {\n [ typeFromHref ] = _.without(typeFromHref, 'Item');\n }\n if (typeFromHref && typeFromHref !== 'Item') principalTypes = [ typeFromHref ]; // e.g. ['ExperimentSetReplicate']\n }\n var initType = { 0 : principalTypes[0] };\n var initValid = { 0 : 1 };\n var initDisplay = { 0 : SubmissionView.principalTitle(context, edit, create, principalTypes[0]) };\n var initBookmarks = {};\n var bookmarksList = [];\n var schema = schemas[principalTypes[0]];\n var existingAlias = false;\n\n // Step A : Get labs from User, in order to autogenerate alias.\n var userInfo = JWT.getUserInfo(); // Should always succeed, else no edit permission..\n var userHref = null;\n if (userInfo && Array.isArray(userInfo.user_actions)){\n userHref = _.findWhere(userInfo.user_actions, { 'id' : 'profile' }).href;\n } else {\n userHref = '/me';\n }\n\n // Step B : Callback for after grabbing user w/ submits_for\n const continueInitProcess = () => {\n // if @id cannot be found or we are creating from scratch, start with empty fields\n if (!contextID || create){\n // We may not have schema (if Abstract type). If so, leave empty and allow initCreateObj ... -> createObj() to create it.\n if (schema) initContext[0] = buildContext({}, schema, bookmarksList, edit, create);\n initBookmarks[0] = bookmarksList;\n this.setState({\n 'keyContext': initContext,\n 'keyValid': initValid,\n 'keyTypes': initType, // Gets updated in submitAmbiguousType\n 'keyDisplay': initDisplay,\n 'currKey': 0,\n 'keyLinkBookmarks': initBookmarks\n }, () => {\n this.initCreateObj(principalTypes[0], 0, 'Primary Object');\n });\n } else {\n // get the DB result to avoid any possible indexing hang-ups\n ajax.promise(contextID + '?frame=object&datastore=database').then((response) => {\n const reponseAtID = object.itemUtil.atId(response);\n var initObjs = [];\n if (reponseAtID && reponseAtID === contextID){\n initContext[0] = buildContext(response, schema, bookmarksList, edit, create, initObjs);\n initBookmarks[0] = bookmarksList;\n if (edit && response.aliases && response.aliases.length > 0){\n // we already have an alias for editing, so use it for title\n // setting creatingIdx and creatingType to null prevents alias creation\n initDisplay[0] = response.aliases[0];\n existingAlias = true;\n }\n } else {\n // something went wrong with fetching context. Just use an empty object\n initContext[0] = buildContext({}, schema, bookmarksList, edit, create);\n initBookmarks[0] = bookmarksList;\n }\n\n this.setState({\n 'keyContext': initContext,\n 'keyValid': initValid,\n 'keyTypes': initType,\n 'keyDisplay': initDisplay,\n 'currKey': 0,\n 'keyLinkBookmarks': initBookmarks\n }, ()=>{\n if (initObjs.length > 0){\n _.forEach(initObjs, (initObj, idx) => this.initExistingObj(initObj));\n }\n // if we are cloning and there is not an existing alias\n // never prompt alias creation on edit\n // do not initiate ambiguous type lookup on edit or create\n if (!edit && !existingAlias){\n this.initCreateObj(principalTypes[0], 0, 'Primary Object', true);\n }\n });\n\n });\n }\n // set state in app to prevent accidental mid-submission navigation\n setIsSubmitting(true);\n };\n\n // Grab current user via AJAX and store to state. To use for alias auto-generation using current user's top submits_for lab name.\n ajax.load(userHref + '?frame=embedded', (r)=>{\n this.setState({ 'currentSubmittingUser' : r }, continueInitProcess);\n }, 'GET', continueInitProcess);\n }", "function goToAccRec() {\n $('#peInvoiceInformation').show();\n $('#invoiceInformation').hide();\n $('#financialSection').show();\n updatePricingInfo();\n fillPeInvsTable(DATA);\n}", "async genAccomodations(){\n //Not yet implemented\n }", "function addAffiliations() {\n djangoAuth\n .authenticationStatus(true)\n .then(function()\n {\n return djangoAuth.profile();\n })\n .then(function(data)\n {\n // Add user's personal affiliations to navigation\n affiliations = data.affiliations ? data.affiliations : [];\n\n affiliations.forEach(function(element, index) {\n msNavigationService.saveItem('affiliations.department-' + index, {\n title: element.title,\n state: 'app.department',\n weight: 1,\n stateParams: {deptId: element.id},\n });\n });\n },function(error) {\n console.log(error);\n });\n }", "function populate_appointments() {\n const appointmentList = getUserAppointments();\n\n for (let i = 0; i < appointmentList.length; i++) { \n $('#appt-list').append('<div class=\"item-container\">'+\n '<div class=\"info-container\">'+\n '<p class=\"med-info\">'+\n '<span class=\"card-subsection-name\">'+\n appointmentList[i].getName()+\n '</span>'+\n '<div class=\"card-subsection-h1\">'+\n appointmentList[i].getStartTime()+ \" - \" + appointmentList[i].getEndTime()+\n '</div>'+\n '<div class=\"card-subsection-h1\">'+\n appointmentList[i].getDate()+\n '</div>'+\n '</p>'+\n '</div>'+\n '</div>')\n }\n}", "function grabItems(){\n\tvar MainEventsCount = document.getElementById('numEvents').value;\n\tvar SubEventsCount = document.getElementById('numSub').value;\n\tvar NewsletterDate = conversionOfDate(document.getElementById('newsletterDate').value);\n\t// localStorage.setItem('NewsletterDate', JSON.stringify(NewsletterDate));\n\t\n\tvar parent = document.getElementById(\"HeaderInformation\");\n\tvar node = document.createElement(\"h1\");\n\tnode.appendChild(document.createTextNode(NewsletterDate));\n\tparent.appendChild(node);\n\n\tif (MainEventsCount != 0 && SubEventsCount != 0){\n\t\tappendMainEvent(MainEventsCount);\n\t\tappendSubBrandEvents(SubEventsCount);\n\t\tclearOldFields();\n\n\t\t// Starting Go to Create the Applause Generator.js\n\t\tvar parent = document.getElementById(\"SubmitItems\");\n\t\tvar child = document.createElement(\"input\");\n\t\tchild.setAttribute(\"type\", \"button\");\n\t\tchild.setAttribute(\"value\", \"Make Applause\");\n\t\tchild.setAttribute(\"onclick\", 'createApplause(); return false;');\n\t\tparent.appendChild(child);\n\t}\n\telse{\n\t\twindow.alert(\"You have an empty or 0 value for SubBrand Events or Events\");\n\t}\n}", "async function findApplicantProfileById(applicant_id) {\n const applicant = await db(\"applicant_profiles\")\n .where({ applicant_id })\n .first();\n if (applicant === undefined) return undefined;\n const applicant_profile_id = applicant.id;\n const grants = await grantsModel.findGrantsByUser(applicant_profile_id);\n\n return { ...applicant, grants };\n}", "function main() {\n\n var form = FormApp.openByUrl(URL);\n var items = form.getItems();\n \n var result = {\n \"metadata\": getFormMetadata(form),\n \"items\": items.map(itemToObject),\n \"count\": items.length\n };\n \n Logger.log(JSON.stringify(result)); \n var Strung = JSON.stringify(result);\n DocumentApp.create('export-google-form').getBody().appendParagraph(Strung);\n}", "function preProcess(){\n\t\t$(\".progress-bar\").css(\"width\",\"75%\");\n\t\t\n\t\t// group data by Donors and by recipients to facilitate analysis\n\t\tDonors = d3.group(aidData, d => d.Donor);\n\t\tDonorKeys = Array.from(Donors.keys());\n\t\tPlotly.d3\n\t\t\t.select('#donor')\n\t\t\t.selectAll('option')\n\t\t\t.data(DonorKeys)\n\t\t\t.enter()\n\t\t\t.append('option')\n\t\t\t.text(function(d) {return d;})\n\t\t\t.attr('value', function(d) {return d;});\n\t\t$(\"#donor\").val(\"United States\");\t\n\t\tDonors = Array.from(Donors);\n\t\n\t\tRecipients = d3.group(aidData, d => d.Recipient);\t\n\t\tRecipients = Array.from(Recipients);\n\t\tdonorPlots( $(\"#donor\").val(), $(\"#aidType\").val(), $(\"#year\").val());\n\t}", "function adoptDog() {\n\tvar email = prompt('Please enter email id');\n\tif(email != '') {\n\t\tvar ga = new GlideAjax('fetchUtils');\n\t\tga.addParam('sysparm_name','createEmailNotification');\n\t\tga.addParam('sysparm_adoption_center', g_form.getValue('adoption_center'));\n\t\tga.addParam('sysparm_adopter_email',email);\n\t\tga.getXML(ajaxProcessor);\n\t}\telse {\n\t\talert('The email id you entered is not valid');\n\t}\n}", "function startPublishing() {\n\t\tif (!publisher) {\n\t\t\tvar parentDiv = document.getElementById(\"myCamera\");\n\t\t\tvar publisherDiv = document.createElement('div'); // Create a div for the publisher to replace\n\t\t\tpublisherDiv.setAttribute('id', 'opentok_publisher');\n\t\t\t\n\t\t\t// Remove loading screen and append the video \n\t\t\t$('div#user1_loading').css('display', 'none');\n\t\t\tparentDiv.appendChild(publisherDiv);\n\t\t\t\n\t\t\tvar publisherProps = {width: VIDEO_WIDTH, height: VIDEO_HEIGHT};\n\t\t\tpublisher = TB.initPublisher(apiKey, publisherDiv.id, publisherProps); // Pass the replacement div id and properties\n\t\t\tsession.publish(publisher);\n\t\t}\n\t}", "async function main() {\n\n\tawait prisma.vote.deleteMany();\n\tawait prisma.candidate.deleteMany();\n\n\tconst candidateData = [\n\t\t{ name: \"John Doe\" },\n\t\t{ name: \"Steve Jobs\" },\n\t\t{ name: \"Alan Turing\" },\n\t];\n\n\tfor (const candidate of candidateData) {\n\t\tconst maxVotes = 10000;\n\t\tconst minVotes = 1;\n\t\tconst votesCount = Math.floor(Math.random() * maxVotes + minVotes);\n\t\tconst votes = [...Array(votesCount).keys()].map( i => ({}));\n\t\tconst item = await prisma.candidate.create({\n\t\t\tdata: {\n name: candidate.name,\n }\n\t\t});\n\t\tawait prisma.candidate.update({\n\t\t\twhere: {\n\t\t\t\tid: item.id,\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tvotes: {\n\t\t\t\t\tcreate: votes,\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n}", "function loadApprovalSetupRecords(isPaging) {\n var apiRoute = baseUrl + 'GetApprovalSetupRecords/'; // by viewModel\n var listApprovalSetupRecords = approvalSetupService.getApprovalSetupList(apiRoute);\n listApprovalSetupRecords.then(function (response) {\n $scope.listApprovalSetupRecords = response.data\n },\n function (error) {\n console.log(\"Error: \" + error);\n });\n }", "function submitName() {\n var firstName = document.getElementById(\"userFirstName\").value;\n var lastName = document.getElementById(\"userLastName\").value;\n\n firstName = firstName.trim();\n lastName =lastName.trim();\n\n if(firstName == \"\" || lastName == \"\"){\n alert(\"Invalid Name\")\n return;\n }\n\n console.log(\"second print all\");\n masterUser.printAll();\n var person = new attendee(lastName,firstName);\n masterUser.add(person);\n var arr = userArray(masterUser);\n writeData(arr, 2, \"masterUser\");\n\n populateUserSelect(\"userName\");\n\n\n}", "function getJobApplicants(req, res, next){\n db.any(\n \"SELECT * FROM Applications INNER JOIN ApplicantUsers on ApplicantUsers.id = Applications.applicant_id where Applications.job_id = $1;\"\n , [req.params.job_id] )\n .then(function(data) {\n res.rows= data\n console.log('successfully getting current applicants for the job', data)\n next();\n })\n .catch(function(error){\n console.error(error);\n })\n}", "function showContractApplicant(offer){\n window.open('/offers/' + offer + '/pdf');\n}", "function make_all_programs() {\n if (window.controller.programs.nprogs === 0) {\n return \"<p style='text-align:center'>\"+_(\"You have no programs currently added. Tap the Add button on the top right corner to get started.\")+\"</p>\";\n }\n var n = 0;\n var list = \"<p style='text-align:center'>\"+_(\"Click any program below to expand/edit. Be sure to save changes by hitting submit below.\")+\"</p><div data-role='collapsible-set'>\";\n $.each(window.controller.programs.pd,function (i,program) {\n list += make_program(n,window.controller.programs.nprogs,program);\n n++;\n });\n return list+\"</div>\";\n}", "function FillCompanyKeys()\n{\n try\n {\n var bSuccess = SetActiveSheet(\"CompanyKeys\");\n /**/\n if(bSuccess)\n {\n var pHandle = SpreadsheetApp.getActiveSpreadsheet();\n var pSheet = pHandle.getSheetByName(\"CompanyKeys\");\n var pSearch =\n {\n 'LibId': g_pHandle.Handle.LibraryId,\n 'ClassId': g_pHandle.Handle.CompanyId,\n 'SecurityCode': g_pHandle.SecurityCode,\n 'PageSize': 10000\n };\n var pDocList = ListDocuments(pSearch);\n /* register log */\n Logger.log(pDocList.Handle);\n /* clear all row and columns */\n pSheet.clear();\n /**/\n for(var i in pDocList.Handle.documentList)\n {\n var pDoc = pDocList.Handle.documentList[i];\n /* append in sheet */\n pSheet.appendRow([pDoc.title, pDoc.id, pDoc.fields[0].values[0]]);\n }\n }\n else\n {\n throw \"Sheet CompanyKeys is not found!\";\n }\n }\n catch(e)\n {\n Logger.log(e.message);\n SpreadsheetApp.getUi().alert(e.message);\n throw e;\n }\n}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { month: -1 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate(\"\", { month: +1 }));\n gw_com_api.setValue(\"frmOption\", 1, \"dept_area\", gw_com_module.v_Session.DEPT_AREA);\n //----------\n gw_com_module.startPage();\n\n }", "function main() {\n loadComments().then(renderComments);\n renderContactData(RESUME.contactData);\n renderSectionData(RESUME.sections);\n}", "function generateResume() {\n html2pdf(areaCv, opt)\n }", "function startApp() {\n displayProducts();\n}", "function runOnComplete() {\n\t\tif (valid == 0) {\n\t\t\t/*\n\t\t\t * checks for privacy-policy\n\t\t\t */\n\t\t\tif ($(\"#privacy-policy\").prop('checked') != true) {\n\t\t\t\t$(\"#privacyValidation\").text(\n\t\t\t\t\t\t\"you must accept the privacy policy to continue\");\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$(\"#privacyValidation\").text(\"\");\n\t\t\t\t$(\".step\").hide(\"fast\");\n\t\t\t\t$(\"#soicalMediaAccountsForm\").show(\"slow\");\n\t\t\t}\n\t\t}\n\t}", "function getApplicants() {\n\tvar person1 = {\n\t\t\"name\" : \"Bill Riley\",\n\t\t\"DOB\" : \"August 4, 1991\",\n\t\t\"address\" : \"123 Street Road\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Illustrator\", \"Published\"] \n\t};\n\n\tvar person2 = {\n\t\t\"name\" : \"Jess Jillenger\",\n\t\t\"DOB\" : \"June 21, 1988\",\n\t\t\"address\" : \"456 Fake Road\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"Ruby on Rails\"]\n\t};\n\n\tvar person3 = {\n\t\t\"name\" : \"Rebecca Simmons\",\n\t\t\"DOB\" : \"December 1, 1994\",\n\t\t\"address\" : \"1324 West Street\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"JavaScript\", \"Angular\"]\n\t};\n\n\tvar person4 = {\n\t\t\"name\" : \"Jim Matthews\",\n\t\t\"DOB\" : \"January 14, 1990\",\n\t\t\"address\" : \"1324 East Street\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"Cognitive Psychology\", \"Published\", \"UI/UX\"]\n\t};\n\n\tvar person5 = {\n\t\t\"name\" : \"Samantha Monico\",\n\t\t\"DOB\" : \"February 7, 1990\",\n\t\t\"address\" : \"1992 Johnson Street\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Cognitive Psychology\", \"UI/UX\", \"PhotoShop\"]\n\t};\n\n\tvar person6 = {\n\t\t\"name\" : \"Cindy Liu\",\n\t\t\"DOB\" : \"May 7, 1979\",\n\t\t\"address\" : \"18 Marr Road\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Published\", \"Angular\", \"JavaScript\", \"Node\"]\n\t};\n\n\treturn [person1, person2, person3, person4, person5, person6];\n}", "function getEmployeeJobApplication(firstname) {\n\treturn Employee.findOne({firstname: firstname})\n\t .populate(\"applications\").exec((err, posts) =>{\n console.log(\"Populated Employee\" + posts)\n }\n\t \n)\n}", "function showBtfylSecondary(pageIdToLoad){\n \n pageIdToLoad = $(\"#alpaca1\").val();\n $(\"#myform\").html(\"\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"PageBtfylSecondary\",\n \"description\": \"A data type to support for Page Btfyl Secondary.\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n },\n \"heading\": {\n \"type\": \"string\",\n \"title\": \"heading\"\n },\n \"mainBody\": {\n \"type\": \"string\",\n \"title\": \"mainBody\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"title\": \"mainContent\",\n \"items\": {\n \"properties\": {\n \"contentHeading\": {\n \"type\": \"string\",\n \"title\": \"contentHeading\"\n },\n \"contentBody\": {\n \"type\": \"string\",\n \"title\": \"contentBody\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"title\": \"Helpful Links\",\n \"maxItems\": 30,\n \"items\": {\n \"properties\": {\n \"linkHeader\": {\n \"type\": \"string\",\n \"title\": \"linkHeader\"\n },\n \"company\": {\n \"type\": \"string\",\n \"title\": \"company\"\n },\n \"number\": {\n \"type\": \"string\",\n \"title\": \"number\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"link\"\n }\n },\n \"type\": \"object\"\n }\n }\n },\n \"_parent\": \"n:node\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"items\": {}\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.name = value.name;\n \n node.heading = value.heading;\n node.mainBody = value.mainBody;\n node.links = value.links;\n node.mainContent = value.mainContent;\n \n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"name\": {\n \"type\": \"text\"\n },\n \"mainBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n },\n \"height\":\"120\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"contentHeading\": {\n \"type\": \"text\"\n }, \n \"contentBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n }\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"linkHeader\": {\n \"type\": \"text\"\n }, \n \"company\": {\n \"type\": \"text\"\n },\n \"number\": {\n \"type\": \"text\"\n },\n \"link\": {\n \"type\": \"text\"\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n } \n\n }\n }\n });\n\n}", "function fillStockMailDistributionForm(settings) {\n document.getElementById('emailDistributionCheckbox').checked = settings.active\n document.getElementById('distributionTimeInput').value = settings.startTime\n}", "function main() {\n\n var clientLib = namespace.lookup('com.pageforest.client');\n\n // Client library for Pageforest\n ns.client = new clientLib.Client(ns);\n\n // Use the standard Pageforest UI widget.\n //ns.client.addAppBar();\n\n // This app demonstrates auto-loading - will reload the doc if\n // it is changed by another user.\n ns.client.autoLoad = true;\n\n // Quick call to poll - don't wait a whole second to try loading\n // the doc and logging in the user.\n ns.client.poll();\n\n // Expose appid\n items.appid = ns.client.appid;\n }", "function confirmAppointment(user, params) {\n //window.alert('confirmAppointment not implemented');\n var apigClient = getSecureApiClient();\n var body = {\n client_project: params[0],\n created_at : params[1],\n authToken: store.get('token')\n };\n console.log('confirmAppointment with params', body);\n\n apigClient.appointmentsConfirmPost({}, body)\n .then(function(response) {\n console.log(response);\n console.log('appointments before assign in confirmAppointment:');\n console.log($scope.appointments);\n //$scope.appointments = [response.data]; //[{}] one data MAYBE this should be another table\n //$scope.appointments.forEach( function(e, i, arr) {\n //if (e.client_project == body.client_project && e.created_at = body.created_at) {\n for (k in $scope.appointments) {\n if ($scope.appointments[k].client_project == body.client_project && $scope.appointments[k].created_at == body.created_at) {\n console.log('Replaeing ' + JSON.stringify($scope.appointments[k]) + ' with ' + JSON.stringify(response.data))\n $scope.appointments[k] = response.data;\n break;\n }\n }\n //$scope.appointments.push(response.data); //[{}] one data MAYBE this should be another table\n console.log('after assining appointments in confirmAppointment');\n console.log($scope.appointments);\n //$scope.appointments = [response.data]; //[{}] one data MAYBE this should be another table\n console.log('before apply in confirmAppointment');\n //console.log(response.data); {}\n $scope.$apply();\n console.log('applied');\n }).catch(function (response) {\n alert('confirm appointment failed');\n showError(response);\n });\n }", "process() {\n var schoolsWithDepartments = await(services.school.listInstances()),\n preparedDepartments = this.findNecessary_(schoolsWithDepartments);\n\n var departmentsGrades = this.convertStages_(preparedDepartments);\n\n await(this.updateDb_(departmentsGrades));\n\n // await(this.deleteUnnecessaryDepartments_());\n }", "function setup_() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n if (ss.getFormUrl()) {\n var msg = 'Form already exists. Unlink the form and try again.';\n SpreadsheetApp.getUi().alert(msg);\n return;\n }\n var form = FormApp.create('Equipment Requests')\n .setCollectEmail(true)\n .setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId())\n .setLimitOneResponsePerUser(false);\n form.addTextItem().setTitle('Employee name').setRequired(true);\n form.addTextItem().setTitle('Desk location').setRequired(true);\n form.addDateItem().setTitle('Due date').setRequired(true);\n form.addListItem().setTitle('Laptop').setChoiceValues(AVAILABLE_LAPTOPS);\n form.addListItem().setTitle('Desktop').setChoiceValues(AVAILABLE_DESKTOPS);\n form.addListItem().setTitle('Monitor').setChoiceValues(AVAILABLE_MONITORS);\n\n // Hide the raw form responses.\n ss.getSheets().forEach(function(sheet) {\n if (sheet.getFormUrl() == ss.getFormUrl()) {\n sheet.hideSheet();\n }\n });\n // Start workflow on each form submit\n ScriptApp.newTrigger('onFormSubmit_')\n .forForm(form)\n .onFormSubmit()\n .create();\n // Archive completed items every 5m.\n ScriptApp.newTrigger('processCompletedItems_')\n .timeBased()\n .everyMinutes(5)\n .create();\n}", "createApplication__c(){\n\n let params = {\n appName: this.appName,\n appArea: this.areaId,\n appDate: this.appDate\n };\n //console.log(params)\n addApplication({wrapper:params})\n .then((resp)=>{\n this.appId = resp.Id; \n //console.log(this.appId);\n // eslint-disable-next-line no-return-assign\n this.newProds.forEach((x) => x.Application__c = this.appId)\n let products = JSON.stringify(this.newProds)\n //console.log(products)\n addProducts({products:products})\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Success',\n message: 'Application Added!',\n variant: 'success'\n })\n );\n }).then(()=>{\n //console.log(\"sending new app to table \"+this.appId); \n fireEvent(this.pageRef, 'newApp', this.appId)\n }).then(()=>{\n this.newProds = [];\n this.appName = ''; \n this.appDate = '';\n this.noArea = true;\n this.notUpdate = undefined; \n }).catch((error)=>{\n console.log(JSON.stringify(error))\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error adding app',\n message: 'Did you select an Area and enter a App Name?',\n variant: 'error'\n })\n \n ) \n })\n }", "function start () {\n stdout('start');\n QPDF.encrypt({\n logger: stdout,\n arrayBuffer: QPDF.base64ToArrayBuffer(myPdfBase64),\n userPassword: 'testme',\n ownerPassword: 'testme',\n callback: function (err, arrayBuffer) {\n if (err) {\n alert(err.message);\n } else {\n sendFile(arrayBuffer);\n }\n }\n });\n }", "function launchApp() {\r\n console.log(\"Hypersubs: Launching.\");\r\n $('#hypersubs-main-dialog').dialog('open');\r\n $('#hypersubs-splash').css('display', 'none');\r\n loadFlange(0, userPreferences.smartFill);\r\n }", "componentDidMount() {\n var app = {};\n let newList = [];\n\n firebase.auth().signInWithEmailAndPassword(\"[email protected]\", \"123456\").catch(function(error) {\n console.log(error)\n });\n\n const itemsRef = firebase.database().ref('applicants');\n itemsRef.once('value', (snapshot) => {\n let items = snapshot.val();\n for (let item in items) {\n newList.push({\n id: item,\n applicant: items[item].applicant\n });\n }\n });\n\n const appRef = firebase.database().ref('applicants/'+this.props.match.params.id);\n appRef.on('value', (snapshot) => {\n app = snapshot.val();\n\n const stat = app[\"status\"];\n delete app.status;\n app[\"gpa\"] = \"4.0\";\n app[\"resume\"] = \"https://drive.google.com/open?id=1895ccUJdAmlJzZyo0AIFP27NH9Bjmdn7\";\n app[\"email\"] = \"[email protected]\";\n app[\"phone\"] = \"4085504766\";\n\n let newQs = [];\n newQs.push({\n title: \"Notes\",\n subs: [{content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa. `\n }]});\n\n newQs.push({\n title: \"Application Questions\",\n score: 5,\n subs: [{subtitle: \"List your other time commitments for the semester.\",\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa.`\n },\n {subtitle: \"Tell us about your interests.\",\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa. Lorem ipsum dolor sit amet, consectetur\n adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa.`\n },\n {subtitle: `Why do you want to be in Sigma Eta Pi? How will you\n contribute to the organization? (250 words or less)`,\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa. Fusce nec nunc ante. Nam feugiat elit\n justo, ac eleifend urna dapibus vel. Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Mauris vehicula, erat ut mattis volutpa.`\n }]});\n\n newQs.push({\n title: \"Professional Interview\",\n score: 2,\n interviewers: [\"LeAnne\", \"Isabel\", \"Alex\"],\n subs: [{subtitle: \"List your other time commitments for the semester.\",\n score: 5,\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa.`\n },\n {subtitle: \"Tell us about your interests.\",\n score: 4,\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa. Lorem ipsum dolor sit amet, consectetur\n adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa.`\n },\n {subtitle: `Why do you want to be in Sigma Eta Pi? How will you\n contribute to the organization? (250 words or less)`,\n score: 3,\n content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Fusce nec nunc ante. Nam feugiat elit justo, ac eleifend urna dapibus\n vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris\n vehicula, erat ut mattis volutpa. Fusce nec nunc ante. Nam feugiat elit\n justo, ac eleifend urna dapibus vel. Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Mauris vehicula, erat ut mattis volutpa.`\n }]});\n\n this.setState({\n appId: this.props.match.params.id,\n status: stat,\n appInfo: app,\n qs: newQs,\n appList: newList\n });\n });\n }", "function successfulContact() {\n console.clear()\n document.getElementById(\"home-title\").innerHTML = \"Loading...\"\n document.getElementById(\"home-content\").innerHTML = \"\"\n loadEnvironmentBuilderPage()\n}", "function main(){\n // Display the products available for purchase\n getProducts()\n \n }", "function setUpForm()\r\n {\r\n var form = {\r\n patients : patients,\r\n phlebotomists : phlebotomists,\r\n pscs : pscs,\r\n labTests : labTests,\r\n diagnoses : diagnoses\r\n };\r\n\r\n if (appId)\r\n {\r\n form.title = \"Updating Appointment \" + appId;\r\n // fill form with preexisting appointment info\r\n } else\r\n form.title = \"Create New Appointment\";\r\n\r\n container.append(appointmentFormTemplate(form));\r\n\r\n // Updating fields\r\n $(\"select#patient\").change(function()\r\n {\r\n $(\"span#patient\").html(patients[$(this).val()].name);\r\n $(\"span#physician\").html(patients[$(this).val()].physician.name);\r\n }).change();\r\n\r\n $(\"select#phlebotomist\").change(function()\r\n {\r\n $(\"span#phlebotomist\").html(phlebotomists[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#psc\").change(function()\r\n {\r\n $(\"span#psc\").html(pscs[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"input#addLabTest\").click(function()\r\n {\r\n $(\"div#labTestsBlock\").append(labTestTemplate(form));\r\n\r\n $(\"select#labTests\").change(function()\r\n {\r\n $(this).parent().children(\"span#labTest\").html(labTests[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#diagnosis\").change(function()\r\n {\r\n $(this).parent().children(\"span#diagnosis\").html(diagnoses[$(this).val()].name);\r\n }).change();\r\n });\r\n\r\n $(\"input#pushAppointment\").click(function()\r\n {\r\n // convert to XML and send to server\r\n var app = {\r\n date : $(\"input#date\").val(),\r\n time : $(\"input#time\").val(),\r\n patient : $(\"select#patient\").val(),\r\n physician : patients[$(\"select#patient\").val()].physician.id,\r\n psc : $(\"select#psc\").val(),\r\n phlebotomist : $(\"select#phlebotomist\").val(),\r\n labTests : {}\r\n };\r\n\r\n $.each(_.map($(\"div#labTestsBlock\").children(\"div\"), function(val)\r\n {\r\n return {\r\n id : $(val).children(\"p\").children(\"select\")[0].value,\r\n dxcode : $(val).children(\"p\").children(\"select\")[1].value\r\n };\r\n }), function(i, o)\r\n {\r\n app.labTests[o.id] = o.dxcode;\r\n });\r\n\r\n var xml = appointmentXMLTemplate(app);\r\n\r\n function success(resp)\r\n {\r\n container.empty();\r\n var app = $(resp).children().children(\"uri\").html();\r\n var title = appId ? \"Appointment \" + appId + \" Updated\" : \"New Appointment Created\";\r\n container.append(\"<h3>\" + title + \"</h3><p style='padding-left:40px;'><a href='\" + app + \"'>\" + app + \"</a></p>\");\r\n appointmentWidget.refresh();\r\n }\r\n function error(resp)\r\n {\r\n container.empty();\r\n container.append($(resp.responseText).children(\"error\"));\r\n }\r\n\r\n if (appId)\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments/\" + appId,\r\n method : \"PUT\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n } else\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments\",\r\n method : \"POST\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n }\r\n });\r\n\r\n if (appId)\r\n {\r\n var app = appointments[appId];\r\n\r\n $(\"input#date\")[0].defaultValue = app.appointment.date;\r\n $(\"input#time\")[0].defaultValue = app.appointment.time;\r\n $(\"select#patient\").val(app.patient.id).change();\r\n $(\"select#phlebotomist\").val(app.phlebotomist.id).change();\r\n $(\"select#psc\").val(app.psc.id).change();\r\n\r\n // For as many labtests as this appointment has, click addLabTest\r\n // They are returned in order, so fill them in order\r\n for (var i = 0; i < app.labTests.tests.length; i++)\r\n $(\"input#addLabTest\").click();\r\n\r\n $.each($(\"select#labTests\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].labTest.id).change();\r\n });\r\n\r\n $.each($(\"select#diagnosis\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].diagnosis.dxcode).change();\r\n });\r\n\r\n } else\r\n {\r\n $(\"input#date\")[0].defaultValue = \"2015-05-20\";\r\n $(\"input#time\")[0].defaultValue = \"10:00\";\r\n }\r\n }", "function seed() {\n\n vm.project = {\n name: 'Fee',\n pub_date: '2017-09-11T23:34:36',\n latitude: 0,\n longitude: 0,\n language_ids: [1],\n max_recording_length: 30,\n recording_radius: 2000,\n out_of_range_distance: 10000,\n audio_stream_bitrate: '96',\n sharing_url: 'http://g.co',\n out_of_range_url: 'http://g.co',\n repeat_mode: 'continuous',\n ordering: 'by_weight',\n audio_format: 'mp3',\n };\n\n }", "function fillCalendar(appointments){\n let calendar = document.getElementsByClassName(\"calendar_day\");\n\n let year = selectedDate.getFullYear();\n let month = selectedDate.getMonth();\n\n let monthName = CALENDAR_MONTH_NAMES[month];\n document.getElementById(\"calendar_month_display\").innerText = `${monthName} ${year}`;\n\n let endDate = new Date(Date.UTC(year, month+1));\n let date = new Date(Date.UTC(year, month));\n let index = (date.getDay() + 6) % 7;\n \n // clear days outside range\n for(let i=0;i<index;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n\n // fill in days + apointments\n while (date < endDate) {\n calendar[index].children[0].innerText = date.getDate() + \".\";\n calendar[index].children[1].innerHTML = \"\";\n\n for(let i=0;i<appointments.length;i++){\n if(date.getUTCDate() == appointments[i].day){\n let appointment = document.createElement(\"div\");\n appointment.innerText = `${appointments[i].lecturer}: ${appointments[i].name}`;\n appointment.setAttribute(\"aria-id\", appointments[i].id);\n appointment.setAttribute(\"aria-name\", appointments[i].name);\n appointment.setAttribute(\"aria-location\", appointments[i].location);\n appointment.setAttribute(\"aria-start\", appointments[i].start);\n appointment.setAttribute(\"aria-end\", appointments[i].end);\n appointment.setAttribute(\"aria-status\", appointments[i].status);\n appointment.setAttribute(\"aria-lecturer\", appointments[i].lecturer);\n appointment.setAttribute(\"aria-type\", appointments[i].type);\n appointment.setAttribute(\"onclick\", \"show_popup(this)\");\n\n calendar[index].children[1].appendChild(appointment);\n }\n }\n calendar[index].setAttribute(\"aria-disabled\", \"false\");\n\n index += 1;\n date.setUTCDate(date.getUTCDate() + 1);\n }\n \n // clear days outside range\n for(let i=index;i<calendar.length;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n}", "function successfulContact() {\n console.clear();\n document.getElementById(\"home-title\").innerHTML = \"Loading...\";\n document.getElementById(\"home-content\").innerHTML = \"\";\n (0, _EnvironmentBuilder.loadEnvironmentBuilderPage)();\n}", "function getStaff(){\n Synergy4Service.getSynergyStaff($scope.totalSynergyKey).then(function(success){\n if(success.data){\n $scope.data = success.data;\n sortEmails2(success.data, success.data.length);\n }\n });\n }", "function updateFrontEnd() {\n let from = getParameterByName('from');\n if (from == 'projectData') getTheProjects();\n else {\n clearAndAddSingleRow('Retrieving Projects...');\n if (getParameterByName('type') === 'findTaskProject') {\n $('#param-field').before('<h3>Select a Project to Create Task for:</h3>');\n taskFinder = true;\n } else taskFinder = false;\n\n filterProjects();\n }\n}", "function getApplicants(groupJobs)\n\t{\n\t\t$('.btn-shorlisted-view')\n\t\t\t.buttonViewer({\n\t\t\t\tdataAttr : 'job-post-id', \n\t\t\t\tApiUrl : 'job/applicants/shortlisted',\n\t\t\t\tjobGroups: groupJobs,\n\t\t\t\tshortlistedBtnViews: $('.btn-shorlisted-view'),\n\t\t\t\tappliedBtnViews: $('.btn-applicants-view'),\n\t\t\t\tviewTemplate: '#view-applicants-temp',\n\t\t\t\tviewTemplateCon: '.applicant-view-con',\n\t\t\t\tdomToHide: $('.jobs-list')\n\t\t\t});\n\t}", "function withdrawDatasetSubmission() {\n $(\"#submit_prepublishing_review-spinner\").show();\n showPublishingStatus(withdrawDatasetCheck);\n}", "function getUserFormsById(id) {\n return new Promise((resolve, reject) => {\n if(!applicant) reject(new Error('applicants cannot be found'));\n let applicant_data = {};\n for(let i in applicant) {\n console.log(id ,applicant[i]);\n if(applicant[i].applicantid == id) {\n applicant_data.applicant = applicant[i];\n break;\n }\n }\n if(!applicant_data.applicant) resolve({});\n let userForms = [];\n for(let j in applicant_form) {\n console.log('form', applicant_form[j])\n if(applicant_form[j].applicantid == id) {\n userForms.push(applicant_form[j]);\n }\n }\n applicant_data.application_form = userForms;\n resolve(applicant_data);\n });\n}", "async function main() {\n // Ensure that the database exists.\n let database = await initializeDatabase();\n // Read the files containing all possible suburb names.\n SuburbNames = {};\n for (let suburb of fs.readFileSync(\"suburbnames.txt\").toString().replace(/\\r/g, \"\").trim().split(\"\\n\"))\n SuburbNames[suburb.split(\",\")[0]] = suburb.split(\",\")[1];\n // Retrieve the page that contains the links to the PDFs.\n console.log(`Retrieving page: ${DevelopmentApplicationsUrl}`);\n let body = await request({\n url: DevelopmentApplicationsUrl,\n proxy: process.env.MORPH_PROXY,\n strictSSL: false,\n headers: {\n \"Accept\": \"text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8\",\n \"Accept-Encoding\": \"\",\n \"Accept-Language\": \"en-US, en; q=0.5\",\n \"Connection\": \"Keep-Alive\",\n \"Host\": \"www.whyalla.sa.gov.au\",\n \"Upgrade-Insecure-Requests\": \"1\",\n \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134\"\n }\n });\n await sleep(2000 + getRandom(0, 5) * 1000);\n let $ = cheerio.load(body);\n let pdfUrls = [];\n for (let element of $(\"div.link-listing__wrap ul li a\").get()) {\n if ($(element).text().toLowerCase().includes(\"lodged applications\")) { // ignores approved application PDFs and just matches lodged application PDFs (case insensitively)\n let pdfUrl = new urlparser.URL(element.attribs.href, DevelopmentApplicationsUrl).href;\n if (pdfUrl.toLowerCase().includes(\".pdf\"))\n if (!pdfUrls.some(url => url === pdfUrl)) // avoid duplicates\n pdfUrls.unshift(pdfUrl); // the most recent PDF appears last (so use \"unshift\" instead of \"push\")\n }\n }\n // Retrieve the previous year PDFs.\n console.log(`Retrieving page: ${DevelopmentApplicationsPreviousYearUrl}`);\n body = await request({\n url: DevelopmentApplicationsPreviousYearUrl,\n proxy: process.env.MORPH_PROXY,\n strictSSL: false,\n headers: {\n \"Accept\": \"text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8\",\n \"Accept-Encoding\": \"\",\n \"Accept-Language\": \"en-US, en; q=0.5\",\n \"Connection\": \"Keep-Alive\",\n \"Host\": \"www.whyalla.sa.gov.au\",\n \"Upgrade-Insecure-Requests\": \"1\",\n \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134\"\n }\n });\n await sleep(2000 + getRandom(0, 5) * 1000);\n $ = cheerio.load(body);\n for (let element of $(\"div.u6ListItem a\").get()) {\n if ($(element).text().toLowerCase().includes(\"lodged applications\")) { // ignores approved application PDFs and just matches lodged application PDFs (case insensitively)\n let pdfUrl = new urlparser.URL(element.attribs.href, DevelopmentApplicationsUrl).href;\n if (pdfUrl.toLowerCase().includes(\".pdf\"))\n if (!pdfUrls.some(url => url === pdfUrl)) // avoid duplicates\n pdfUrls.push(pdfUrl);\n }\n }\n // Check that at least one PDF was found.\n if (pdfUrls.length === 0) {\n console.log(\"No PDF URLs were found on the pages.\");\n return;\n }\n console.log(`Found ${pdfUrls.length} PDF(s) on the pages.`);\n // Select the most recent PDF. And randomly select one other PDF (avoid processing all PDFs\n // at once because this may use too much memory, resulting in morph.io terminating the current\n // process).\n let selectedPdfUrls = [];\n selectedPdfUrls.push(pdfUrls.shift());\n if (pdfUrls.length > 0)\n selectedPdfUrls.push(pdfUrls[getRandom(0, pdfUrls.length)]);\n if (getRandom(0, 2) === 0)\n selectedPdfUrls.reverse();\n for (let pdfUrl of selectedPdfUrls) {\n console.log(`Parsing document: ${pdfUrl}`);\n let developmentApplications = await parsePdf(pdfUrl);\n console.log(`Parsed ${developmentApplications.length} development application(s) from document: ${pdfUrl}`);\n // Attempt to avoid reaching 512 MB memory usage (this will otherwise result in the\n // current process being terminated by morph.io).\n if (global.gc)\n global.gc();\n for (let developmentApplication of developmentApplications)\n await insertRow(database, developmentApplication);\n }\n}", "function startLicenseAgree()\n{\n var handleUrl = \"handle/\" + cocoon.parameters.handle;\n var signatureNeeded = UFALLicenceAgreement.signatureNeeded(getObjectModel());\n var everythingFine = false;\n if(signatureNeeded) {\n everythingFine = doLicenseAgree(handleUrl);\n }\n\n if(!everythingFine) {\n cocoon.redirectTo(cocoon.request.getContextPath() + \"/\" + handleUrl, true);\n getDSContext().complete();\n }\n}", "function load() {\n if(vm.document._id !== -1) {\n backendService.getDocumentById(vm.document._id).success(function(data) {\n\n // got the data - preset the selection\n vm.document.title = data.title;\n vm.document.fileName = data.fileName;\n vm.document.amount = data.amount;\n vm.document.senders = data.senders;\n vm.document.tags = data.tags;\n vm.document.modified = data.modified;\n vm.document.created = data.created;\n\n vm.selectedSenders = data.senders;\n vm.selectedTags = data.tags;\n\n })\n .error( function(data, status, headers) {\n\n if(status === 403) {\n $rootScope.$emit('::authError::');\n return;\n }\n\n alert('Error: ' + data + '\\nHTTP-Status: ' + status);\n return $location.path('/');\n\n\n });\n } else {\n vm.selectedSenders = [];\n vm.selectedTags = [];\n }\n\n }" ]
[ "0.5320105", "0.52702105", "0.5175638", "0.51134676", "0.51078737", "0.50882065", "0.5069123", "0.50587296", "0.50564486", "0.5038789", "0.5028549", "0.5018491", "0.5016163", "0.49958947", "0.49903733", "0.49903733", "0.49795118", "0.49791926", "0.49716425", "0.49691746", "0.49671715", "0.496388", "0.4962419", "0.4947858", "0.49459854", "0.49072582", "0.4898118", "0.4890717", "0.48870602", "0.4874717", "0.4869968", "0.4868472", "0.4852837", "0.4851706", "0.48483706", "0.48413795", "0.48298478", "0.48118988", "0.47927287", "0.47922182", "0.4788016", "0.47863927", "0.4783814", "0.4778905", "0.4775758", "0.4767162", "0.4766079", "0.47568145", "0.47512275", "0.47495133", "0.47459328", "0.4744836", "0.47448105", "0.47368193", "0.47344548", "0.4724505", "0.47158545", "0.47151554", "0.47068733", "0.46989658", "0.46974492", "0.46943563", "0.46893615", "0.46889442", "0.46871388", "0.46865326", "0.46825886", "0.4679663", "0.46728137", "0.4668018", "0.4666065", "0.46617174", "0.46614236", "0.46603712", "0.4658862", "0.46523654", "0.46450606", "0.46430042", "0.46410754", "0.46387476", "0.46386626", "0.46374992", "0.46307144", "0.46296927", "0.46234745", "0.46224123", "0.4621197", "0.46173003", "0.46160942", "0.4608186", "0.4607179", "0.4606242", "0.46051234", "0.4603737", "0.4597853", "0.4592815", "0.45924088", "0.4592163", "0.45920882", "0.4591153" ]
0.55660033
0
below function is for image validation
function check(file) { var filename=file.value; var ext=filename.substring(filename.lastIndexOf('.')+1); if(ext=="jpg" || ext=="png" || ext=="jpeg" || ext=="gif" || ext=="JPG" || ext=="PNG" || ext=="JPEG" || ext=="GIF") { document.getElementById("submit").disabled=false; document.getElementById("msg1").innerHTML=""; } else { document.getElementById("msg1").innerHTML="! Please upload only JPG , GIF , JPEG File"; document.getElementById("submit").disabled=true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateImg(ctrl) {\n var fileUpload = ctrl;\n var regex = new RegExp(\"([a-zA-Z0-9\\s_\\\\.\\-:])+(.jpeg|.jpg|.png|.gif)$\");\n if (regex.test(fileUpload.value.toLowerCase())) {\n if (typeof (fileUpload.files) != \"undefined\") {\n var reader = new FileReader();\n reader.readAsDataURL(fileUpload.files[0]);\n reader.onload = function (e) {\n var image = new Image();\n image.src = e.target.result;\n image.onload = function () {\n var height = this.height;\n var width = this.width;\n if (height == 680 && width == 1020) {\n // alert(\"Ảnh hợp lệ.\");\n return true;\n } else {\n fileUpload.value = null;\n alert(\"Ảnh không đúng kích thước 1020 x 680 !\");\n return false;\n }\n };\n }\n } else {\n alert(\"Trình duyệt của bạn không hỗ trợ HTML5.\");\n return false;\n }\n } else {\n alert(\"Hãy chọn đúng định dạng file ảnh.\");\n return false;\n }\n}", "function isValidImage(images, allowed) {\n\n\n\n\n}", "function validateImg(ctrl) {\n\tvar fileUpload = ctrl;\n\tvar regex = new RegExp('([a-zA-Z0-9s_\\\\.-:])+(.jpeg|.jpg|.png|.gif)$');\n\tif (regex.test(fileUpload.value.toLowerCase())) {\n\t\tif (typeof fileUpload.files != 'undefined') {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.readAsDataURL(fileUpload.files[0]);\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar image = new Image();\n\t\t\t\timage.src = e.target.result;\n\t\t\t\timage.onload = function() {\n\t\t\t\t\tvar height = this.height;\n\t\t\t\t\tvar width = this.width;\n\t\t\t\t\tif (height == 680 && width == 1020) {\n\t\t\t\t\t\t// alert(\"Ảnh hợp lệ.\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfileUpload.value = null;\n\t\t\t\t\t\talert('Ảnh không đúng kích thước 1020 x 680 !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t} else {\n\t\t\talert('Trình duyệt của bạn không hỗ trợ HTML5.');\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\talert('Hãy chọn đúng định dạng file ảnh.');\n\t\treturn false;\n\t}\n}", "function validateImg(ctrl) {\n\tvar fileUpload = ctrl;\n\tvar regex = new RegExp('([a-zA-Z0-9s_\\\\.-:])+(.jpg|.png|.gif)$');\n\tif (regex.test(fileUpload.value.toLowerCase())) {\n\t\tif (typeof fileUpload.files != 'undefined') {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.readAsDataURL(fileUpload.files[0]);\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar image = new Image();\n\t\t\t\timage.src = e.target.result;\n\t\t\t\timage.onload = function() {\n\t\t\t\t\tvar height = this.height;\n\t\t\t\t\tvar width = this.width;\n\t\t\t\t\tif (height == 680 && width == 1020) {\n\t\t\t\t\t\t// alert(\"Ảnh hợp lệ.\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfileUpload.value = '';\n\t\t\t\t\t\talert('Ảnh không đúng kích thước 1020 x 680 !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t} else {\n\t\t\talert('Trình duyệt của bạn không hỗ trợ HTML5.');\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\talert('Hãy chọn đúng định dạng file ảnh.');\n\t\treturn false;\n\t}\n}", "function check_image(file) {\n\n}", "function imageValidation(imageId, showImageId, errorDiv) {\n var image_holder = $(\"#\" + showImageId);\n if ($(\"#\" + errorDiv).parent().find(\".error\")) {\n $(\"#\" + errorDiv).parent().find(\".error\").text('');\n }\n image_holder.empty();\n if (imageId.files[0].type.startsWith(\"image/\")) {\n var reader = new FileReader();\n if (imageId.files[0].size / (validationError.playerImage.imageSizeInKB) <= (validationError.playerImage.maxLengthLimit)\n && imageId.files[0].size / (validationError.playerImage.imageSizeInKB) >= (validationError.playerImage.minLengthLimit)) {\n reader.onload = function (e) {\n $('#' + showImageId)\n .attr('src', e.target.result);\n };\n reader.readAsDataURL(imageId.files[0]);\n } else {\n $(\"#\" + errorDiv).show();\n $(\"#\" + errorDiv).text(validationError.proofPruchase.maxLengthLimitMessage);\n return false;\n }\n } else {\n $(\"#\" + errorDiv).show();\n $(\"#\" + errorDiv).text(validationError.proofPruchase.imageOnly);\n return false;\n }\n\n}", "function validateImage(src) {\r\n\tstrArr = src.split('.');\r\n\r\n\tif (strArr[strArr.length-1] == 'png' || strArr[strArr.length-1] == 'jpg' || strArr[strArr.length-1] == 'jpeg') {\r\n\t\treturn src;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function validateImageWithSize (files,height,width) \n{\n \n var image_height = height || \"\";\n var image_width = width || \"\";\n if (typeof files !== \"undefined\") \n {\n for (var i=0, l=files.length; i<l; i++) \n {\n var blnValid = false;\n var ext = files[0]['name'].substring(files[0]['name'].lastIndexOf('.') + 1);\n if(ext == \"JPEG\" || ext == \"jpeg\" || ext == \"jpg\" || ext == \"JPG\" || ext == \"png\" || ext == \"PNG\")\n {\n blnValid = true;\n }\n \n if(blnValid ==false) \n { \n\n showAlert(\"Sorry, \" + files[0]['name'] + \" is invalid, allowed extensions are: jpeg , jpg , png\",\"error\");\n $(\".fileupload-preview\").html(\"\");\n $(\".fileupload\").attr('class',\"fileupload fileupload-new\");\n $(\"#profile_image\").val('');\n \n return false;\n }\n else\n { \n var reader = new FileReader();\n reader.readAsDataURL(files[0]);\n reader.onload = function (e) \n {\n var image = new Image();\n image.src = e.target.result;\n \n image.onload = function () \n {\n var height = this.height;\n var width = this.width;\n console.log(\"current height:\"+height+\" validate height:\"+image_height );\n\n console.log(\"current width:\"+width+\" validate width:\"+image_width);\n\n if(height > image_height/* || width > image_width */)\n {\n $('#logo').val('');\n showAlert(\"Height and Width must be less than or equal to \"+image_height+\" X \"+image_width+\".\" ,\"error\");\n $(\".fileupload-preview\").html(\"\");\n $(\".fileupload\").attr('class',\"fileupload fileupload-new\");\n $(\"#image\").val('');\n return false; \n }\n else\n {\n //swal(\"Uploaded image has valid Height and Width.\");\n return true;\n }\n };\n \n }\n \n } \n \n }\n \n }\n else\n {\n showAlert(\"No support for the File API in this web browser\" ,\"error\");\n } \n}", "function isValidImage(str) {\r\n\tvar error=0;\r\n\tvar exterror=0;\r\n\tvar nameerror=0;\r\n\tvar lastcount=str.split('\\\\').length;\r\n\tvar uploadimg=str.split('\\\\')[lastcount-1];\t\t\r\n\tvar pos=uploadimg.lastIndexOf(\".\");\t\t\t\t\r\n\tvar str1=uploadimg.substring(pos);\t\t\t\t\r\n\tvar str=str1.toLowerCase();\t\t\t\t\t\t\r\n\t//Check if the Image is a valid format\r\n\tif(str==\".jpg\" || str== \".gif\" || str==\".jpeg\")\r\n\t{\r\n\t\texterror=0;\t//The image is not a .jpg or .gif\r\n\t} else {\r\n\t\texterror=1;\t\r\n\t}\r\n\t//Check if the imagename is valid\r\n\tvar imagename=uploadimg.substring(0,pos);\r\n\tif (isalphanumeric(imagename) == false) {\r\n\t\tnameerror=2;\r\n\t}\r\n\tif (exterror==0 && nameerror==0){\r\n\t\terror=0;\r\n\t} else if (exterror!=0){\r\n\t\terror = exterror;\r\n\t} else if (nameerror!=0){\r\n\t\terror = nameerror;\r\n\t}\r\n\treturn(error);\t\t\r\n}", "function isValidImage(filename) {\n if(!filename && typeof filename !== 'string') return false;\n let fileType = filename.split('.');\n fileType = fileType[fileType.length -1];\n return (fileType === \"jpg\" || fileType ===\"jpeg\" || fileType === \"png\")\n \n \n}", "function check_image() {\n var im = document.getElementById(\"image_form\").elements.namedItem(\"image_src\").value;\n\n var image = new Image();\n image.src = im;\n\n image.onload = function() {\n if (this.width > 0) {\n alert(\"IMAGE SRC OK - CLICK 'ADD IMAGE' TO SUBMIT\"); }};\n\n image.onerror = function() {\n alert(\"IMAGE SRC INCORRECT - CHECK URL AND RE-ENTER\"); }; \n}", "function imageValidation(imageThis,imageFieldId,imageDisplayClass,isImageTag){\r\n\tvar flag\t\t=\t1;\r\n\tvar errorType\t=\t\"\";\r\n\t\r\n\tvar fileImage\t=\t$(\"#\"+imageFieldId).val();\r\n\tvar extension \t= \tfileImage.substring(fileImage.lastIndexOf('.') + 1).toLowerCase();\r\n\t\r\n\tif (extension == \"gif\" || extension == \"png\" || extension == \"bmp\"\r\n || extension == \"jpeg\" || extension == \"jpg\") {\r\n\t\t\r\n\t\tvar fileSize\t=\timageThis.files[0].size;//in Byts\r\n\t\tfileSize\t\t=\t(fileSize/1024).toFixed(2);//In KB\r\n\t\tfileSize\t\t=\t(fileSize/1024).toFixed(2);//In MB\r\n\t\t\r\n\t\tif(fileSize > 1){//File check For 1 mb \r\n\t\t\tflag\t=\t0;\r\n\t\t\terrorType\t=\t\"FILE_SIZE\";\t\r\n\t\t}\r\n\t}else {\r\n\t\tflag\t\t=\t0;\r\n\t\terrorType\t=\t\"FILE_TYPE_ERROR\";\r\n\t}\r\n\t\r\n\tif(flag == 0){\r\n\t\tif($(\"#\"+imageFieldId).val() != \"\"){\r\n\t\t\tdisplayMessageBox(\"Error\", getImageFileErrorMessage(errorType));\r\n\t\t}\r\n\t\t$(\"#\"+imageFieldId).val('');\r\n\t\t\r\n\t\t$(\"#\"+imageFieldId).closest( \".fileupload\" ).fileupload('clear');\r\n\t\tvar orginalSrc = $(\"#\"+imageFieldId+\"Original\").attr('src');\r\n\t\tif(isImageTag){\r\n \t\t$('.'+imageDisplayClass).attr('src', ''+orginalSrc);\r\n \t}else {\r\n \t\t$('.'+imageDisplayClass+' img').attr('src', ''+orginalSrc);\r\n \t}\r\n\t}\r\n\t\r\n\treturn flag;\r\n}", "function checkImg(i) {\n\t\t\n\t\tvar file = $(event.target)[0].files[0];\n\t\tvar img = new Image();\n\t\tvar imgwidth = 0;\n\t\tvar imgheight = 0;\n\t\tvar error=$(event.target).next();\n\t\t\n\t\tif(typeof file!==typeof undefined){\n\t\t\timg.src = URL.createObjectURL(file);\n\t\t\timg.onload=function(){\n\t\t\t\n\t\t\timgwidth = this.width;\n\t\t\timgheight = this.height;\n\t\t\t\n\t\t\tif(imgwidth > parseInt(150) && imgheight > parseInt(150)){\n\t\t\t\terror.text(\"Inserisci un'immagine di massimo 150x150\"); \n\t\t\t\t$(\".nextBtn\"+i).prop('disabled', true);\n\t\t\t}\n\t\t\telse{\n\t\t\t\terror.text(\"\"); \n\t\t\t\t$(\".nextBtn\"+i).prop('disabled', false);\n\t\t\t}\n\t\t}\n\t\t\n\t\t} else{\n\t\t\terror.text(\"\");\n\t\t\t$(\".nextBtn\"+i).prop('disabled', false);\n\t\t\treturn true;\n\t\t}\n\t}", "function imageValidationAndPreview(imageThis,imageFieldId,imageDisplayClass,isImageTag,isImageSizeCheck,imageWidthValid,imageHeightValid){\r\n\t\r\n\tvar imageValidationFlag\t\t=\timageValidation(imageThis,imageFieldId,imageDisplayClass,isImageTag);\r\n\tif(imageValidationFlag == 1){\r\n\t\treadURL(imageThis,imageFieldId,imageDisplayClass,isImageTag,isImageSizeCheck,imageWidthValid,imageHeightValid);\r\n\t}\r\n}", "validFile(imageName){\n let lowercaseImageName = imageName.toLowerCase();\n return (\n lowercaseImageName.indexOf(\".jpg\") !== -1 ||\n lowercaseImageName.indexOf(\".jpeg\") !== -1 ||\n lowercaseImageName.indexOf(\".tiff\") !== -1 ||\n lowercaseImageName.indexOf(\".bmp\") !== -1\n )\n }", "validateImageFile(file, rules) {\n let errors = [];\n\n /**\n * Valid file size selected\n * @rule fileSize\n */\n if (rules.fileSize && file.size > rules.fileSize){\n errors.push(`File size should not be greater than ${(rules.fileSize / (1024 * 1024))} MB`);\n }\n\n /**\n * Valid selected mime type\n * @rule mime\n */\n if (rules.mime && rules.mime.indexOf(file.type.replace(/image\\//g, \"\")) === -1){\n errors.push(\"Invalid file uploaded ,Please make sure you select a file with \"+rules.mime.join(\",\"));\n }\n\n return errors;\n }", "function fnValidateImage(oInput){\n\n\tvar sPath = oInput.val();\n\n\t// checks length of the path - if zero no image is added\n\tif( sPath.length == 0 ){\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function checkImageDimensions(image){if(test)console.log(image.src+\" ; state:\"+image.complete+\":n w h:\"+image.naturalWidth+\" \"+image.naturalHeight+\";w h:\"+image.clientWidth+\" \"+image.clientHeight);if(image.clientWidth>0){if(image.clientWidth<minWidthOfImageForDisplayBottomOffersWrapper){if(test)console.log('картинка '+image.src+' не прошла проверку на размеры с шириной '+image.naturalWidth+'('+_typeof(image.naturalWidth)+') и высотой '+image.naturalHeight+'('+_typeof(image.naturalHeight)+')');return false;}else return true;}else if(image.naturalWidth<minWidthOfImageForDisplayBottomOffersWrapper){if(test)console.log(image.naturalHeight);return false;}return true;}", "function validate(event) {\n\n\n var fileInput = document.getElementById(\"image1\").files;\n if (fileInput != '')\n {\n for (var i = 0; i < fileInput.length; i++)\n {\n\n var vname = fileInput[i].name;\n var ext = vname.split('.').pop();\n var allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'PNG'];\n var foundPresent = $.inArray(ext, allowedExtensions) > -1;\n // alert(foundPresent);\n\n if (foundPresent == true)\n {\n } else {\n $(\".bus_image\").html(\"Please select only Image File.\");\n event.preventDefault();\n //return false; \n }\n }\n }\n}", "function isImageOk(img) {\n if (!img.complete) {\n return false;\n }\n return !(typeof img.naturalWidth !== 'undefined' && img.naturalWidth === 0);\n }", "function heightAndWidthValid(self, width, height) {\n var file,\n img;\n\n if((file = self.files[0])) {\n img = new Image();\n img.onload = function() {\n if(this.width < width || this.height < height) {\n errorMsg.html(\"Images size can't be less than, \"+ width+ \"*\"+ height+ \"pixels.\");\n $('#imagePreview').cropper('destroy');\n $(\"#imagePreview\").removeAttr(\"src\");\n }\n };\n img.src = _URL.createObjectURL(file);\n }\n }", "function validateFileExtension(fld)\n{\n var img = fld;\n /* var objImage = new Image();\n objImage.src = fld.value\n alert(\"width : \" + objImage.width + \" height : \" + objImage.height);*/\n var fileSize = fld.files[0].size;\n fileSize = Math.round(parseInt(fileSize)/1024)\n if(img.id=='pho' && (fileSize>100)){ \n document.getElementById(\"photo_tab\").style.display=\"block\";\n document.getElementById(\"photo_tab\").rows[1].cells[2].innerHTML = fileSize + 'kb';\n return false; \n }else if(img.id=='sign' && (widthTest>100 || heightTest>40)){\n document.getElementById(\"sign_tab\").style.display=\"block\";\n document.getElementById(\"sign_tab\").rows[1].cells[2].innerHTML = fileSize + 'kb';\n return false;\n}\n/*//or however you get a handle to the IMG\nvar widthTest = img.clientWidth;\nvar heightTest = img.clientHeight;\nif(img.id=='pho' && (widthTest>200 || heightTest >80)){\n document.getElementById(\"photo_tab\").style.display=\"block\";\n document.getElementById(\"photo_tab\").rows[1].cells[2].innerHTML = widthTest;\n document.getElementById(\"photo_tab\").rows[2].cells[2].innerHTML = heightTest;\n return false;\n}else if(img.id=='sign' && (widthTest>100 || heightTest>40)){\n document.getElementById(\"sign_tab\").style.display=\"block\";\n document.getElementById(\"sign_tab\").rows[1].cells[2].innerHTML = widthTest;\n document.getElementById(\"sign_tab\").rows[2].cells[2].innerHTML = heightTest;\n return false;\n}*/\nif(!/(\\.bmp|\\.gif|\\.jpg|\\.jpeg)$/i.test(fld.value)) {\n\t\talert(\"Invalid image file type.\");\n\t\tfld.focus();\n\t\treturn false;\n}\nreturn true;\n}", "function isImageCb (url) {\n\t validatedUrls.push(url);\n\t if (validatedUrls.length === 6) {\n\t cb(validatedUrls);\n\t }\n\t }", "function checkSize(img) {\r\n\tvar w = nearestPowerOfTwo(img.width);\r\n\tvar h = nearestPowerOfTwo(img.height);\r\n\tif (w !== img.width || h !== img.height) {\r\n var canv = document.createElement('canvas');\r\n\tcanv.width = w;\r\n canv.height = h;\r\n canv.getContext('2d').drawImage(img, 0, 0, w, h);\r\n img = canv;\r\n\tconsole.warn(\"一時的に\"+img.src+\"を2の乗数に変更。テクスチャサイズを変更して下さい\");\r\n\t}\r\n\treturn img;\r\n\t}", "function checkSubImage() {\n var img1 = document.getElementById('txtImage1').value;\n var img2 = document.getElementById('txtImage2').value;\n var img3 = document.getElementById('txtImage3').value;\n var img4 = document.getElementById('txtImage4').value;\n var isNeedAlert = false;\n if (img1.length === 0 && img2.length === 0 && img3.length === 0 && img4.length === 0) {\n return;\n } else if (img1.length === 0 && img2.length > 0) {\n isNeedAlert = true;\n } else if ((img1.length === 0 || img2.length === 0) && img3.length > 0) {\n isNeedAlert = true;\n }else if ((img1.length === 0 || img2.length === 0 || img3.length === 0) && img4.length > 0) {\n isNeedAlert = true;\n }\n //alert\n if (isNeedAlert) {\n alert('Please fill in sub image fileds in order');\n }\n}", "function validarImagen() {\r\n // Revisar si está vacío\r\n if (chequearVacio(imagen)) return;\r\n return true;\r\n}", "async function checkImageUrl() {\n await validateImageUrl(data.featuredImageUrl);\n setImageUrlValid(true);\n }", "function validar_archivo(file){\n $(\"#img_file\").attr(\"src\",\"../../img/imagenes_subidas/image.svg\");//31.gif\n //var ext = file.value.match(/\\.(.+)$/)[1];\n //Para navegadores antiguos\n if (typeof FileReader !== \"function\") {\n $(\"#img_file\").attr(\"src\",'../../img/imagenes_subidas/image.svg');\n return;\n }\n var Lector;\n var Archivos = file[0].files;\n var archivo = file;\n var archivo2 = file.val();\n if (Archivos.length > 0) {\n\n Lector = new FileReader();\n\n Lector.onloadend = function(e) {\n var origen, tipo, tamanio;\n //Envia la imagen a la pantalla\n origen = e.target; //objeto FileReader\n //Prepara la información sobre la imagen\n tipo = archivo2.substring(archivo2.lastIndexOf(\".\"));\n console.log(tipo);\n tamanio = e.total / 1024;\n console.log(tamanio);\n\n //Si el tipo de archivo es válido lo muestra, \n\n //sino muestra un mensaje \n\n if (tipo !== \".jpeg\" && tipo !== \".JPEG\" && tipo !== \".jpg\" && tipo !== \".JPG\" && tipo !== \".png\" && tipo !== \".PNG\") {\n $(\"#img_file\").attr(\"src\",'../../img/imagenes_subidas/photo.svg');\n $(\"#error_formato1\").removeClass('hidden');\n //$(\"#error_tamanio\"+n).hide();\n //$(\"#error_formato\"+n).show();\n console.log(\"error_tipo\");\n }\n else{\n $(\"#img_file\").attr(\"src\",origen.result);\n $(\"#error_formato1\").addClass('hidden');\n }\n\n\n };\n Lector.onerror = function(e) {\n console.log(e)\n }\n Lector.readAsDataURL(Archivos[0]);\n }\n}", "function verifImage(){\n var file,fileTypes;\n file=$('#boutonAvatar');\n fileTypes = ['image/jpeg','image/jpg','image/png','image/gif'];\n for (var i = 0; i < fileTypes.length; i++) {\n if(file.files[0].type == fileTypes[i]) {\n return false;\n }\n }\n return true;\n}", "function testTypeImage(fileType,type){var arrTypeImage=type.filter(function(i){return i==fileType.type.split('/')[1];//берем только вторую часть типа\n});return arrTypeImage.length;}//Size Checking Funcures", "function fnAddimage()\n{\n\t\n\tvar appImage=document.forms[0];\n\tvar imageName=trim(appImage.imgName.value);\n\tvar imageDesc=trim(appImage.imgDesc.value);\n\tappImage.imgName.value=imageName;\n\tappImage.imgDesc.value=imageDesc;\n\n\tif(imageName.length==0 || imageName.value==\"\" )\n\t{\n\t\n\t\tvar id = '798';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgName\",-1);\n \t\treturn false;\n\n\t}\t\n\tif (imageDesc.length>2000)\n\t{\n\t\tvar id = '799';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgDesc\",-1);\n\t\treturn false;\n\t\t\n\t}\n\n\n\n\t\n\n\tvar toLoadFileName=document.forms[0].imageSource.value;\n\n\ttoLoadFileName=toLoadFileName.substring(0,toLoadFileName.indexOf('_'));\n\tvar fileName=document.forms[0].imageSource.value;\n\n\t\n\t\t\n\t\t\tif (fileName==\"\" || fileName.length==0)\n\t\t\t{\n\t\t\t\t\t\t\tvar id='780';\n\t\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\tif(fileName==\"\"){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar code=fileName.split(\"\\\\\");\n\t\t\t\t\tvar temp=\"\";\n\t\t\t\t\tif (code.length > 1)\t{\n\t\t\t\t\t\tfor (j=1;j<code.length;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp=code[j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp=code[0];\n\t\t\t\t\t}\n\t\t\t\t\tif(temp!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\tvar checkParam=temp.substring(temp.indexOf('.')+1,temp.length);\n\t\t\t\t\t\n\t\t\t\t\tvar flag = false;\n\t\t\t\t\tvar arr = new Array();\n\t\t\t\t\tarr[0] = \"gif\";\n\t\t\t\t\tarr[1] = \"jpeg\";\n\t\t\t\t\tarr[2] = \"bmp\";\n\t\t\t\t\tarr[3] = \"tiff\";\n\t\t\t\t\tarr[4] = \"jpg\";\n\t\t\t\t\tarr[5] = \"tif\";\n\t\t\t\t\tarr[6] = \"pdf\";//Added for CR_97 for allowing PDF files in Appendix\n\t\t\t\t\t\n\t\t\t\t\tfor(var i = 0 ; i < arr.length; i++){\n\t\t\t\t\t\tif(trim(checkParam.toLowerCase())==arr[i]){\n\t\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!flag){\n\t\t\t\t\t\n\t\t\t\t\t\tvar id='901';\n\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\tdocument.forms[0].action=\"AppendixAction.do?method=addImage\";\n\t\t\t\t\tdocument.forms[0].submit();\n}\n}", "function isImageCb (url) {\n validatedUrls.push(url);\n if (validatedUrls.length === 6) {\n cb(validatedUrls);\n }\n }", "function isValidImage(image, callback) {\n\tvar url = getImageSource(image);\n\n\tif ( ! url) {\n\t\treturn callback(null, false);\n\t}\n\n\tgetImageSize(url, function(err, size) {\n\t\tif (err) {\n\t\t\treturn callback(err);\n\t\t}\n\n\t\tcallback(null, isValidSize(size));\n\t});\n}", "function validate(file) {\n\t\tif (file.type == \"image/png\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$(\"input#file\").replaceWith($(\"input#file\").val(\"\").clone(true));\n\t\t\treturn false;\n\t\t}\n\t}", "function validateFile() {\n\n const fileName = $('#uploadImage').val();\n const allowedExtensions = new Array('jpg', 'png');\n const fileExtension = fileName.split('.').pop().toLowerCase(); // split the filename by dot(.), and pop the last element from the array which will give you the extension as well. If there will be no extension then it will return the filename.\n\n for (let i = 0; i <= allowedExtensions.length; i++) {\n if (allowedExtensions[i] === fileExtension) {\n return true; // valid file type\n }\n }\n return false;\n}", "function validate_image (id) {\n\t/*alert('hiiii');\n if (typeof ($(\"#\"+id)[0].files) != \"undefined\") {\n var size = parseFloat($(\"#fileUpload\")[0].files[0].size / 1024).toFixed(2);\n alert(size + \" KB.\");\n } else {\n alert(\"This browser does not support HTML5.\");\n }*/\n\treturn true;\n}", "function validateField() { \n var docs = document.getElementById(\"img\");\n docs.setAttribute(\"src\", \"gif_path\");\n }", "function validation(fileName) {\r\n\tfileName = fileName + \"\";\r\n\tvar fileNameExtensionIndex = fileName.lastIndexOf('.') + 1;\r\n\tvar fileNameExtension = fileName.toLowerCase().substring(\r\n\t\t\tfileNameExtensionIndex, fileName.length);\r\n\tif (!((fileNameExtension === 'jpg') || (fileNameExtension === 'gif') || (fileNameExtension === 'png'))) {\r\n\t\talert('jpg, gif, png 확장자만 업로드 가능합니다.');\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function IsValidRecord(imageField) {\n var functionName = \"IsValidRecord\";\n try {\n if (imageField.isValid) {\n return \"<img src='TransparentImage.png' title='' />\";\n }\n else\n return \"<img src='ErrorIcon.png' title='\" + imageField.errorMsg.replace(/'/g, '') + \"'/>\";\n //return \"<img src='ErrorIcon.png'/> <div id='errorMessage'>\" + imageField.errorMsg + \"</div>\";\n } catch (e) {\n throwError(e, functionName);\n }\n}", "function getUpload() {\t\n\t// Define local variables.\n\tvar file = document.getElementById(\"fileInput\").files[0];\n\tvar hexAllowers = [\"FF D8 FF\", \"89 50 4E\", \"47 49 46\"];\n\tvar fileValidation = false;\n\t\n\tvar read = new FileReader();\n\tread.addEventListener('load', function () {\n\t\t// Check file for proper HEX signature.\n\t\tvar hex = new Uint8Array(this.result);\n\t\tvar hexSignature = (hex[0].toString(16) + \" \" + hex[1].toString(16) + \" \" + hex[2].toString(16)).toUpperCase();\n\n\t\tfor(var i = 0; i < 3; i++) {\n\t\t\tif(hexAllowers[i] == hexSignature) {\n\t\t\t\tfileValidation = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Being working with upload image.\n\t\tif(file.type.match(\"image.*\") && fileValidation == true) {\n\t\t\t// Create new image.\n\t\t\tvar img = new Image();\n\t\t\timg.onload = function() {\n\t\t\t\t// Set the minimum and maximum image dimensions.\n\t\t\t\tvar width_min = 200;\n\t\t\t\tvar height_min = 200;\n\t\t\t\t\n\t\t\t\tvar width_max = 400;\n\t\t\t\tvar height_max = 400;\n\t\t\t\t\n\t\t\t\t// Resize image to proper constraints.\n\t\t\t\tif(img.width >= width_min || img.height >= height_min) {\n\t\t\t\t\tif(img.width > width_max || img.height > height_max) {\n\t\t\t\t\t\tswitch(true) {\n\t\t\t\t\t\t\tcase (img.width > img.height):\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\timg.width = width_max;\n\t\t\t\t\t\t\t\timg.height = height_max * (img.height / img.width;);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase (img.height > img.width):\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\timg.height = height_max;\n\t\t\t\t\t\t\t\timg.width = width_max * (img.width / img.height);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase (img.width == img.height):\n\t\t\t\t\t\t\t\timg.width = width_max;\n\t\t\t\t\t\t\t\timg.height = height_max;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\timg.width = img.width;\n\t\t\t\t\t\timg.height = img.height;\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Create new canvas and draw image.\n\t\t\t\t\tvar canvas = document.createElement(\"canvas\");\n\t\t\t\t\tvar ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\n\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\tctx.drawImage(img, 0, 0, img.width, img.height);\n\t\t\t\t\t\n\t\t\t\t\t// Convert the image to black and white.\n+\t\t\t\t\t/*var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n+\t\t\t\t\tvar data = imageData.data;\n+\t\t\t\t\tfor(var i = 0; i < data.length; i += 4) {\n+\t\t\t\t\t\tdata[i + 0] = data[i + 1] = data[i + 2] = (data[i] + data[i + 1] + data[i + 2]) / 3;\n+\t\t\t\t\t}\n+\t\t\t\t\tctx.putImageData(imageData, 0, 0);\n+\n+\t\t\t\t\tvar grayImg = new Image();\n+\t\t\t\t\tgrayImg.onload = function() {\n+\t\t\t\t\t\tdocument.body.appendChild(aImg);\n+\t\t\t\t\t\tdocument.body.appendChild(grayImg);\n+\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t// Convert the canvas to Base64 and create unique file ID.\n\t\t\t\t\tvar dataURL = canvas.toDataURL(\"image/png\");\n\t\t\t\t\tvar fileName = file.name.replace(/\\.[^.]+$|\\W/g, \"\");\n\t\t\t\t\t\n\t\t\t\t\tdocument.getElementById(\"filePreview\").src = dataURL;\n\t\t\t\t\tdocument.getElementById(\"fileData\").value = dataURL;\n\t\t\t\t\tdocument.getElementById(\"fileName\").value = fileName;\n\t\t\t\t} else {\n\t\t\t\t\talert (\"Upload failed. File dimensions too small.\\nThe minimum image dimensions are 200 x 200 pixels.\")\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar url = window.URL || window.webkitURL;\n\t\t\timg.src = url.createObjectURL(file);\n\t\t} else {\n\t\t\talert(\"Upload failed. Cannot read the file.\\nThe uploaded file must be an image.\")\n\t\t}\n\t});\n\n\tread.readAsArrayBuffer(file);\n}", "function validate()\r\n{\r\n\t\r\n\tif( document.myForm.img1.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img1.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img2.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img2.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img3.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img3.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img4.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img4.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img5.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img5.focus() ;\r\n return false;\r\n }\r\n \r\n alert( \"Values entered successfully\" );\r\n}", "function fileValidation(){\n var fileInput = document.getElementById(\"file\")\n var filePath = fileInput.value;\nvar allowedExtenstions = /(\\.jpg|\\.png)$/i;\nif(!allowedExtenstions.exec(filePath)){\n alert(\"Please upload jpg or png\");\n fileInput.value ='';\n return false;\n\n}\n}", "function hasImg(input)\n{\n\treturn (input.indexOf('<img') != -1 || input.indexOf('<Img>') != -1 || input.indexOf('<IMG') != -1);\n}", "function checkFile() {\n str = document.getElementById('imgUser').value;\n if (str != \"\") {\n str = str.toUpperCase();\n str = str.split(\".\", 2);\n str = str[1];\n tipo = \"JPG\";\n tipo1 = \"JPEG\";\n tipo2 = \"PNG\";\n if ((str != tipo) && (str != tipo1) && (str != tipo2)) {\n $(\"#divImgUser\").prop(\"class\", \"form-group has-error has-feedback\");\n $(\"#LblImgUserError\").show();\n $(\"#SpImg\").show();\n $(\"#imgUser\").focus();\n $(\"#btnGuardar\").prop(\"disabled\", true);\n } else {\n $(\"#divImgUser\").prop(\"class\", \"form-group\");\n $(\"#LblImgUserError\").hide();\n $(\"#SpImg\").hide();\n $(\"#btnGuardar\").prop(\"disabled\", false);\n }\n }\n}", "function IsValidImageUrl(url, callback) {\n var img = new Image();\n img.onerror = function () {\n callback(url, false);\n };\n img.onload = function () {\n callback(url, true);\n };\n img.src = url;\n}", "function imagePreview(input) {\n if (input.files && input.files[0]) {\n const fileReader = new FileReader();\n fileReader.onload = function (e) {\n const image = input.files[0];\n const imageName = image.name;\n const imageSize = image.size;\n const imageExt = imageName.split('.').pop().toLowerCase();\n const validExt = ['jpeg' , 'jpg' , 'png'];\n const validSize = 2000000; // image size of 2 000 000 bytes = 2MB\n const imageExtIsValid = validExt.includes(imageExt); // validates to true if it is a valid image file\n const imageSizeIsValid = imageSize <= validSize; // validates to true if it is a valid image size\n let messageDiv = document.getElementById('sermon-banner-message');\n let message = '';\n\n if (!imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file less than 2MB\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else if (imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a smaller image file less than 2MB\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else if (!imageExtIsValid && imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else {\n messageDiv.style.display = 'none';\n sermonImgTagPreview.setAttribute('src', e.target.result);\n }\n\n messageDiv.innerHTML = message;\n messageDiv.style.display = 'block';\n \n }\n fileReader.readAsDataURL(input.files[0]);\n }\n}", "function fileChangeCheck(fileUp) {\n var fileName = fileUp[\"0\"].files[\"0\"].name;//獲取本地文件名稱\n var fileSize = fileUp[\"0\"].files[\"0\"].size;//獲取文件大小\n //檢查上傳文件是否超過2MB\n fileSize = fileSize / 1024;\n if (fileSize > 2048) {\n alert(\"图片不能大于2MB\");\n $(this).val(\"\");\n return false;\n } else {\n //檢查上傳文件是圖片文件\n var fileName = fileName.substring(fileName.lastIndexOf(\".\") + 1).toLowerCase();\n if (fileName != \"jpg\" && fileName != \"jpeg\" && fileName != \"png\" && fileName != \"gif\") {\n alert(\"请选择图片格式上传(jpg,png,gif,gif等)!\");\n $(this).val(\"\");\n return false;\n } else {\n return true;\n }\n }\n}", "function validateForm() {\n\t// (Can't use `typeof FileReader === \"function\"` because apparently\n\t// it comes back as \"object\" on some browsers. So just see if it's there\n\t// at all.)\n\tif (!window.FileReader) {\n\t\tconsole.log(\"The file API isn't supported on this browser yet.\");\n\t\treturn false;\n\t}\n\t\n\tconsole.log('Form submitted!');\n\tvar inpObj = document.getElementById('inputImage');\n\tif (!inpObj.value) {\n\t\tconsole.log(\"you didnt enter an image\");\n\t}\n\telse if (!inpObj.files) {\n\t\tconsole.log(\"This browser doesn't support the `files` property of file inputs.\");\n\t}\n\telse if (!inpObj.files[0]) {\n\t\tconsole.log(\"Please select a file before clicking 'Submit'\");\n\t}\n\telse {\n\t\tfile = inpObj.files[0];\n\t\tconsole.log(\"File \" + file.name + \" is \" + file.size + \" bytes in size\");\n\t\t//if larger than 5Mbytes\n\t\tif(file.size > 5120000){\n\t\t\tconsole.log(\"the file is larger than 5Mbytes(5,120,000 bytes)!\");\n\t\t}\n\t\t\n\t\tdisplayImage(inpObj);\n\t}\t\t\n\treturn false;\n}", "function validateFile(dest, cb) {\n if(dest.indexOf(\".jpg\") > -1) {\n validateJPG(dest, cb);\n }\n else if(dest.indexOf(\".png\") > -1) {\n validatePNG(dest, cb);\n }\n // no idea how to validate. So just claim it's fine.\n else { cb(false); }\n }", "function validateChequePhoto()\n{\n\tif(document.getElementById(\"chequephotoId\").value == \"\") \n\t{\n\t\t var msg = \"Please upload an image.\";\n\t\t //the cheque photo element clashes with the function so I just made it so it only makes the border red.\n\t\t document.form1.chequephotoId.style.border=\"solid 1px red\";\n\t\t return false; \n\t}\n\treturn true;\n}", "function ifImgValid(url,succ,fail){ //check if a url is a valid image. If yes, call succ, else call fail\n if(url.substring(0,7)==\"http://\"){\n http.get(url, function (res) {\n res.once('data', function (chunk) {\n res.destroy();\n if(imageType(chunk))succ();\n else fail();\n });\n }).on('error',function(){\n fail();\n })\n }\n else if(url.substring(0,8)==\"https://\"){\n https.get(url, function (res) {\n res.once('data', function (chunk) {\n res.destroy();\n if(imageType(chunk))succ();\n else fail();\n });\n }).on('error',function(){\n fail();\n })\n }\n else fail();\n}", "function validateNewPano(panoId){ \n // console.log(\"validateNewPano panoId: \", panoId)\n let pId = extractId(panoId)\n // console.log(gPanos[pId])\n const reAnyTitle = /[\\w]+/i;\n const reAnyNum = /[-\\d\\.]+/;\n const imageFileTest = reAnyTitle.test( gPanos[pId].elements.inputFile.value); \n const viewNameValid = reAnyTitle.test( gPanos[pId].elements.viewName.value);\n const viewNameTest = !gPanos[pId].elements.viewNameEnabled.checked || viewNameValid;\n const camPosX = reAnyNum.test(gPanos[pId].elements.posx.value);\n const camPosY = reAnyNum.test(gPanos[pId].elements.posy.value);\n const camPosZ = reAnyNum.test(gPanos[pId].elements.posz.value);\n const camPosNumValid = ( camPosX && camPosY && camPosZ );\n const camPosEnabled = gPanos[pId].elements.camPosEnabled.checked\n const camPosTest = !camPosEnabled || camPosNumValid;\n\n const imageFileValue = gPanos[pId].elements.inputFile.value.match(reAnyTitle)\n // console.log('imageFileValue', imageFileValue)\n const viewNameValue = gPanos[pId].elements.viewName.value.match(reAnyTitle)\n // console.log('viewNameValue', viewNameValue)\n const camPosXValue = gPanos[pId].elements.posx.value.match(reAnyNum)\n // console.log('camPosXValue', camPosXValue)\n const camPosYValue = gPanos[pId].elements.posy.value.match(reAnyNum)\n const camPosZValue = gPanos[pId].elements.posz.value.match(reAnyNum)\n const allValid = imageFileTest && viewNameTest && camPosTest\n // Create the object that contains validation data for each element\n const valObject = {\n image: {valid: imageFileTest, el: gPanos[pId].elements.inputFile}, \n name: {valid: viewNameTest, el: gPanos[pId].elements.viewName}, \n camx: {valid: camPosX || camPosTest, el: gPanos[pId].elements.posx}, \n camy: {valid: camPosY || camPosTest, el: gPanos[pId].elements.posy}, \n camz: {valid: camPosZ || camPosTest, el: gPanos[pId].elements.posz}, \n camPos: {valid: camPosTest, el: null},\n all: {valid: allValid, el: null} \n }\n // Parse the values of all the fields, if everything is valid\n if (allValid){\n // console.log('imageFileValue', imageFileValue)\n valObject.image.value = imageFileValue['input']\n if (gPanos[pId].elements.viewNameEnabled.checked){\n valObject.name.value = viewNameValue[0]\n } else {\n valObject.name.value = ''\n }\n if (gPanos[pId].elements.camPosEnabled.checked){\n valObject.camx.value = camPosXValue[0]\n valObject.camy.value = camPosYValue[0]\n valObject.camz.value = camPosZValue[0]\n } else {\n valObject.camx.value = pId\n valObject.camy.value = '0'\n valObject.camz.value = '0'\n }\n }\n return valObject\n }", "function validatePassportPhoto()\n{\n\tif(document.getElementById(\"passportphotoId\").value == \"\") \n\t{\n\t\t var msg = \"Please upload an image.\";\n\t\t //call the display error function\n\t\t displayError(document.form1.passportphotoId, msg);\n\t\t return false; \n\t}\n\treturn true;\n}", "function validateFormModification(e) {\n\n // Contrôler les fichiers images\n var files = document.getElementById(\"doc\").files;\n var rslt = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n\n if (ex != 'image/png' && ex != 'application/pdf' && ex != 'image/jpeg'\n && ex != 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n && ex != 'application/msword'\n && ex != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n && ex != 'application/vnd.ms-powerpoint'\n && ex != 'application/vnd.openxmlformats-officedocument.presentationml.presentation')\n {\n rslt = true ;\n }\n\n });\n\n if (rslt) {\n alert(\"Les documents doivent être au format : Word, PowerPoint, PDF, JPG, PNG ou Excel ! \");\n document.getElementById(\"labelDoc\").style.color = \"red\"\n document.getElementById(\"doc\").value = \"\"\n\n return false; \n }\n\nreturn ( true );\n\n\n }", "function IsValidImageUrl(url) {\r\n $(\"<img>\", {\r\n src: url,\r\n error: function () {\r\n alert(url + \": \" + false);\r\n },\r\n load: function () {\r\n alert(url + \": \" + true);\r\n }\r\n });\r\n}", "static isAllowedImageType(name) {\r\n var allowedRx = C.RECOG_RGX.IMAGE;\r\n return allowedRx.test(name);\r\n }", "function checkImgFile(file) {\n //Check File Size\n if (file.size > 0 && file.size < 1000000) {\n //Check File Name\n var extension = file.name.substr(file.name.lastIndexOf('.') + 1).toUpperCase();\n if (extension == \"PNG\" || extension == \"JPG\" || extension == \"JPEG\" || extension == \"GIF\")\n return 1;\n else\n return \"Supported File Types: PNG, JPG, GIF\";\n }\n else\n return \"Supported File Size: 1MB Maximum\";\n }", "function checkForImg(val){\n return !val ? 'https://tinyurl.com/tv-missing' : val.original\n }", "imageURLErrors() {\r\n const errors = [];\r\n if (!this.$v.imageURL.$dirty) return errors;\r\n !this.$v.imageURL.required && errors.push('Image link is required');\r\n return errors;\r\n }", "function isImageOk(img) {\n // Image was removed from the page code (issue #1)\n if (typeof img === \"undefined\") {\n return false;\n }\n // During the onload event, IE correctly identifies any images that\n // weren’t downloaded as not complete. Others should too. Gecko-based\n // browsers act like NS4 in that they report this incorrectly.\n // NOTE: This check doesn't seem to be needed - and doesn't work \n // reliably in MS Edge in my tests. So disabling for now.\n //if (!img.complete) {\n // return false;\n //}\n // However, they do have two very useful properties: naturalWidth and\n // naturalHeight. These give the true size of the image. If it failed\n // to load, either of these should be zero.\n if (typeof img.naturalWidth !== \"undefined\" && img.naturalWidth <= 1) {\n return false;\n }\n // No other way of checking: assume it’s ok.\n return true;\n}", "function ReturnIfImageError() {\n if (currentEpisode.Pages[0].Path.search(\"img_warning\") > 0)\n return true;\n else\n return false;\n \n}", "function imgError(image) {\n image.onerror = \"\";\n image.src = \"assets/noimage.png\";\n return true;\n}", "function imgFail (image) {\n image.onerror=\"\";\n image.src = \"img/shrug.png\";\n return true;\n}", "function ValidateFile(limit) {\n var wImgFile = document.getElementById('fileinput').files[0];\n\t\tif(wImgFile == null){ModifyElement(\"fl\", \"block\", \"Upload an image\"); return \"isempty\";} //if no file -> return \"isempty\";\n\t\t\n\t\tvar cRegex = new RegExp(\"(.*?)\\.(gif|jpg|jpeg|png|swf|psd|bmp|jpc|jp2|jpx|jb2|swc|iff|wbmp|xbm|ico|webp)$\");\n\t\tvar oPasscount = 0;\n\t\t\n\t\t//truncate filename for display\n\t\tvar wName = (wImgFile.name.length < 30) ? wImgFile.name : wImgFile.name.substring(0,20) + \"...\" + wImgFile.name.substring(wImgFile.name.lastIndexOf(\".\")-3,wImgFile.name.length);\n\t\t//modify label to show the selected file\n\t\tModifyElement(\"fl\", \"block\", wName);\n\t\t\n\t\tvar wSizeWarn = document.getElementById(\"sizeWarning\");\n\t\tvar wTypeWarn = document.getElementById(\"typeWarning\");\n\t\t\n\t\t//Size warning - file must be greater than 12b\n\t\tif(wImgFile.size < 12){\n\t\t\tif(typeof(wSizeWarn) != 'undefined' && wSizeWarn != null){\n\t\t\t\tModifyElement(\"sizeWarning\", \"block\", \"* File is smaller than 12b: \\[\" + wName + \"\\] is \" + wImgFile.size + \"b in size.\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"sizeWarning\",\"upload_warning\",\"* File is smaller than 12b: \\[\" + wName + \"\\] is \" + wImgFile.size + \"b in size.\");\n\t\t\t}\n\t\t}\n\t\telse { \n\t\t\tModifyElement(\"sizeWarning\", \"none\", \"no error\");\n\t\t\toPasscount += 1;\n\t\t}\n\t\t\n\t\t//Size warning - file must be less than limit if there is one\n\t\tif(limit!=null && wImgFile.size > limit){\n\t\t\toPasscount-=1; //prevents error overwriting\n\t\t\t\n\t\t\tif(typeof(wSizeWarn) != 'undefined' && wSizeWarn != null){\n\t\t\t\tModifyElement(\"sizeWarning\", \"block\", \"* File is greater than \" + Math.floor(limit/1000) + \"Kb: \\[\" + wName + \"\\] is \" + Math.ceil(wImgFile.size/1000) + \"Kb in size.\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"sizeWarning\",\"upload_warning\",\"* File is greater than \" + Math.floor(limit/1000) + \"Kb: \\[\" + wName + \"\\] is \" +Math.ceil(wImgFile.size/1000) + \"b in size.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Type warning - file must be an image\n if (!(cRegex.test(wImgFile.name.toLowerCase()))) {\n\t\t\tif(typeof(wTypeWarn) != 'undefined' && wTypeWarn != null){\n\t\t\t\tModifyElement(\"typeWarning\", \"block\", \"* File \\[\" + wName + \"\\] is not a valid image type (.jpeg, .png, .gif)\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"typeWarning\",\"upload_warning\",\"* File \\[\" + wName + \"\\] is not a valid image type (.jpeg, .png, .gif)\");\n\t\t\t}\n }\n\t\telse { \n\t\t\tModifyElement(\"typeWarning\", \"none\", \"no error\");\n\t\t\toPasscount += 1;\n\t\t}\n\n\t\treturn (oPasscount == 2);\n}", "function imageOk(img) {\n // During the onload event, IE correctly identifies any images that\n // weren't downloaded as not complete. Others should too. Gecko-based\n // browsers act like NS4 in that they report this incorrectly.\n if (!img.complete) {\n return false;\n }\n // However, they do have two very useful properties: naturalWidth and\n // naturalHeight. These give the true size of the image. If it failed\n // to load, either of these should be zero.\n if (typeof img.naturalWidth !== \"undefined\" && img.naturalWidth === 0) {\n return false;\n }\n // No other way of checking: assume it's ok.\n return true;\n }", "async function validateImages(){\n let htmlString = null;\n let htmlValue = null; // Parsed HTML\n let forEvaluation = [];\n\n // Footer Image\n // NOTE: Only checks in index.html. Pretty safe assumption that if partner updated the image, they'll\n // update it on all pages as it would be OBVIOUS if some pages have different logos.\n try {\n const htmlData = await fs.readFile(path.join(wizardPath, 'index.html'));\n htmlString = htmlData.toString();\n htmlValue = HTMLParser.parse(htmlString);\n } catch(e) {\n console.error(`Error in parsing index.html`)\n throw e;\n }\n\n const footerImgSrc = htmlValue.querySelector('#footer-logo').getAttribute('src');\n const footerImgData = await fs.readFile(path.join(wizardPath, footerImgSrc));\n forEvaluation.push(Validator.customEvaluation(() => {\n return md5(footerImgData) !== defaulImgHash.footerImg;\n },\n `Footer image has been replaced`,\n `Footer image is the default footer image`,\n `Personalize UI`\n ));\n\n // Loading Image\n const loaderImgSrc = htmlValue.querySelector('#loading-img').getAttribute('src');\n const loaderImgData = await fs.readFile(path.join(wizardPath, loaderImgSrc));\n forEvaluation.push(Validator.customEvaluation(() => {\n return md5(loaderImgData) !== defaulImgHash.loadingImg;\n },\n `\"Loading\" graphic has been replaced`,\n `\"Loading\" graphic is still the default svg`,\n `Personalize UI`\n ));\n\n await Validator.evaluateArr(Validator.CRITICAL, forEvaluation);\n}", "checkImg(el){\r\n let pathImg = el.poster_path\r\n let img = \"\"\r\n if(!pathImg){\r\n img = \"no-img.png\"\r\n }else{\r\n img = 'https://image.tmdb.org/t/p/w342/'+ pathImg\r\n }\r\n return img\r\n }", "function file_com_img(img){\n \n var files=$(img)[0].files;\n var filename= files[0].name;\n var extension=filename.substr(filename.lastIndexOf('.')+1);\n var allowed=[\"jpg\",\"png\",\"jpeg\"];\n \n if(allowed.lastIndexOf(extension)===-1){\n $.alert({\n title:'Error on file type!',\n content:'The file type selected is not of jpg , jpeg or png. Please select a valid image/photo',\n type:'red',\n typeAnimated:true,\n buttons:{\n ok:{\n text:'Ok',\n btnClass:'btn-red',\n action:function()\n {\n img.value=\"\";\n $('#label-span').html('Select photo/image');\n\t\t\t\t\t\t/*\n $('#upload_image_view').attr({src:\"assets/img/default-icon-1024.png\"}).show();\n $('#hidden_pre_div').hide();*/\n }\n }\n }\n });\n }else{\n if(img.files && img.files[0])\n {\n var filereader = new FileReader();\n filereader.onload=function(evt)\n {\n //Hide the default image/photo\n //$('#upload_image_view').hide();\n //Show the image selected and add an img element to the div element\n //$('#hidden_pre_div').show().html('<img src=\"'+evt.target.result+'\" width=\"200\" height=\"200\" />');\n //set label text\n $('#label-span').html(''+filename);\n\t\t\t \n };\n filereader.readAsDataURL(img.files[0]);\n }\n }\n}", "function addImageValidation(req, res, next) {\n log.info(\"Add Image Validation Starts\");\n if(req.user.roles[0] === \"reviewer\" || req.user.roles[0] === \"admin\") {\n log.error(\"Image Upload Failed - Error: Unauthorized user\");\n res.status(200).send({'error': 'Unauthorized user'});\n } else {\n db.productDetail.findOne({productID: req.query.productId}, function(err, product) {\n if(err || !product) {\n next();\n } else if(product) {\n var userId = req.user._id.toString();\n if(userId !== product.supplier.toString() && userId !== product.designer.toString() && userId !== product.reviewer.toString()) {\n log.error(\"Add Image Failed - Error: Unauthorized user\");\n res.status(200).send({'error': 'Not authorized to update this product'});\n } else if(product.status === statusMapper.approved) {\n log.error(\"Add Image Failed - Error: Product is approved already\");\n res.status(200).send({'error': 'Approved product cannot be updated'});\n } else {\n next();\n }\n }\n });\n }\n log.info(\"Add Image Validation Ends\");\n}", "function badImg(url) {\n // Insert placeholder image\n $('#newPinImg').attr('src', '../public/img/badImg.jpg');\n // Notify the user\n errorMsg(`No image found at '${url}'`);\n $('#newPinUrl').removeClass('valid').addClass('invalid');\n // Prevent user from saving a bad image URL\n lastUrl = false;\n}", "imageAdded(){\n if (!this.state.valid_image){\n alert(\"Please add a picture.\");\n return false;\n }\n return true;\n }", "function isImage($field) {\n return !_.isEmpty($field) && $field.prop(\"type\") === \"file\" && $field.hasClass(\"coral-FileUpload-input\");\n }", "function formValidator() {\n var imgRule = {extension: \"png|jpg\"};\n var imgErrorMsg = \"Invalid img, only png & jpg accepted\";\n $(\"#storyForm\").validate({\n debug: true,\n rules: {\n title: {required: true, minlength: 10},\n city: {required: true, minlength: 3},\n dateFrom: \"required\",\n dateTo: \"required\",\n countryList: \"required\",\n fieldsList: \"required\",\n storyInShort: \"required\",\n aboutOpportunity: \"required\",\n aboutInstitution : \"required\",\n providerOrg: {minlength: 5},\n \"img-1\": imgRule,\n \"img-2\": imgRule,\n \"img-3\": imgRule\n },\n messages: {\n title: {\n minlength: \"Please entar a valid title with at least 10 charater\"\n },\n city: {\n minlength: \"Please entar a valid city name with at least 3 charater\"\n },\n providerOrg: {\n minlength: \"Please entar a valid city name with at least 3 charater\"\n },\n \"img-1\": imgErrorMsg,\n \"img-2\": imgErrorMsg,\n \"img-3\": imgErrorMsg\n }\n });\n}", "function imgTag_check(element , start){\n var imgStart = element.value.indexOf(\"<img\",start); // img: <img src=... >\n if (imgStart > -1 ){\n var end = element.value.indexOf(\">\",imgStart);\n if (end == -1 ){\n return;\n }\n var imgData = element.value.substring(imgStart, end+1); // <img src=... >\n if(imgData.indexOf(\"alt\") == -1){\n imgData = \"<img alt=\\\"\\\" \" + imgData.substring(4);\n element.value = element.value.substring(0,imgStart) + imgData + element.value.substring(end+1);\n }\n imgTag_check(element, end);\n }\n}", "validate() {\n\t\tif ( this.foreground.width != this.background.width ||\n\t\t this.foreground.height != this.foreground.width ) {\n\t\t\t\tthrow \"KameraError: Vordergrund und Hintergrund sind nicht gleich groß\";\n\t\t} else\n\t\t\treturn true\n\t}", "isImageUrlValid(url) {\n var http = new XMLHttpRequest();\n http.open('HEAD', url, false);\n http.send();\n //302 is the code from unspash.com specifically for valid image URLs\n if (http.status != 0) {\n return true;\n }\n return false;\n }", "function readURL(input,imageFieldId,displayFieldClassName,isImageTag,isImageSizeCheck,imageWidthValid,imageHeightValid) {\r\n\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n\r\n var flag\t=\t0;\r\n reader.onload = function (e) {\r\n \t\t//Initiate the JavaScript Image object.\r\n \t\tvar image = new Image();\r\n \t\t//Set the Base64 string return from FileReader as source.\r\n \t\timage.src = e.target.result;\r\n \t\t//Validate the File Height and Width.\r\n \t\timage.onload = function () {\r\n \t\t\tvar height = this.height;\r\n \t\t\tvar width = this.width;\r\n \t\t\tif(isImageSizeCheck){\r\n \t\t\tif (height != imageHeightValid) {\r\n \t\t\t\tflag\t=\t1;\r\n \t\t\t\t$(\"#\"+imageFieldId).val('');\r\n \t\t\t\t$(\"#\"+imageFieldId).closest( \".fileupload\" ).fileupload('clear');\r\n \t\t\t\tdisplayMessageBox(\"Error\", getImageFileErrorMessageDimension(\"FILE_SIZE_HEIGHT\",imageWidthValid,imageHeightValid));\r\n \t\t\t\treturn false;\r\n \t\t\t}else if(width != imageWidthValid){\r\n \t\t\t\tflag\t=\t1;\r\n \t\t\t\t$(\"#\"+imageFieldId).val('');\r\n \t\t\t\t$(\"#\"+imageFieldId).closest( \".fileupload\" ).fileupload('clear');\r\n \t\t\t\tdisplayMessageBox(\"Error\", getImageFileErrorMessageDimension(\"FILE_SIZE_WIDTH\",imageWidthValid,imageHeightValid));\r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t\t}\r\n\t\t\t\tif(height >= width){\r\n \t\t\tif(isImageTag){\r\n \t\t$('.'+displayFieldClassName).css({'max-height':'100%'});\r\n \t\t$('.'+displayFieldClassName).css({'width':'auto'});\r\n \t}else {\r\n \t\t$('.'+displayFieldClassName+' img').css({'max-height':'100%'});\r\n \t\t$('.'+displayFieldClassName+' img').css({'width':'auto'});\r\n \t}\r\n \t\t}else {\r\n \t\t\tif(isImageTag){\r\n \t\t$('.'+displayFieldClassName).css({'max-width':'100%'});\r\n \t\t$('.'+displayFieldClassName).css({'height':'auto'});\r\n \t}else {\r\n \t\t$('.'+displayFieldClassName+' img').css({'max-width':'100%'});\r\n \t\t$('.'+displayFieldClassName+' img').css({'height':'auto'});\r\n \t}\r\n \t\t}\r\n \t\t\t\t\r\n\t \tif(isImageTag){\r\n\t \t\t$('.'+displayFieldClassName).attr('src', e.target.result);\r\n\t \t}else {\r\n\t \t\t$('.'+displayFieldClassName+' img').attr('src', e.target.result);\r\n\t \t}\r\n \t\t};\r\n };\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function validate_uploadfile_format(fileName,filterType)\n {\n \n var allowed_extensions1 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\");\n var allowed_extensions2 = new Array(\"pdf\",\"doc\",\"docs\");\n var allowed_extensions12 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\",\"pdf\",\"doc\",\"docx\");\n \n var file_extension = fileName.split('.').pop(); // split function will split the filename by dot(.), and pop function will pop the last element from the array which will give you the extension as well. If there will be no extension then it will return the filename.\n\n if(filterType == 'image'){\n for(var i = 0; i <= allowed_extensions1.length; i++)\n {\n if(allowed_extensions1[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n if(filterType == 'docs'){\n for(var i = 0; i <= allowed_extensions2.length; i++)\n {\n if(allowed_extensions2[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n if(filterType == 'imgdocs'){\n for(var i = 0; i <= allowed_extensions12.length; i++)\n {\n if(allowed_extensions12[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n \n \n return 'false';\n }", "function checkInput()\n {\n var child = pasteCatcher.childNodes[0];\n pasteCatcher.innerHTML = \"\";\n\n if (child) {\n // If the user pastes an image, the src attribute\n // will represent the image as a base64 encoded string.\n if (child.tagName === \"IMG\") {\n createImage(child.src);\n }\n }\n }", "function CheckFile(file)\n{\n var msg;\n var error=0;\n var maxSize=1024*1024*5;\n if(file.files[0].size>maxSize)\n error=error+1;\n var filesExt = ['jpg', 'gif', 'png','jpeg'];\n var parts = $(file).val().split('.');\n if(filesExt.join().search(parts[parts.length - 1]) == -1){\n error=error+2;\n }\n if(error!=0){\n switch (error) {\n case 1:\n msg='Файл перевищує 5 Мб';\n break;\n case 2:\n msg='Неправильний формат файлу';\n break;\n case 3:\n msg='Файл перевищує 5 Мб. Неправильний формат файлу';\n break;\n }\n $('#errorMessage').text(msg);\n $('#errorMessage').show();\n $('#imgButton').attr('disabled','true');\n }else{\n $('#errorMessage').hide();\n $('#imgButton').removeAttr('disabled');\n }\n}", "isImage(file) {\n return (\n Utility.isObject(file)\n && typeof file.hasOwnProperty(\"type\")\n && [\"image/png\", \"image/gif\", \"image/bmp\", \"image/jpg\", \"image/jpeg\"].indexOf(file.type) > -1\n );\n }", "function checkUploadedImage(fileInput) {\n let uploadImgErrMsg = document.getElementById('uploadImgErrMsg');\n let image = fileInput.files;\n /// check if really choosed something\n if (image.length > 0) {\n let url = 'Controllers/multipleController.php';\n let objectToSend = {imageType: image[0].type, imageSize: image[0].size, checkImage: null};\n $.post(url, objectToSend, function (response) {\n let uploadImgErrMsg = document.getElementById('uploadImgErrMsg');\n if ((response === 'ok')) {\n letSaveImage = true;\n uploadImgErrMsg.innerHTML = \"\";\n uploadImgErrMsg.style.display = \"none\";\n /// open file reader to display image\n var reader = new FileReader();\n reader.onload = function (e) {\n document.getElementById('imageDisplayer').src = e.target.result;\n }\n reader.readAsDataURL(fileInput.files[0]);\n } else {\n letSaveImage = false;\n uploadImgErrMsg.innerHTML = response;\n uploadImgErrMsg.style.display = \"block\";\n }\n });\n /// in case chanded is mind and chose to not upload......\n } else {\n letSaveImage = null;\n uploadImgErrMsg.innerHTML = \"\";\n uploadImgErrMsg.style.display = \"none\";\n }\n}", "function verifyImageType(cb) {\n var imageType = composeImageType(0)\n\n if (cb) {\n verifyImageTypeAsync(imageType, cb)\n } else {\n return verifyImageTypeSync(imageType)\n }\n }", "function imagePreview(input) {\n if (input.files && input.files[0]) {\n let fileReader = new FileReader();\n fileReader.onload = function (e) {\n // console.log(e);\n const image = input.files[0];\n const imageName = image.name;\n const imageSize = image.size;\n const imageExt = imageName.split('.').pop().toLowerCase();\n const validExt = ['jpeg' , 'jpg' , 'png'];\n const validSize = 2000000; // image size of 2 000 000 bytes = 2MB\n const imageExtIsValid = validExt.includes(imageExt); // validates to true if it is a valid image file\n const imageSizeIsValid = imageSize <= validSize; // validates to true if it is a valid image size\n let messageDiv = document.getElementById('blog-banner-message');\n let message = '';\n\n if (!imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file less than 2MB\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else if (imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a smaller image file less than 2MB\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else if (!imageExtIsValid && imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else {\n messageDiv.style.display = 'none';\n blogImgTagPreview.setAttribute('src', e.target.result);\n }\n\n messageDiv.innerHTML = message;\n messageDiv.style.display = 'block';\n }\n fileReader.readAsDataURL(input.files[0]);\n }\n}", "function imgError(image) {\n image.onerror = \"\";\n image.src = \"images/no-image.png\";\n return true;\n}", "function imageCheck() {\n var result = document.getElementById('imageurl').value;\n if (result) {\n document.getElementById('addImage').disabled = false;\n }\n else {\n document.getElementById('addImage').disabled = true;\n }\n}", "canImageDiff() {\n return false;\n }", "function handleMissingImage(img) {\n $(img).unbind('error').css({ 'display': 'none' });\n}", "image(input) {\n return new Promise((valid, invalid) => {\n if (\n input.getAttribute('type') === 'file'\n && input.getAttribute('accept').indexOf('image') > -1\n && _bn_getFile(input) !== false\n ) {\n __WEBPACK_IMPORTED_MODULE_0__file_file__[\"a\" /* BunnyFile */].getSignature(_bn_getFile(input)).then(signature => {\n if (__WEBPACK_IMPORTED_MODULE_0__file_file__[\"a\" /* BunnyFile */].isJpeg(signature) || __WEBPACK_IMPORTED_MODULE_0__file_file__[\"a\" /* BunnyFile */].isPng(signature)) {\n valid();\n } else {\n invalid({signature});\n }\n }).catch(e => {\n invalid(e);\n });\n } else {\n valid();\n }\n });\n }", "function readURLU(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var textoImagem = e.target.result;\r\n if(textoImagem.includes(\"data:image/gif\") || textoImagem.includes(\"data:image/png\") || textoImagem.includes(\"data:image/jpeg\")){\r\n $('#imgU-profile').attr('src', e.target.result);\r\n document.getElementById(\"input-imgU-profile\").className=\"custom-file-input form-control is-valid\";\r\n imagemU=true;\r\n }\r\n else{\r\n document.getElementById(\"input-imgU-profile\").className=\"custom-file-input form-control is-invalid\";\r\n }\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function imgError(image) {\n image.onerror = \"\";\n image.src = \"http://liftbazaar.ir/no-image.jpg\";\n return true;\n}", "function fileUploaderValidationImgOnly(fileUploader, maxSizeInBytes) {\n var id_value = document.getElementById(fileUploader.id).value;\n if (id_value != '') {\n var valid_extensions = /(.jpg|.jpeg|.gif|.png|.bmp)$/i;\n if (valid_extensions.test(id_value)) {\n if (document.getElementById(fileUploader.id).files[0].size > parseInt(maxSizeInBytes)) {\n document.getElementById(fileUploader.id).value = \"\";\n alert('File size should not be greater than ' + parseInt(maxSizeInBytes / 1024).toString() + 'KB');\n }\n }\n else {\n document.getElementById(fileUploader.id).value = \"\";\n alert('Invalid File');\n }\n }\n}", "function fileValidation(allowedFiles, element)\n{\n\t\t//https://developer.mozilla.org/en-US/docs/Web/API/FileList\n\t\t//http://stackoverflow.com/questions/10703102/jquery-get-all-filenames-inside-input-file?lq=1\n\t\tvar files=$(element).prop(\"files\");\n\t\t// loop trough files\n\t\tfor (var i = 0; i < files.length; i++) \n\t\t{\n\t\t\n\t\t\t// get item\n\t\t\tfile = files[i];\n\t\t\n\t\t\tvar value=file.name; //value of file field \"this.is_file.jpg\"\n\t\t\tvar lastIndex=value.lastIndexOf('.')+1; //get last index of \".\" from value = 12\n\t\t\tvar ext=value.substr(lastIndex).toLowerCase(); //extension = get string from that lastIndex+1 = 13-15 (jpg)\n\t\t\n\t\t\tif(jQuery.inArray(ext, allowedFiles)==-1) \n\t\t\t{\n\t\t\t\t$(element).val(null); //clear default(real) input field\n\t\t\t\t$(element).filestyle('clear');// if you are using bootstrap-filestyle.js, clear bootstrap input text\n\t\t\t\talert(\"You have selected invalid file type. Choose another file type.\");\n\t\t\t}\n\t\t\t//if user wants to upload more than 10 images\n\t\t\tif(i>9)\n\t\t\t{\n\t\t\t\t$(element).val(null); //clear default(real) input field\n\t\t\t\t$(element).filestyle('clear');// if you are using bootstrap-filestyle.js, clear bootstrap input text\n\t\t\t\talert(\"You can upload maximum 10 images\");\n\t\t\t}\n\t\t}\n}", "function _checkPreview() {\n if (vm.user.fileInput.length == 0) {\n vm.user.imageUrl = defaultImageUrl\n vm.useFile = false\n return vm.imagePreview = defaultImageUrl\n }\n let reader = new FileReader()\n reader.onload = function (event) {\n $scope.$apply(function () {\n vm.imagePreview = event.target.result\n vm.useFile = true\n })\n }\n reader.readAsDataURL(vm.user.fileInput[0])\n }", "function GenCheckImage( width, height, checkSize )\n{\n var x,\n y;\n var pixels = new Uint8Array( width * height * 3 );\n\n for ( y = 0; y < height; y++ )\n for ( x = 0; x < width; x++ )\n {\n var rColor = 0;\n var bColor = 0;\n\n if ( ( x / checkSize ) % 2 == 0 )\n {\n rColor = 255 * ( ( y / checkSize ) % 2 );\n bColor = 255 * ( 1 - ( ( y / checkSize ) % 2 ) );\n }\n else\n {\n bColor = 255 * ( ( y / checkSize ) % 2 );\n rColor = 255 * ( 1 - ( ( y / checkSize ) % 2 ) );\n }\n\n pixels[(y * height + x) * 3] = rColor;\n pixels[(y * height + x) * 3 + 1] = 0;\n pixels[(y * height + x) * 3 + 2] = bColor;\n }\n\n return pixels;\n}", "function checkDim(file) {\r\n\tvar reader = new FileReader();\r\n var image = new Image();\r\n\r\n reader.readAsDataURL(file); \r\n reader.onload = function(_file) {\r\n image.src = _file.target.result; // url.createObjectURL(file);\r\n image.onload = function() {\r\n var w = this.width;\r\n var h = this.height;\r\n $(\"#width\").html(w);\r\n $(\"#height\").html(h);\r\n };\r\n };\r\n image.onerror = function() {\r\n alert('Invalid file type: '+ file.type);\r\n }; \r\n}", "function fileValidation() {\r\n\tvar fileInput = document.getElementById('file1');\r\n\tvar filePath = fileInput.value;\r\n\tvar allowedExtensions = /(\\.png|\\.jpg|\\.jpeg)$/i;\r\n\tif (!allowedExtensions.exec(filePath)) {\r\n\t\talert('Please upload file having extensions .png /.jpg /.jpeg only.');\r\n\t\tfileInput.value = '';\r\n\t\treturn false;\r\n\t} else {\r\n\t\t//alert(' Great job');\r\n\t}\r\n}", "function checkExpireImg() {\n return listBase64.length < 10;\n}", "function readURL(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var textoImagem = e.target.result;\r\n if(textoImagem.includes(\"data:image/gif\") || textoImagem.includes(\"data:image/png\") || textoImagem.includes(\"data:image/jpeg\")){\r\n $('#imgP-profile').attr('src', e.target.result);\r\n document.getElementById(\"input-imgP-profile\").className=\"custom-file-input form-control is-valid\";\r\n imagemP=true;\r\n }\r\n else{\r\n document.getElementById(\"input-imgP-profile\").className=\"custom-file-input form-control is-invalid\";\r\n }\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function petEditValidator(){\r\n //Verificando se todos os campos estao preenchidos\r\n\tif($('#animalImage').attr('src') === './src/images/animals/white.jpg'){\r\n\t\talert(\"Campo imagem não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalName').val() == ''){\r\n\t\talert(\"Campo nome não está preenchido.\");\r\n\t\treturn false;\r\n }\r\n if($('#animalId').val() == ''){\r\n\t\talert(\"Campo Id não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalBreed').val() == ''){\r\n\t\talert(\"Campo raça não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalAge').val() == ''){\r\n\t\talert(\"Campo idade não está preenchido.\");\r\n\t\treturn false;\r\n }\r\n return true;\r\n}", "imageUpload (e) {\n let imgData = e.target.files[0];\n let imageExt = imgData ? imgData.type : '';\n let imageSize = imgData ? imgData.size : '';\n\n const reader = new FileReader();\n\n if(imgData){\n reader.onload = (() => {\n return e => {\n const previewSrc = e.target.result;\n console.log(previewSrc);\n this.props.dispatch(setUserDataImage({imageVal: previewSrc}));\n }\n })(imgData);\n reader.readAsDataURL(imgData);\n this.props.dispatch(setUserDataImageAsObject(imgData));\n }\n\n let dispatchObj = {\n imgData,\n status: null,\n imageValid: true,\n show: false\n }\n\n if(!imgData){\n dispatchObj.imgData = '';\n dispatchObj.imageValid = false;\n } else if(!(this.allowedExts.includes(imageExt)) || !(imageSize>MIN_SIZE || imageSize<MAX_SIZE)){\n dispatchObj.status = \"error\";\n dispatchObj.imageValid = false;\n dispatchObj.show = true\n }\n\n \n\n return this.props.dispatch(validateImage(dispatchObj));\n }" ]
[ "0.81135786", "0.79945785", "0.79666895", "0.7904438", "0.75314087", "0.7440538", "0.7417404", "0.7410234", "0.7363304", "0.7164638", "0.7158257", "0.7127481", "0.70516634", "0.700713", "0.6968656", "0.69049245", "0.68455446", "0.6762769", "0.67513007", "0.67327356", "0.6680844", "0.6646219", "0.66360396", "0.66160876", "0.659103", "0.6544708", "0.6493014", "0.64880836", "0.6472391", "0.64703196", "0.6451361", "0.64248395", "0.6419636", "0.64144534", "0.6405952", "0.6404113", "0.64024633", "0.6398357", "0.6380909", "0.6370446", "0.63400805", "0.62814033", "0.6274361", "0.6256547", "0.62485296", "0.6242476", "0.6236467", "0.6232936", "0.6208483", "0.62069654", "0.62021977", "0.6193058", "0.61917895", "0.6169256", "0.6166512", "0.6166454", "0.6162377", "0.61589414", "0.6144756", "0.6141035", "0.6134366", "0.6122377", "0.6117999", "0.6109143", "0.61026394", "0.6098103", "0.60902476", "0.6088944", "0.6086322", "0.60812235", "0.6080951", "0.6080125", "0.60775554", "0.6070713", "0.60562414", "0.6053857", "0.60508764", "0.6047433", "0.6039011", "0.6037038", "0.60293084", "0.60266393", "0.6024976", "0.6014877", "0.6000263", "0.59934515", "0.59874254", "0.59722173", "0.5967953", "0.5965585", "0.5964819", "0.5960572", "0.59523684", "0.59488904", "0.59340966", "0.5926916", "0.592257", "0.5912731", "0.59115803", "0.5909763", "0.5903102" ]
0.0
-1
Below Function is or PDF file Validation
function check1(file) { var filename=file.value; var ext=filename.substring(filename.lastIndexOf('.')+1); if(ext=="pdf") { document.getElementById("submit").disabled=false; document.getElementById("msg1").innerHTML=""; } else { document.getElementById("msg1").innerHTML="! Please upload only Pdf File"; document.getElementById("submit").disabled=true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validatePDF() {\n if (this.hasExistingPDF()) {\n this.requiredPDF.check()\n return true\n } else if (this.primary_pdf_upload.hasFiles && this.onlyOnePdfAllowed() && this.isAPdf()) {\n this.requiredPDF.check()\n return true\n } else {\n this.requiredPDF.uncheck()\n return false\n }\n }", "function validarExt(){\r\n var pdffFile = document.getElementById('pdffFile');\r\n var archivoRuta = pdffFile.value;\r\n var extPermitidas = /(.pdf)$/i;\r\n\r\nif(!extPermitidas.exec(archivoRuta)){\r\n alert('Asegurate de haber selecconado un PDF');\r\n pdffFile.value='';\r\n return false;\r\n}\r\n\r\nelse{\r\n if(pdffFile.files && pdffFile.files[0]){\r\n var visor = new FileReader();\r\n visor.onload=function(e){\r\n //document.getElementById('visorArchivo').innerHTML= \r\n //'<embed src=\"'+e.target.result+'\" >';\r\n }\r\n visor.readAsDataURL(pdffFile.files[0]);\r\n }\r\n}\r\n}", "function checkPdf(pdf) {\n\tconsole.log(\"checkPdf()\");\n\tvar pdfType = pdf.type;\n\tvar pdfSize = pdf.size;\n\tconsole.log(pdfSize + pdfType)\n\tvar error = \"\";\n\tvar uploadOk = true;\n\t// Extension check\n\tif (pdfType != \"application/pdf\") {\n\t\tuploadOk = false;\n\t\terror = error + \"Il file selezionato non è un pdf.<br>\";\n\t}\n\t// Size check\n\tif (pdfSize > 2000000) {\n\t\tuploadOk = false;\n\t\terror = error + \"Il file selezionato è troppo pesante. Il limite supportato è di 2 MB.<br>\" + '\\n';\n\t}\n\t// Error?\n\tif (!uploadOk) {\n\t\terror = error + \"Il caricamento non è andato a buon fine!\";\n\t\t$(\"#alert-corsi-pdf\").append('<div class=\"alert alert-danger alert-dismissable fade in\">' + \n\t\t\t'<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>' + error +\n\t\t\t'</div>');\n\t}\n\treturn uploadOk;\n}", "isAPdf(){\n if( $('#fileupload p.name span').text().includes('.pdf')){\n $(\"#pdf-format-error\").addClass('hidden')\n return true\n } else {\n $(\"#pdf-format-error\").removeClass('hidden')\n $('#fileupload tbody.files').empty()\n return false\n }\n }", "function validate_pdf_upload(file_type) {\n\n // var file_name = file_name.value;\n\n if (file_type == 'doc') {\n\n var input_files = document.getElementById('post_pdf_upload');\n\n var files = input_files.files;\n\n var file;\n\n // var feedback = document.getElementById('pdf_feedback');\n $('#pdf_feedback').html('');\n $('#submit_post').removeAttr('disabled');\n\n var extensions = new Array(\"pdf\", \"xls\", \"xlsx\");\n\n for (let i = 0; i < files.length; i++) {\n\n var file = files[i];\n\n var file_name = file.name;\n\n var file_extension = file_name.split('.').pop();\n\n var file_extension = file_extension.toLowerCase();\n\n if (extensions.includes(file_extension)) {\n $('#pdf_feedback').html($('#pdf_feedback').html() + file_name + '<br/>');\n } else {\n $('#pdf_feedback').html('*only pdf and xls spreadsheets allowed. Please select a different file<br/>');\n $('#submit_post').prop('disabled', true);\n return false;\n }\n\n }\n\n }\n\n if (file_type == 'img') {\n\n var input_files = document.getElementById('post_img_upload');\n\n var files = input_files.files;\n\n var file;\n\n // var feedback = document.getElementById('pdf_feedback');\n $('#img_feedback').html('');\n\n $('#submit_post').removeAttr('disabled');\n\n var extensions = new Array(\"jpeg\", \"jpg\", \"png\");\n\n for (let i = 0; i < files.length; i++) {\n\n var file = files[i];\n\n var file_name = file.name;\n\n var file_extension = file_name.split('.').pop();\n\n var file_extension = file_extension.toLowerCase();\n\n if (extensions.includes(file_extension)) {\n $('#img_feedback').html($('#img_feedback').html() + file_name + '<br/>');\n } else {\n $('#img_feedback').html('*only .jpeg, .jpg & .png extensions allowed . Please select a different image<br/>');\n $('#submit_post').prop('disabled', true);\n\n return false;\n }\n\n }\n }\n\n\n}", "function checkFileType(e)\n{\n\t\n\tuploadPdfFlag = 0;\n\tif ( $(\"input[name= printableCheckbox]\")\n\t\t\t.is(\":checked\") ) \n\t{\n\t\t\n\t\t var el = e.target ? e.target : e.srcElement ;\n\t\t \n\t\t var regex = /pdf|jpg|jpeg|JPG|JPEG/ ;\n\t\t\n\t\t if( regex.test(el.value) )\n\t\t {\n\t\t\t invalidForm[el.name] = false ;\n\t\t\t \t\t \n\t\t\t $(el).parent(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='success help-inline'>Valid file</span>\"));\n\t\t\t \n\t\t } else {\n\t\t\t\n\t\t\t $(el).parents(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='error help-inline'>Please upload only jpg or pdf file</span>\"));\n\t\t\t \n\t\t\t invalidForm[el.name] = true ;\n\t\t\t errorBy = el.name ;\n\t\t\t \n\t\t\t \n\t\t }\n\t \n\t \n\t} else {\n\t\tinvalidForm = {} ;\n\t}\n\n\t \n\t \n}", "function isValidFile(file) { \n\n //document.getElementById('results-section').style.display = 'block';\n\n //if (!window.FileReader) {\n // bodyAppend(\"The file API isn't supported on this browser yet.\");\n // return;\n //}\n\n //if (!input) {\n // bodyAppend(\"Um, couldn't find the fileinput element.\");\n //}\n //else if (!input.files) {\n // bodyAppend(\"This browser doesn't seem to support the `files` property of file inputs.\");\n //}\n //else if (!input.files[0]) {\n // bodyAppend(\"Please select a file before clicking 'Load'\");\n //}\n /*else*/ {\n //var file = input.files[0];\n var sizeInMB = (file.size / (1024 * 1024)).toFixed(2);\n\n if (sizeInMB > 1) { \n bodyAppend(\"File \" + file.name + \" is \" + file.size + \" bytes in size (\" + sizeInMB + \" megabytes in size)\" + \"- File isn't valid\");\n return false;\n } \n \n var filename = file.name;\n var parts = filename.split('.');\n var extension = parts[parts.length - 1];\n\n if (extension === \"csv\" || extension === \"xml\") {\n bodyAppend(\"File \" + file.name + \" is \" + file.size + \" bytes in size (\" + sizeInMB + \" megabytes in size) \" + \"with format \" + extension + \" - File is valid\");\n return true;\n }\n else {\n bodyAppend(\"File \" + file.name + \" is \" + file.size + \" bytes in size (\" + sizeInMB + \" megabytes in size)\" + \"with format \" + extension + \"- File isn't valid\");\n return false;\n }\n } \n}", "function checkResume() {\n\tvar x = document.getElementById('resume').value;\n\tvar sub = x.substring(x.length-3);\n\tvar validate;\n\t\n\tif(sub == \"doc\" || sub == \"ocx\" || sub == \"pdf\"){\n\t\tvalidate = true\n\t}\n\tif(sub == 0 || sub == \"\") {\n\t\tdocument.getElementById('div_4').className='error'\n\t\tdocument.getElementById('errPosition3').innerHTML='Invalid file type. Must be .doc , .docx or .pdf ';\n\t\tvalidate = false;\n\t}\n\treturn validate;\n}", "function isAllowedFileExtensionPDF(filename) {\n\t//cut out the path portion\n\twhile (filename.indexOf(\"/\", 0) > 0)\n\t\tfilename = filename.substr(filename.indexOf(\"/\", 0) + 1, filename.length - filename.indexOf(\"/\", 0))\n\twhile (filename.indexOf(\"\\\\\", 0) > 0)\n\t\tfilename = filename.substr(filename.indexOf(\"\\\\\", 0) + 1, filename.length - filename.indexOf(\"\\\\\", 0))\n\n\tvar lastPeriod, i, fileExtension;\n\tlastPeriod = filename.indexOf(\".\", 0);\n\ti = lastPeriod;\n\twhile (lastPeriod > 0) {\n\t\ti = lastPeriod;\n\t\tlastPeriod = filename.indexOf(\".\", i + 1);\n\t}\n\n\tif (i > 0)\n\t\tfileExtension = filename.substr(i + 1, filename.length - i).toUpperCase();\n\telse\n\t\tfileExtension = \"\";\n\n\tswitch (fileExtension) {\n\t\tcase \"GIF\":\n\t\tcase \"JPG\":\n\t\tcase \"JPEG\":\n\t\tcase \"PNG\":\n\t\tcase \"HTM\":\n\t\tcase \"HTML\":\n\t\tcase \"DOC\":\n\t\tcase \"DOCX\":\n\t\tcase \"XLS\":\n\t\tcase \"XLSX\":\n\t\tcase \"TXT\":\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n}", "function validateFormModification(e) {\n\n // Contrôler les fichiers images\n var files = document.getElementById(\"doc\").files;\n var rslt = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n\n if (ex != 'image/png' && ex != 'application/pdf' && ex != 'image/jpeg'\n && ex != 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n && ex != 'application/msword'\n && ex != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n && ex != 'application/vnd.ms-powerpoint'\n && ex != 'application/vnd.openxmlformats-officedocument.presentationml.presentation')\n {\n rslt = true ;\n }\n\n });\n\n if (rslt) {\n alert(\"Les documents doivent être au format : Word, PowerPoint, PDF, JPG, PNG ou Excel ! \");\n document.getElementById(\"labelDoc\").style.color = \"red\"\n document.getElementById(\"doc\").value = \"\"\n\n return false; \n }\n\nreturn ( true );\n\n\n }", "verifyPageNumberInsidePdf(pageNumber, pdfFilePath) {\r\n let dataBuffer = fs.readFileSync(pdfFilePath);\r\n pdf(dataBuffer).then((data) => {\r\n assert.expectToContain(pageNumber, data.numpages);\r\n }).catch((error) => {\r\n logger.Log().error('The exception caused due to :- ' + error);\r\n console.log('The pdf couldnt read beacuse of :- ' + error);\r\n });\r\n }", "function DocumentValidation() {\n var bool = true;\n var Lo_Obj = [\"ddldocTypes\", \"ddldocType\", \"ddlcompany\", \"ddlpromotors\", \"hdnfilepath\"];\n var Ls_Msg = [\"Document Type\", \"Document\",\"Company\",\"Promotor\",\"\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function validaCampoFileInsave(Nombre, ActualLement, espacio) {\n\n var ID = document.getElementById(ActualLement + '_txt_' + Nombre);\n var file = ID.files[0];\n var errorIs2 = false;\n var tipoArch = $('#' + ActualLement + '_txt_' + Nombre).attr('accept');\n var MaxTam = $('#' + ActualLement + '_txt_' + Nombre).attr('maxtam');\n var espacio = espacio !== undefined ? espacio : '_S_solicitud_datos';\n if (!MaxTam) {\n MaxTam = 10;\n }\n if (!tipoArch) {\n tipoArch = '.pdf';\n }\n var FilesAdded = new Array();\n var _G_ID_ = '#' + ActualLement;\n if (tipoArch.toUpperCase().includes('PDF')) {\n var reader = new FileReader(file);\n reader.onload = function (event) {\n var text = reader.result;\n var firstLine = text.split('\\n').shift(); // first line\n if (!(firstLine.toString().toUpperCase().includes('PDF'))) {\n redLabel_Space(Nombre, 'El archivo es inválido o no es PDF', _G_ID_);\n errorIs2 = true;\n }\n }\n reader.readAsText(file, 'UTF-8');\n }\n if (file.size > (MaxTam * 1024 * 1024)) {\n redLabel_Space(Nombre, 'El archivo no debe superar los ' + MaxTam + ' MB', _G_ID_);\n errorIs2 = true;\n }\n if (!ValidateAlphanumeric((file.name).replace('.', ''))) {\n redLabel_Space(Nombre, 'El nombre del archivo no debe contener caracteres especiales', _G_ID_);\n errorIs2 = true;\n }\n $(_G_ID_ + espacio + ' input').each(function (i, item) {\n if (item.type === 'file' && item.value !== '') {\n if (FilesAdded.indexOf(item.value) !== -1) {\n redLabel_Space(item.name, 'El archivo ya se encuentra cargado en otro requisito', _G_ID_);\n errorIs2 = true;\n }\n FilesAdded.push(item.value);\n }\n });\n if (file.size <= (0)) {\n redLabel_Space(Nombre, 'El archivo no es valido', _G_ID_);\n errorIs2 = true;\n }\n\n\n var tipoAA = file.name;\n tipoAA = tipoAA.split('.');\n var tamtipoAA = tipoAA.length;\n tipoAA = tipoAA[tamtipoAA - 1];\n\n\n if (!(tipoAA).toUpperCase().replace('.', '').includes(tipoArch.replace('.', '').toUpperCase())) {\n redLabel_Space(Nombre, 'El archivo debe ser' + tipoArch.toUpperCase(), _G_ID_);\n errorIs2 = true;\n }\n setTimeout(function () {\n if (errorIs2) {\n ShowAlertM(_G_ID_, null, null, true);\n }\n errorIs[Nombre] = errorIs2;\n return errorIs2;\n }, 1000);\n}", "function checkFileType(file, cb, next, res) {\n\tconst filetypes = /pdf/;\n\tconst extname = filetypes.test(\n\t\tpath.extname(file.originalname).toLowerCase()\n\t);\n\tconst mimetype = filetypes.test(file.mimetype);\n\tif (extname && mimetype) {\n\t\treturn cb(null, true);\n\t} else {\n\t\treturn cb(\"Invalid type\", null);\n\t}\n}", "function validateFileUpload(el, useWhiteList) {\n\tvar val = el.value;\n\tvar cbox = document.getElementById(el.name + \"_pdf\");\n\tif (cbox) {\n\t\tcbox.disabled = true;\n\t\tcbox.checked = false;\n\t}\n\tif (val.length > 0) {\n\t\tif (!isAllowedFileExtension(val, useWhiteList)) {\n\t\t\talert(\"The file you are trying to upload is not an allowed file type.\");\n\t\t\tel.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (cbox) {\n\t\t\tcbox.disabled = !isAllowedFileExtensionPDF(val);\n\t\t\tif (cbox.disabled) cbox.checked = false;\n\t\t}\n\t}\n\treturn true;\n}", "function checkPdfJpegfiles(id)\n{\n\t//|| ext[1]==\"JPEG\" || ext[1]==\"jpeg\" || ext[1]==\"PNG\" || ext[1]==\"png\" ||\n\tvar flag=0;\n\t var myfile=$('#corresuploaddoc'+id).val();\t\t\t\n var ext = myfile.split('.');\n \n if(ext[1]==\"pdf\" || ext[1]==\"jpg\" || ext[1]==\"JPG\"){\n \tflag=1;\n }\n else{\n \t flag=0;\n \tbootbox.alert(\"Please select pdf or image(jpg) file only\");\n \tdocument.getElementById(\"corresuploaddoc\"+id).value = \"\";\n }\n \n if(flag==1)\n \t {\n \t checkFileSize(id);\n \t } \n \n}", "function validate_uploadfile_format(fileName,filterType)\n {\n \n var allowed_extensions1 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\");\n var allowed_extensions2 = new Array(\"pdf\",\"doc\",\"docs\");\n var allowed_extensions12 = new Array(\"jpeg\",\"jpg\",\"png\",\"gif\",\"pdf\",\"doc\",\"docx\");\n \n var file_extension = fileName.split('.').pop(); // split function will split the filename by dot(.), and pop function will pop the last element from the array which will give you the extension as well. If there will be no extension then it will return the filename.\n\n if(filterType == 'image'){\n for(var i = 0; i <= allowed_extensions1.length; i++)\n {\n if(allowed_extensions1[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n if(filterType == 'docs'){\n for(var i = 0; i <= allowed_extensions2.length; i++)\n {\n if(allowed_extensions2[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n if(filterType == 'imgdocs'){\n for(var i = 0; i <= allowed_extensions12.length; i++)\n {\n if(allowed_extensions12[i]==file_extension)\n {\n return 'true'; // valid file extension\n }\n }\n }\n \n \n \n return 'false';\n }", "validateFile(file, rules) {\n let errors = [];\n\n /**\n * Valid file size selected\n * @rule fileSize\n */\n if (rules.fileSize && file.size > rules.fileSize){\n errors.push(`File size should not be greater than ${(rules.fileSize / (1024 * 1024))} MB`);\n }\n\n /**\n * Valid selected mime type\n * @rule mime\n */\n if (rules.mime && file.type.length > 0 && rules.mime.indexOf(file.type.substring(file.type.indexOf(\"/\") + 1)) === -1){\n errors.push(\"Invalid file uploaded ,Please make sure you select a file with \"+rules.mime.join(\",\")+ \" extension\");\n }\n\n return errors;\n }", "function validaCampoFileInsavePrev(Nombre, ActualLement, espacio) {\n var ID = document.getElementById(ActualLement + '_txt_' + Nombre);\n var file = ID.files[0];\n var errorIs2 = false;\n var tipoArch = $('#' + ActualLement + '_txt_' + Nombre).attr('accept');\n var MaxTam = $('#' + ActualLement + '_txt_' + Nombre).attr('maxtam');\n var espacio = espacio !== undefined ? espacio : '_S_solicitud_datos';\n if (!MaxTam) {\n MaxTam = 10;\n }\n if (!tipoArch) {\n tipoArch = '.pdf';\n }\n var FilesAdded = new Array();\n var _G_ID_ = '#' + ActualLement;\n if (tipoArch.toUpperCase().includes('PDF')) {\n var reader = new FileReader(file);\n reader.onload = function (event) {\n var text = reader.result;\n var firstLine = text.split('\\n').shift(); // first line\n if (!(firstLine.toString().toUpperCase().includes('PDF'))) {\n redLabel_Space(Nombre, 'El archivo es invalido o no es PDF', _G_ID_);\n errorIs2 = true;\n }\n }\n reader.readAsText(file, 'UTF-8');\n }\n if (file.size > (MaxTam * 1024 * 1024)) {\n redLabel_Space(Nombre, 'El archivo no debe superar los ' + MaxTam + ' MB', _G_ID_);\n errorIs2 = true;\n }\n if (!ValidateAlphanumeric((file.name).replace('.', ''))) {\n redLabel_Space(Nombre, 'El nombre del archivo no debe contener caracteres especiales', _G_ID_);\n errorIs2 = true;\n }\n $(_G_ID_ + espacio + ' input').each(function (i, item) {\n if (item.type === 'file' && item.value !== '') {\n if (FilesAdded.indexOf(item.value) !== -1) {\n redLabel_Space(item.name, 'El archivo ya se encuentra cargado en otro requisito', _G_ID_);\n errorIs2 = true;\n }\n FilesAdded.push(item.value);\n }\n });\n if (file.size <= (0)) {\n redLabel_Space(Nombre, 'El archivo no es valido', _G_ID_);\n errorIs2 = true;\n }\n\n\n var tipoAA = file.name;\n tipoAA = tipoAA.split('.');\n var tamtipoAA = tipoAA.length;\n tipoAA = tipoAA[tamtipoAA - 1];\n\n\n if (!(tipoAA).toUpperCase().replace('.', '').includes(tipoArch.replace('.', '').toUpperCase())) {\n redLabel_Space(Nombre, 'El archivo debe ser' + tipoArch.toUpperCase(), _G_ID_);\n errorIs2 = true;\n }\n setTimeout(function () {\n if (errorIs2) {\n ShowAlertMPrev(_G_ID_, null, null, true);\n }\n errorIs[Nombre] = errorIs2;\n return errorIs2;\n }, 1000);\n}", "hasExistingPDF(){\n return $.find('#primary_file_name').length > 0\n }", "isImage(filename){\n return filename.split('.').pop()==\"pdf\"\n }", "function creativity_doc(input){ \n if (input.files && input.files[0]) {\n var reader = new FileReader();\n alert('HI doc'+input.files[0].type); \n $supported_filetype=['application/pdf','text/plain','application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'application/vnd.ms-powerpoint','application/vnd.ms-excel'];\n \n\n if($supported_filetype.indexOf(input.files[0].type) < 0){\n \n alert('file format not supported'); \n return false;\n }\n\n if(input.files[0].size >= 100004800){\n \n alert('Uploaded Doc size is more the allowed size');\n return false;\n }\n\n alert('validated');\n var div='<div class=\"sel-hob-main\">'+\n '<span class=\"text-file sel-copy\">&nbsp;</span>'+\n '<div class=\"sel-close\"></div>'+\n '</div>';\n \n $('#preview_cre_image').html(div);\n \n \n \n }\n }", "function validateCertificateAndSign() {\n //1-Check document extension to apply digital signature to only PDFs\n //2-Check if there is alias saved in profile\n //3-Check if Plug-in is running\n //if plug-in down after setting isSignaturePluginRunning to true , service call of check certificate will alert the error that will force me to refresh the page and re check isSignaturePluginRunning and set to false.\n //if plug-in running after setting isSignaturePluginRunning to false, user must refresh page manually.\n //in both cases , user must refresh.\n if (extensionOfDoc != \"pdf\") {\n return extError;\n }\n else if (typeof certificateInProfile == 'undefined' || !certificateInProfile || certificateInProfile.length === 0 || certificateInProfile === \"\" || !/[^\\s]/.test(certificateInProfile) || /^\\s*$/.test(certificateInProfile) || certificateInProfile.replace(/\\s/g, \"\") === \"\") {\n return certDNEError;\n }\n else if (!checkSignaturePluginRunningServiceCall()) {\n return pluginError;\n }\n else {\n //4- check if certificate isExist in client user machine certificate store\n var certCheckErrorInService = checkCertificateExistServiceCall();\n if (certCheckErrorInService) {\n return certCheckError;\n }\n // if certificate is retrieved successfully , Sign PDF and create new version ; else alert error message\n if (isCertificateExist) {\n var signedItemSuccessfuly = signAndImportNewVersion();\n // var signedItemSuccessfuly = true;\n if (signedItemSuccessfuly) {\n return signSucceed;\n }\n else {\n return signFailed;\n }\n }\n else {\n return certDelError;\n }\n }\n\n}", "function validateFormPropals() {\n\n //if ( formEditConception.propals !== undefined ) {\n\n var files = document.getElementById(\"propals\").files;\n var l = files.length ;\n if (l != 3) {\n alert(\"Vous devez soumettre 3 propositions ! \" );\n document.getElementById(\"propals\").value = '' ;\n return false;\n }\n else\n {\n var resultat = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n if (ex != \"image/png\" && ex != \"image/jpeg\" )\n {\n resultat = true ;\n }\n });\n if (resultat) {\n alert(\"Les propositions doivent être au format : JPG ou PNG ! \");\n document.getElementById(\"propals\").value = \"\"\n return false; \n } \n }\n }", "function isPDF() {\n return (\n document.body &&\n document.body.children[0] &&\n document.body.children[0].type === \"application/pdf\"\n );\n}", "function validaUploadDoc() {\n var validado = true;\n if ($(\"#nameU\").val() == \"\") {\n $(\"#nameU\").addClass(\"is-invalid\");\n validado = false;\n } else {\n $(\"#nameU\").removeClass(\"is-invalid\");\n }\n var _validFileExtensions = [\"jpg\", \"jpeg\", \"bmp\", \"gif\", \"png\",'xls','xlsx','doc', 'docx','ppt', 'pptx','txt','pdf']; \n var file1 = $('#file')[0]\n var archivo = file1.files[0];\n var index;\n if(typeof archivo !== 'undefined'){\n var fullname=archivo.name.split(\".\");\n var type=fullname.pop();\n index=_validFileExtensions.findIndex(x => x == type);\n }else{\n index=-1;\n }\n\n if(index==-1){\n $(\"#file\").addClass(\"is-invalid\");\n $(\"#file_message\").html(\"tipo de archivo invalido\");\n validado = false;\n }else{\n $(\"#file\").removeClass(\"is-invalid\");\n $(\"#file_message\").html(\"\");\n }\n return validado;\n}", "function inputFileCheck()\n{\n\n var element = eval(this.element);\n if ( typeof element != 'undefined' )\n {\n\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [element.name]);\n var val = element.value;\n\n\n if ( this.invalid_chars )\n {\n var arr = val.invalidChars(this.invalid_chars);\n\n if ( arr && arr.length )\n {\n alert(JS_RESOURCES.getFormattedString('validation.invalid_chars',\n [this.ref_label, arr.join(', ')]));\n shiftFocus( element, false);\n return false;\n }\n }\n\n if ( val.length < this.minlength )\n {\n if ( this.minlength == 1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n }\n else\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.minimum_length',\n [this.minlength, this.ref_label]));\n }\n\n return false;\n }\n\n if ( this.img_check )\n {\n return image_check(element);\n }\n\n }\n return true;\n}", "function isPDFFileName(filename) {\n var extension = filename.split(\".\")[filename.split(\".\").length - 1];\n var known_extensions = [\"pdf\"];\n return known_extensions.includes(extension.toLowerCase());\n }", "function isPDFFileName(filename) {\n var extension = filename.split(\".\")[filename.split(\".\").length - 1];\n var known_extensions = [\"pdf\"];\n return known_extensions.includes(extension.toLowerCase());\n }", "function validateAttachFile() {\n var tempName = \"\";\n var fileName = fileInput.files[0].name;\n var fileExtension = fileName.split('.').pop().toLowerCase();\n var fileSize = fileInput.files[0].size;\n \n if(jQuery.inArray(fileExtension, ['png', 'jpg', 'jpeg', 'PNG', 'JPG', 'JPEG']) == -1) {\n errorMsg = \"<i>\" + fileName + \"</i> has invalid file type<br>\";\n attachment = \"\"\n } else if(fileSize > 4000000) {\n errorMsg = \"The size of <i>\" + fileName + \"</i> is too big<br>\";\n fileInputText.value = \"\";\n attachment = \"\";\n } else {\n errorMsg = \"\";\n if (fileName.lastIndexOf('\\\\')) {\n tempName = fileName.lastIndexOf('\\\\') + 1;\n } else if (fileName.lastIndexOf('/')) {\n tempName = fileName.lastIndexOf('/') + 1;\n }\n fileInputText.value = fileName.slice(tempName, fileName.length);\n attachment = fileInput.files[0];\n }\n}", "function checkFileType(file, cb) {\n if(file.fieldname==='nicPhoto' || file.fieldname === 'profilePicture' || file.fieldname === 'uni_id_photo' || file.fieldname === 'profile_picture') {\n if ( file.mimetype === 'image/png' || file.mimetype === 'image/jpg' || file.mimetype === 'image/jpeg') { // check file type to be pdf, doc, or docx\n cb(null, true);\n } \n else {\n console.log('only jpg , jpeg & png file supported');\n cb(null, false);\n }\n }\n else if(file.fieldname === 'proofDocument'||file.fieldname === 'submission') {\n if ( file.mimetype === 'image/png' || file.mimetype === 'image/jpg' || file.mimetype === 'image/jpeg' || file.mimetype === 'application/pdf') { // check file type to be pdf, doc, or docx\n cb(null, true);\n } \n else {\n console.log('only jpg , jpeg , png & pdf file supported');\n cb(null, false);\n }\n }\n else {\n console.log('no such field found');\n cb(null, false);\n }\n}", "function validateFileExtention(){\n\tvar ext=\"\";\n\tvar kilobyte=1024;\n\tvar len=$('input[type=file]').val().length;\n\tvar count=0;\n\t $('input[type=file]').each(function () {\n\t var fileName = $(this).val().toLowerCase(),\n\t regex = new RegExp(\"(.*?)\\.(pdf|jpeg|png|jpg|gif)$\");\n\t\t\t if(fileName.length!=0){\n\t \tif((this.files[0].size/kilobyte)<=kilobyte){\n\t\t\t\t}else{\n\t\t\t\t\tif(fileName.lastIndexOf(\".\") != -1 && fileName.lastIndexOf(\".\") != 0)\n\t\t\t\t ext= fileName.substring(fileName.lastIndexOf(\".\")+1); \n\t\t\t\t\talert(\"Please Upload Below 1 MB \"+ext+\" File\");\n\t\t\t\t\tcount++;\n\t\t\t\t\t//alert('Maximum file size exceed, This file size is: ' + this.files[0].size + \"KB\");\n\t\t\t\t\t$(this).val('');\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t if (!(regex.test(fileName))) {\n\t\t $(this).val('');\n\t\t alert('Please select correct file format');\n\t\t count++;\n\t\t return false; \t\n\t\t }\n\t }\n\t });\n\t if(count!=0){\n\t\t return false; \n\t }else{\n\t\t return true;\n\t }\n}", "function fileValidation() {\r\n\tvar fileInput = document.getElementById('file1');\r\n\tvar filePath = fileInput.value;\r\n\tvar allowedExtensions = /(\\.png|\\.jpg|\\.jpeg)$/i;\r\n\tif (!allowedExtensions.exec(filePath)) {\r\n\t\talert('Please upload file having extensions .png /.jpg /.jpeg only.');\r\n\t\tfileInput.value = '';\r\n\t\treturn false;\r\n\t} else {\r\n\t\t//alert(' Great job');\r\n\t}\r\n}", "validateImageFile(file, rules) {\n let errors = [];\n\n /**\n * Valid file size selected\n * @rule fileSize\n */\n if (rules.fileSize && file.size > rules.fileSize){\n errors.push(`File size should not be greater than ${(rules.fileSize / (1024 * 1024))} MB`);\n }\n\n /**\n * Valid selected mime type\n * @rule mime\n */\n if (rules.mime && rules.mime.indexOf(file.type.replace(/image\\//g, \"\")) === -1){\n errors.push(\"Invalid file uploaded ,Please make sure you select a file with \"+rules.mime.join(\",\"));\n }\n\n return errors;\n }", "function isPassValidation(files) {\r\n var errorMessage = \"\";\n var disallowedTypes = disallowedFileTypes;\n var disallowedTypeArray = disallowedTypes.split(\";\");\n var limitSize = maxFileSizeByByte;\n var typeErrorCount = 0;\n var typeErrorContent = \"\";\n var sizeErrorCount = 0;\n var sizeErrorContent = \"\";\n var zeroSizeErrorCount = 0;\n var zeroSizeErrorContent = \"\";\n var allowedFiles = [];\n\n if (disallowedTypeArray.length > 0) {\r\n for (var k = 0; k < disallowedTypeArray.length; k++) {\r\n if (String.IsNullOrEmpty(disallowedTypeArray[k])) {\r\n continue;\r\n }\n\n if (disallowedTypeArray[k].indexOf(\".\") != 0) {\r\n disallowedTypeArray[k] = \".\" + disallowedTypeArray[k];\r\n }\r\n }\r\n }\n\n for (var j = 0; j < files.length; j++) {\r\n var isDisallowed = false;\n var fileName = files[j].name;\n\n if (disallowedTypeArray.length > 0) {\r\n\n var dotIndex = fileName.lastIndexOf(\".\");\n\n if (dotIndex > -1) {\r\n var suffix = fileName.substring(dotIndex, fileName.length);\n\n if (disallowedTypeArray.contains(suffix)) {\r\n isDisallowed = true;\n typeErrorCount++;\n typeErrorContent += fileName + \"; \";\r\n }\r\n }\r\n }\n\n if (files[j].size == 0 && !isDisallowed) {\r\n isDisallowed = true;\n zeroSizeErrorCount++;\n zeroSizeErrorContent += fileName + \"; \";\r\n }\n\n if (!isDisallowed && parseInt(limitSize) > 0 && files[j].size > parseInt(limitSize)) {\r\n isDisallowed = true;\n sizeErrorCount++;\n sizeErrorContent += fileName + \"; \";\r\n }\n\n if (!isDisallowed) {\r\n allowedFiles.push(files[j]);\r\n }\r\n }\n\n if (typeErrorCount > 0) {\r\n var typeErrorMsgPattern = typeErrorPattern;\n errorMessage = String.format(typeErrorMsgPattern, typeErrorCount, typeErrorContent);\n errorMessage += \"<br/>\";\r\n }\n\n if (sizeErrorCount > 0) {\r\n var sizeErrorMsgPattern = sizeErrorPattern;\n errorMessage += String.format(sizeErrorMsgPattern, sizeErrorCount, sizeErrorContent);\n errorMessage += \"<br/>\";\r\n }\n\n if (zeroSizeErrorCount > 0) {\r\n\n var zeroSizeErrorMsgPattern = zeroSizeErrorPattern;\n errorMessage += String.format(zeroSizeErrorMsgPattern, zeroSizeErrorCount, zeroSizeErrorContent);\n errorMessage += \"<br/>\";\r\n }\n\n if (errorMessage.length == 0) {\r\n return allowedFiles;\r\n }\n\n // used in attachment list iframe for Resubmit link button.\n if (!$.exists('#' + errorMsgId)) {\r\n parent.showMessage(errorMsgId, errorMessage, \"Error\", true, 1, true);\r\n }\n else {\r\n showMessage(errorMsgId, errorMessage, \"Error\", true, 1, true);\r\n }\n\n return allowedFiles;\r\n }", "function sjb_is_attachment( event ) {\n var error_free = true;\n $(\".sjb-attachment\").each(function () {\n\n var element = $(\"#\" + $(this).attr(\"id\"));\n var valid = element.hasClass(\"valid\");\n var is_required_class = element.hasClass(\"sjb-not-required\"); \n\n // Set Error Indicator on Invalid Attachment\n if (!valid) {\n if (!(is_required_class && 0 === element.get(0).files.length)) {\n error_free = false;\n }\n }\n\n // Stop Form Submission\n if (!error_free) {\n event.preventDefault();\n }\n });\n\n return error_free;\n }", "function validation(fileName) {\r\n\tfileName = fileName + \"\";\r\n\tvar fileNameExtensionIndex = fileName.lastIndexOf('.') + 1;\r\n\tvar fileNameExtension = fileName.toLowerCase().substring(\r\n\t\t\tfileNameExtensionIndex, fileName.length);\r\n\tif (!((fileNameExtension === 'jpg') || (fileNameExtension === 'gif') || (fileNameExtension === 'png'))) {\r\n\t\talert('jpg, gif, png 확장자만 업로드 가능합니다.');\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function parsePdf(filename) {\n var pdfParser = new PDFParser();\n\n // Error event\n pdfParser.on('pdfParser_dataError', function (err) {\n console.log(err.parserError);\n });\n\n // Success event\n pdfParser.on('pdfParser_dataReady', function (pdfData) {\n // Output file as JSON\n var outputJson = Utils.removeDiacritics(JSON.stringify(pdfData.formImage.Pages[0].Texts, null, 2));\n\n // Check if user wants to write into a JSON file\n if (args[1]) {\n Utils.writeToJson(baseName, outputJson);\n } else {\n console.log(outputJson);\n }\n });\n\n // Loads the PDF file into the parser\n pdfParser.loadPDF(\"./input_files/\" + filename);\n}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function processPRFiles() {\n console.log (`PR files to validate ${prWorkFlowJSONFiles} for basedir ${baseDir} on branch ${branchName}`);\n const fileArr = prWorkFlowJSONFiles.split(\" \").filter(item => item);\n const ajv = new Ajv({allErrors: true, strict: false});\n const validate = ajv.compile(workflowSchema);\n fileArr.forEach(file => {\n console.log (`processing file ${file}`);\n const filePath = require(baseDir+\"/\"+file);\n const valid = validate(filePath);\n if (!valid) {\n console.log(validate.errors);\n process.exit(1);\n } else {\n console.log ('Success');\n process.exit(0);\n }\n });\n}", "get acceptFormat(){\n return ['.pdf', '.jpg', '.jpeg', '.csv', '.xlsx']\n }", "function validateFile(dest, cb) {\n if(dest.indexOf(\".jpg\") > -1) {\n validateJPG(dest, cb);\n }\n else if(dest.indexOf(\".png\") > -1) {\n validatePNG(dest, cb);\n }\n // no idea how to validate. So just claim it's fine.\n else { cb(false); }\n }", "function checkFile( file){\n\n if (file == \"\"){\n\n return false;\n }\n return true;\n }", "function isPassValidation(files) {\n var errorMessage = \"\";\n var disallowedTypes = disallowedFileTypes;\n var disallowedTypeArray = disallowedTypes.split(\";\");\n var limitSize = maxFileSizeByByte;\n var typeErrorCount = 0;\n var typeErrorContent = \"\";\n var sizeErrorCount = 0;\n var sizeErrorContent = \"\";\n var zeroSizeErrorCount = 0;\n var zeroSizeErrorContent = \"\";\n var allowedFiles = [];\n\n if (disallowedTypeArray.length > 0) {\n for (var k = 0; k < disallowedTypeArray.length; k++) {\n if (String.IsNullOrEmpty(disallowedTypeArray[k])) {\n continue;\n }\n\n if (disallowedTypeArray[k].indexOf(\".\") != 0) {\n disallowedTypeArray[k] = \".\" + disallowedTypeArray[k];\n }\n }\n }\n\n for (var j = 0; j < files.length; j++) {\n var isDisallowed = false;\n var fileName = files[j].name;\n\n if (disallowedTypeArray.length > 0) {\n\n var dotIndex = fileName.lastIndexOf(\".\");\n\n if (dotIndex > -1) {\n var suffix = fileName.substring(dotIndex, fileName.length);\n\n if (disallowedTypeArray.contains(suffix)) {\n isDisallowed = true;\n typeErrorCount++;\n typeErrorContent += fileName + \"; \";\n }\n }\n }\n\n if (files[j].size == 0 && !isDisallowed) {\n isDisallowed = true;\n zeroSizeErrorCount++;\n zeroSizeErrorContent += fileName + \"; \";\n }\n\n if (!isDisallowed && parseInt(limitSize) > 0 && files[j].size > parseInt(limitSize)) {\n isDisallowed = true;\n sizeErrorCount++;\n sizeErrorContent += fileName + \"; \";\n }\n\n if (!isDisallowed) {\n allowedFiles.push(files[j]);\n }\n }\n\n if (typeErrorCount > 0) {\n var typeErrorMsgPattern = typeErrorPattern;\n errorMessage = String.format(typeErrorMsgPattern, typeErrorCount, typeErrorContent);\n errorMessage += \"<br/>\";\n }\n\n if (sizeErrorCount > 0) {\n var sizeErrorMsgPattern = sizeErrorPattern;\n errorMessage += String.format(sizeErrorMsgPattern, sizeErrorCount, sizeErrorContent);\n errorMessage += \"<br/>\";\n }\n\n if (zeroSizeErrorCount > 0) {\n\n var zeroSizeErrorMsgPattern = zeroSizeErrorPattern;\n errorMessage += String.format(zeroSizeErrorMsgPattern, zeroSizeErrorCount, zeroSizeErrorContent);\n errorMessage += \"<br/>\";\n }\n\n if (errorMessage.length == 0) {\n return allowedFiles;\n }\n\n // used in attachment list iframe for Resubmit link button.\n if (!$.exists('#' + errorMsgId)) {\n parent.showMessage(errorMsgId, errorMessage, \"Error\", true, 1, true);\n }\n else {\n showMessage(errorMsgId, errorMessage, \"Error\", true, 1, true);\n }\n\n return allowedFiles;\n }", "function excelTypeCheck(file) {\n if(['xlsx','xls'].indexOf(file.name.split('.').pop()) == -1) {\n document.getElementById(\"process_status\").style.color = \"red\";\n document.getElementById('process_status').innerHTML = \"Error: Excel document must be XLS or XLSX file.\";\n return false;\n }\n return true;\n}", "check (filename, callback) {\n const extension = path.extname(filename).toLowerCase()\n const allowedExtensions = this.watchExtensions\n var isSvgFont = false\n if (extension === '.svg') {\n isSvgFont = fs.readFileSync(filename, 'utf8').indexOf('</font>') > -1\n }\n return callback(null, allowedExtensions.indexOf(extension) > -1 && !isSvgFont)\n }", "check (filename, callback) {\n const extension = path.extname(filename).toLowerCase()\n const allowedExtensions = this.watchExtensions\n var isSvgFont = false\n if (extension === '.svg') {\n isSvgFont = fs.readFileSync(filename, 'utf8').indexOf('</font>') > -1\n }\n return callback(null, allowedExtensions.indexOf(extension) > -1 && !isSvgFont)\n }", "function validateFileBeforeUpload (file){\n // file type checking \n var validFormats = ['jpg','jpeg','png'];\n var filename = file.name;\n var ext = filename.substr(filename.lastIndexOf('.')+1);\n var matchExt = false;\n for (var index = 0; index < validFormats.length; index++) {\n if(ext == validFormats[index]){\n matchExt = true; \n }\n \t}\n \t return matchExt; \n\t}", "canValidate(filename) {\n /* .html is always supported */\n const extension = path__default[\"default\"].extname(filename).toLowerCase();\n if (extension === \".html\") {\n return true;\n }\n /* test if there is a matching transformer */\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n return resolved.canTransform(filename);\n }", "function validarPeso(datos) {\n if (datos.files && datos.files[0]) {\n var pesoFichero = datos.files[0].size / 1024;\n if (pesoFichero > pesoPermitido) {\n $('#texto').text('El peso maximo permitido del fichero es: ' + pesoPermitido + ' KBs Su fichero tiene: ' + pesoFichero + ' KBs');\n return false;\n } else {\n return true;\n }\n }\n}", "function fc_UploadFile_Validar(idUpload) { \n var file = document.getElementById(idUpload); \n var fileName=file.value; \n\n fileName = fileName.slice(fileName.lastIndexOf(\"\\\\\") + 1); \n tipoError = -1;\n if ( fileName.length > 0 )\n {\n var ext = (fileName.toLowerCase().substring(fileName.lastIndexOf(\".\")))\n var listado = new Array(\".xls\",\".csv\");\n var ok = false;\n for (var i = 0; i < listado.length; i++){\n if (listado [i] == ext) { \n ok = true;\n break; \n }\n } \n if(ok){ \n tipoError = 0;\n }else{\n tipoError = 2;\n }\n }\n else\n { \n tipoError = 1; \n }\n return tipoError; \n}", "function validate_format(req, res, next) { \n // If no files were selected\n if (!req.files) {\n return res.redirect('/')\n };\n\n // Image/mime validation\n const mime = fileType(req.files.image.data);\n if(!mime || !accepted_extensions.includes(mime.ext))\n return next(res.status(500).send('The uploaded file is not in ' + accepted_extensions.join(\", \") + ' format!'));\n next();\n}", "validateFormatFiles() {\n var exito = true;\n var erroresEnArchivos = false; // Para comprobar si hay errores\n var maximoDeArchivos = NUM_MAX_FILES_UPLOAD; // El número máximo de archivos que se podrán enviar\n var pesoMaximoPorArchivo = 100000; // El peso máximo en bytes por archivo.\n var matrizDeTiposAdmitidos = new Array(\"image/jpeg\", \"image/png\", \"image/gif\", \"image/tiff\");\n var erroresTipoAdmitidos = new Array();\n var archivosSeleccionados = $(\"#ficheros\")[0][\"files\"];\n\n var numMaxArchivos = false;\n // Si se excede el número de archivos, marcamos que hay error.\n if (archivosSeleccionados.length > maximoDeArchivos) {\n exito = false;\n this.showMessageUpload(this.ID_DIV_MSG_ERROR, messages.mensaje_error_subir_maximo_fotografías_1 + maximoDeArchivos + messages.mensaje_error_subir_maximo_fotografías_2);\n this.emptySelectedFiles();\n\n } else {\n\n if (!erroresEnArchivos) {\n // Si no hay error, seguimos comprobando\n for (var archivo in archivosSeleccionados) {\n if (archivosSeleccionados[archivo][\"name\"] != undefined && archivosSeleccionados[archivo][\"type\"] != undefined) {\n if (archivo != parseInt(archivo)) continue;\n \n if (matrizDeTiposAdmitidos.indexOf(archivosSeleccionados[archivo][\"type\"]) < 0) {\n erroresTipoAdmitidos.push(archivosSeleccionados[archivo][\"name\"]);\n erroresEnArchivos = true;\n }\n }\n }\n }\n\n\n if (erroresEnArchivos) {\n if (erroresTipoAdmitidos.length > 0) {\n var msgError = \"\";\n for (var i = 0; erroresTipoAdmitidos != null && i < erroresTipoAdmitidos.length; i++) {\n msgError = msgError + erroresTipoAdmitidos[i];\n if (erroresTipoAdmitidos.length - i > 1) {\n msgError = msgError + \",\";\n }\n } // for\n\n this.showMessageUploadList(this.ID_DIV_MSG_ERROR, messages.mensaje_error_archivos_no_son_imagenes, erroresTipoAdmitidos);\n }\n this.emptySelectedFiles();\n exito = false;\n } else if (archivosSeleccionados.length == 0) {\n this.showMessageUpload(this.ID_DIV_MSG_ERROR, messages.mensaje_error_archivos_no_son_imagenes);\n this.hideDivMessage(this.ID_DIV_MSG_SUCCESS);\n exito = false;\n }\n }\n\n return exito;\n }", "function check_file() {\n var file = document.getElementById('file_name').value;\n if(file == null || file == \"\") {\n alert(\"Please choose the file\");\n return false;\n }\n\n var ext = file.substring(file.lastIndexOf('.') + 1).toLowerCase();\n\n if(ext != 'csv') {\n alert(\"Please choose only csv file type\");\n return false;\n }\n\n}", "function validate_format(req, res, next) {\n // For MemoryStorage, validate the format using `req.file.buffer`\n // For DiskStorage, validate the format using `fs.readFile(req.file.path)` from Node.js File System Module\n let mime = fileType(req.file.path);\n\n // if can't be determined or format not accepted\n if(!mime || !accepted_extensions.includes(mime.ext))\n return next(new Error('The uploaded file is not in ' + accepted_extensions.join(\", \") + ' format!'));\n \n next();\n}", "function kawiGenerateSignedPDFFiles() {\n result = getKawi().generateSignedPDFFiles();\n \n //Evaluar resultado obtenido del applet\n if(result === \"PKI_KEYS_CANCEL\") {\n ////Ha presionado boton Cancelar durante la carga de las llaves\n return false;\n \n } if( (result.search(\"!...\") > -1 ) || (!result) ) {\n \n //Ha ocurrido un error\n kawiClearPDF();\n throw new Error(\"ERROR\");\n }\n return true;\n}", "function PDF_evaluation(callback){\n\tconsole.log(\"Start evaluating PDF\");\n\texecFile('./eval.sh', ['upload/pdf', 'grey'], (err, stdout, stderr) => {\n\t\tif (err){\n\t\t\tconsole.log(\"Error occur\");\n\t\t\tcallback(err);\n\t\t}\n\t\tconsole.log(\"Finish evaluating\");\n\t\tconsole.log(`stdout: ${stdout}`);\n\t\tcallback(stdout);\n\t});\n}", "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "function validateType (fileName){\n //console.log(fileName);\n //let fileType = (fileName).split(\".\");\n let fileType = (fileName.split(\".\"))[1].toLowerCase();\n console.log(fileType);\n if (fileType == \"jpg\" || fileType == \"jpeg\" || fileType == \"gif\" || fileType == \"png\"){\n //if((fileType.find(type => type==\"jpg\" || type==\"jpeg\" ||type==\"gif\" || type==\"png\")) !== undefined){\n return true;\n } else {\n return false;\n }\n }", "function validate(event) {\n\n\n var fileInput = document.getElementById(\"image1\").files;\n if (fileInput != '')\n {\n for (var i = 0; i < fileInput.length; i++)\n {\n\n var vname = fileInput[i].name;\n var ext = vname.split('.').pop();\n var allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'PNG'];\n var foundPresent = $.inArray(ext, allowedExtensions) > -1;\n // alert(foundPresent);\n\n if (foundPresent == true)\n {\n } else {\n $(\".bus_image\").html(\"Please select only Image File.\");\n event.preventDefault();\n //return false; \n }\n }\n }\n}", "function validate() {\n const element = inputField.current;\n const validityState = element.validity;\n const files = element.files;\n\n if (validityState.valueMissing)\n return { message: `${props.label} is required.`, element };\n\n for (let i = 0; i < files.length; i++) {\n if (props.accept) {\n const acceptParts = props.accept.split(\"/\");\n for (const part of acceptParts) {\n if (part !== \"*\" && !files[i].type.includes(part))\n //prefer returning subtype over type\n return {\n message: `${props.label} is wrong format. Expected: ${\n acceptParts[1] !== \"*\" ? acceptParts[1] : acceptParts[0]\n }`,\n element,\n };\n }\n }\n\n if (props.size && files[i].size > props.size)\n return {\n message: `${props.label} is too big. Max ${props.size / 1000000}MB`,\n element,\n };\n }\n\n return null;\n }", "function handleFormSubmit(){\n\n // Add in the signature shit\n // In here, make a json file and save it in the appropriate folder\n // then also make PDF :(\n\n var treatmentResults = {\n \"speakToMedia\" : $(\"#speakToMedia input[type='radio']:checked\").val(),\n \"scientificPhotoUsage\" : $(\"#scientificPhotoUsage input[type='radio']:checked\").val(),\n \"mediaPhotoUsage\" : $(\"#mediaPhotoUsage input[type='radio']:checked\").val(),\n \"questions\" : []\n }\n\n $(\"#intraline-medical-history .intraline-truefalse-row\").each(function(index){\n var tempRes = \"\";\n var writtenAnswer = $(this).find(\".intraline-truefalse-expand .card-body .form-control\").val();\n console.log(writtenAnswer);\n if((\"\" + writtenAnswer).length > 0) {\n tempRes = writtenAnswer\n }\n else tempRes = $(this).data(\"result\");\n\n var answerObject = {\n \"name\" : $(this).data(\"name\"),\n \"question\" : $(this).find(\".intraline-truefalse-question\").text(),\n \"val\" : tempRes\n };\n if(tempRes) treatmentResults.questions.push(answerObject);\n });\n var emailconsent = \"\" + $(\"#intraline-form-basicinfo input[name='emailconsent']:checked\").val();\n //should validate\n var patientData = {\n \"fname\" : $(\"#intraline-form-basicinfo input[name='fname']\").val(),\n \"lname\" : $(\"#intraline-form-basicinfo input[name='lname']\").val(),\n \"dateofbirth\" : $(\"#intraline-form-basicinfo input[name='dateofbirth']\").val(),\n \"address\" : $(\"#intraline-form-basicinfo input[name='address']\").val(),\n \"email\" : $(\"#intraline-form-basicinfo input[name='email']\").val(),\n \"emailconsent\" : emailconsent,\n \"tel\" : $(\"#intraline-form-basicinfo input[name='tel']\").val(),\n }\n\n var patient = new Patient();\n patient.createPatient(patientData, [treatmentResults]);\n\n}", "async function verifyPDF(req, res){\n\t//secreto compartido\n\tlet secret =\"0kQZrhqOMP7Xjtmi@rx_506_soin@8qDN4pebwmXFcMAZ\";\n\n\t//archivo firmado\n\tlet fileDataBinary = fs.readFileSync(path.resolve(__dirname,'../public/98582_Signed.pdf'));\n\t\t\n\n\t// console.log(await fileType.fromBuffer(fileDataBinary));\n\n\tconst compressed = await gzip(fileDataBinary, 'Buffer')\n\t // .then((compressed) => {\n\n\n\t\tconst bufferDecompressed = await unzip(compressed)\n\t\tconst {ext: filemimeType} = await fileType.fromBuffer(bufferDecompressed)\n\n\t\tconsole.log(filemimeType.toUpperCase());\n\n\t\t// tipo puede ser PDF o XML\n\t\tlet tokenData = {\n\t\t\t\"tipo\": filemimeType.toUpperCase(),\n\t\t\t\"file\": compressed.toString('base64'), \t\t\t\n\t\t}\n\n\t\tvar token = jwt.encode(tokenData,secret,'HS512')\n\t\t// console.log(tokenData)\n\n\t\t// const ls = exec('java -cp /Users/esligonzalez/FirmaDigital/lib/FirmaDigitalServer.jar com.soin.firmaDigital.Sign_verify '+token, function (error, stdout, stderr) {\n\t\t// if (error) {\n\t\t// console.log(error.stack);\n\t\t// console.log('Error code: '+error.code);\n\t\t// console.log('Signal received: '+error.signal);\n\t\t// }\n\t\t// console.log('Child Process STDOUT: '+stdout);\n\t\t// console.log('Child Process STDERR: '+stderr);\n\t\t// });\n\n\t\t// ls.on('exit', function (code) {\n\t\t// console.log('Child process exited with exit code '+code);\n\t\t// res.status(200).send(\"OK\")\n\t\t// });\n\t\t\n\t\n\t\trequest.post('http://ec2-3-231-29-238.compute-1.amazonaws.com:8080/springmvc_signDigital-0.0.1-SNAPSHOT/verifyDocsSign', {form: { data : token }}, (error, res2, body) => {\n\t\t\tif (error) {\n\t\t\t console.error(error)\n\t\t\t return\n\t\t\t}\n\t\t\tconsole.log(`statusCode: ${res2.statusCode}`)\n\t\t\tconsole.log(`body: ${body}`)\n\t\t\t\n\t\t\t//remuevo los enters de la respuesta\n\t\t\tlet responseData = JSON.parse(body.replace(/\\n/g,'','all'));\n\t\t\tlet arrayDeFirmas = responseData.Firmas\n\n\t\t\t//obtener cedula de usuario para comparar\n\t\t\tfor (let i = 0; i < arrayDeFirmas.length; i++) {\n\t\t\t\t//identificacion entera\n\t\t\t\tconsole.log(arrayDeFirmas[i].SubjectSN);\n\t\t\t\t//se quita lo inicial y luego los guiones\n\t\t\t\tlet id = arrayDeFirmas[i].SubjectSN.substring(4,arrayDeFirmas[i].SubjectSN.length)\n\t\t\t\tid = id.replace(/-/g,'','all')\n\t\t\t\t//importante la identificacion tiene un cero al inicio esta se puede quitar o no\n\t\t\t\tconsole.log(`identificacion ${id}`);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t \tres.send(200, \"OK\");\t\n\t\t})\n\t// }) \n}", "function wrong_extension() {\n $('#post_error').text(\"Vybraný soubor není pdf!\");\n}", "function AttachmentsCheque(input, Id) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(Id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(Id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + Id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function validateForm() {\n\t// (Can't use `typeof FileReader === \"function\"` because apparently\n\t// it comes back as \"object\" on some browsers. So just see if it's there\n\t// at all.)\n\tif (!window.FileReader) {\n\t\tconsole.log(\"The file API isn't supported on this browser yet.\");\n\t\treturn false;\n\t}\n\t\n\tconsole.log('Form submitted!');\n\tvar inpObj = document.getElementById('inputImage');\n\tif (!inpObj.value) {\n\t\tconsole.log(\"you didnt enter an image\");\n\t}\n\telse if (!inpObj.files) {\n\t\tconsole.log(\"This browser doesn't support the `files` property of file inputs.\");\n\t}\n\telse if (!inpObj.files[0]) {\n\t\tconsole.log(\"Please select a file before clicking 'Submit'\");\n\t}\n\telse {\n\t\tfile = inpObj.files[0];\n\t\tconsole.log(\"File \" + file.name + \" is \" + file.size + \" bytes in size\");\n\t\t//if larger than 5Mbytes\n\t\tif(file.size > 5120000){\n\t\t\tconsole.log(\"the file is larger than 5Mbytes(5,120,000 bytes)!\");\n\t\t}\n\t\t\n\t\tdisplayImage(inpObj);\n\t}\t\t\n\treturn false;\n}", "viewPdf(url) {\n if (url) {\n window.location = url;\n } else{\n alert(\"There is no PDF to view\");\n }\n }", "processFile(file, rules) {\n let errors = this.validateFile(file, rules);\n\n if (errors.length === 0){\n if (this.isImage(file)){\n this.loadImage(file);\n }\n\n if (this.afterFileSelect){\n this.afterFileSelect(file);\n }\n } else {\n toastr.error(errors.shift(errors), \"\", {timeOut: 3000});\n }\n }", "function ValidarFormatoArchivo() {\n debugger;\n var fileInput = document.getElementById('imagenEncabezado');\n var filePath = fileInput.value;\n var allowedExtensions = /(.jpg)$/i;\n if (!allowedExtensions.exec(filePath)) {\n $(\"#modal\").modal(\"show\");\n $(\"#titulo\").html(\"Advertencia\");\n $(\"#contenido\").html(\"Solo se permite el archivo en formato .JPG\");\n fileInput.value = '';\n return false;\n }\n}", "function validFile(req, res, next) {\n if (req.query.type !== \"file\") {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\"\n });\n } else {\n next();\n }\n}", "function checkForm() {\n var a = true\n if (isNaturalNumber($pr_price.val())) {\n if (Number($pr_price.val()) > 500000) {\n $('#error-price').html('Tiền có giá trị 0 - 500.000')\n a = false\n } else {\n $('#error-price').html('')\n }\n } else {\n $('#error-price').html('Tiền là giá trị số dương')\n a = false\n }\n\n if (isValidName($pr_name.val())) {\n $('#error-name').html('')\n } else {\n $('#error-name').html('Tên là ký tự chữ số dài từ 2 - 200 ký tự')\n a = false\n }\n\n if($('#txt-file')[0].files[0] == null){\n $('#error-image').html('Chưa chọn hình ảnh!')\n a = false\n }else{\n $('#error-image').html('')\n }\n if(a) emptyError()\n return a;\n }", "function ValidateFile(limit) {\n var wImgFile = document.getElementById('fileinput').files[0];\n\t\tif(wImgFile == null){ModifyElement(\"fl\", \"block\", \"Upload an image\"); return \"isempty\";} //if no file -> return \"isempty\";\n\t\t\n\t\tvar cRegex = new RegExp(\"(.*?)\\.(gif|jpg|jpeg|png|swf|psd|bmp|jpc|jp2|jpx|jb2|swc|iff|wbmp|xbm|ico|webp)$\");\n\t\tvar oPasscount = 0;\n\t\t\n\t\t//truncate filename for display\n\t\tvar wName = (wImgFile.name.length < 30) ? wImgFile.name : wImgFile.name.substring(0,20) + \"...\" + wImgFile.name.substring(wImgFile.name.lastIndexOf(\".\")-3,wImgFile.name.length);\n\t\t//modify label to show the selected file\n\t\tModifyElement(\"fl\", \"block\", wName);\n\t\t\n\t\tvar wSizeWarn = document.getElementById(\"sizeWarning\");\n\t\tvar wTypeWarn = document.getElementById(\"typeWarning\");\n\t\t\n\t\t//Size warning - file must be greater than 12b\n\t\tif(wImgFile.size < 12){\n\t\t\tif(typeof(wSizeWarn) != 'undefined' && wSizeWarn != null){\n\t\t\t\tModifyElement(\"sizeWarning\", \"block\", \"* File is smaller than 12b: \\[\" + wName + \"\\] is \" + wImgFile.size + \"b in size.\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"sizeWarning\",\"upload_warning\",\"* File is smaller than 12b: \\[\" + wName + \"\\] is \" + wImgFile.size + \"b in size.\");\n\t\t\t}\n\t\t}\n\t\telse { \n\t\t\tModifyElement(\"sizeWarning\", \"none\", \"no error\");\n\t\t\toPasscount += 1;\n\t\t}\n\t\t\n\t\t//Size warning - file must be less than limit if there is one\n\t\tif(limit!=null && wImgFile.size > limit){\n\t\t\toPasscount-=1; //prevents error overwriting\n\t\t\t\n\t\t\tif(typeof(wSizeWarn) != 'undefined' && wSizeWarn != null){\n\t\t\t\tModifyElement(\"sizeWarning\", \"block\", \"* File is greater than \" + Math.floor(limit/1000) + \"Kb: \\[\" + wName + \"\\] is \" + Math.ceil(wImgFile.size/1000) + \"Kb in size.\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"sizeWarning\",\"upload_warning\",\"* File is greater than \" + Math.floor(limit/1000) + \"Kb: \\[\" + wName + \"\\] is \" +Math.ceil(wImgFile.size/1000) + \"b in size.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Type warning - file must be an image\n if (!(cRegex.test(wImgFile.name.toLowerCase()))) {\n\t\t\tif(typeof(wTypeWarn) != 'undefined' && wTypeWarn != null){\n\t\t\t\tModifyElement(\"typeWarning\", \"block\", \"* File \\[\" + wName + \"\\] is not a valid image type (.jpeg, .png, .gif)\");\n\t\t\t} else{\n\t\t\t\tAddElement(\"warnings\",\"p\",\"typeWarning\",\"upload_warning\",\"* File \\[\" + wName + \"\\] is not a valid image type (.jpeg, .png, .gif)\");\n\t\t\t}\n }\n\t\telse { \n\t\t\tModifyElement(\"typeWarning\", \"none\", \"no error\");\n\t\t\toPasscount += 1;\n\t\t}\n\n\t\treturn (oPasscount == 2);\n}", "function validFile(req, res, next) {\n if (req.query.type !== \"file\") {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\",\n });\n } else {\n next();\n }\n}", "function validateFile(input,ext,size)\n{\n var file_name = input.value;\n var split_extension = file_name.split(\".\").pop();\n var extArr = ext.split(\"|\");\n if($.inArray(split_extension.toLowerCase(), extArr ) == -1)\n {\n $(input).val(\"\");\n showToaster('error','You Can Upload Only .'+extArr.join(\", \")+' files !');\n return false;\n }\n if(size != \"\"){\n \n }\n}", "function PDFValue(){}", "function PDFValue(){}", "function PDFValue(){}", "function checkFileType() {\n var validFileType = false;\n var regexFileType = /(?:\\.([^.]+))?$/; //whats my extention?\n var checkValidFileType = regexFileType.exec(fileName)[1];\n var validFileTypes = [\"jpeg\", \"png\", \"gif\", \"jpg\"]; //which file types are valid?\n\n for(var i = 0; i < validFileTypes.length; i++){\n if(validFileTypes[i] === checkValidFileType){\n validFileType = true;\n }\n }\n\n if(validFileType){\n return true;\n }else{\n return false;\n }\n\n }", "function checkForPageParameters()\n{\n var fileName = P2.getFieldValue('fileName');\n if (fileName) //we already have file name. We are called for managing this specific file\n {\n P2.hideOrShowPanels(['searchPanel'], 'none');\n P2.act(null, null, 'getDataTypes');\n return;\n }\n //No parameter is passed. We have to allow user to select file\n P2.act(null, null, 'getFiles');\n}", "function validate() {\n return new Promise((resolve, reject) => {\n process.send(['import-validate']);// mainWindow.webContents.send('import-validate');\n let reader = fs.createReadStream(extract)\n .on(\"data\", function (buffer) {\n let header = buffer.toString().split('\\n')[0];\n reader.close();\n if (header === '#ADDED;HASH(B64);NAME;SIZE(BYTES)') {\n resolve();\n } else {\n reject(0);\n }\n })\n .on(\"error\", function (err) {\n console.log(err);\n reject(1);\n })\n });\n}", "function checkValidity(){\n var isValid = true,behFile,bodyNode;\n \n if ( GarrJumpMenus.length < 1){\n isValid = false;\n\t \n behFile = dreamweaver.getConfigurationPath() +\n \"/Behaviors/Actions/\" + FILE_Name;\n \n\t bodyNode = dreamweaver.getDocumentDOM(behFile).body;\n\t\t\t\t\t \n bodyNode.innerHTML = \"<p>&nbsp;</p>\" +\n\t \"<p>\" + MSG_Invalid_Document + \"</p>\" +\n\t \"<p>\" + MSG_Correcting_Document + \"</p>\"; \n }\n return isValid;\n}", "createPDFFile(uid, barcodeArray, barcodePNGArray, real, qr) {\r\n var doc = new PDFDocument({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n let filename;\r\n if (real) {\r\n filename = \"../pdf/production/\" + uid + \".pdf\";\r\n }\r\n else {\r\n filename = \"../pdf/test/\" + uid + \".pdf\";\r\n }\r\n let stream = doc.pipe(fs.createWriteStream(filename));\r\n let total_double_pages = Math.ceil(barcodePNGArray.length / (this.Card_Layout[0] * this.Card_Layout[1]));\r\n //For each double page, generate front and back side\r\n for (let i = 0; i < total_double_pages; i++) {\r\n //Front Page\r\n if (i != 0) {\r\n doc.addPage({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n }\r\n //For each card (row, column)\r\n for (let j = 0; j < this.Card_Layout[0]; j++) {\r\n for (let k = 0; k < this.Card_Layout[1]; k++) {\r\n let barcode_index = i * (this.Card_Layout[0] * this.Card_Layout[1]) + j * this.Card_Layout[1] + k;\r\n if (barcode_index < barcodePNGArray.length) {\r\n let x = j * (240 + 18) + 18;\r\n let y = k * (150 + 40) + 20;\r\n // Add the Card Border\r\n doc.image(\"../assets/img/front.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n //Add the QR Code\r\n if (qr) {\r\n doc.image(barcodePNGArray[barcode_index], x + this.QR_Coords[0], y + this.QR_Coords[1], {\r\n width: this.QR_Width,\r\n height: this.QR_Width\r\n });\r\n // Add the Barcode Number\r\n doc.text(\"\" + barcodeArray[barcode_index], x + this.QR_Coords[0], y + this.QR_Coords[1] + this.QR_Width, {\r\n width: 75,\r\n height: 15,\r\n align: \"center\"\r\n });\r\n }\r\n else {\r\n doc.image(barcodePNGArray[barcode_index], x + this.Barcode_Coords[0], y + this.Barcode_Coords[1], {\r\n width: this.Barcode_Width\r\n });\r\n }\r\n }\r\n }\r\n }\r\n //Back Page\r\n /*\r\n doc.addPage({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n //For each card (row, column)\r\n for (let j = 0; j < this.Card_Layout[0]; j++) {\r\n for (let k = 0; k < this.Card_Layout[1]; k++) {\r\n let barcode_index = i * (this.Card_Layout[0] * this.Card_Layout[1]) + j * this.Card_Layout[1] + k;\r\n if (barcode_index < barcodeArray.length) {\r\n let x = 841.89 - (j * (240 + 18) + 18) - 240;\r\n let y = k * (150 + 40) + 20;\r\n // Add the Card Border\r\n doc.image(\"../assets/img/back.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n }\r\n }\r\n }\r\n */\r\n }\r\n /*\r\n for (var i = 0; i < barcodeArray.length; i++) {\r\n let pageIndex = i % 9;\r\n let rowIndex = pageIndex % 3;\r\n let columnIndex = (pageIndex - rowIndex) / 3;\r\n //Add new Pages\r\n if (pageIndex == 0 && i != 0) {\r\n doc.addPage({\r\n layout: \"landscape\"\r\n });\r\n }\r\n // Calculate Coordinates\r\n let x = rowIndex * (241 + 18) + 18\r\n let y = columnIndex * (150 + 40) + 41\r\n \n // Add the Card Border\r\n doc.image(\"../assets/img/box.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n doc.image(barcodeArray[i], x + this.Barcode_Coords[0], y + this.Barcode_Coords[1], {\r\n width: this.Barcode_Width\r\n });\r\n }\r\n */\r\n doc.end();\r\n return filename;\r\n }", "function beforeSubmit() {\n console.log(\"beforeSubmit\");\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n if( !$('#ebook_file').val()) {\n $(\"#output\").html(\"Are you kidding me?\");\n return false\n }\n var fsize = $('#ebook_file')[0].files[0].size; //get file size\n var ftype = $('#ebook_file')[0].files[0].type; // get file type\n\n //allow only valid image file types\n switch(ftype) {\n case 'application/pdf':\n break;\n default:\n $(\"#output\").html(\"<b>\"+ftype+\"</b> Unsupported file type!\");\n return false\n }\n\n //Allowed file size is less than 1 MB (1048576)\n if(fsize>1048576) {\n $(\"#output\").html(\"<b>\"+bytesToSize(fsize) +\"</b> Too big Image file! <br />Please reduce the size of your photo using an image editor.\");\n return false\n }\n\n //Progress bar\n // progressbox.show(); //show progressbar\n // statustxt.html(completed); //set status text\n // statustxt.css('color','#000'); //initial color of status text\n\n // $('#submit-btn').hide(); //hide submit button\n // $('#loading-img').show(); //hide submit button\n // $(\"#output\").html(\"\");\n }\n else\n {\n //Output error to older unsupported browsers that doesn't support HTML5 File API\n $(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n return false;\n }\n }", "function check(file)\n\t{\n\tvar filename=file.value;\n\tvar ext=filename.substring(filename.lastIndexOf('.')+1);\n\t\tif(ext==\"jpg\" || ext==\"png\" || ext==\"jpeg\" || ext==\"gif\" || ext==\"JPG\" || \n\t\text==\"PNG\" || ext==\"JPEG\" || ext==\"GIF\")\n\t\t{\n\t\tdocument.getElementById(\"submit\").disabled=false;\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"\";\n\t\t}\n\t\telse\n\t\t{\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"! Please upload only JPG , GIF , JPEG File\";\n\t\tdocument.getElementById(\"submit\").disabled=true;\n\t\t}\n\t}", "function _isValidMarkupFile(extn){\n var valid = false;\n switch(extn){\n case 'html':\n case 'shtml':\n case 'htm': valid = true;\n }\n \n return valid;\n }", "function fileValidation(){\n var fileInput = document.getElementById(\"file\")\n var filePath = fileInput.value;\nvar allowedExtenstions = /(\\.jpg|\\.png)$/i;\nif(!allowedExtenstions.exec(filePath)){\n alert(\"Please upload jpg or png\");\n fileInput.value ='';\n return false;\n\n}\n}", "function findBookPdfAttachment(attachmentItems){\n var fileData=false;\n for (let attachmentItem of attachmentItems ){\n console.debug(`>>> Looking at attachment \"${attachmentItem.get('title')}\"...`);\n fileData = attachmentItem.apiObj.links.enclosure;\n // skip all non-pdf attachments\n if ( fileData.type != \"application/pdf\" ){\n console.debug(\">>> Is not a PDF, skipping...\");\n continue;\n }\n break;\n }\n if( ! fileData ){\n throw new Error(\"No main PDF.\");\n }\n return fileData;\n }", "function isPrintingPDF() {\n\n return ( /print-pdf/gi ).test(window.location.search);\n\n }", "function validar_formato_xls(sender){\n\n var validExts = new Array(\".xlsx\", \".xls\");\n var fileExt = sender.value;\n fileExt = fileExt.substring(fileExt.lastIndexOf('.'));\n if (validExts.indexOf(fileExt) < 0) {\n //mensaje\n swal(\"Formato invalido \" ,\"Los formatos admitidos son: xls, xlsx !!\",\"warning\");\n //null el input file\n $(\"#\"+sender.id).val(null);\n }\n else return true;\n\n }//end function validar_formato", "function checkFileObject(pObj) {\n\t\t\t\t\tvar mustHaveCondition = (assertChain(pObj, \"objectType\") && (\"file\" === pObj.objectType)) || (assertChain(pObj, \"image.url\") && assertChain(pObj, \"url.length\")),\n\t\t\t\t\t\tnormalFileConditions = [\n\t\t\t\t\t\t\tassertChain(pObj, \"mimeType\") && (pObj.mimeType.length),\n\t\t\t\t\t\t\tassertChain(pObj, \"fileUrl\") && (pObj.fileUrl.length),\n\t\t\t\t\t\t\tassertChain(pObj, \"objectType\") && (\"file\" === pObj.objectType),\n\t\t\t\t\t\t\tassertChain(pObj, \"image.url\") && assertChain(pObj, \"url.length\")\n\t\t\t\t\t\t];\n\t\t\t\t\treturn (!(-1 === normalFileConditions.indexOf(true))) && (mustHaveCondition);\n\t\t\t\t}", "function YffValidator() {}", "function checkIfFile() \n{\n console.log(linksOnPage[0]);\n for (var i =0; i < linksOnPage.length ; i++) \n {\n if ((linksOnPage[i].substr(linksOnPage[i].length - 4) == '.pdf') ||\n (linksOnPage[i].substr(linksOnPage[i].length - 4) == '.doc') ||\n (linksOnPage[i].substr(linksOnPage[i].length - 5) == '.docx') ||\n (linksOnPage[i].substr(linksOnPage[i].length - 4) == '.vhd'))) \n {\n linksThatAreFiles.push(linksOnPage[i]);\n }\n }\n return linksThatAreFiles;\n}", "function checkFileType(e)\n{\n\t\n\tvar el = e.target ? e.target : e.srcElement ;\n\t var cls = '';\n\tif(parseInt($('input#editUserroleId').val()) > 0 )\n\t{\n\t\tcls = 'marginForError';\n \n\t}\n\t var regex = /png|jpg|jpeg|gif/ ;\n\t if( regex.test(el.value) )\n\t {\n\t\t\n\t\t invalidForm[el.name] = false ;\n\t\t \t\t \n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls +\" success help-inline'>Valid file</span>\");\n\t\t \n\t } else {\n\t\t\n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('error').removeClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls + \" error help-inline'>Please upload valid file</span>\");\n\t\t \n\t\t invalidForm[el.name] = true ;\n\t\t errorBy = el.name ;\n\t }\n}", "function validation() {\r\n\t\t\r\n\t}", "function upload_validation() {\n\t\n\t$('#mw-upload-form').on('submit', function(){\n\t\t\n\t\t//Add space preceding text in Desc and Source\n\t\t$('#mw-input-source, #wpUploadDescription').each(function() {\n\t\t\tvar valFirstChar = $(this).val().charAt(0);\n\t\t\tif (valFirstChar !== '' && valFirstChar !== ' ')\n\t\t\t\t$(this).val( ' ' + $(this).val() );\n\t\t});\n\t\t\n\t\t//Make file extension lowercase\n\t\tvar fileName = $('#wpDestFile').val()\n\t\t , ext = fileName.substring(fileName.lastIndexOf('.')+1).toLowerCase();\n\t\t$('#wpDestFile').val( fileName.slice(0, -1*ext.length) + ext );\n\t\t\n\t});\n\t\n\t//Add the html5 'required' property and 'pattern' attribute to the Source field on Special:Upload\n\t$('#mw-input-source').prop('required', true).attr('pattern', '.*\\\\S.*');\n\t//Add helpful links to Guidelines:Files\n\t$('label[for=mw-input-source]').html('Source (<a href=\"/Guidelines:Files#Sourcing\" target=\"_blank\" title=\"Guidelines:Files\">help</a>)');\n\t$('label[for=mw-input-subject]').html('Subject (<a href=\"/Guidelines:Files#Subject\" target=\"_blank\" title=\"Guidelines:Files\">help</a>)');\n\t\n}", "function validate()\n{\t\n//\talert(\"hiiiiii\");\n\tvar msg=\"You Have Selected \";\n\tfid=document.getElementById(\"formID\").value;\n\tfdos=document.getElementById(\"formSubmissionDate\").value;\n\tfdos=fdos.replace(/\\s{1,}/g,'');\n\tfsn1=document.getElementById(\"candidateFirstName\").value;\n\tfsn1=fsn1.replace(/\\s{1,}/g, '');\n\tfsn2=document.getElementById(\"candidateMiddleName\").value;\n\tfsn2=fsn2.replace(/\\s{1,}/g, '');\n\tfsn3=document.getElementById(\"candidateLastName\").value;\n\tfsn3=fsn3.replace(/\\s{1,}/g, '');\n\tfdob=document.getElementById(\"dateOfBirth\").value;\n\tfdob=fdob.replace(/\\s{1,}/g,'');\n\tfemail=document.getElementById(\"candidateEmail\").value;\n\tfcn=document.getElementById(\"candidateContactNo\").value;\n\tfcn=fcn.replace(/\\s{1,}/g, '');\n\tatt=document.getElementsByName(\"file\");\n\t//Regular Expression\n\tredt=/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/;\n\tran=/^[A-Za-z ]{3,20}$/;\n\tcr=/^[\\w\\s]/;\n\tem1=/^([a-z0-9_.-])+@([a-z0-9_.-])+\\.+([a-z0-9_-]{2,3})+\\.+([a-z0-9_-]{2,3})$/;\n\tem2=/^([a-z0-9_.-])+@([a-z0-9_.-])+\\.+([a-z0-9_-]{3})$/;\n\tvar regPositiveNum = '[-+]?([0-9]*\\.[0-9]+|[0-9]+)$';\n\n\t//Form ID validation\n\tif(fid==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Select FORMID\";\n\t\talert(\"Please Select FORMID\");\n\t\treturn false;\n\t}\n\t//Date Validation\n\tif(fdos==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter Date Of Submission\";\n\t\talert(\"Please Enter Date Of Submission\");\n\t\treturn false;\n\t}\n\n\t//Student Name Validation\n\tif(fsn1=='First Name' || fsn1==\"\")\n\t{\n\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter First Name of Student\";\n\t\talert(\"Please Enter First Name of Student\");\n\t\treturn false;\n\t}\n\tif(fsn1!=''){\n\t\tif(!fsn1.match(ran)){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Invalid First Name of Student\";\n\t\t\talert(\"Invalid First Name of Student\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif(fsn2=='MiddleName' || fsn2==\"\"){\n\t\tdocument.getElementById(\"candidateMiddleName\").value=\"\";\n\t}\n\t\t\n\tif(fsn3=='Last Name' || fsn3==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Last Name of Student\";\n\t\talert(\"Please Enter Last Name of Student\");\n\t\treturn false;\n\t}\n\tif(fsn3!=''){\n\t\tif(!fsn3.match(ran)){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Invalid Last Name of Student\";\n\t\t\talert(\"Invalid Last Name of Student\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//Validate Gender\n\tvar gndr = document.getElementsByName(\"gender\");\n\tif ( ( gndr[0].checked == false ) && ( gndr[1].checked == false ))\n\t{\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please select Gender: Male or Female\";\n\t\talert(\"Please select Gender: Male or Female\");\n\t\treturn false;\n\t}\n\t\n\t//Date of Birth Validation\n\tif( fdob==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter Date Of Birth\";\n\t\talert(\"Please Enter Date Of Birth\");\n\t\treturn false;\n\t}\n\t\n\t//Validate category\n\tct = document.getElementById(\"category\").value;\n\tct = ct.replace(/\\s{1,}/g,'');\n\tif(ct == \"\")\n\t{\talert(\"Please Select Category\");\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Select Category\";\n\t\treturn false;\n\t}\n\t\n\t//Email Validation\n\tif(femail==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\"; \n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter E-mail Id\";\n\t\talert(\"Please Enter E-mail Id\");\n\t\treturn false;\n }\t\n if(!(em1.test(femail) || em2.test(femail))){\n //\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Valid E-mail Id\";\n \talert(\"Please Enter Valid E-mail Id\");\n\t\treturn false;\n }\n \n\t//Contact Number Validation\n\tif(fcn==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Contact Number\";\n\t\talert(\"Please Enter Contact Number\");\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tif(!fcn.match(regPositiveNum)){\n\t\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Numeric contact Number\";\n\t\t\talert(\"Please Enter Numeric contact Number\");\n\t\t\treturn false;\n\t\t}\n\t\tif (fcn<7000000000 || fcn>9999999999){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Valid Phone Number\";\n\t\t\talert(\"Please Enter Valid Phone Number\");\n\t\t\treturn false;\n\t\t}\t\t\n\t\t/*else{\t\t\n\t\t\t//document.getElementById(\"warningbox\").style.visibility=\"collapse\";\n\t\t\tchk=document.getElementsByName(\"file\");\n\t\t\tfor(var i=0;i<chk.length-1;i++){\n\t\t\t\tvar value = document.getElementsByName('file')[i].value;\n\t\t\t\tmsg=msg+value+\" \";\t\t\t\n\t\t\t}\n\t\t\tif(msg==\"You Have Selected \"){\n\t\t\t\tif(!confirm(\"You Have Not Uploaded Any Attachment.\\n \\t Do You Want To Submit ???\"))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(!confirm(msg))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}*/\n\t\treturn true;\n\t}\n}", "function checkExtension()\n{\n // for mac/linux, else assume windows\n var fileTypes = new Array('.ppt','.pptx','.jnt','.rtf','.pps','.pdf','.swf','.doc','.xls','.xlsx','.docx','.ppsx','.flv','.mp3','.wmv','.wav','.wma','.mov','.avi','.mpeg'); // valid filetypes\n var fileName = document.getElementById('fileupload').value; // current value\n var extension = fileName.substr(fileName.lastIndexOf('.'), fileName.length);\n var valid = 0;\n for(var i in fileTypes)\n {\n if(fileTypes[i].toUpperCase() == extension.toUpperCase())\n {\n valid = 1;\n break;\n }\n }\n return valid;\n}", "validate() {}", "function CfnDocumentPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('attachments', cdk.listValidator(CfnDocument_AttachmentsSourcePropertyValidator))(properties.attachments));\n errors.collect(cdk.propertyValidator('content', cdk.requiredValidator)(properties.content));\n errors.collect(cdk.propertyValidator('content', cdk.validateObject)(properties.content));\n errors.collect(cdk.propertyValidator('documentFormat', cdk.validateString)(properties.documentFormat));\n errors.collect(cdk.propertyValidator('documentType', cdk.validateString)(properties.documentType));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('requires', cdk.listValidator(CfnDocument_DocumentRequiresPropertyValidator))(properties.requires));\n errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags));\n errors.collect(cdk.propertyValidator('targetType', cdk.validateString)(properties.targetType));\n errors.collect(cdk.propertyValidator('updateMethod', cdk.validateString)(properties.updateMethod));\n errors.collect(cdk.propertyValidator('versionName', cdk.validateString)(properties.versionName));\n return errors.wrap('supplied properties not correct for \"CfnDocumentProps\"');\n}", "function _checkError(file) {\n var errorMessage = null;\n if( !file ) errorMessage = \"Error creating file on Google Drive :(\";\n if( file.error ) errorMessage = file.message;\n\n if( errorMessage ) {\n _setMessage(errorMessage, \"danger\");\n $(\"#export-csv\").removeClass(\"disabled\").html(\"Export\");\n return true;\n }\n return false;\n}" ]
[ "0.75290984", "0.73973876", "0.7146534", "0.7021656", "0.6979149", "0.67986125", "0.6759464", "0.6586638", "0.6563994", "0.64976907", "0.6400455", "0.6348961", "0.63258517", "0.62632644", "0.6261901", "0.6231844", "0.62240165", "0.61931247", "0.61180466", "0.60936517", "0.60865456", "0.6083756", "0.6079527", "0.60436356", "0.5939397", "0.59387636", "0.586057", "0.5850263", "0.5850263", "0.58438456", "0.58400315", "0.58372986", "0.5819914", "0.57919455", "0.5787078", "0.5786702", "0.57310635", "0.5706899", "0.5705512", "0.56932783", "0.5684835", "0.5681128", "0.5675717", "0.56655824", "0.5656658", "0.5642583", "0.5642583", "0.5632605", "0.560622", "0.560442", "0.5581889", "0.5575293", "0.55520886", "0.5546342", "0.55438834", "0.55158335", "0.5502036", "0.54691374", "0.5464908", "0.5454619", "0.5448592", "0.544686", "0.54403883", "0.542943", "0.5427842", "0.5418543", "0.54085296", "0.54063267", "0.54044014", "0.539843", "0.53966177", "0.5384556", "0.5380858", "0.5373441", "0.5366076", "0.5366076", "0.5366076", "0.53655976", "0.5365339", "0.5348265", "0.53430635", "0.5338923", "0.5338669", "0.5338668", "0.5324031", "0.53229475", "0.53060687", "0.5305984", "0.5305444", "0.5299093", "0.52895194", "0.5266056", "0.5262759", "0.52598035", "0.52556086", "0.5254276", "0.52521443", "0.5248039", "0.5243138", "0.524242" ]
0.7045202
3
searchbtn() end search result output into displayData() area
function displayData(allData) { const data = allData.data console.log(data) let list =[] //put 10 data as object into list----------------------- for (let i = 0; i < 10; i++) { const item = { title: data[i].title, albumTitle: data[i].album.title, albumImage: data[i].album.cover_small, artistName: data[i].artist.name, artistPicture: data[i].artist.picture_small, albumDuration: data[i].duration, } list.push(item) console.log(list) } //*********** showing output result as html into displayResults area*************** let displayResults = document.getElementById("output") displayResults.innerHTML = "" displayResults.style.display = 'block' for (let i = 0; i < list.length; i++) { let {title, albumTitle, albumImage, artistName, artistPicture, albumDuration} = list[i]; displayResults.innerHTML += `<div class="single-result row align-items-center my-3 p-3"> <div class="col-md-6"> <h3 class="lyrics-name mb-3">${title}</h3> <p class="author lead">Artist: <span style="font-weight:600">${artistName}</span></p> <p style="margin-top: -15px;" class="author lead">Album: <span style="font-weight:600">${albumTitle}</span></p> <p style="margin-top: -15px;" class="author lead">Album duration: <span style="font-weight:600">${albumDuration}</span></p> </div> <div class="col-md-3"> <img src="${albumImage}" class="img-fluid rounded-circle"> <img src="${artistPicture}" class="img-fluid rounded-circle"> </div> <div class="col-md-3 text-md-right text-center"> <button onclick="getLyrics('${title}', '${artistName}', '${albumImage}', '${artistPicture}')" class="btn btn-success">Get Lyrics</button> </div> </div>` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearSearchResults() {\n $(\"#output\").text(\"\");\n }", "function endSearch() {\n MicroModal.show(\"addresses-modal\");\n\n // Remove \"Searching...\" message\n $(\".find-address\").text(\"Find Address\");\n\n $(\".find-address\").prop(\"disabled\", false);\n }", "function handleSearchResult(data) {\n\t\tvar searchResult = \"\";\n\t\tsearchResult += \"<div class='resultButton'>\"\n\t\tsearchResult += \"<img class='resultImage' alt='test' src='\" + data[0].profilePicture +\"'\\>\";\n\t\tsearchResult += \"<h2 class='resultName' action='/profile'>\" + data[0].username + \"</h2>\";\n\t\tsearchResult += \"</div>\";\n\t\tdocument.getElementById(\"searchResults\").innerHTML = searchResult;\t\n\t}", "function handleSearch(data){\n\tlet output = data.results;\n\tif (output.length === 0) {\n\t\t$('.results-container').html('');\n\t\t$('body').append(`<div class=\"notify\"><h2>Sorry. We didn't find that show. Please try another.</h2>\n\t\t\t<p class=\"okay\"><strong>OK</strong></p></div>`);\n\t\tnotification();\n\t} else {\n\t\t$('.results-container').html('');\n\t$('.main-head').css('margin', '0%').css('opacity', '0').css('z-index', '-3').css('transition', '1500ms');\n\t$('#search-field').css('margin-top', '-4%').css('transition', '1500ms');\n\t$('body').append(`<div class=\"notify\"><h2>Please select which show you were looking for</h2><p class=\"okay\"><strong>OK</strong></p></div>`);\n\tnotification();\n\tfor (let i = 0; i < output.length; i++) {\n\t\tlet resultName = output[i].name;\n\t\tif (output[i].name.length > 15) {\n\t\t\t\tresultName = output[i].name.substring(0, 15) + '...';\n\t\t}\n\t\t$('.results-container').append(`<div class=\"result-item\" name=\"${output[i].name}\"> \n\t\t\t <p class=\"result-title\">${resultName}</p><br> \n\t\t\t<img id=\"${output[i].id}\" alt=\"${resultName} image\" src=\"https://image.tmdb.org/t/p/w200_and_h300_bestv2/${output[i].poster_path}\"></div>`);\n\t}\n\n\t// Removes initial search results that don't have recommendations\n\tfor (let k = 0; k < output.length; k++) {\n\t\tfunction emptyRecs(){\n\t\t$.get(\n\t\t\t'https://api.themoviedb.org/3/tv/'+ output[k].id + '/recommendations',\n\t\t\t{\n\t\t\t\tapi_key: '08eba60ea81f9e9cf342c7fa3df07bb6',\n\t\t\t},\n\t\t\thandleNullRecs\n\t\t\t)\n\t\t}\n\n\t\tfunction handleNullRecs(e){\n\t\t\tlet imgID = \"#\" + output[k].id;\n\t\t\tif (e.results.length === 0) {\n\t\t\t\t$(imgID).parent().remove();\n\t\t\t}\n\t\t}\n\t\temptyRecs();\n\t}\n\t$('.result-item img').click(recommendations);\n}\n\t}", "function clearOutPutDataToHTML() {\n STATE.searchResult = [];\n render();\n}", "function showResults(search) {\n\t//show loading icon in btn\n\tvar btn = $('#search');\n\t\tbtn.addClass('searching');\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search&search='+search,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t// console.log(data.length);\n\t\t\t// console.log(typeof data[0] !== 'object');\n\t\t\t// var result = JSON.parse(data);\n\t\t\tappendResultToDom(data);\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search failed!', 'short-time-msg-failure');\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t}\n\t}\n\t);\n}", "function search() {\n restartSearch();\n if (searchField.val()) {\n dt.search(searchField.val()).draw();\n }\n if (searchSelect.val()) {\n dt.columns(2).search(searchSelect.val()).draw();\n }\n}", "function search(){\n searchResult = [];\n var input = document.getElementById(\"input\");\n var filter = input.value.toUpperCase();\n var pageSpan = document.getElementById(\"page\");\n \n for(var i = 0; i < data.length; i++){\n \n if(data[i].employee_name.toUpperCase().indexOf(filter) != -1) searchResult.push(data[i]);\n if(searchResult){\n isSearched = true;\n pageSpan.innerHTML = currentPage + \"/\" + numberOfPages();\n currentPage = 1;\n createTable(searchResult,currentPage);\n showAndHideButtons(searchResult,currentPage);\n }\n }\n}", "function displayWeatherButton() {\n document.getElementById(\"btn btn-light\").innerHTML = getResults(searchbox.value);\n}", "function search(elmnt){\n var keyword = elmnt.id;\n var ddId = document.getElementById(keyword+'DD');\n var display;\n\n search.called = 'true';\n \n if (searchedKeywords.length == 0){\n searchedKeywords.push([keyword, 'false']);\n }\n for (var i=0; i<searchedKeywords.length; i++){\n if (searchedKeywords[i][0] == keyword){\n if(searchedKeywords[i][1] == 'false'){\n searchedKeywords[i][1]='true';\n display = searchedKeywords[i][1];\n break;\n } else {\n searchedKeywords[i][1]='false';\n display=searchedKeywords[i][1];\n break;\n }\n } else {\n searchedKeywords.push([keyword, 'false']);\n }\n }\n \n if (display=='true'){\n ddId.style.display = \"grid\";\n ddId.style.gridTemplateColumns = \"1fr 1fr\";\n ddId.style.gridGap=\"1em\";\n ddId.innerHTML = \"<button id='\"+keyword+\"' class='btn btn-default mt-2' onclick='searchAmzn(this)'><i class='fa fa-amazon'></i> Amazon</button><button id='\"+keyword+\"' class='btn btn-success mt-2' onclick='searchGoogle(this)'><i class='fa fa-google'></i> Google</button><button class='btn btn-link more-btn' id='\"+keyword+\"' onclick='searchMore(this)'><i class='fa fa-plus'></i> More</button>\"; \n } if (display=='false'){\n ddId.innerHTML = \"\"; \n }\n}", "function show_results(data, tsearch) \n { sout = '<table id=\"search_table\">';\n sout += result_content (data.nct);\n\n // page navigation\n sout += '<tr><td colspan=\"3\"><p id=\"nav_search\">'\n first = parseInt(data.nct[0][1]);\n last = parseInt(data.nct[data.nct.length-1][1]);\n np = parseInt(data.npag);\n // previous\n if (np > 1)\n sout += '<span id=\"rprev\" class=\"nav_page\"> Previous Page (' + (first-20) + ' - ' + (last-20) + ')</span>';\n else\n sout += '<span> Previous Page </span>'\n // current\n sout += '<span id=\"rshow\"> Showing (' + first + ' - ' + last + ')</span>'\n // next\n pmax = Math.ceil(parseInt(data.n.replace(',',''))/20);\n if (np+1 <= pmax)\n sout += '<span id=\"rnext\" class=\"nav_page\"> Next Page (' + (first+20) + ' - ' + (last+20) + ')</span>'\n else\n sout += '<span> Next Page </span>'\n sout += '</p></td></tr></table>';\n $(\"#results\").html(sout); \n \n // navigation clicks\n $('#rprev').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)-1);\n else\n search(parseInt(data.npag)-1);\n\t$(document).scrollTop(0);\n });\n\n $('#rnext').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)+1);\n else\n search(parseInt(data.npag)+1);\n\t$(document).scrollTop(0);\n });\n\n $('.filter_link').bind('click', function() \n { tag_cloud_filtering (tsearch); });\n }", "function displayResults (a_BTN) {\n // Discard previous results table if any\n // Can happen if we have slow searches, and several have been \"queued\" in series all happening\n // after last updateSearch() dispatch ..\n if (resultsTable != null) {\n\tSearchResult.removeChild(resultsTable);\n\tresultsTable = null;\n\tcurResultRowList = {};\n//\tresultsFragment = null;\n\n\t// If a row cell was highlighted, do not highlight it anymore\n//\tclearCellHighlight(rcursor, rlastSelOp, rselection.selectIds);\n\tcancelCursorSelection(rcursor, rselection);\n }\n\n // Create search results table\n// resultsFragment = document.createDocumentFragment();\n resultsTable = document.createElement(\"table\");\n resultsTable.id = \"resultstable\";\n SearchResult.appendChild(resultsTable); // Display the search results table + reflow\n// resultsFragment.appendChild(resultsTable);\n\n let len = a_BTN.length;\n//trace(\"Results: \"+len);\n if ((len <= 3) && (searchlistTimeoutId != undefined)) { // Close search history immediately when there are too few results\n\tclearTimeout(searchlistTimeoutId);\n\tcloseSearchList();\n }\n if (len > 0) {\n\tlet i;\n\tfor (let j=0 ; j<len; j++) {\n\t i = a_BTN[j];\n\t let url = i.url;\n//trace(\"Matching BTN.id: \"+i.id+\" \"+i.title+\" \"+url);\n\t if ((url == undefined) // folder (or separator ...)\n\t\t || !url.startsWith(\"place:\") // \"place:\" results behave strangely .. (they have no title !!)\n\t\t ) {\n\t\t// Append to the search result table\n\t\tlet BTN_id = i.id;\n\t\tif ((i.type != \"separator\") && (BTN_id != TagsFolder) && (BTN_id != MobileBookmarks)) { // Do not display separators nor Tags nor MobileBookmarks folders in search results\n\t\t let BN = curBNList[BTN_id];\n\t\t if (BN == undefined) { // Desynchro !! => reload bookmarks from FF API\n\t\t\t// Signal reload to background, and then redisplay to all\n\t\t\tsendAddonMessage(\"reloadFFAPI_auto\");\n\t\t\tbreak; // Break loop in case of error\n\t\t }\n\t\t if ((options.trashEnabled && options.trashVisible) || (BN.inBSP2Trash != true)) { // Don't display BSP2 trash folder results except on debug\n\t\t\tappendResult(BN);\n\t\t }\n\t\t}\n\t }\n\t}\n }\n // Stop waiting icon and display the search result table\n WaitingSearch.hidden = true;\n// SearchResult.appendChild(resultsFragment); // Display the search results table + reflow\n}", "function searchSuccess() {\n var results = range.end - range.start;\n if (results === 1)\n $('#status').html(\"Found \" + (range.end-range.start) + \" result\");\n else\n $('#status').html(\"Found \" + (range.end-range.start) + \" results\");\n $('#status').css('color', 'green');\n queryPosition = query.length - 1;\n var resultPositions = new Array();\n for (var i=range.start; i < range.end; ++i) {\n resultPositions.push(bwtIndex.suffixArray[i]);\n }\n bwtView.text.setActiveAll(resultPositions, 'green');\n enableButtons();\n}", "function getInput() {\n\t\t\tsearchBtn.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchTerm = searchValue.value.toLowerCase();\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t\tresults.innerHTML = ''; // clear page for new results\n\t\t\t\tgetData(searchTerm); // run w/ searchTerm\n\t\t\t\tformContainer.reset();\n\t\t\t});\n\t\t}", "function submitButton() {\n $('.js-search-results').html(\"\");\n $('.js-search-form').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('.js-search-location');\n const query = queryTarget.val();\n $('.js-search-location').val(\"\");\n $('.js-results-title').html(\"Results for \" + query);\n getDataFromApi(query, displaySearchData);\n });\n}", "afterSearch(searchText, result) {\n }", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function finishoff(norecs) {\r\n\tif (displayed == 0) {\r\n\t\tdocument.getElementById(\"results_table\").innerHTML = \"<B>You searched for: <\\/B><FONT COLOR=\\\"blue\\\">\" + (search_term==\"\"?\"- no text -\":search_term) + \"</FONT>\" + (changes_to_text==\"\"?\"\":\"<BR>(where the following changes were made: \" + changes_to_text.substr(2,changes_to_text.length) + \")\") + \"<BR><BR>There were <B>no results</B> to display. Perhaps you could try alternative words/terms in your search.\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"results_table\").innerHTML = \"<B>You searched for: <\\/B><FONT COLOR=\\\"blue\\\">\" + (search_term==\"\"?\"- no text -\":search_term) + \"</FONT>\" + (changes_to_text==\"\"?\"\":\"<BR>(where the following changes were made: \" + changes_to_text.substr(2,changes_to_text.length) + \")\") + \"<BR><BR>The <B>results of your search<\\/B> are listed below, and are presented in reverse word order with the most likely matches first. You can click on the links for further information, and to discover your related NS-SEC code.\" + wholedisplaytext + (displayed==norecs?\"<BR><BR><FONT COLOR=\\\"darkgreen\\\"><B>Your search returned more than \"+norecs+\" results. To display the next \"+defaultnorecords+\" results, <INPUT ID=\\\"display_more\\\" TYPE=\\\"BUTTON\\\" CLASS=\\\"SOCbutton\\\" VALUE=\\\"click this button\\\" onclick=\\\"showmoreresults(\"+norecs+\");\\\" /> or try refining your search term.<\\/B><\\/FONT>\":\"\") + \"<BR><BR>For further information about coding, please refer to the <A HREF=\\\"http://www.ons.gov.uk/ons/guide-method/classifications/current-standard-classifications/soc2010/soc2010-volume-2-the-structure-and-index/index.html\\\" TARGET=\\\"_blank\\\" TITLE=\\\"Link to the SOC 2010 Volume 2 coding index\\\">SOC 2010 Volume 2 coding index</A>.<BR>\";\r\n\t};\r\n\tupdatePbar(\"progressbar_oput\",100);\r\n\tdocument.getElementById(\"img_oput\").src = \"data/done.gif\";\r\n\tdocument.getElementById(\"progresstitle\").innerHTML = \"Search complete!\";\r\n\tdocument.getElementById(\"search_jobs\").disabled = false;\r\n\tdocument.getElementById(\"search_cancel\").disabled = true;\r\n\tdocument.getElementById(\"progressbarwrapper\").style.display = \"none\";\r\n}", "function endSearch() {\n // Load the status messages to the DOM\n for(const searchProblem of searchProblems) {\n $(\".search-problems\").append(`\n <p class=\"wildlife-status\">${searchProblem}</p>\n `);\n }\n\n // Remove searching message from page\n console.log(\"Search complete\");\n $(\".search-status\").text(\"Search complete\");\n $(\".search-status\").addClass(\"hidden\")\n\n $(\".wildlife-results\").removeClass(\"hidden\");\n\n $(\".wildlife-submit\").prop(\"disabled\", false);\n }", "function displaySearch(data) {\n var result = data.query.search;\n $(\".search-result\").html(\"\");\n for (var i = 0; i < result.length; i++) {\n var tmp =\n '<div class=\"row result\" id=\"result-' +\n (i + 1) +\n '\">' +\n '<h5 class=\"title\" id=\"title' +\n (i + 1) +\n '\">' +\n '<a href=\"https://en.wikipedia.org/wiki/' +\n result[i].title +\n '\"> ' +\n result[i].title +\n \"</a></h5><br>\" +\n '<p class=\"snippet\" id=\"snippet' +\n (i + 1) +\n '\">' +\n result[i].snippet +\n \"...</p></div>\";\n $(\".search-result\").html($(\".search-result\").html() + tmp);\n }\n $(\".result\").css({\n background: \"rgba(244, 244, 244)\",\n margin: \"15px\",\n padding: \"15px\",\n width: \"100%\"\n });\n}", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function _searchResultChanged(data) {\n _updateState(hotelStates.FINISH_SEARCH, data);\n }", "function clearResults()\r\n{\r\n\t// Stop any existing search.\r\n\tsearchControl.cancelSearch();\r\n\t\r\n\t// Clear the results.\r\n\tresults = new Array();\r\n\tresultProgress = new Array();\r\n\tresultCounter = 0;\r\n\twriteDiv('results', null, \"\");\r\n\tshowProgress(0);\r\n\t\r\n\t// Clear the input box.\r\n\tsetControlValue(\"searchInput\", \"\");\r\n}", "function clearResults(){\n searchResults.innerHTML = '';\n}", "function searchQuery(){\n\t// clear the previous search results\n\t$(\"#content\").html(\"\");\n\t// get the query from the search box\n\tvar query = $(\"#searchBox\").val().replace(\" \", \"%20\");\n\tdisplaySearchResults(query);\n\t// clear search box for next query\n\t$(\"#searchBox\").val(\"\");\n}", "function clearSearchResults() {\n $(\"#results\").html(\"\");\n}", "function searchButtonClicked() {\n if (!processConfiguration()) {\n window.alert(\"Error on configuration. Be sure to add valid access tokens to configuration first to perform a search.\");\n return\n }\n //nothing entered...\n searchString = processSearchString(document.getElementById(\"input\").value);\n if (searchString == \"\") {\n return;\n }\n sources = [];\n projects = [];\n connectorAPIs = [];\n connectorManager = new ConnectorManager(token_config['GitHub'], token_config['GitLab']);\n //resetting the necessary values\n getSources();\n getConnectors();\n currentPage = 1;\n maxPage = 1;\n receivedProjects = 0;\n rowCounter = 0;\n //the date is used to ignore newly created projects\n //-> would lead to displacements when changing pages\n date = new Date(Date.now()).toISOString().replace(/[\\..+Z]+/g, \"+00:00\");\n document.getElementById(\"lastSearchedOutput\").innerHTML = searchString;\n initiateSearch();\n}", "function updateData() {\r\n data.filter(getFilter)\r\n simulation.updateData(getFilter);\r\n courseMap.update(getHighlight);\r\n $(\"#search-results\").empty();\r\n if (search.searching) {\r\n let searchResults = data.courses.filter(getHighlight);\r\n $.each(searchResults.slice(0, 3), (i, e) => {\r\n $(\"#search-results\")\r\n .append(`<a href=\"#\" class=\"list-group-item\">${e.subject} ${e.catalog_number}</a>`);\r\n $(\"#search-results>a\").last().click(function () {\r\n courseMap.zoomTo(e);\r\n showDetails(e)\r\n });\r\n });\r\n if (searchResults.length > 3) {\r\n $(\"#search-results\")\r\n .append(`<a href=\"#\" class=\"list-group-item\">+ ${searchResults.length - 3} more</a>`);\r\n $(\"#search-results>a\").last().click(function () {\r\n $(\"#search-results>a\").last().remove()\r\n $.each(searchResults.slice(3), (i, e) => {\r\n $(\"#search-results\")\r\n .append(`<a href=\"#\" class=\"list-group-item\">${e.subject} ${e.catalog_number}</a>`);\r\n $(\"#search-results>a\").last().click(function () {\r\n courseMap.zoomTo(e);\r\n showDetails(e)\r\n });\r\n });\r\n });\r\n }\r\n }\r\n}", "function search(data){\n setSearch(data); \n }", "function handleContinedSearch(data){\n setContinuedNavigation(data);\n clearOldResults(data);\n renderResults(data);\n}", "function handleSearchEvent() {\n const newData = filterStudents(searchValue);\n showPage(newData, 1);\n addPagination(newData);\n}", "endSearch() {\n if (!this._isEnabled) {\n return;\n }\n this.hideLoading();\n // When inside Ionic Modal and onSearch event is used,\n // ngDoCheck() doesn't work as _itemsDiffer fails to detect changes.\n // See https://github.com/eakoriakin/ionic-selectable/issues/44.\n // Refresh items manually.\n this._setItems(this.items);\n this._emitOnSearchSuccessOrFail(this._hasFilteredItems);\n }", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "function displayResults (data) {\n displayList(data);\n initMap(data);\n unhideHtml();\n}", "function searchAftrClick() {\n var searchTerm = $(\"#searchTerm\").val();\n\n if (searchTerm.length > 0) {\n sample();\n } else {\n // search string is of 0 length ... remove list of previous results\n $(\"#output\").html(\"<hr>\");\n }\n}", "function showResults () {\n const value = this.value\n const results = index.search(value, 8)\n // console.log('results: \\n')\n // console.log(results)\n let suggestion\n let childs = suggestions.childNodes\n let i = 0\n const len = results.length\n\n for (; i < len; i++) {\n suggestion = childs[i]\n\n if (!suggestion) {\n suggestion = document.createElement('div')\n suggestions.appendChild(suggestion)\n }\n suggestion.innerHTML = `<b>${results[i].tablecode}</>: ${results[i].label}`\n // `<a href = '${results[i].tablecode}'> ${results[i]['section-name']} ${results[i].title}</a>`\n\n // console.log(results[i])\n }\n\n while (childs.length > len) {\n suggestions.removeChild(childs[i])\n }\n //\n // // const firstResult = results[0].content\n // // const match = firstResult && firstResult.toLowerCase().indexOf(value.toLowerCase())\n // //\n // // if (firstResult && (match !== -1)) {\n // // autocomplete.value = value + firstResult.substring(match + value.length)\n // // autocomplete.current = firstResult\n // // } else {\n // // autocomplete.value = autocomplete.current = value\n // // }\n }", "function search() {\n\t\n}", "function clicked() {\n search()\n; }", "function performSearch(button)\n{\n $(\"#results\").empty();\n settings = getSearchSettings();\n resultsList = [];\n for ([key, value] of filesToDisplays)\n {\n if (doesFileMatch(key, settings))\n {\n resultsList.push(key);\n }\n }\n compareFunc = getCompareFunc();\n filterFunc = getFilterFunc();\n if (compareFunc !== null) {\n resultsList = resultsList.filter(filterFunc);\n resultsList.sort(compareFunc);\n }\n fragment = document.createDocumentFragment();\n for (result of resultsList)\n {\n fragment.appendChild(filesToDisplays.get(result));\n }\n document.getElementById(\"results\").appendChild(fragment);\n}", "function show_data(data, query){\n var have_no_data = true;\n $('#data-tables').empty();\n for (data_type in data.results) {\n\n if(data.results[data_type].data.length > 0) {\n have_no_data = false;\n if(data.results[data_type].detail) {\n build_detail(data_type, data.results[data_type]);\r\n }\n else {\n build_table(data_type, data.results[data_type]);\n }\n }\n }\n have_no_data && $('#data-tables').html('<h4>No results found</h4>');\n var stateObj = { html: document.getElementById('main-content').innerHTML};\n var new_url = [base_url, query].join('#!');\n history.pushState(stateObj, \"Data Dashboard\", new_url);\n //only crime data for now\n var not_last_searched = true;\n if(query.indexOf('last-searched') !== -1) {\n not_last_searched = false;\n }\n var filtered_query = allowed_alert(query);\n if(not_last_searched && filtered_query) {\n var query_btn_text = '';\n if(filtered_query != query) {\n query_btn_text = ' (only crime data will be used)';\n }\n $('#data-tables').prepend('<button type=\"button\" style=\"margin-bottom: 1em\" class=\"btn-default btn\" id=\"dd-save-query\" data-query=\"' + filtered_query + '\">Create an alert with this search</button>' + query_btn_text);\n }\n $('#dd-save-query').click(function(e) {\n e.preventDefault();\n var query = $(this).data('query');\n create_alert(query);\n });\n }", "function search() {\n\t\tvar query_value = $('input#search').val();\n\t\t$('b#search-string').html(query_value);\n\t\tif(query_value !== ''){\n //alert(\"Uneto:\"+query_value);\n\t\t\t$.ajax({\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t\t\tdataType: \"json\",\n\t\t\t\turl: \"QuickSearchResults?name=\"+query_value,\n\t\t\t\tsuccess: function(server_response){\n var content=returnHtmlContent(server_response);\n\t\t\t\t\t$(\"ul#results\").html(content);\n \n //menjamo border radius kad se predje strlicom preko polja\n $(\".result\").mouseover(function(){\n //alert(\"called\");\n $(this).css({\"border-radius\": \"10px;\"});\n });\n $('.result').click(function(){\n var idFilm=$(this).children(\":first\").attr(\"id\");\n //alert(\"Kliknuto\");\n showInfo(idFilm); \n });\n\t\t\t\t}\n\t\t\t});\n \n /**/\n\t\t}\n\n return false; \n\t}", "function search() {\r\n const h2 = document.getElementsByTagName('h2')[0] \r\n const label = document.createElement('label')\r\n const input = document.createElement('input')\r\n const button = document.createElement('button')\r\n const img = document.createElement('img')\r\n label.className = 'student-search'\r\n label.setAttribute('for', 'label')\r\n h2.insertAdjacentElement('afterend', label)\r\n input.placeholder = 'Search by name...'\r\n input.id = 'search'\r\n label.appendChild(input)\r\n button.type = 'button'\r\n label.appendChild(button)\r\n img.src = 'img/icn-search.svg'\r\n img.alt = 'Search icon'\r\n button.appendChild(img)\r\n\r\n // Completes search after clicking on Search button\r\n button.addEventListener('click', (e) => {\r\n let searchValue = input.value\r\n console.log('Value of Search: ', searchValue)\r\n const results = []\r\n for(let i = 0; i < data.length; i++) {\r\n const firstName = data[i].name.first.toUpperCase()\r\n const lastName = data[i].name.last.toUpperCase()\r\n if(searchValue.toUpperCase() === firstName || searchValue.toUpperCase() === lastName) {\r\n results.push(data[i])\r\n } \r\n }\r\n input.value = ''\r\n if(results.length > 0) {\r\n showPage(results, 1)\r\n addPagination(results)\r\n } else {\r\n student_list.innerHTML = ''\r\n link_list.innerHTML = ''\r\n student_list.insertAdjacentHTML('beforeend', '<h2>No results found</h2>')\r\n }\r\n })\r\n\r\n // Completes search with each key-up\r\n input.addEventListener('keyup', (e) => {\r\n let searchValue = (e.target.value).toUpperCase()\r\n const results = []\r\n for(let i = 0; i < data.length; i++) {\r\n let firstName = data[i].name.first.toUpperCase()\r\n let lastName = data[i].name.last.toUpperCase()\r\n if(firstName.includes(searchValue) || lastName.includes(searchValue)) {\r\n results.push(data[i])\r\n }\r\n if(results.length > 0) {\r\n showPage(results, 1)\r\n addPagination(results)\r\n }\r\n // console.log('From within keyup: ', results)\r\n }\r\n if(results.length === 0) {\r\n student_list.innerHTML = ''\r\n link_list.innerHTML = ''\r\n student_list.insertAdjacentHTML('beforeend', '<h2>No results found</h2>')\r\n }\r\n })\r\n}", "function search_results(data, context){\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $('#loading').hide();\n $search_results.hide();\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2>');\n if (data.ids.length>0) {\n $search_results.append('<ul class=\"paging\"></ul>');\n pager = $('ul.paging');\n for(item in data.ids) {\n object_id = data.ids[item];\n display_item(object_id, pager);\n }\n } else {\n $search_results.append('<div>None found. Please try again...</div>');\n }\n page_size = 10;\n if (data.ids.length>200) {\n page_size = data.ids.length/20;\n }\n pager.quickPager({pageSize: page_size, pagerLocation: \"both\"});\n $search_results.fadeIn();\n }", "function search() {\n var query_value = $('input#searchbar').val();\n $('b#search-string').html(query_value);\n if(query_value !== ''){\n $.ajax({\n type: \"POST\",\n url: \"/g5quality_2.0/search.php\",\n data: { query: query_value },\n cache: false,\n success: function(html){\n $(\"ul#results\").html(html);\n }\n });\n }return false;\n }", "function displaySearchResult(search) {\n window.location.replace(\"?=\" + food + \"\");\n }", "function clearPreviousResults() {\n searchResults.innerHTML = '';\n}", "getResult(){\r\n // Call database\r\n this.getMovie();\r\n this.getSeries();\r\n this.getGenreMovie();\r\n this.getGenreSerie();\r\n \r\n // Clear Searchbar\r\n this.searchInput= ''; \r\n }", "arrayLikeSearch() {\r\n this.setEventListener();\r\n if (!this.display || this.display == this.selectedDisplay) {\r\n this.setEmptyTextResults();\r\n \r\n return true;\r\n }\r\n this.resultslength = this.results.length;\r\n this.$emit(\"results\", { results: this.results });\r\n this.load = false;\r\n\r\n if (this.display != this.selectedDisplay) {\r\n this.results = this.source.filter((item) => {\r\n return this.formatDisplay(item)\r\n .toLowerCase()\r\n .includes(this.display.toLowerCase())&& !item.invisible;\r\n });\r\n \r\n \r\n }\r\n }", "function onSearchComplete() {\n $('events').hide(); $('search-results').show(); $('back-to-events-button').show();\n}", "function setSearchClick(searchUrl) {\n $(\"#search-btn\").on(\"click\", function() {\n var searchInput = $(\"#search-input\").val();\n if (!searchInput == \"\") {\n $(\"#result-panels-wrapper\").html(\"\");\n getSearchData(searchUrl, searchInput);\n }\n });\n}", "function displaySearchResults(data) {\n const list = data.data.results;\n\n if (list.length === 0) {\n $('.unknown-section').html(`\n <div class='unknown'>\n <h2>No character found by that name.</h2>\n </div>\n `);\n\n $('.main-unknown-section').prop('hidden', false);\n $('.search-results-section').prop('hidden', true);\n\n return;\n }\n\n $('.main-unknown-section').prop('hidden', true);\n $('.search-results-section').prop('hidden', false);\n\n for (let i = 0; i < list.length; i++) {\n $('.search-results').append(`\n <div class=\"search-result\">\n <a href=\"#\" class=\"result-name\">${list[i].name}</a>\n </div>\n `);\n }\n}", "function displayResults(data) {\n console.log('Results that will be displayed in HTML looks like this first:', data);\n $('#results').append(resultsHTML(data));\n }", "function clear () {\n self.searchTerm = '';\n search();\n }", "function salir_search(){\n\t\tdocument.getElementById('resultado').innerHTML='';\n\t\tdocument.getElementById('resultado').style.display='none';\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function executeSearch() {\n\tlet user_input = $('#class-lookup').val().toUpperCase();\n\t\t\n\t// clears search results\n\t$('#search-return').empty();\n\n\t// display search hint when input box is empty\n\tif (user_input == \"\"){\n\t\t$('#search-return').append(emptySearchFieldInfo());\n\t}\n\t\n\tfor (course in catalog) {\n\t\t\n\t\t// user input describes a course code\n\t\tif (user_input == course) {\n\t\t\t$('#search-return').append(createCourseContainer(course));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// user input describes a department code\n\t\tif (user_input == catalog[course]['department']) {\n\t\t\t$('#search-return').append(createCourseContainer(course));\n\t\t}\n\t\t\n\t}\n\t\n\t// display a message if no results is returned\n\tif ($('#search-return').children().length == 0) {\n\t\t$('#search-return').append(`<li style='border: 3px solid black;'>\n\t\t\t\t\t\t\t\t\t\t<h3>Sorry, we couldn't find what you were looking for.</h3>\n\t\t\t\t\t\t\t\t\t</li>`)\n\t}\n}", "function displaySearchResults(response, search) {\n var user_finder = new RegExp(search, 'i'),\n results_string = \"\",\n i,\n j;\n\n if(globe.getID(0)) {\n removeLink();\n }\n\n if (globe.search_type_name.checked) {\n for (i = 0; i < response.length; i += 1) {\n if (user_finder.test(response[i].toMake)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].toMake + \"</p>\";\n globe.addID(i.toString());\n }\n }\n } else {\n for (i = 0; i < response.length; i += 1) {\n for (j = 0; j < response[i].ingredients.length; j += 1) {\n if (user_finder.test(response[i].ingredients[j].ingredient)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].ingredients[j].ingredient + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n }\n\n globe.hint_span.innerHTML = \"\";\n if (results_string === \"\") {\n results_string = \"<span>No results.</span>\";\n }\n globe.results_div.innerHTML = results_string;\n \n if (globe.getID(0)) {\n createLink();\n }\n}", "function displaySearchData(data) {\n console.log(data.businesses.length);\n if (data.businesses.length === 0) {\n const results = noRestaurantsMessage();\n $('.js-search-results').prop('hidden', false);\n $('.js-search-results').html(results);\n }\n else {\n const results = data.businesses.map((item, index) => renderResult(item));\n $('.js-search-results').prop('hidden', false);\n $('.js-search-results').html(results);\n }\n}", "function searchFilter (list) {\n const inputValue = document.querySelector('.student-search input').value.toLowerCase();\n const results = [];\n active = document.querySelector('button');\n active.className = 'active';\n//loop over list and push into array\n for (let i = 0; i < list.length; i++) {\n let result = list[i].name.first.toLowerCase() + ' ' + list[i].name.last.toLowerCase();\n if (result !== 0 && result.includes(inputValue)){\n results.push(list[i]);\n \n }\n \n//Display a no results found message \n if(results.length === 0){\n const createDiv = document.createElement('div');\n const noResults = document.createElement('p');\n createDiv.appendChild(noResults);\n document.querySelector('.student-list').append(createDiv);\n noResults.textContent = \"No Results Found\";\n \n} \n\n\n // display results of input\nshowPage(results, 1);\naddPagination(results); \n } \n\n }", "function buttonSearch(){\n\tsearchTerm = this.attributes[2].value; \n\tsearchTerm = searchTerm.replace(/\\s+/g, '+').toLowerCase();\n\t\t\n \tdisplayGifs ();\n}", "function displayData(data) {\n let searchTextBox = document.getElementById(\"keyword\");\n let queryItem = searchTextBox.value;\n queryItem = queryItem.trim().toLowerCase();\n let mainContainer = document.getElementById(\"search-list\");\n\n // Clear any previous search result\n while (mainContainer.firstChild) {\n mainContainer.removeChild(mainContainer.firstChild);\n }\n\n // Create ul list and append to container\n let ul = document.createElement('ul');\n ul.setAttribute('id', 'ul-results');\n mainContainer.appendChild(ul);\n\n // Display everything if no input\n if (queryItem == '') {\n for (let i = 0; i < data.Sheet1.length; i++) {\n if (!itemsChosen.includes(data.Sheet1[i].Exercise_name)) {\n let liItem = document.createElement(\"li\");\n let aElem = document.createElement(\"a\");\n let link = document.createTextNode(data.Sheet1[i].Exercise_name); \n \n aElem.setAttribute('onClick', `addAFormItem(${data.Sheet1[i].undefined}, \"${data.Sheet1[i].Exercise_name}\"); removeListItem(${data.Sheet1[i].undefined});`);\n aElem.appendChild(link);\n \n liItem.setAttribute('id', data.Sheet1[i].undefined);\n liItem.appendChild(aElem);\n \n ul.appendChild(liItem);\n }\n }\n }\n\n // Filter items and display the filtered result\n else {\n let foundAName = false;\n\n // Display all the exercise names that contain the query name\n for (let i = 0; i < data.Sheet1.length; i++) {\n\n // If a exercise name has part of the query, display it\n if (data.Sheet1[i].Exercise_name.toLowerCase().indexOf(queryItem) > -1 && !itemsChosen.includes(data.Sheet1[i].Exercise_name)) {\n let liItem = document.createElement(\"li\");\n let aElem = document.createElement(\"a\");\n let link = document.createTextNode(data.Sheet1[i].Exercise_name); \n\n aElem.setAttribute('onClick', `addAFormItem(${data.Sheet1[i].undefined}, \"${data.Sheet1[i].Exercise_name}\"); removeListItem(${data.Sheet1[i].undefined})`);\n aElem.appendChild(link);\n\n liItem.setAttribute('id', data.Sheet1[i].undefined);\n liItem.appendChild(aElem);\n\n ul.appendChild(liItem);\n foundAName = true;\n }\n }\n\n // If no results show, display message\n if (foundAName == false) {\n let msg = document.createTextNode(\"Sorry, we can't find what you're looking for. Instead, add your own item.\");\n let liItem = document.createElement(\"li\");\n let aElem = document.createElement(\"a\");\n\n liItem.setAttribute('style', 'color:white');\n\n aElem.appendChild(msg);\n liItem.appendChild(aElem);\n\n ul.appendChild(liItem);\n }\n }\n}", "function displaySearch(results) {\n console.log(results);\n $(\".travelResults\").empty(); //Prevents Search Duplicates\n\n var searchContent = \"\"; //String to creates out View Results\n searchContent = '<div class=\"panel-group\">';\n searchContent += '<div class=\"panel panel-info\">';\n searchContent += '<div class=\"panel-heading\">';\n searchContent += '<img class=\"img_small\" src=\"' + results[\"logo_url\"] + '\" /> ';\n searchContent += '<span style=\"font-size: 18pt;color: coral;vertical-align: middle;\">' + results[\"walkscore\"] + '</span>';\n searchContent += '<a href=\"' + results[\"more_info_link\"] + '\">';\n searchContent += '<img class=\"img_small\" src=\"' + results[\"more_info_icon\"] + '\"/>';\n searchContent += '</a>';\n searchContent += '</div>';\n searchContent += '<div class=\"panel-body\">';\n searchContent += '<p style=\"font-size: 11pt;color: steelblue;vertical-align: middle;\"> <strong>Description:</strong> ' + results[\"description\"] + '</p>';\n searchContent += '</div>';\n searchContent += '<div class=\"panel-footer\">';\n searchContent += '<a style=\"font-size:8pt;color:darkgray;\" href=\"' + results[\"help_link\"] + '\">' + 'For How Walks Score Works!' + '</a>';\n searchContent += '</div>';\n $(\".travelResults\").append(searchContent);\n}", "function displaySearchTag(searchTerm) {\n $(\"#countCopy\").html(\" for: <strong>\" + searchTerm + \"</strong> <span id='clearSearch'>Clear Search</span>\");\n $(\"#clearSearch\").click(function () {\n //reset global array, search field contents, and result count on page\n SearchArray = [];\n $(\"#search\").val(\"\");\n $(\"#countCopy\").html(\"\");\n\n //restore inputs to all facets\n var facetsToRender = getApplicableFacets(AllLib);\n renderFacetInputs(facetsToRender);\n applyFilters();\n });\n}", "function dosearch() {\n // Now find transfers\n drawChart();\n}", "function search () {\n saveState();\n self.filtered = self.gridController.rawItems.filter(self.filterFunc);\n self.gridController.doFilter();\n }", "function displayResults(weather) {\n // console.log(weather);\n weatherImg.src = \"https://openweathermap.org/img/wn/\" + weather.weather[0].icon + \"@2x.png\";\n\n\n city.innerText = `${weather.name},${weather.sys.country}`;\n // Date \n date.innerText = dateBuilder(todayDate);\n // Current Temperature\n currTemp.innerHTML = `${Math.round(weather.main.temp)}<span> °c</span>`;\n // weather description\n weatherDescription.innerText = `${weather.weather[0].description}`;\n // High Low\n\n searchbox.value = \"\";\n}", "function processSearch(response) {\r\n\tlet responseData = JSON.parse(response);\r\n\t searchResults = responseData.results;\r\n\t results_html=\"\";\r\n\tfor (i in responseData.results)\r\n\t\tresults_html+=\"<p onclick=\\\"nameClicked(event)\\\" id=\"+responseData.results[i].id+\" class=results>\"+responseData.results[i].name+\"</p>\";\r\n\r\n\tdocument.getElementById(\"output\").innerHTML=results_html;\r\n}", "function searchthis(e){\n $.search.value = \"keyword to search\";\n $.search.blur();\n focused = false;\n needclear = true;\n}", "function onChangeSearch(data, searchFor) {\n var children = $(data).find(\"tbody\").children();\n hideNonMatches(children, searchFor);\n}", "function run_search() {\n var q = $(elem).val();\n if (!/\\S/.test(q)) {\n // Empty / all whitespace.\n show_results({ result_groups: [] });\n } else {\n // Run AJAX query.\n closure[\"working\"] = true;\n $.ajax({\n url: \"/search/_autocomplete\",\n data: {\n q: q\n },\n success: function(res) {\n closure[\"working\"] = false;\n show_results(res);\n }, error: function() {\n closure[\"working\"] = false;\n }\n })\n }\n }", "function displayResults(data){\r\n // remove all past results\r\n $(\".results\").remove();\r\n // lift WikiSearch title to top of page\r\n $(\".titleClass\").css(\"padding-top\",\"0px\");\r\n // show results\r\n \r\n const result = data[\"query\"][\"search\"][0][\"title\"];\r\n // create div for all search results\r\n $(\".searchMenu\").append(\"<div class = 'searchResults results'></div>\");\r\n // main search result title\r\n $(\".searchResults\").append(\"<div class='searchTitle'></div>\");\r\n $(\".searchTitle\").html(\"Search Results for <a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+result+\"\\'>\"+result+\"</a>\"); // push titleClass to top of page\r\n \r\n // results\r\n for (var ii =1; ii < data[\"query\"][\"search\"].length -1; ii++){\r\n // create div for each result\r\n $(\".searchResults\").append(\"<div class='key\" + ii + \" result'></div>\");\r\n // append to div\r\n var searchResult = data[\"query\"][\"search\"][ii][\"title\"];\r\n $(\".key\" + ii).append(\"<p class = 'resultTitle'><a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+searchResult+\"\\'>\"+searchResult+\"</a></p>\");\r\n $(\".key\"+ii).append(\"<p class = 'resultText'>\" + data[\"query\"][\"search\"][ii][\"snippet\"]+\"...\" + \"</p>\");\r\n }\r\n}", "function populateResults() {\n\n\n\n //display the loading div\n showLoadingDiv(true);\n\n //get the path\n var value = $(idSearchBoxJQ).val();\n previousSearchValue = value; //store this value in the previous value.\n\n\n getData(value);\n\n\n }", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function singleSearchBar(){\n const searchText = document.getElementById(\"anySearch\").value.toLowerCase();\n console.log(searchText);\n const result = [];\n const nameResult = findByName(searchText, searchText);\n console.log('nameResult:');\n console.log(nameResult);\n result.concat(nameResult);\n renderedTable(result);\n}", "function prevResultSet(searchTerm)\n{\n const settings = {\n url: BOOKS_SEARCH_URL,\n data: {\n q: `${searchTerm}`,\n maxResults: 6,\n startIndex: startIndex\n },\n dataType: 'json',\n type: 'GET',\n success: displayData\n };\n $.get(settings);\n}", "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "function onExecuteSearch(searchInput, resultsContainer)\n{\n var query = searchInput.value;\n\n if(query)\n {\n getResults(query, function(results) {\n\n var resultsList = getResultsList(results);\n\n // Clear existing results container (if applicable)\n var currResultsList = document.getElementById('results');\n if(currResultsList)\n {\n resultsContainer.removeChild(currResultsList);\n }\n\n // Display current results\n resultsContainer.appendChild(resultsList);\n\n });\n }\n}", "function doSearchResults(data, elem) {\n\t\n\t// store a reference to the search results node so we\n\t// don't keep looking it up\n\tvar results = $(elem);\n\t\n\t// variables to store the data\n\tvar id;\n\tvar cinema;\n\tvar exhibitor;\n\tvar address;\n\tvar entry = '';\n\tvar para;\n\n\t// empty any existing search results\n\tresults.empty();\n\t\n\tif(data.results.length > 0) {\n\t\n\t\t// loop through all of the items\n\t\t$.each(data.results, function(index, value) {\n\t\t\n\t\t\tentry = '<p class=\"fw-search-result fw-search-result-' + value.state + '\">' + value.result + ' </p>';\n\t\t\n\t\t\tpara = $(entry);\n\t\t\t\n\t\t\tif($.inArray(marques.computeLatLngHash(value.coords), mapData.hashes) > -1) {\n\t\t\t\tentry = '<span class=\"fw-add-to-map\">Added</span>';\n\t\t\t} else {\n\t\t\t\tentry = '<span id=\"' + value.type + \"-\" + value.id + '\" class=\"fw-add-to-map add-to-map fw-clickable\">Add to Map</span>';\n\t\t\t}\n\t\t\t\n\t\t\tentry = $(entry);\n\t\t\t\n\t\t\tentry.data('result', value);\n\t\t\tpara.data('result', value);\n\t\t\t\n\t\t\tpara.append(entry);\n\t\t\t\n\t\t\tresults.append(para);\n\t\t\n\t\t});\n\t\t\t\n\t} else {\n\t\tresults.append('<p class=\"no-search-results\">No Search Results Found</p>');\n\t}\n\n}", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function handleNewSearch(data){\n setNewNavigation(data);\n clearOldResults(data);\n renderResults(data);\n}", "function getDataFromAPI() {\r\n\r\n $(\"#searchWindow\").removeClass('d-none');\r\n\r\n $(\"#resultBody\").html(``);\r\n let searchData = $(\"#searchField\").val();\r\n // Handle Empty field\r\n if (searchData === \"\" || searchData === null) {\r\n alert(\"Please Search For Something\");\r\n }\r\n else {\r\n getBooks(searchData, 0);\r\n }\r\n // Inicializa o primeiro livro\r\n //updateCurrentBook('0');\r\n\r\n}", "function searched() {\n\n $(\".searched\").click(function (event) {\n console.log($(this).text())\n // event.stopPropagation()\n // event.preventDefault()\n var city = $(this).text()\n getWeather(city)\n getForecast(city)\n console.log(city)\n $('#dashBoard').empty()\n $('#foreCast').empty()\n $('#city').val(\"\")\n $('#five').empty()\n })\n\n }", "function parseSearchResult(data) {\r\n $(\".search-results-table\").find(\".content-row\").remove();\r\n data = data.slice(0, 20);\r\n data.forEach(addSearchResult);\r\n}", "function SearchResults() {\n\n}", "function watchForSubmit(){\n $(\".js-submit-search\").on('click', function(){\n event.preventDefault();\n\n $('.js-results').contents().remove();\n\n const query = $(this).prev().val();\n console.log($(this).prev().val());\n getDataFromAPI(query, displaySearchData);\n });\n}", "closeSearchList() {\n this.searchList = [];\n this.showSearchList = false;\n this.searchText = '';\n this.recordFound = false;\n }", "function search() {\n\ttry {\n\t\tvar data = getDataSearch();\n\t\t$.ajax({\n\t\t\ttype \t\t: 'POST',\n\t\t\turl \t\t: '/stock-manage/input-output/search',\n\t\t\tdataType \t: 'json',\n\t\t\tdata \t\t: data,\n\t\t\tloading \t: true,\n\t\t\tsuccess: function(res) {\n\t\t\t\tif (res.response) {\n\t\t\t\t\t$('#input-output-list').html(res.html);\n\t\t\t\t\t//sort clumn table\n\t\t\t\t\t$(\"#table-stock-manager\").tablesorter();\n\t\t\t\t\t_setTabIndex();\n\t\t\t\t}\n\t\t\t}\n\t\t}).done(function(res){\n\t\t\t_postSaveHtmlToSession();\n\t\t});\n\t} catch (e) {\n alert('search' + e.message);\n }\n}", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "function handleSearchButtonClick() {\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function (date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n\n }\n\n if (filterCity != \"\") {\n filteredData = filteredData.filter(function (city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\") {\n filteredData = filteredData.filter(function (state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filteredData = filteredData.filter(function (country) {\n var dataCountry = country.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filteredData = filteredData.filter(function (shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function displayResults() {\n if (suggestionsArray.length > 0){\n $(\"#name\").append(suggestionsArray[0].name)\n $(\"#description\").append(suggestionsArray[0].description);\n $(\"#link\").prop(\"href\", suggestionsArray[0].link)\n $(\"#IMG\").attr(\"src\", suggestionsArray[0].IMG);\n suggestionsArray.splice(0, 1);\n } else {\n netflixAndChill();\n }\n }", "function performSearch(search){\n let result = [];\n for (var i = 0; i < data.length; i++) {\n if (data[i].name.first.toLowerCase().includes(search) || data[i].name.last.toLowerCase().includes(search))\n {\n result.push(data[i]);\n }\n }\n if (result.length > 0) {\n showPage(result, 1);\n addPagination(result);\n } else {\n let studentList = document.querySelector('.student-list');\n let linkList = document.querySelector('.link-list');\n studentList.innerHTML = \"<div>No results</div>\";\n linkList.innerHTML = \"\";\n }\n}", "function results(data) {\n $(\"#movie_results\").html(data.results.length+\" Results for search '\"+$(\"#movieQuery\").val()+\"'\");\n data.results.forEach(function(item){$(\"#movie_results\").append(\"<hr><ul>\").append(\"<li>Title: \"+item.title+\"</li>\").append(\"<li><img src=\"+img_base_url+item.poster_path+\"></img></li>\").append(\"<li>Popularity: \"+item.popularity+\"</li>\").append(\"</ul><hr>\")});\n}", "function doneTyping() {\r\n search();\r\n}", "function ComposeSearchData()\n{\n var html = '<table><tr><td valign=\"top\">';\n \n\t// Text search.\n \n if (num_textfields > 0) {\n\thtml += '<p><form onSubmit=\"data_TextSearch(); return false;\">'\n\t + 'Search ID Fields: '\n\t + '<input type=\"text\" size=\"20\" id=\"data_search\"> '\n\t + '<input type=\"submit\" value=\"Search\"></form>'; \n }\n \n\t// Search numeric fields by equality.\n \n html += '<p><nobr><form onSubmit=\"data_SearchEquality(); return false;\">'\n\t + 'Numeric Equality: '\n\t + '<select size=\"1\" id=\"data_numfld\">';\n for (var n = 0; n < num_activities; n++) {\n\thtml += '<option>' + activity_name[n] + '</option>';\n }\n html += '</select> Value = '\n\t + '<input type=\"text\" size=\"10\" id=\"data_numval\">'\n\t + ' &plusmn; <input type=\"text\" size=\"10\" id=\"data_numtol\"> '\n + '<input type=\"submit\" value=\"Search\"></form></nobr>';\n\n\t// Search numeric fields by range.\n\n html += '<p><nobr><form onSubmit=\"data_SearchRange(); return false;\">'\n\t + 'Numeric Range: '\n\t + '<select size=\"1\" id=\"data_rangefld\">';\n for (var n = 0; n < num_activities; n++) {\n\thtml += '<option>' + activity_name[n] + '</option>';\n }\n html += '</select> Value &ge; '\n\t + '<input type=\"text\" size=\"10\" id=\"data_rangelo\">'\n\t + ' and &le; <input type=\"text\" size=\"10\" id=\"data_rangehi\"> '\n + '<input type=\"submit\" value=\"Search\"></form></nobr>';\n\n\t// Add a radio button pertaining to selection.\n\t\n html += '<p>Apply to Selection: '\n\t + '<input type=\"radio\" name=\"data_apply\" checked'\n\t + ' id=\"data_applyrepl\" value=\"Replace\">Replace '\n\t + '<input type=\"radio\" name=\"data_apply\"'\n\t + ' id=\"data_applyext\" value=\"Extend\">Extend '\n\t + '<input type=\"radio\" name=\"data_apply\"'\n\t + ' id=\"data_applyfilt\" value=\"Filter\">Filter'\n\t + '<input type=\"radio\" name=\"data_apply\"'\n\t + ' id=\"data_applydesel\" value=\"Filter\">Deselect';\n\n\t// Let the user know how many molecules are selected.\n\t\n var nsel = NumSelected();\n html += '<p><span id=\"data_numsel\">' + nsel + ' molecule'\n\t + (nsel == 1 ? '' : 's') + '</span> selected'\n\t + ' <input type=\"button\" value=\"View\"'\n\t + ' onClick=\"data_SelectionView()\">'\n\t + ' <input type=\"button\" value=\"OpenSDF\"'\n\t + ' onClick=\"data_SelectionOpenSDF()\">';\n\t \n html += '<p><input type=\"button\" value=\"Select All Molecules\"'\n + ' onClick=\"data_SelectAll(true)\">'\n + ' <input type=\"button\" value=\"Clear Selection\"'\n + ' onClick=\"data_SelectAll(false)\">';\n\n \t// Add some explanatory text.\n\t\n html += '</td><td valign=\"top\" style=\"border-width: 1px;'\n \t + ' border-style: solid; border-color: #A0A0C0\">';\n \n html += '<p>Searching by ID replaces the selection list with compounds'\n + ' with an exactly identical text field.';\n \n html += '<p>Numeric Equality matches the indicated field by value,'\n + ' with an optional tolerance parameter.';\n\t \n html += ' Numeric Range matches the indicated field if it lies between'\n \t + ' the lower and upper limits; if either limit is omitted, it is'\n\t + ' open.';\n\t \n html += '<p>For numeric searches, Replace overwrites the current selection'\n \t + ' list with those compounds which match the criteria. Extend adds'\n\t + ' matching compounds to the selection list. Filter unselects '\n\t + ' compounds unless they match. Deselect unselects compounds which'\n\t + ' match.';\n \n html += '</td></table>';\n\n return html;\n}", "function handleSearchWaypointResultClick(e) {\n\t\t\tvar rootElement = $(e.currentTarget).parent().parent().parent().parent();\n\t\t\tvar index = rootElement.attr('id');\n\t\t\trootElement.removeClass('unset');\n\t\t\trootElement = rootElement.get(0);\n\n\t\t\trootElement.querySelector('.searchAgainButton').show();\n\t\t\trootElement.querySelector('.guiComponent').hide();\n\n\t\t\tvar waypointResultElement = rootElement.querySelector('.waypointResult');\n\t\t\t//remove older entries:\n\t\t\twhile (waypointResultElement.firstChild) {\n\t\t\t\twaypointResultElement.removeChild(waypointResultElement.firstChild);\n\t\t\t}\n\t\t\twaypointResultElement.insert(e.currentTarget);\n\t\t\twaypointResultElement.show();\n\n\t\t\t//remove search markers and add a new waypoint marker\n\t\t\ttheInterface.emit('ui:waypointResultClick', {\n\t\t\t\twpIndex : index,\n\t\t\t\tfeatureId : e.currentTarget.id,\n\t\t\t\tsearchIds : rootElement.getAttribute('data-search')\n\t\t\t});\n\t\t}", "function handleSearchButtonClick() {\n var filterDate = $dateInput.value;\n\n // Filter on date\n if (filterDate != \"\") {\n tableData = data.filter(function(address) {\n var addressDate = address.datetime;\n return addressDate === filterDate;\n });\n } else { tableData };\n\n renderTable();\n}", "function retrieveGeocodeResults(data) {\n searchButton.style.display = 'inline';\n\n if (data.results && data.results.length > 0) {\n var location = data.results[0];\n var coords = location.geometry.location;\n getPlaces(coords.lat, coords.lng, '');\n getFoursquareEvents(coords.lat, coords.lng, '', location.formatted_address);\n getEventfulEvents(coords.lat, coords.lng, '', location.formatted_address);\n getUpcomingEvents(coords.lat, coords.lng, '', location.formatted_address);\n locationInput.value = location.formatted_address;\n LOCATION_KEY = location.formatted_address.split(',')[0];\n setTitlePage(LOCATION_KEY);\n } else {\n // TODO: error handling\n }\n}", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }" ]
[ "0.6950369", "0.69364357", "0.67773074", "0.67766184", "0.67467004", "0.6722208", "0.6691302", "0.66685736", "0.66430646", "0.6617809", "0.65997803", "0.6557262", "0.6550048", "0.6538848", "0.65283865", "0.6527526", "0.65106696", "0.64950734", "0.64888", "0.6475366", "0.64566314", "0.64402884", "0.6429768", "0.642949", "0.6428692", "0.6424088", "0.6422501", "0.64182156", "0.6411574", "0.6405895", "0.64012367", "0.6397214", "0.6383477", "0.63672435", "0.6350332", "0.6349759", "0.6336532", "0.63361734", "0.63322246", "0.63298935", "0.632586", "0.6325331", "0.6311104", "0.6309181", "0.62939465", "0.6289058", "0.6279596", "0.6277709", "0.6272452", "0.6271995", "0.62705606", "0.62648755", "0.6252084", "0.6249856", "0.624573", "0.62424743", "0.6239565", "0.62342113", "0.623207", "0.6226672", "0.6223496", "0.6221397", "0.62177503", "0.6212417", "0.6207998", "0.62007856", "0.61967945", "0.6196545", "0.61955523", "0.6184425", "0.6183421", "0.61798805", "0.61767995", "0.6172745", "0.6171122", "0.61710495", "0.61674243", "0.6165922", "0.6158259", "0.61387306", "0.61376435", "0.61366415", "0.61333674", "0.6127995", "0.6126454", "0.6121312", "0.6119926", "0.6113193", "0.61128724", "0.6106495", "0.60973483", "0.60951793", "0.60924566", "0.6092329", "0.60919297", "0.6085447", "0.60831726", "0.60826737", "0.60796905", "0.60724145", "0.60687435" ]
0.0
-1
functie die aangeroepen wordt wanneer gebruiker op de button klikt
function requestAccess() { DeviceOrientationEvent.requestPermission().then((response) => { if (response == "granted") { permissionGranted = true; background(46, 46, 45); } else { textSize(39); textAlign(CENTER, TOP); fill(214, 32, 32); text("Je hebt de toegang afgewezen! Sluit browser compleet af en probeer opnieuw", width/2-500/2, 650, [510]); } // haalt button weg na het klikken button.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myFunction() {\n //console.log('formuchangejsut mail');\n $( \".inputinsciption\" ).show();\n $( \"#boutonfacebook\" ).hide();\n $( \".titlesupr\" ).hide();\n $(\"#btninscription\").text(\"Sign up\");\n $(\"#btninscription\").attr('onclick','FunctionPostInsertUser()');\n }", "unsignedButtonClicked()\n\t{\n\t\tthis.db.set( 'letterType', 3 );\n\t\treturn this.router.navigateToRoute( 'voting-form' );\n\t}", "function opdrachttxt() {\n // element id dat je moet gebruiken is: \"opdracht2\"\n\n\n\n\n\n\n}", "function HTML_Login(){\n $(\"#divhtml\").html(html);\n// al hacer click se invia los datos para add users\n \t$('#bt_Login').click(function(){\n \tvar corroborado = false;\n if (CorroborarCampoLogin(corroborado)){\n Login();//funcion login\n }\n });\n }", "function user_create_send_notification_button() {\n this.submit( null, null, function(data){\n data.resetpw = true;\n })\n}", "function voegspelertoe(){\n\t\t\t\t\t\n\t\tvar nummer = $('.speler').length + 1;\n\t\t\n\t\t\n\t\t$( \"#verwijderspeler\" + $('.speler').length ).after( '<input class=\"sessioninput speler\" placeholder=\"Speler '+nummer+'\" type=\"text\" required=\"required\" id=\"spelernaam' + nummer + '\" name=\"deelnemer'+nummer+'\"><input type=\"button\" id=\"verwijderspeler'+nummer+'\" value=\"x\" class=\"verwijderknop\" onclick=\"verwijderspeler(deelnemer'+nummer+')\" />' );\n\t\t\n\t}", "function otkljucajDugmeNastavi() {\r\n if(formValidacija.ime && formValidacija.email && formValidacija.telefon)\r\n {\r\n $('#btnDaljeKorisnik').removeAttr('disabled');\r\n }\r\n else {\r\n $('#btnDaljeKorisnik').attr('disabled', true);\r\n }\r\n}", "function logIn() {\r\n let userr = $('#username').val()\r\n let passw = $('#passwrd').val()\r\n //if they do we get our entire menu back with extra options\r\n if (userr == usernameadmin && passw == passwordadmin) {\r\n $('#disp').css('display', 'block')\r\n deletingchildelem()\r\n $(\".overlay-content\").show(500);\r\n $(\".overlay-content\").css(\"display\", \"block\");\r\n $('.overlay-content').append('<button type=\"button\" class=\"btn btn-primary\" onclick=\"logOut()\" id=\"logger\">Log Out</button>')\r\n $('#loggs').css('display', 'none')\r\n }\r\n //if not we get notification\r\n else {\r\n alert('Incorrect username or password!')\r\n }\r\n}", "function informationAcoout(){\n let btn = document.querySelector(\"#cont-menu > #user\");\n if(localStorage.getItem(\"user\")){\n btn.onclick = (e)=>{\n if(localStorage.getItem(\"user\")){\n location.replace(\"/login/informacioncuenta\");\n }else{\n urlCreateAccount();\n }\n }\n }else{\n urlCreateAccount();\n }\n}", "function loginGyldigTomt(brukernr) {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = bruker[brukernr].epost;\r\n let passord = \"\";\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n aqObject.CheckProperty(Aliases.textnodeFyllInnDittPassord, \"contentText\", cmpEqual, \"Fyll inn ditt passord\");\r\n \r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}", "function ocultarLoginRegistro() {\n /* Oculta uno de los Divs: Login o Registro, según cuál link se haya clickeado */\n var clickeado = $(this).attr(\"alt\");\n var itemClickeado = $(\"#\" + \"div\" + clickeado);\n itemClickeado.removeClass(\"hidden\").siblings(\"div\").addClass(\"hidden\");\n $(\"#txt\" + clickeado + \"Nombre\").focus();\n $(\"#div\" + clickeado + \"Mensaje\").html(\"\");\n }", "usersLogIn(e){\n\t\te?e.preventDefault():'';\n\t\tlet {email, password} = this.props.users_controle;\n\t\tif(email&&password){\n\t\t\tthis.props.usersLogIn( email, password, ()=>{\n\t\t\t\tthis.props.usersGetActiveUser();\n\t\t\t\tthis.props.usersControle(this.init());\n\t\t\t\tFlowRouter.go('/');\n\t\t\t} );\n\t\t}else{\n\t\t\t//Trigger alert thanks to Bert meteor package\n\t\t\tBert.alert({\n\t\t\t\ttitle:'Error data for login',\n\t\t\t\tmessage:'give at least email & password ' ,\n\t\t\t\ttype:'info',\n\t\t\t\ticon:'fa-info'\n\t\t\t});\n\t\t}\n\t\t\n\t}", "function keurenButton() {\n\tconst menuButtonBody = document.querySelector('.menu-buttons');\n\t\n\tvar role = sessionStorage.getItem(\"rol\");\n\t//If user is a Voorstel manager add 2 buttons for approving products and seeing all the products\n\tif (role === \"Voorstel manager\") {\n\t\tmenuButtonBody.innerHTML += '<div class=\"button-div\">' +\n\t\t\t\t\t\t\t\t\t\t'<a href=\"product_keuren.html\"><button class=\"menu-button\" name=\"keuren\" value=\"Keuren\" id=\"keuren\">Keuren</button></a>' +\n \t\t\t\t\t\t\t\t'</div>';\n\t\t\n \tmenuButtonBody.innerHTML += '<div class=\"button-div\">' +\n \t\t\t\t\t\t\t\t\t'<a href=\"products.html\"><button class=\"menu-button\" name=\"product\" value=\"Producten\" id=\"producten\"\">Producten</button></a>' +\n \t\t\t\t\t\t\t\t'</div>';\n \t\n \t$(\".menu-content\").css(\"margin\", \"6vh auto\");\n\n //If user is a Budget manager only add 1 button that leads to budget proposals\n\t} else if (role === \"Budget manager\") {\n\t\tmenuButtonBody.innerHTML += '<a href=\"budget_keuren.html\"><button class=\"menu-button\" name=\"keuren\" value=\"Keuren\" id=\"keuren\"\">Keuren</button></a>';\n\t\t\n\t\t$(\".menu-content\").css(\"margin\", \"12vh auto\");\n\t}\n}", "function onChangePasswordUserClick() {\n gCustomerId = $(this).data('id');\n $('#modal-update-password').modal('show');\n }", "function loginUgyldig() {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = func.random(15) + \"@\" + func.random(7) + \".com\"\r\n let passord = func.random(8)\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}", "_handleButtonAddAdmin()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_ADD_USER_ADMIN,\n {username: this._getSelectedUser(), project: this._project});\n }", "function addButton() {\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) { \n var usernam = user.email.substr(0,user.email.indexOf(\".\"));\n firebase.database().ref(\"Users\").child(usernam).push( {\n \"AMPM\": ap.value, \n \"Classroom\": classroom.value, \n \"Name\": build.value,\n \"Time\": time.value\n });\n refresh();\n } else {\n window.location.href = \"index.html\";\n }\n });\n }", "function fAppDevise() {\n $(\"#bokd\").click(fAffDevise);\n}", "function showButtons() {\n $(\".private\").css(\"display\", \"inherit\");\n $(\"#signUp\").css(\"display\", \"none\"); //Ocultamos el boton iniciar sesion\n}", "function showPassword() {\n register((data, err)=>{\n if(data === -1) {\n showErr(err);\n }\n else {\n data = JSON.parse(data);\n userId = data.userId;\n attempt = 3;\n listenNextButton();\n $(\"#password1\").text(data.password_1);\n $(\"#password2\").text(data.password_2);\n $(\"#password3\").text(data.password_3);\n $(\"#ui_2\").fadeIn();\n }\n });\n}", "function loginTomtGyldig(brukernr) {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = \"\";\r\n let passord = bruker[brukernr].passord;\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n aqObject.CheckProperty(Aliases.textnodeFyllInnDinEPostadresse, \"contentText\", cmpEqual, \"Fyll inn din e-postadresse\");\r\n\r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}", "function useNewButton() {\r\n createUser();\r\n startPage()\r\n}", "function checkCoockieForUserName() {\n var $accountButton = $('.headerRight__account');\n $accountButton.unbind('click');\n //close Sign in window\n $('.authorization').remove();\n if (!getCookie('userLogin')) {\n //set account text standart\n $accountButton.text('My Account ').append($('<i />', {class: 'fas fa-caret-down'}));\n //add event for authorization\n $accountButton.click(function (event) {\n buildAuthorizationForm();\n event.preventDefault();\n });\n } else {\n $accountButton.text('Hello, ' + getCookie('userLogin'));\n $accountButton.click(function (event) {\n buildMenuUser();\n event.preventDefault();\n });\n }\n}", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "function handleSignUp(e) {\n setVisible(false);\n setSignUp('true');\n }", "function validerUti(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txtutiNom\").value==\"\")\n msg=\"ajouter un nom d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiPrenom\").value==\"\")\n msg=\"ajouter un prenom d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiMotdepass\").value==\"\")\n msg=\"ajouter un mot de pass d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiAdmin\").value==\"\")\n msg=\"ajouter un admin d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiInactif\").value==\"\")\n msg=\"ajouter actif ou inactif d'Utilisateur s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function cambiausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.addVar(\"usuario_id\",f.f2usrid.value);\n x.go(\"clientes\",\"editausr\",llenausr);\n }\n}", "function addEventHandlerChangePasswordButton() {\n\td3.select(\"#change-password-button\").on(\"click\", function() {\n\t\td3.event.preventDefault();\n\t\tshowChangePasswordDialog();\n\t});\n}", "isActivate(e){\n\t\tif(this.state.user.activate == 0){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<span className=\"mr-20\">\n\t\t\t\t\t<button type=\"button\" className=\"Confirm_Button\" onClick={this.rejectPerson}> Reject </button>\n\t\t\t\t</span>\n\t\t\t\t<button type=\"button\" className=\"Confirm_Button\" onClick={this.AddPerson}> Confirm </button>\n\t\t\t</div> \n\t\t);\n\t\t}else{\n\t\t\tif (this.state.user.id == this.props.auth_user.id){\n\t\t\treturn;\n\t\t\t}\n\t\treturn <button type=\"button\" className=\"AddPositionButton\" onClick={this.handleShowRecommend}> Recommend</button> ;\n\t\t}\n\t}", "_handleButton()\n {\n // Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__AUTHENTICATION_LOGIN, {username: this.ui.textUsername.val(), password: this.ui.textPassword.val()}); \n }", "function OnGUI() {\n GUI.Label( Rect (10, 10, 120, 20), \"Pseudo:\" ); //text with your nick\n GUI.Label( Rect (10, 30, 120, 20), \"Mot de passe:\" );\n\n formNick = GUI.TextField ( Rect (130, 10, 100, 20), formNick ); //here you will insert the new value to variable formNick\n formPassword = GUI.PasswordField ( Rect (130, 30, 100, 20), formPassword, \"*\"[0] ); //same as above, but for password\n\n if ( GUI.Button ( Rect (10, 60, 100, 20) , \"Connexion\" ) ){ //just a button\n Login();\n }\n GUI.TextArea( textrect, formText );\n\n if(GUI.Button(Rect(115, 60, 100, 20), \"Quitter\")){ \n\t\tApplication.LoadLevel(\"Accueil\");\n }\n}", "function prepareButton(id) {\n\t// alert(\"preparing button3\");\n\tif (document.getElementById(id) != null) { // userindex.jsp -->\n\t\t// applicantlist.jsp, wenn\n\t\t// Button gedrueckt wurde\n\t\t// alert(\"idneuneu= \"+id);\n\t\tdocument.getElementById(id).onclick = function() {\n\t\t\twindow.location = 'applicantlist.jsp?AID=' + id;\n\t\t};\n\t}\n}", "function managePasswordForgotten() {\n\t$('#passwordReset').click(function() { \n\t\t// We must reset the document and send a link to the registered email\n\t\t// to a form where the end user can update the password\n\t\tclearDocument();\n\t\tloadHTML(\"navbar.html\");\n\t\tnavbarHover();\n\t\t$(document.body).append(\"<center><h1>Please fill in the following form !</h1><center>\");\n\t\tloadHTML(\"passwordForgotten.html\");\n\t\tloadJS(\"js/forms.js\");\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\n loadHTML(\"footer.html\");\n\t});\n}", "function bringit(){\n document.getElementById('register').onclick=melding;\n}", "createAccountButtonHandler () {\n const createAccountButton = document.querySelector(\"#createAccountButton\")\n createAccountButton.addEventListener(\"click\", () => {\n forms.getUserInputAndSendToMain()\n })\n }", "function urlCreateAccount(){\n let btn = document.querySelector(\"#cont-menu > #user\");\n btn.onclick = (e)=>{\n location.href = \"/login/signup\"\n }\n}", "function ComprobandoCamposAdministrador()\n\t{\n\n\t\tvar NombreAdmin = document.getElementById('AdminitradorNombre').value;\n\t\tvar ApellidosAdmin = document.getElementById('AdminitradorApellido').value;\n\t\tvar UsuarioAdmin = document.getElementById('AdminitradorUsuario').value;\n\n\t\tif (NombreAdmin!=\"\" && ClaveAdmin!=\"\" && ApellidosAdmin!=\"\" && UsuarioAdmin!=\"\" && BanderaAdministradores==1) {\tdocument.getElementById('AdminitradorClave').value=ClaveAdmin; ClaveAdmin+=1; alert('Puedes Continuar');};\n\t}", "function confirmRegisterCrbt(name, userId) {\n $('#rbt-register-name').html(name);\n $('#rbt_member_id').val(userId);\n}", "function bbedit_acpperms_clicked() {}", "function crea_cambia_pass(){\n\n \tdestruye_cambia_pass();\n\n \t$(\"#pass\").attr(\"readonly\",\"true\");\n\n \t$(\".modal-footer\").append('<button id=\"btn_passUsuario\" type=\"button\" class=\"btn btn-warning\" data-action=\"-\">'+\n '<span id=\"lbl_btn_passUsuario\"></span>'+\n '</button>');\n\n \n $(\"#btn_passUsuario\").html(\"Cambiar Contraseña\");\n\n $(\"#btn_passUsuario\").attr('data-action', 'cambia_pass');\n\n $(\"#btn_passUsuario\").click(function(event) {\n\t \t\t/* Act on the event */\n\t \t\tpass = $(\"#pass\").val();\n\n\t \t\tvar action_pass = $(this).attr('data-action');\n\t \t\tvalida_action_pass(action_pass);\n\t \t});\n\n\t \tfunction valida_action_pass(action_pass){\n\n\t \t\tif(action_pass == \"cambia_pass\"){\n\t \t\t\tcambia_pass();\n\t \t\t}else if(action_pass == \"edita_pass\"){\n\t \t\t\t\n\t \t\t\tedita_pass(pass);\n\t \t\t}\n\t \t}\n\n\t \tfunction cambia_pass(){\n\n\t \t\t$(\"#btn_passUsuario\").attr('data-action', 'edita_pass');\n\t \t\t$(\"#btn_passUsuario\").html(\"Guardar Contraseña\");\n\n\t \t\t$(\"#pass\").removeAttr('readonly');\n\n\t \t\t$(\"#pass\").val(\"\");\n\n\t \t\t$(\"#pass\").focus();\n\t \t}\n\n\t \tfunction edita_pass(pass){\n\n\t \tconsole.log(\"Carga pass \"+pass);\n\n\t\t $.ajax({\n\t\t url: '../controller/ajaxController12.php',\n\t\t data: \"pkID=\"+id_usuario+\"&pass=\"+pass+\"&tipo=actualiza_usuario&nom_tabla=usuarios\",\n\t\t })\n\t\t .done(function(data) {\n\t\t \tconsole.log(data);\n\t\t \talert(data.mensaje);\n\t\t \tlocation.reload();\n\t\t })\n\t\t .fail(function() {\n\t\t console.log(\"error\");\n\t\t })\n\t\t .always(function() {\n\t\t console.log(\"complete\");\n\t\t });\n\t }\n }", "function in_register() {\n\t$('#register-submit').on(\"click\", function () {\n\t\tconsole.log(\"entra register click\");\n\t\tregister();\n\n\t})\n\n\n\t$('#form_register').on(\"keydown\", function (e) {\n\t\tconsole.log(\"clickpass\")\n\t\tif (e.which == 13) {\n\t\t\tconsole.log(\"entra register\");\n\n\t\t\tregister();\n\t\t}\n\t});\n}", "function choferesX(){\n window.location = config['url']+\"Administrador/modulo?vista=registrar_chofer\";\n}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "function onSubmitRegister(event){\r\n if(registerData.RegisterPassword===registerData.RegisterConfirmPassword){\r\n event.preventDefault()\r\n fetch('/register_admin',{\r\n method: 'post',\r\n headers: {'Content-Type':'application/json'},\r\n body: JSON.stringify({\r\n userName: registerData.RegisterUserName,\r\n password: registerData.RegisterPassword,\r\n ConfirmPassword: registerData.RegisterConfirmPassword\r\n })\r\n }).then(res => res.json())\r\n .then(user =>{\r\n if(user){ \r\n localStorage.setItem('Admin',registerData.RegisterUserName);\r\n // localStorage.setItem(`${registerData.RegisterUserName}`,JSON.stringify(registerData));\r\n handleClick() \r\n }else{\r\n window.alert(\"Something went wrong Try Again.\")\r\n }\r\n }) \r\n }else{\r\n window.alert(\"password Doesnt match.\")\r\n }\r\n }", "function supprUser(){\n\tif (confirm(\"Voulez-vous vraiment supprimer cet utilisateur ?\")) {\n\t\t$.post(\"php/suppr_user.php\",{id:$(this).data('id')},valideSup);\n\t}\t\n}", "function ChequearClaveAdmin() {\n password= $(\"#password\").val()\n repassword=$(\"#repassword\").val()\n if ( password != repassword){\n $('#mensajeError').text(\"Las claves no coinciden!\");\n $('#bt_ActualizarRegistro').attr('disabled','disabled')\n $(\"#repassword\").focus()\n \n }else if ( password == repassword){\n $('#mensajeError').text(\"\");\n $('#bt_ActualizarRegistro').removeAttr('disabled')\n } \n}", "function registerLoginClicks(){\n\t\t$(\"#password\").keypress(function(event){\n\t\t\tif(event.which == 13) {\n\t\t \t\tloginClick();\n\t\t\t}\n\t\t});\n\t\t$(\"#password\").keyup(function(e) {\n\t\t\tcheckrequiredFields();\n\t\t}); \n\t\t$(\"#userName\").keyup(function(e) {\n\t\t\tcheckrequiredFields();\n\t\t});\n\t\t$(\"#logon\").click(function(e) {\n\t\t\tloginClick();\n\t\t});\n\t}", "function asignarEventoClickAprendiz(idAprendiz,identificacion,nombreCompleto,idFicha,idDetalleEstado,contador){\r\n\r\n\t$(\"#btnModificarAprendiz\"+contador).click(function(){\r\n\r\n\t\tlimpiarFormulario(\"formModificarAprendiz\");\r\n\t\t\r\n\t\t$(\"#txtIdAprendiz\").val(idAprendiz);\r\n\t\t\r\n\t\t$(\"#txtIdentificacionAprendizMod\").val(identificacion);\r\n\t\t$(\"#txtNombreCompletoAprendizMod\").val(nombreCompleto);\r\n\t\t$(\"#selectFichaAprendizMod\").val(idFicha);\r\n\t\t$(\"#selectDetalleEstadoAprendizMod\").val(idDetalleEstado);\r\n\t\t\r\n\t});\r\n}", "function registor(e) {\n e.preventDefault();\n setloading(true);\n if (!userName == \"\") {\n auth\n .createUserWithEmailAndPassword(email, password)\n .then(async (user) => {\n var User = user.user;\n await db.ref(\"User/\" + User.uid).set({\n UserName: userName,\n Email: User.email,\n Code: generatedCode,\n Major: major,\n DoB: DoB,\n Phone: phone,\n });\n })\n .then(() => (window.location = \"/upload_image\"))\n .catch((error) => {\n alert(error.message);\n setloading(false);\n // ..\n });\n }\n\n setemail(\"\");\n setDoB(\"\");\n setMajor(\"\");\n setgeneratedCode(\"\");\n setpassword(\"\");\n setuserName(\"\");\n setcareer(\"\");\n setphone(\"\");\n }", "function btnQuitarPublicacion(div) {\n controlesEdit(true, div, \".quitarPublicacionMode\")\n }//-------------------------------", "function ULOGA_EMAIL(a, n) {\r\n if (a != undefined) {\r\n if (a) {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"block\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {\r\n RST_PSS(n);\r\n };\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"reset password\";\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not created\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n}", "function logInClick() {\n\tif (!logInBtn) return;\n\n\tlogInBtn.onclick = function() {\n\t\twindow.location.href='protected/admin.php';\n\t}\n}", "function SetUserActive(Username, Nama)\n{\n new Messi('Apakah anda ingin mengaktifkan user : <b>' + Username + '</b>( '+ Nama + ')', {title: 'Info', modal: true, titleClass: 'info', buttons: [{id: 0, label: 'Yes', val: 'Y' , btnClass: 'btn-success'}, {id: 1, label: 'No', val: 'N', btnClass: 'btn-danger'}], \n callback: function(val) \n {\n if (val==\"Y\")\n {\n parent.window.location = '?m=user&a=SetUserActive&Username='+Username;\n }\n }\n }); \n}", "function onLoad(){\n\t\n\t//Clicar nos nomes dos usuarios\n\t$('.users').click(function (){\n\t\t\n\t\t$('.settings_user').hide();\n\t\t$(this).children().children('.settings_user').show();\n\t\t\n\t});\n\t\n\t//Botao Editar Usuaario\n\t$('.editar_btn').click(function(){\n\t\t\n\t\t$('#sombra').show();\n\t\t$('.editar_user').show();\n\t\t\n\t});\n\t\n\t//Botao de fecharo Editar usuario\n\t$('#fexa_edituser').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.editar_user').hide();\n\t\t\n\t});\n\t\n\t//Botao de salvar o Editar o usuario\n\t$('#salvar_user').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.editar_user').hide();\n\t\t//CODIGO PARA ALTERAR O USUARIO AQUI\n\t});\n\t\n\t\n\t//Botao apagar usuario\n\t$('.apagar_btn').click(function(){\n\t\t\n\t\t$('#sombra').show();\n\t\t$('.apagar_user').show();\n\t\t\n\t});\n\t\n\t//Confirmou o apagamento\n\t$('#sim_apagar').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.apagar_user').hide();\n\t\t//CODIGOS PARA APAGAR O USUARIO\n\t\t\n\t});\n\t\n\t//Cancelou o apagamento\n\t$('#nao_apagar').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.apagar_user').hide();\n\t\t//CODIGO PRA DELETAR O USUARIO AQUI\n\t\t\n\t});\n\t\n\t//botao Nova notificavao\n\t$('#new_noti').click(function(){\n\t\t\n\t\t//LINK PARA A PAGINA de NOVAS notificacoes\n\t\t\n\t});\n\n\t//botao notificacoes\n\t$('#notis').click(function(){\n\t\n\t\t//LINKS PARA A PAGINA DE NOTIFICACOES\n\t\t\n\t});\n\t\n\t//vini muito loko, esse botao eh o de cadastro.\n\t$('#cadastrar').click(function(){\n\t\t\n\t\t$('#sombra').show();\n\t\t$('.new_user').show();\n\t\t\n\t});\n\t\n\t//Dentro do cadastro, esse eh o botao do radio USUARIO, modificado na variavel user_mod\n\t$('#user_usuario').click(function(){\n\t\t\n\t\t$('#user_adm').css(\"background-image\", \"none\");\n\t\t$('#user_usuario').css(\"background-image\", \"url('assets/newuser/selecao.png')\");\n\t\tuser_mod = 1;\n\t\t\n\t});\n\t\n\t//Dentro do cadastro, esse eh o botao do radio ADM, modificado na variavel user_mod\n\t$('#user_adm').click(function(){\n\t\t\n\t\t$('#user_usuario').css(\"background-image\", \"none\");\n\t\t$('#user_adm').css(\"background-image\", \"url('assets/newuser/selecao.png')\");\n\t\tuser_mod = 2;\n\t\t\n\t\t\n\t});\n\t\n\t//Dentro do EDITAR USUARIO, esse eh o botao do radio USUARIO, modificado na variavel user_mod\n\t$('#euser_usuario').click(function(){\n\t\t\n\t\t$('#euser_adm').css(\"background-image\", \"none\");\n\t\t$('#euser_usuario').css(\"background-image\", \"url('assets/newuser/selecao.png')\");\n\t\tuser_mod = 1;\n\t\t\n\t});\n\t\n\t//Dentro do EDITAR USUARIO, esse eh o botao do radio ADM, modificado na variavel user_mod\n\t$('#euser_adm').click(function(){\n\t\t\n\t\t$('#euser_usuario').css(\"background-image\", \"none\");\n\t\t$('#euser_adm').css(\"background-image\", \"url('assets/newuser/selecao.png')\");\n\t\tuser_mod = 2;\n\t\t\n\t\t\n\t});\n\t\n\t//E esse eh o botao que eh apertado quando se conclui o cadastro.\n\t$('#incluir_user').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.new_user').hide();\n\t\t$('#user_usuario').css(\"background-image\", \"none\");\n\t\t$('#user_adm').css(\"background-image\", \"none\");\n\t\t//CODIGO PRA GERAR UM ADM NERDAO OU UM USUARIO MTO LOKO AQUI\n\t});\n\t\n\t//Botao que fexa a janela de noso Usuario\n\t$('#fexa_newuser').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.new_user').hide();\n\t\t$('#user_usuario').css(\"background-image\", \"none\");\n\t\t$('#user_adm').css(\"background-image\", \"none\");\n\t\t\n\t});\n\t\n\t//PARTE DO SCRIPT DO NOVA rNOTI\n\t$('#fexa_novanoti').click(function(){\n\t\t\n\t\t$('#sombra2').show();\n\t\t$('.certeza_cancelar').show();\n\t});\n\t\n\t$('#newpublicar-agora').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.nova_noti').hide();\n\t\t\n\t});\n\n\t$('#salvar_novanoti').click(function(){\n\t\n\t$('#sombra').hide();\n\t$('.nova_noti').hide();\n\t\n\t});\n\t\n\t$('#new_noti').click(function(){\n\t\t\n\t\t$('#sombra').show();\n\t\t$('.nova_noti').show();\n\t\t\n\t\t});\n\t\n\n\t//Confirmou o apagamento\n\t$('#sim_cancel').click(function(){\n\t\t\n\t\t$('#sombra').hide();\n\t\t$('.editar_noti').hide();\n\t\t$('#sombra2').hide();\n\t\t$('.certeza_cancelar').hide();\n\t\t$('.nova_noti').hide();\n\t\t\n\t});\n\t\n\t//Confirmou o apagamento\n\t$('#nao_cancel').click(function(){\n\t\t\n\t\t$('#sombra2').hide();\n\t\t$('.certeza_cancelar').hide();\n\t\t\n\t});\n}", "function EnviarUsuario(){\n $('#lblUsuario, #lblNombreC, #lblPass, #lblPassC, #lblRol').hide();\n \n var user = $('#Usuario').val(); var nombre = $('#NombreC').val();\n var clave = $('#Pass').val(); var clave2 = $('#PassC').val();\n var rol = $('#rol option:selected').val();\n \n //alert(rol);\n \n if (user==\"\"){$('#lblUsuario').show(); return false;\n }else if (nombre==\"\"){$('#lblNombreC').show(); return false;\n }else if (clave==\"\"){$('#lblPass').show();return false;\n }else if (clave2==\"\" || clave!=clave2) {$('#lblPassC').show();return false;\n }else if (rol==\"\") {$('#lblRol').show();return false;}\n\n $('#Adduser').hide();\n \n $.ajax({\n url: \"GuardarUsuario/\"+user+\"/\"+nombre+\"/\"+clave+\"/\"+rol,\n type: \"post\",\n async:true,\n success:\n function(){\n swal({title: \"EL USUARIO SE AGREGO CORRECTAMENTE!\",\n type: \"success\",\n confirmButtonText: \"CERRAR\",\n }).then(\n function(){gotopage(\"Usuarios\");}\n )\n }\n });\n}", "function controlModuloUsuario() {\n\tmetodo = document.getElementById(\"metodo\").value;\n\tif (metodo == \"add\") {\n\t\tup = document.getElementById(\"password\");\n\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\tif (user_password == \"\") {\n\t\t\t//alert(\"Debe llenar este campo\");\n\t\t\t//up.focus();\n\t\t\treturn 'Debe llenar el password';\n\t\t}\n\t}\n\tif (metodo == \"modify\") {\n\t\tup = document.getElementById(\"password\");\n\t\tcambiar = document.getElementById(\"cambiar\").value;\n\t\tif (cambiar == \"yes\") {\n\t\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\t\tif (user_password == \"\") {\n\t\t\t\t// alert(\"Debe llenar este campo\");\n\t\t\t\t// up.focus();\n\t\t\t\t// return false;\n\t\t\t\treturn 'Debe Llenar el nuevo password';\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function regViajes(){\n window.location = config['url']+\"Administrador/modulo?vista=registrar_viaje\";\n}", "function abreUsuarioDialog(marker,idTarget) {\n\t// Activamos conexión con otro usuario\n\tvar index=usuarios.indexOf(idTarget);\n\tvar nombre=usuariosData[index].nombre;\n\tvar edadUser=usuariosData[index].edad;\n\tvar infoContent='<div class=\"id\">'+nombre+' ('+edadUser+')</div><div class=\"btnToChat\">chatea ></div>';\n\tinfowindow.content=infoContent;\n\tinfowindow.open(map,marker);\n\t $('.btnToChat').click(function(){\n\t\tabreChat(idTarget,index);\n\t});\n}", "function activar(per_id){\n\tbootbox.confirm(\"¿Esta seguro de activar la persona?\",function(result){\n\t\tif (result) {\n\t\t\t$.post(\"../ajax/persona.php?op=activar\", {per_id : per_id}, function(e){\n\t\t\t\tbootbox.alert(e);\n\t\t\t\ttabla.ajax.reload();\n\t\t\t});\n\t\t}\n\t})\n}", "function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}", "function setUserData() {\r\n userDto = UserRequest.getCurrentUser();\r\n // set value for Mã giới thiệu\r\n document.getElementsByClassName('btn btn-primary')[0].innerText =\r\n ' Mã giới thiệu: ' + userDto.username;\r\n document.getElementById('numOfCoin').innerHTML = userDto.accountBalance + ' xu';\r\n document.getElementById('numOfTime').innerHTML = userDto.numOfDefaultTime + ' phút';\r\n document.getElementById('numOfCoinGiftBox').innerHTML = userDto.numOfCoinGiftBox + ' hộp';\r\n document.getElementById('numOfTimeGiftBox').innerHTML = userDto.numOfTimeGiftBox + ' hộp';\r\n document.getElementById('numOfTravelledTime').innerHTML = userDto.numOfTravelledTime + ' phút';\r\n document.getElementById('numOfStar').innerHTML = userDto.numOfStar + ' sao';\r\n fadeout();\r\n}", "async forgotpasswordbtn () {\n await (await this.btnForgotPassword).click();\n }", "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n }", "function pm_topMenu(){\n\t// DODAJ / IZBRISI PROFIL IZ PRIJATELJA\n\t$('#btn_addKontakt').click(function(){\t\n\t\tif($(this).children('#btn_addKontakt_text').text()==\"Sačekajte...\") return;\n\t\tvar friend = \"Dodaj u svoje kontakte\";\n\t\tvar unfriend = \"Izbriši iz svojih kontakata\";\n\n\n\t\tvar btn = $(this); var text = btn.children('#btn_addKontakt_text').text();\n\t\tbtn.children('#btn_addKontakt_text').text(\"Sačekajte...\");\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\tdata: \"&status=\"+___USER_status+\"&user=\"+___USER_ID,\n\t\t\turl: \"_skripte/addFriend.php\",\n\t\t\tsuccess: function(o){\n\t\t\t\talert(o);\n\n\t\t\t\tif(___USER_status=='visit'){\n\t\t\t\t\t___USER_status = 'friend';\n\t\t\t\t\tbtn.children('#btn_addKontakt_text').text(unfriend);\n\t\t\t\t} else if(___USER_status=='friend'){\n\t\t\t\t\t___USER_status = 'visit';\n\t\t\t\t\tbtn.children('#btn_addKontakt_text').text(friend);\n\t\t\t\t}\n\n\t\t\t\tbtn.attr('disabled', false);\n\t\t\t}\n\t\t});\n\t});\t\n}", "function setAdmin() {\n let username = $('input[name=\"all-users\"]:checked').val();\n if(!checkElement(username)) return;\n $.post(\"/chatroom/setAdmin\", {username: username, chatRoomId: chatroomId}, function () {\n }, \"json\");\n}", "function sendPasswordToUser(fld, email, minimizeBtn) {\n\t//send data to php\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=send-password&email='+email,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\tfld.val(' Password sent!');\n\t\t\t//conver minimize UI to Close UI\n\t\t\tminimizeBtn.val('X');\n\t\t},\n\t\terror: function(response) {\n\t\t\tfld.val(' failed..');\n\t\t\t//conver minimize UI to Close UI\n\t\t\tminimizeBtn.val('X');\n\t\t}\n\t}\n\t);\n}", "function register_event_handlers()\n {\n //Cambiamos de nombre del boton atras\n $(\".button.backButton\").html(\"ATRAS\");//$.ui.popup('Hi there');\n LOGIN.crearEnlaces(); \n ALUMNO.crearEnlaces(); \n PROFESOR.crearEnlaces(); \n /* button #idLogin */\n $(document).on(\"click\", \"#idLogin\", function(evt)\n {\n LOGIN.onClickLogin();\n }); \n \n /* button #idEscogerAlumno */\n $(document).on(\"click\", \"#idEscogerAlumno\", function(evt)\n {\n ALUMNO.onClickEscogerAlumno();\n \n });\n /* button #idEscogerProfesor */\n $(document).on(\"click\", \"#idEscogerProfesor\", function(evt)\n {\n /* your code goes here */ \n PROFESOR.onClickEscogerProfesor();\n });\n}", "function pregunta2(){\n var confirmacion = false;\n //control es la variable que controla que la llamada siempre este activa\n //si el control es falso \n if(control == false){\n confirmacion = confirm(\"Usted ya puede crear aristas\"); //se mostra un mensaje de que se activaran las llamadas\n //si la confirmacion del usuario es afirmativa\n if(confirmacion) control = !control; //se procedera a cambiar el valor del control\n document.getElementById(\"btn-2\").focus();\n }\n //si no es el caso del control falso y sea verdadero\n else if (control == true){\n confirmacion = confirm(\"Usted ya no puede crear aristas\"); //se mostrara un mensaje que notificara que las llamdas se desactivaran\n //si la confirmacion del usuario es afirmativa\n if(confirmacion) control = !control; //se procedera a cambiar el valor del control\n document.getElementById(\"btn-2\").blur();\n }\n}", "function User_ON(Email)\n{\n\tbootbox.confirm(\"<form role='form'>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='text'><b>Introduza o seu código.</b></div><br>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='form-group'>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <input style='width: 300px;' type='password' class='form-control' id='Password'>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div></form>\", function (result) {\n\n\t\tif(result)\n\t\t{\n\t\t\tchrome.storage.local.get(Email, function (result) {\n\n\t\t\t\tvar pass = CryptoJS.SHA3($('#Password').val()); \n\n\t\t\t\tif(_.isEqual(pass, result[Email]))\n\t\t\t\t{\n\t\t\t\t\tvar obj = {};\n\n\t\t\t\t obj['atv-'+Email] = '0';\n\n\t\t\t\t\tchrome.storage.local.set(obj);\n\n\t\t\t\t\tgetData();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbootbox.alert(\"<br><div class='text'><b>O código introduzido está errado. <br><br>Tente de novo.</b></div>\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function submitClick() {\n updateDBUser(currentUser.email, newName, newCountry, pictureIndex);\n setShowForm(!showForm);\n }", "function set_on_click_listeners()\n{\n\t$(\"#username\").keyup(function(){\n\t\tif(event.keyCode == 13)\n\t\t\tlogin('','');\n\t});\n\t$(\"#password\").keyup(function(){\n\t\tif(event.keyCode == 13)\n\t\t\tlogin('','');\n\t});\n}", "function compagnie_loyer()\n{\n if(cases[pos_actuelle()].id == joueur_actuel)\n {\n\tdocument.getElementById(\"jeu\").innerHTML = \"Vous etes chez vous\";\n\tvalidation.innerHTML = bouton_passer;\n\tvar b_p = document.getElementById(\"bouton_passer\");\n\tb_p.addEventListener(\"click\", passer, false);\n }\n else\n {\n\tvar dette = \n\t document.getElementById(\"jeu\").innerHTML = des_actuel * ((joueurs[cases[pos_actuelle()].id].compagnies == 1) ? 4 : 10) * 100;\n\tjeu.innerHTML = \"Vous etes chez la compagnie de \" + cases[pos_actuelle()].nom + \", vous devez payer \" + dette + \".\";\n\tvalidation.innerHTML = \"<input type=\\\"button\\\" id=\\\"bouton_loyer\\\" value=\\\"payer\\\"/>\";\n\tb_l = document.getElementById(\"bouton_loyer\");\n\tb_l.addEventListener(\"click\", need_money.bind(this, dette), false);\n }\n}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function inscriptionGood(){\n\n\tvalidInscriptionButtun.removeAttr('disabled')\n\t\t\t\t\t\t\t.attr('type', 'submit');\n\tdocument.forms[\"inscription\"].action=\"confirmationInscription.php\";\n}", "function confirmerAchat () {\n let bouton = document.getElementById(\"confirmer\");\n bouton.addEventListener(\"click\", ()=>{\n alert(\"Achat confirmé\");\n });\n}", "function lcom_RegOKCompleta(){\n\topenFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n}", "function loginTomtTomt() {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = \"\";\r\n let passord = \"\";\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n aqObject.CheckProperty(Aliases.textnodeFyllInnDittPassord, \"contentText\", cmpEqual, \"Fyll inn ditt passord\");\r\n aqObject.CheckProperty(Aliases.textnodeFyllInnDinEPostadresse, \"contentText\", cmpEqual, \"Fyll inn din e-postadresse\");\r\n\r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}", "function verify() {\n //verifica en que pagina se encuentra, dependiendo de la pagina, su respectiva verificacion\n\n\n\n $(\"#altaProductoBoton\").on(\"click\", verificarAltaProducto);\n $(\"#altaCategoriaBoton\").on(\"click\", verificarAltaCategoria);\n $(\"#bajaProductoBoton\").on(\"click\", verificarBajaProducto);\n $(\"#modificarproductoBoton\").on(\"click\", verficiarModificarProducto);\n $(\"#modificarProductoConfirmBoton\").on(\"click\", verficiarModificarConfirmProducto);\n\n\n}", "function cancelus(){\n\n //toma el valor del sku que se esta editando\nconst usuid = \"'\"+$('input:text[name=idusedit]').val()+\"'\"\n\n//llama a la funcion borrar con el parametro del sku que se esta editando para que lo borre de la tupla auxiliar\nborr(usuid);\n\n //redirecciona a la pantalla de productod\n location.href='usuariosad.html';\n}", "function showHide(e){\n var btnBtn = e.target;\n var $reveal = $(\".eye-open-close\");\n \n var hold = btnBtn.parentElement.parentElement;\n var holdbtn = hold.children[2];\n var holdch = document.querySelector(\".confirmpassword\");\n \n $reveal.find(\"i\").remove();\n \n \n if(holdbtn.getAttribute(\"type\")===\"password\" && holdch.getAttribute(\"type\")===\"password\" ){\n holdbtn.setAttribute(\"type\",\"text\");\n holdch.setAttribute(\"type\",\"text\");\n $reveal.html($(\"<i/>\", { class: \"far fa-eye-slash\" }));\n }\n \n else{\n holdbtn.setAttribute(\"type\",\"password\");\n holdch.setAttribute(\"type\", \"password\");\n $reveal.html($(\"<i/>\", { class: \"fas fa-eye\" }));\n }\n // retrieveUsersDetais();\n}", "function loadUser() {\n checkAdmin(username);\n hideElement(\"#btn-invite-form\");\n if (isAdmin) {\n // showElement(\"#btn-block-user\");\n showElement(\"#btn-delete-user\");\n showElement(\"#btn-ban-user\");\n showElement(\"#btn-set-admin\");\n hideElement(\"#btn-report-user\");\n showElement(\".incoming-message .btn-group\");\n if (chatroomType === \"Private\")\n showElement(\"#btn-invite-form\");\n } else {\n // hideElement(\"#btn-block-user\");\n hideElement(\"#btn-delete-user\");\n hideElement(\"#btn-ban-user\");\n hideElement(\"#btn-set-admin\");\n showElement(\"#btn-report-user\");\n hideElement(\".incoming-message .btn-group\");\n }\n}", "function primerBoton(){\r\n alert(\"Hiciste click en el primer boton\");\r\n}", "function tambahRuangan() {\n var namaRuanganBaru = inputNamaRuangan.val().trim().toLowerCase();\n var sudahGabung = false;\n $('#chat-cell').children('ol').each(function () {\n if ($(this).prop('id').substring(10) == namaRuanganBaru) {\n sudahGabung = true;\n }\n });\n if (!sudahGabung) {\n var linkRuangan = $('<a class=\"mdl-navigation__link\" id=\"ruangan-'+namaRuanganBaru+'\"></a>');\n linkRuangan.html('<i class=\"material-icons\" role=\"presentation\">forum</i>&nbsp;'+namaRuanganBaru);\n daftarRuangan.prepend(linkRuangan);\n\n inputNamaRuangan.val('');\n loginWindow.hide();\n chatWindow.show();\n addChannelWindow.hide();\n buatRuangan(namaRuanganBaru);\n socket.emit('gabung', namaRuanganBaru);\n loadRuangan(namaRuanganBaru);\n\n socket.emit('pesan_sistem', { pesan: '<font color\"green\"><strong>'+inputNama.val()+'</strong> bergabung dalam obrolan.</font>', room: namaRuanganBaru });\n \n } else {\n inputNamaRuangan.val('');\n loginWindow.hide();\n chatWindow.show();\n addChannelWindow.hide();\n loadRuangan(newChannelName);\n }\n }", "function setAlert(){\n if (comprobarFormulario()) {\n $('<form>')\n .addClass('pre-form')\n .append(createInput(INTIT, 'text', 'Titulo del boton'))\n .append(createInput(INCONT, 'text', 'Contenido del alert'))\n .append(inputBotones(click))\n .appendTo('body');\n }\n\n /**\n * Funcion que realiza la craeción del alert.\n * @param {Event} e Evento que ha disparado esta accion.\n */\n function click(e) {\n e.preventDefault();\n var contenido = $('#'+INCONT).val();\n var titulo = $('#'+INTIT).val();\n if (titulo && contenido) {\n divDraggable()\n .append(\n $('<button>')\n .html(titulo)\n .data('data', contenido)\n .on('click', (e)=>{\n alert($(e.target).data('data'));\n })\n )\n .append(botonEliminar())\n .appendTo('.principal');\n $(e.target).parents('form').remove();\n } else {\n alert('Rellene el campo de \"Titulo\" y \"Contenido\" o pulse \"Cancelar\" para salir.');\n }\n }\n}", "function sendEvents() {\n // Click to register in Register window\n $('.rentalbikes-register-window button').on('click', function() {\n setDatas('register');\n validateDatas('register');\n if (opts.errors != ''){\n setError(opts.errors, 'register');\n } else {\n callAjaxControllerRegistration('register');\n }\n return false;\n });\n\n // Press enter in login window\n $(document).keypress(function(e) {\n if (e.which == 13\n && $('.rentalbikes-login-window').css('display') == 'block') {\n setDatas('login');\n validateDatas('login');\n if (opts.errors != '') {\n setError(opts.errors, 'login');\n }\n else {\n callAjaxControllerLogin('login');\n }\n }\n });\n\n // Click on login in Login window\n $('.rentalbikes-login-window button').on('click', function() {\n setDatas('login');\n validateDatas('login');\n if (opts.errors != '') {\n setError(opts.errors, 'login');\n } else {\n callAjaxControllerLogin('login');\n }\n return false;\n });\n\n //login from login page\n $('#send2').on('click', function () {\n var dataForm = new VarienForm('login-form', true);\n if (dataForm.validator && dataForm.validator.validate()) {\n callAjaxControllerLogin('loginPage');\n }\n });\n\n //registration from login page\n $('#btnRegister').on('click', function () {\n var dataForm = new VarienForm('register-form', true);\n if (dataForm.validator && dataForm.validator.validate()) {\n callAjaxControllerRegistration('registerPage');\n }\n });\n }", "function iniciar() {\n cuerpoTablaUsuario = document.getElementById('cuerpoTablaUsuario'); \n divRespuesta = document.getElementById('divRespuesta');\n var botonAlta = document.getElementById('botonAlta');\n botonAlta.addEventListener('click', altaUsuario); \n}", "function assign_user(friend_list) {\n $(document).on(\"click\",\"#assign_public_user\",function(e) {\n if (friend_list.length > 0 ) {\n data_in = 'public_user=public';\n } else {\n data_in = 'public_user=assign';\n }\n $.post( \"/intro\",data_in)\n .done(function(){\n window.location = \"http://tgt-dev.appspot.com/\";\n });\n return false;\n });\n}", "function registrar(){\n\tvar regbtn=\"1\";\n\tvar email = $(\"#email\").val();\n\tvar pass = $(\"#password\").val();\n\tvar repass = $(\"#repassword\").val();\n\tvar nombre = $(\"#nombre\").val();\n\tvar apellido =$(\"#apellidos\").val();\t\n\tvar direccion = $(\"#direccion\").val();\n\tvar numero = $(\"#numero\").val();\n\tvar rut = $(\"#rut\").val();\n\tvar departamento = $(\"#departamento\").val();\n\tvar telfijo = $(\"#telefonofijo\").val();\n\tvar celular = $(\"#celular\").val();\n\tvar check=$(\"input:checkbox[name='checkregistro']:checked\").val();\n\tvar idUsuario=$(\"#confirmUsuario\").val();\n\t\n\t$(\"#contregpopup\").text(\"Cargando...\");\n\tif(pass == repass){\n\t\t//las contraseñas deben ser iguales\n\t\tif(pass.length < 6 || repass.length < 6) { \n\t\t\t$(\"#mensajepass\").text(\"Las contraseñas deben tener como mínimo 6 caracteres...\");\n\t\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\tscrollTop: '0px'\n\t\t\t}, 300);\n\t\t\t$(window).scroll(function(){\n\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t} else {\n\t\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger hidden\");\n\t\t\tif($(\"#email\").val().indexOf('@', 0) == -1 || $(\"#email\").val().indexOf('.', 0) == -1) {\n //alert('El correo electrónico introducido no es correcto.');\n $(\"#mensajeemail\").attr(\"class\",\"alert alert-danger text-center\");\n }else{\n \tif(email!='' && pass!='' && nombre!='' && repass!='' && email!='' && apellido!='' && direccion!='' && numero!='' && rut!=''){\n\t\t\t\t\t//no deben hacer campos vacios\n\t\t\t\t\tif (check) {\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Procesando registro\");\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t$.post('php/AgregarUsuario/intermediario.php',{regbtn:regbtn,email:email,pass:pass,nombre:nombre,apellido:apellido,direccion:direccion,numero:numero,rut:rut,departamento:departamento,telfijo:telfijo,celular:celular,idUsuario:idUsuario},\n\t\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(data);\n\t\t\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t\t\t\t}, 300);\n\t\t\t\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif(data == \"Se ha registrado correctamente...\"){\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Debe aceptar los terminos y condiciones para completar el registro\");\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\t\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Debe llenar todos los campos obligatorios...\");\n\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t}, 300);\n\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\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}else{\n\t\t$(\"#mensajepass\").text(\"Las contraseñas no coinciden\");\n\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t$('#agregarUsuarioModal').animate({\n\t\t\tscrollTop: '0px'\n\t\t}, 300);\n\t\t$(window).scroll(function(){\n\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t} else {\n\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t}\n\t\t});\n\t}\n\n\t}//cierre registro usuario", "function main(){\n var form = find_password_form();\n\n // Connexion, on rempli si possible, sinon on intercepte\n if(form[\"type\"] == \"login\"){\n login_id = {\"id\": \"Mathieu\", \"password\": \"p4ssw0rd\"}; //Aucun moyen de les récupérer...\n auto_login(form, login_id);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp si changement\n ecouter(form);\n }\n // Inscription, on prérempli\n if(form[\"type\"] == \"signup\"){\n auto_signup(form);\n ecouter(form);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp\n }\n}", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "function useSaveButton() {\r\n var user = document.getElementById(\"userID\").value;\r\n editASingleUser(user)\r\n startPage()\r\n}", "function addEventHandlerForgotPasswordButton() {\n\td3.select(\"#forgot-password-button\").on(\"click\", function() {\n\t\td3.event.preventDefault();\n\t\tvar emailElement = d3.select(\"input[name=email]\");\n\t\tvar email = emailElement.property(\"value\");\n\t\tif(tp.util.isEmpty(email) || !validEmail(email)) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-reset-email-invalid\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\temailElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\t\tvar confirmDispatcher = tp.dialogs.showDialog(\"confirmDialog\", tp.lang.getFormattedText(\"password-reset-confirm\", email))\n\t\t\t.on(\"ok\", function() {\n\t\t\t\ttp.session.sendPasswordReset(email, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.error(error, data);\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"errorDialog\", \"#password-reset-failed\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Handle successful send passwors reset\n\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"messageDialog\", \"#password-reset-successful\");\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t})\n\t\t;\n\t});\n}", "function registreren(){\n\t window.location.href = \"registreren.html\";\n }", "function compagnie_acheter()\n{\n document.getElementById(\"jeu\").innerHTML = \"<h1>\" + document.getElementById(\"c\"+pos_actuelle()+\"_nom\").innerHTML + \"</h1>\" + \"<p> <input type=\\\"button\\\" id=\\\"bouton_acheter\\\" value=\\\"Acheter\\\"/></p>\";\n validation.innerHTML = bouton_passer;\n \n var b_p = document.getElementById(\"bouton_passer\");\n b_p.addEventListener(\"click\", passer,false);\n \n var b_a = document.getElementById(\"bouton_acheter\");\n b_a.addEventListener(\"click\", function()\n\t\t\t {\n\t\t\t if(joueurs[joueur_actuel].capital > 15000)\n\t\t\t {\n\t\t\t\t cases[pos_actuelle()] = {\"compagnie\" : true, \"nom\": joueurs[joueur_actuel].nom, \"id\": joueur_actuel};\n\t\t\t\t joueurs[joueur_actuel].compagnies += 1;\n\t\t\t\t joueurs[joueur_actuel].capital -= 15000;\n\t\t\t\t passer();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t alert(\"pas assez d'argent\");\n\t\t\t }\n\t\t\t \n\t\t\t },false);\n}", "function register_event_handlers()\n {\n \n \n /* button Login */\n $(document).on(\"click\", \".uib_w_4\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button #retailerlist */\n $(document).on(\"click\", \"#retailerlist\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#retailer_list\"); \n return false;\n });\n \n /* button #retailerregister */\n $(document).on(\"click\", \"#retailerregister\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#retailer_register\"); \n return false;\n });\n \n /* button #retailerrequest */\n $(document).on(\"click\", \"#retailerrequest\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#retailer_request\"); \n return false;\n });\n \n /* button #enduser */\n $(document).on(\"click\", \"#enduser\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#end_user_list\"); \n return false;\n });\n \n /* button #login */\n $(document).on(\"click\", \"#login\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button #back */\n \n \n /* button #back */\n $(document).on(\"click\", \"#back\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button #back */\n $(document).on(\"click\", \"#back\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button .uib_w_17 */\n $(document).on(\"click\", \".uib_w_17\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_18\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button #logout */\n $(document).on(\"click\", \"#logout\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button #backmain */\n $(document).on(\"click\", \"#backmain\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#main_page\"); \n return false;\n });\n \n /* button #register */\n $(document).on(\"click\", \"#register\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#reigister_success\"); \n return false;\n });\n \n }", "checkButton()\n {\n if(this.imeModel==\"\" || this.emailModel==\"\" || this.telefonModel==\"\")\n {\n this.butShow=false;\n }\n else\n {\n this.butShow=true;\n }\n }", "function guardausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.go(\"clientes\",\"guardausr\",llenausr);\n }\n}", "function rete(){\n\t\t\t$(window.location).attr('href', '../php/rete_sociale.php?'+$.cookie('username'));\n\t\t}", "function btnSaludar(){\n alert(\"Hola a todos\");\n}", "switchToRegister() {\n document.getElementById(\"login-form-container\").classList.add('right-panel-active');\n this.clearFeedback();\n updatePageTitle(\"Lag konto\");\n }", "function fl_outToPesach_btn ()\n\t\t{\n\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}" ]
[ "0.6457133", "0.64038706", "0.63845533", "0.63838714", "0.63149834", "0.62490803", "0.6248833", "0.62378776", "0.61632925", "0.61623", "0.61434615", "0.6129469", "0.6120418", "0.61201364", "0.6118974", "0.61156183", "0.610099", "0.60940266", "0.60909", "0.60779184", "0.60748947", "0.6073493", "0.6046163", "0.60302347", "0.6018383", "0.5992418", "0.5991582", "0.5985678", "0.59849817", "0.59721786", "0.5961926", "0.5942318", "0.59385246", "0.5929237", "0.59239614", "0.5890889", "0.58838755", "0.5881677", "0.5881483", "0.58671343", "0.5861247", "0.5854628", "0.58478355", "0.5846537", "0.5844404", "0.5844227", "0.5841272", "0.58378416", "0.58297724", "0.5820542", "0.5815874", "0.5815396", "0.5812264", "0.5810254", "0.58070856", "0.5803929", "0.5803312", "0.5802679", "0.5790196", "0.5789879", "0.5786156", "0.57857245", "0.57802576", "0.57790565", "0.57762855", "0.5769007", "0.57684517", "0.5760517", "0.5753676", "0.57382935", "0.5732414", "0.572793", "0.5723907", "0.571446", "0.57093835", "0.5706511", "0.57044095", "0.5701441", "0.57014316", "0.5701171", "0.56993526", "0.5697141", "0.5694728", "0.569176", "0.56904393", "0.56897765", "0.5688285", "0.5687941", "0.5678012", "0.56720877", "0.5670496", "0.56669956", "0.56665", "0.5664852", "0.56634736", "0.5663117", "0.5662047", "0.5661341", "0.5660738", "0.56599355", "0.5659781" ]
0.0
-1
Functions should iterate thru elements and change them OR return a DOMNodeCollection instance
html(argHTML) { if (argHTML === undefined) return this.elementArray[0].innerHTML; this.each(ele => { ele.innerHTML = argHTML; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function manipulateelements(item){\n /*do soemthing to item*/\n}", "function ElementCollection(){\n\tthis.inState = 0;\n\tthis.placeHolder = document.createComment('ElementCollection');\n\tthis.children = [];\n\tthis.firstChild = null;\n\tthis.lastChild = null;\n\tthis.parentElement = null;\n\tthis.placeHolder.ElementCollection = this;\n\treturn this;\n}", "function __(elm) { return document.querySelectorAll(elm) }", "function wr(elemsSelector) {\n return new NodeList(elemsSelector);\n }", "function recreateDOMList($el, length){\n\tconst args = ['sel'];\n\tfor (var i = 1; i < length; i++)\n\t\targs.push(`a${i}`);\n\n\tconst obj = {};\n\tconst temp = Function('o', `return function(${args.join(',')}){return o.find(sel)}`)(obj);\n\tfor (var i = 0; i < length; i++)\n\t\ttemp[i] = $el[i];\n\n\tobj.find = sel=> temp.find(sel);\n\n\tObject.defineProperty(temp, '_', {value:true});\n\treturn Object.setPrototypeOf(temp, DOMList.prototype);\n}", "function findAndReplace(){\n elementsInsideBody.forEach(element =>{\n element.childNodes.forEach(child =>{\n if(child.nodeType === 3){\n replaceText(child);\n console.log('replaced');\n }\n });\n });\n}", "removeChilds( ) {\n if ( !this.dom ) {\n return;\n }\n\n let all = this.flattenChildren( );\n\n all.forEach( ( item ) => {\n let dom = item.clearDom( );\n if( dom ) {\n dom.remove( );\n }\n } );\n\n // remove all remaining elements (not DOMNodes)\n let node = this.dom;\n while ( node.lastChild ) {\n node.removeChild( node.lastChild );\n }\n }", "all(el, callback) {\n el = this.s(el);\n el.forEach((data) => {\n callback(this.toNodeList(data));\n });\n }", "getElements(){\n return this.elements;\n }", "function updateChildren(DOMElement, changes, dispatch, context) {\n // Create a clone of the children so we can reference them later\n // using their original position even if they move around\n if (!DOMElement) return;\n let childNodes = toArray(DOMElement.childNodes)\n\n // changes.forEach(change => {\n // Actions.case({\n // insertChild: (vnode, index, path) => {\n // var placeHolder = createPlaceHolderAtIndex(DOMElement, childNodes, index)\n // change.placeHolder = placeHolder\n // },\n // moveChild: (vnode, index, actions) => {\n // var placeHolder = createPlaceHolderAtIndex(DOMElement, childNodes, index)\n // change.placeHolder = placeHolder\n //\n //\n // },\n // removeChild: (index) => {\n //\n // },\n // updateChild: (index, actions) => {\n // let _update = updateElement(dispatch, context)\n // actions.forEach(action => _update(childNodes[index], action))\n // }\n // }, change)\n // })\n\n changes.forEach(change => {\n Actions.case({\n insertChild: (vnode, index, path) => {\n insertAtIndex(DOMElement, index, createElement(vnode, path, dispatch, context), change.placeHolder)\n mountElement(vnode)\n },\n moveChild: (index, newVnode, oldVnode, actions, path) => {\n var el = (oldVnode.nativeNode || createElement(newVnode, path, dispatch, context))\n insertAtIndex(DOMElement, index, el, change.placeHolder)\n let _update = updateElement(dispatch, context)\n actions.forEach(action => _update(el, action))\n },\n removeChild: (index, vnode) => {\n var child = childNodes[index];\n if (child && child.parentNode == DOMElement) {\n DOMElement.removeChild(child)\n removeThunks(vnode)\n }\n },\n updateChild: (index, actions) => {\n let _update = updateElement(dispatch, context)\n actions.forEach(action => _update(childNodes[index], action))\n }\n }, change)\n })\n}", "function forEach(arr, fun) { return HTMLCollection.prototype.each.call(arr, fun); }", "function __( el )\n{\n return document.querySelectorAll( el );\n}", "function applyToElements(elements, action)\r\n{\r\n for (var i=0; i < elements.length; i++)\r\n action(elements[i]);\r\n}", "function visitElements(seeds, handler) {\r\n var queue = [seeds], tmp;\r\n while (tmp = queue.shift()) {\r\n for (var i = 0; i < tmp.length; i++) {\r\n var el = tmp[i];\r\n if (!el || el.nodeType != Node.ELEMENT_NODE)\r\n { continue; }\r\n handler(el);\r\n if (el.children && el.children.length > 0)\r\n { queue.push(el.children); }\r\n }\r\n }\r\n }", "function toNodes(elements) {\n\t\t// Support passing things as argument lists, without the first wrapping array\n\t\t// Do not reset elements, since this causes a circular reference on Opera\n\t\t// where arguments inherits from array and therefore is returned umodified\n\t\t// by Array.create, and where setting elements to a new value modifies\n\t\t// this arguments list directly.\n\t\tvar els = Base.type(elements) == 'array' ? elements : Array.create(arguments);\n\t\t// Find out if elements are created, or if they were already passed.\n\t\t// The convention is to return the newly created elements if they are not\n\t\t// elements already, otherwise return this.\n\t\tvar created = els.find(function(el) {\n\t\t\treturn !DomNode.isNode(el);\n\t\t});\n\t\t// toNode can either return a single DomElement or a DomElements array.\n\t\tvar result = els.toNode(this.getDocument());\n\t\treturn {\n\t\t\t// Make sure we always return an array of the resulted elements as well,\n\t\t\t// for simpler handling in inserters below\n\t\t\tarray: result ? (Base.type(result) == 'array' ? result : [result]) : [],\n\t\t\t// Result might be a single element or an array, depending on what the\n\t\t\t// user passed. This is to be returned back. Only define it if the elements\n\t\t\t// were created.\n\t\t\tresult: created && result\n\t\t};\n\t}", "constructor(mixed, parentNode) {\n if (mixed instanceof HTMLElement) this.elements = [mixed];\n else if (parentNode !== undefined) this.elements = parentNode.querySelectorAll(selector);\n else this.elements = document.querySelectorAll(mixed);\n this.length = this.elements.length;\n }", "function forEachNodeList(els, fn) {\n Array.prototype.forEach.call(els, fn);\n}", "function domEach(array, fn) {\n const len = array.length;\n for (let i = 0; i < len; i++)\n fn(array[i], i);\n return array;\n}", "get all() {\n const _elements = [];\n try {\n const value = this.elements.value;\n if (value && value.length) {\n // create list elements\n for (let i = 0; i < value.length; i++) {\n // make each list element individually selectable via xpath\n const selector = `(${this._selector})[${i + 1}]`;\n const listElement = this._elementStoreFunc.apply(this._store, [selector, this._elementOpts]);\n _elements.push(listElement);\n }\n }\n return _elements;\n }\n catch (error) {\n // this.elements will throw error if no elements were found\n return _elements;\n }\n }", "function domEach(array, fn) {\n var len = array.length;\n\n for (var i = 0; i < len; i++) {\n fn(array[i], i);\n }\n\n return array;\n}", "findElements() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const es = [];\r\n const ids = yield this.findElementIds();\r\n ids.forEach(id => {\r\n const e = new Element(this.http.newClient(''), id);\r\n es.push(e);\r\n });\r\n return es;\r\n });\r\n }", "async refresh(DOMnode = document){\n return Promise.all([...DOMnode.querySelectorAll(\"[\"+this.keyAttr+\"]\")].map(n => this.fill(n)))\n }", "function Dom2(lista) {\n this.elements = document.querySelectorAll(lista)\n\n this.addClass = function(classe) {\n this.elements.forEach((item)=>{\n item.classList.add(classe)\n })\n }\n this.removeClass = function(classe) {\n this.elements.forEach((item)=>{\n item.classList.remove(classe)\n })\n }\n}", "static syncChildrenElement(sourceElement, targetElement) {\n const me = this,\n sourceNodes = arraySlice.call(sourceElement.childNodes),\n targetNodes = arraySlice.call(targetElement.childNodes);\n\n while (sourceNodes.length) {\n const sourceNode = sourceNodes.shift(),\n targetNode = targetNodes.shift();\n\n // only textNodes and elements allowed (no comments)\n if (sourceNode && sourceNode.nodeType !== Node.TEXT_NODE && sourceNode.nodeType !== Node.ELEMENT_NODE) {\n throw new Error(`Source node type ${sourceNode.nodeType} not supported by DomHelper.sync()`);\n }\n if (targetNode && targetNode.nodeType !== Node.TEXT_NODE && targetNode.nodeType !== Node.ELEMENT_NODE) {\n throw new Error(`Target node type ${targetNode.nodeType} not supported by DomHelper.sync()`);\n }\n\n if (!targetNode) {\n // out of target nodes, add to target\n targetElement.appendChild(sourceNode);\n } else {\n // match node\n\n if (sourceNode.nodeType === targetNode.nodeType) {\n // same type of node, take action depending on which type\n if (sourceNode.nodeType === Node.TEXT_NODE) {\n // text\n targetNode.data = sourceNode.data;\n } else {\n if (sourceNode.tagName === targetNode.tagName) {\n me.performSync(sourceNode, targetNode);\n } else {\n // new tag, remove targetNode and insert new element\n targetElement.insertBefore(sourceNode, targetNode);\n targetNode.remove();\n }\n }\n }\n // Trying to set text node as element, use it as innerText\n // (we get this in FF with store mutations and List)\n else if (sourceNode.nodeType === Node.TEXT_NODE && targetNode.nodeType === Node.ELEMENT_NODE) {\n targetElement.innerText = sourceNode.data.trim();\n } else {\n throw new Error('Currently no support for transforming nodeType');\n }\n }\n }\n\n // Out of source nodes, remove remaining target nodes\n targetNodes.forEach((targetNode) => {\n targetNode.remove();\n });\n }", "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "function getDOMElements(){\r\n return {\r\n squares: Array.from(document.querySelectorAll(\".grid div\")),\r\n firstSquare: function(){ return this.squares[30] },\r\n squaresInActiveGameplace: Array.from(grid.querySelectorAll(\".activegameplace\")),\r\n firstSquareInRow: document.querySelectorAll(\".first-in-row\"),\r\n lastSquareInRow: document.querySelectorAll(\".last-in-row\"),\r\n music: document.getElementById(\"myAudio\")\r\n }\r\n}", "function recreateDOMList($el, length){\n\tconst args = new Array(length);\n\targs[0] = 'sel';\n\n\tfor (var i = 1; i < length; i++)\n\t\targs[i] = `a${i}`;\n\n\t/*\n\t\"args\" will can only contain [sel, a0, a1, a...]\n\tIt may not contain dangerous script evaluation.\n\tAnd this is just for IE11 and Safari's polyfill.\n\t*/\n\tconst obj = {};\n\tconst temp = Function('o', `return function(${args.join(',')}){return o.find(sel)}`)(obj);\n\n\tfor (var i = 0; i < length; i++)\n\t\ttemp[i] = $el[i];\n\n\tobj.find = sel=> temp.find(sel);\n\n\tObject.defineProperty(temp, '_', {value:true});\n\treturn Object.setPrototypeOf(temp, DOMList.prototype);\n}", "function clearElements(node){\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "function DOMEnumerator(elements) {\n return _super.call(this, DOMEnumerator.ensureElements(elements)) || this;\n }", "function applyToAllElements(fn, type) {\n var c = document.getElementsByTagName(type);\n for (var j = 0; j < c.length; j++) {\n fn(c[j]);\n }\n}", "function getElements() {\r\n\t// remove prevously created elements\r\n\tif(window.inputs) {\r\n\t\tfor(var i = 0; i < inputs.length; i++) {\r\n\t\t\tinputs[i].className = inputs[i].className.replace('outtaHere','');\r\n\t\t\tif(inputs[i]._ca) inputs[i]._ca.parentNode.removeChild(inputs[i]._ca);\r\n\t\t\telse if(inputs[i]._ra) inputs[i]._ra.parentNode.removeChild(inputs[i]._ra);\r\n\t\t}\r\n\t\tfor(i = 0; i < selects.length; i++) {\r\n\t\t\tselects[i].replaced = null;\r\n\t\t\tselects[i].className = selects[i].className.replace('outtaHere','');\r\n\t\t\tselects[i]._optionsDiv._parent.parentNode.removeChild(selects[i]._optionsDiv._parent);\r\n\t\t\tselects[i]._optionsDiv.parentNode.removeChild(selects[i]._optionsDiv);\r\n\t\t}\r\n\t}\r\n\r\n\t// reset state\r\n\tinputs = new Array();\r\n\tselects = new Array();\r\n\tlabels = new Array();\r\n\tradios = new Array();\r\n\tradioLabels = new Array();\r\n\tcheckboxes = new Array();\r\n\tcheckboxLabels = new Array();\r\n\tfor (var nf = 0; nf < document.getElementsByTagName(\"form\").length; nf++) {\r\n\t\tif(document.forms[nf].className.indexOf(\"default\") < 0) {\r\n\t\t\tfor(var nfi = 0; nfi < document.forms[nf].getElementsByTagName(\"input\").length; nfi++) {inputs.push(document.forms[nf].getElementsByTagName(\"input\")[nfi]);}\r\n\t\t\tfor(var nfl = 0; nfl < document.forms[nf].getElementsByTagName(\"label\").length; nfl++) {labels.push(document.forms[nf].getElementsByTagName(\"label\")[nfl]);}\r\n\t\t\tfor(var nfs = 0; nfs < document.forms[nf].getElementsByTagName(\"select\").length; nfs++) {selects.push(document.forms[nf].getElementsByTagName(\"select\")[nfs]);}\r\n\t\t}\r\n\t}\r\n}", "_updateDOM() {\n this._updateAttributes();\n this._updateStyles();\n }", "function _resolveElements(elements) {\n // No input is just an empty array\n if (!elements) {\n return [];\n }\n\n // Make sure it's in array form.\n if (typeof elements === \"string\" || !elements || !elements.length) {\n elements = [elements];\n }\n\n // Make sure we have a DOM element for each one, (could be string id name or toolkit object)\n var i,\n realElements = [];\n for (i = 0; i < elements.length; i++) {\n if (elements[i]) {\n if (typeof elements[i] === \"string\") {\n var element = _Global.document.getElementById(elements[i]);\n if (element) {\n realElements.push(element);\n }\n } else if (elements[i].element) {\n realElements.push(elements[i].element);\n } else {\n realElements.push(elements[i]);\n }\n }\n }\n\n return realElements;\n }", "function querySelectorAll(){\n\t\tvar result = document.querySelectorAll.apply(document, arguments);\n\t\t// opera fails to add the foreach method added to the nodelist prototype\n\t\tif (result.forEach === undefined){\n\t\t\tresult.forEach = Array.prototype.forEach;\n\t\t}\n\t\treturn result;\n\t}", "findAll(qs) {\n if (!this.element) return false;\n return Array.from(this.element.querySelectorAll(qs)).map((e) => enrich(e));\n }", "function restoreDom(all) {\n for (var i = 0; i < all.length; i++) {\n all[i].paintItem();\n if (all[i].children.length) {\n restoreDom(all[i].children);\n }\n }\n }", "function eachElement (elements, callback) {\n if (elements.nodeType) {\n elements = [elements];\n } else if (typeof elements === 'string') {\n elements = document.querySelectorAll(selector(elements));\n }\n\n for (var a = 0; a < elements.length; a++) {\n if (elements[a].nodeType === 1) {\n callback(elements[a], a);\n }\n }\n }", "_getAllTextElementsForChangingColorScheme() {\n let tagNames = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'label']\n let allItems = [];\n\n for (let tagname of tagNames) {\n allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(tagname));\n }\n // allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(\"h1\"));\n\n return allItems;\n }", "function modifyMultiple(elements, process) {\n\t\tvar ind = elements.length;\n\t\twhile(ind--) {\n\t\t\tprocess(elements[ind]);\n\t\t}\n\t}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function removeOldElements(elements) {\n if (typeof elements === 'undefined') {\n return;\n }\n\n for (var i = 0; i < elements.length; i++) {\n elements[i].remove();\n }\n }", "function changedElements(elements) {\n return _.filter(elements, function (e) { return e.lastParentSize !== e.parentSize;});\n }", "function _decorate(collection) {\n\n // creates an event listener on nodelists given a trigger and a handler function\n collection.on = function (eventName, handler) {\n nodeList.forEach(function(el) {\n el.addEventListener(eventName, handler)\n })\n };\n\n // get and set css properties on nodelists\n collection.css = function (...cssProps) {\n if (cssProps.length == 1 && typeof cssProps[0] === 'object') {\n // set props one by one\n } else if (cssProps.length == 1 && typeof cssProps[0] == 'string') {\n // return single property value\n } else if (cssProps.length == 2 && typeof cssProps[0] == 'string' && typeof cssProps[1] == 'string') {\n // set single property\n } else {\n throw new Error(`Invalid parameter(s): ${cssProps} passed to .css()`);\n }\n };\n\n // returns the HTML of the first element in a nodelist\n collection.html = function (collection) {\n return collection[0].innerHTML;\n }\n\n return nodeList;\n}", "updateValueByDOMTags(){\n this.value.length = 0;\n\n [].forEach.call(this.getTagElms(), node => {\n if( node.classList.contains(this.settings.classNames.tagNotAllowed.split(' ')[0]) ) return\n this.value.push( getSetTagData(node) )\n })\n\n this.update()\n }", "function upgradeElements(elements) {\n if (!Array.isArray(elements)) {\n elements = elements.toArray();\n }\n componentHandler.upgradeElements(elements);\n}", "function ddChangeAllElements(object,elemIds) {\n var index = object.selectedIndex;\n if (index > 0) {\n for (var i = 0; i < elemIds.length; i++) {\n var elem = getElementByIdCS(elemIds[i]);\n if (elem) elem.selectedIndex = index - 1;\n }\n }\n}", "bindToDom() {\n document\n .querySelectorAll(\"[s-text]\")\n .forEach(x => this.syncNode(x, x.attributes[\"s-text\"].value));\n }", "function getNodesFromDom(selector) {\n\t const elementList = document.querySelectorAll(selector);\n\t const nodesArray = Array.from(elementList);\n\t return new DomNodeColection(nodesArray);\n\t}", "function returnElementArray($container) {\n var nsp = '[data-' + ns + ']',\n // if an $el was given, then we scope our query to just look within the element\n DOM = $container ? $container.find(nsp) : $(nsp);\n\n return DOM;\n }", "function updateViaArray(node, childNodes, i) {\n var fragment = node.ownerDocument.createDocumentFragment();\n if (0 < i) {\n removeNodeList(node.childNodes, i);\n appendNodes(fragment, childNodes.slice(i));\n node.appendChild(fragment);\n } else {\n appendNodes(fragment, childNodes);\n resetAndPopulate(node, fragment);\n }\n }", "function Elements() {\n}", "allElems() {\n return this.rootNode;\n }", "allElems() {\n return this.rootNode;\n }", "setElement() {\n errors.throwNotImplemented(\"setting an element in a collection\");\n }", "function domEach(array, fn) {\n var len = array.length;\n for (var i = 0; i < len && fn(i, array[i]) !== false; i++)\n ;\n return array;\n}", "function ElementNodes(nodelist) {\n\tvar eNodes = []; // return array is defined\n\n\tfor (var i=0, j=nodelist.length; i < j; i++) {\n\t\tif (nodelist[i].nodeType == 1) { // if nodelist is real element\n\t\t\teNodes.push(nodelist[i]); // push the nodelist into our eNodes array\n\t\t}\n\t}\n\n\treturn eNodes;\n}", "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i)\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1\n offset += child.nodeSize\n continue outer\n }\n }\n f(child, offset)\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f) }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1) }\n offset += child.nodeSize\n }\n}", "function convertNodes() {\n var nodes, i, len, c, e;\n nodes = [];\n for (i = 0, len = usercomics.length; i < len; i = i + 1) {\n c = usercomics[i];\n e = new Element('span', { 'comicid': c.id });\n e.innerHTML = c.name;\n nodes[i] = e;\n }\n return nodes;\n}", "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount;\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i);\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1;\n offset += child.nodeSize;\n continue outer\n }\n }\n f(child, offset);\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f); }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1); }\n offset += child.nodeSize;\n }\n}", "prepareDocument(document) {\n let imgElemsQuery = \".//*[@src | @srcset]\";\n const ORDERED_NODE_SNAPSHOT_TYPE = 7;\n let imgElemsResult = document.evaluate(imgElemsQuery, document, null, ORDERED_NODE_SNAPSHOT_TYPE);\n for (let i = 0, elem; i < imgElemsResult.snapshotLength; ++i) {\n elem = imgElemsResult.snapshotItem(i);\n this.prepareElement(elem)\n }\n }", "addAll(parent, startIndex, endIndex) {\n let index = startIndex || 0;\n for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index) {\n this.findAtPoint(parent, index);\n this.addDOM(dom);\n }\n this.findAtPoint(parent, index);\n }", "prepareDocument(document) {\n /**\n * Convenience function to iterate and recurse through a DOM tree\n */\n function traverseElements(elem, callback) {\n callback(elem);\n const children = elem.children;\n for (let i = 0; i < children.length; ++i) {\n traverseElements(children.item(i), callback);\n }\n }\n traverseElements(document.documentElement, this.prepareElement);\n }", "_resetCursorStops() {\n Polymer.dom.flush();\n // Polymer2: querySelectorAll returns NodeList instead of Array.\n this._listElements = Array.from(\n Polymer.dom(this.root).querySelectorAll('li'));\n }", "function DOMImplementation() {\n}", "function DOMImplementation() {\n}", "_setChildElementValue() {\n this._elements.forEach((element) => {\n let name = element.name;\n element.value = this.value[name];\n });\n }", "function updateDOM() {\n backlogListArray = updateColumnInDOM(backlogList, arrayNames.indexOf('backlog'), backlogListArray);\n progressListArray = updateColumnInDOM(progressList, arrayNames.indexOf('progress'), progressListArray);\n completeListArray = updateColumnInDOM(completeList, arrayNames.indexOf('complete'), completeListArray);\n onHoldListArray = updateColumnInDOM(onHoldList, arrayNames.indexOf('onHold'), onHoldListArray);\n\n // Update Local Storage\n updateSavedColumns();\n}", "getChildNodeIterator() {}", "function updateDOMforChild(children, index, subIndexes, type, num, parentElem) {\n\tvar _this = this;\n\n\t// make sure children are document nodes as we insert them into the DOM\n\tvar nodeChildren = makeChildrenNodes(children);\n\n\t// choose witch change to perform\n\tvar operation = void 0;\n\tswitch (type) {\n\t\tcase 'add':\n\t\t\toperation = addElements;\n\t\t\tbreak;\n\t\tcase 'set':\n\t\t\toperation = setElements;\n\t\t\tbreak;\n\t\tcase 'rm':\n\t\t\toperation = removeElements;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn Promise.reject('Trying to perform a change with unknown change-type:', type);\n\t}\n\n\t// to minor changes directly but bundle long langes with many elements into one animationFrame to speed things update_done\n\t// if we do this for every change, this slows things down as we have to wait for the animationframe\n\treturn new Promise(function (resolve, reject) {\n\t\tif (nodeChildren && nodeChildren.length > BATCH_CHILD_CHANGE_TRESHOLD) {\n\t\t\trequestAnimationFrame(operation.bind(_this, index, subIndexes, type === 'rm' ? num : nodeChildren, parentElem, resolve));\n\t\t} else {\n\t\t\toperation(index, subIndexes, type === 'rm' ? num : nodeChildren, parentElem, resolve);\n\t\t}\n\t});\n}", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function _reset () {\n _elements = [];\n }", "function setHTMLof (oldNode) {\n return {\n to: function(newNode) {\n return oldNode.innerHTML = newNode.innerHTML \n }\n }\n }", "function upgradeAllRegisteredInternal() {\n\t for (var n = 0; n < registeredComponents_.length; n++) {\n\t upgradeDomInternal(registeredComponents_[n].className);\n\t }\n\t }", "function upgradeAllRegisteredInternal() {\n\t for (var n = 0; n < registeredComponents_.length; n++) {\n\t upgradeDomInternal(registeredComponents_[n].className);\n\t }\n\t }", "setElements() {\n this.$element = jQuery(this.element);\n this.$togglers = this.$element.find(this.options.togglersAttribute);\n }", "function getNodesFromDom(selector) {\n const elementList = document.querySelectorAll(selector);\n const nodesArray = Array.from(elementList);\n return new DomNodeColection(nodesArray);\n}", "function _findElements(domRoot) {\n\t\tlet items = Array.from(domRoot.querySelectorAll(`[${DOM_SELECTOR}]`));\n\t\tif (domRoot.hasAttribute(DOM_SELECTOR)) {\n\t\t\titems.push(domRoot);\n\t\t}\n\n\t\titems.forEach(function (item) {\n\t\t\tif (!item[DOM_ATTRIBUTE]) {\n\t\t\t\titem[DOM_ATTRIBUTE] = new _constructor(item);\n\t\t\t}\n\t\t});\n\t}", "function translateElements(elements, store, fromLanguage, toLanguage) {\n try {\n elements.forEach((element, index) => {\n const currentHtml = element.innerHTML;\n const currentText = getText(element);\n let originalText;\n if(currentText) {\n originalText = currentText;\n }\n else {\n originalText = currentHtml;\n }\n const translatedText = getTranslatedValue(store, originalText.trim(), fromLanguage, toLanguage, element);\n if(currentHtml.includes(originalText.trim())) {\n element.innerHTML = currentHtml.replace(originalText.trim(), translatedText);\n }\n else {\n element.innerHTML = translatedText;\n }\n });\n }\n catch(err) {\n logException('translateElements', err.message);\n }\n}", "domRemoveChildren(el) {\n if (!el) return;\n while (el.firstChild) {\n el.firstChild.remove();\n };\n }", "function changeDOM(newBegin) {\n\t // If new begin is negative, set newBegin to 0;\n\t if (newBegin < 0) {\n\t\tnewBegin = 0;\n\t }\n\n\t // If new begin is same as old begin, exit function\n\t if (newBegin == begin) {\n\t\treturn;\n\t }\n\t \n\t var difference = newBegin - begin;\n\t if (difference > 0) {\n\t\t// Remove from the top of the feed\n\t\t$target.find('.feed').slice(0, difference).remove();\n\n\t\t// Add to the bottom of the feed\n\t\t$target.append(nodeBank.slice(newBegin + numNodes - difference, newBegin + numNodes));\n\t } else {\n\t\t// RECALL THAT difference IS NEGATIVE IN THIS CASE\n\t\tvar $feed = $target.find('.feed');\n\t\t// Remove from bottom of the feed\n\t\t$feed.slice($feed.length + difference, $feed.length).remove();\n\n\t\t// Add to the top of the feed\n\t\t$target.prepend(nodeBank.slice(newBegin, newBegin - difference));\n\t }\n\t begin = newBegin;\n\t}", "function updateDOM(element, array) {\n for (let i = 1; i < array.length + 1; i++) {\n element[i].textContent = array[i - 1];\n }\n}", "function reconcileChildren(wipFiber, elements) {\n // Here we reconcile the old fibers with the new elements\n let index = 0;\n let oldFiber = wipFiber.alternate && wipFiber.alternate.child;\n let prevSibling = null;\n\n while(index < elements.length ||\n oldFiber != null\n ) {\n // compare oldFiber and element: \n // element is the thing we want to render to DOM; oldFiber is what we rendered last time\n // compare strategy: 1. if old fiber and element has the same type, we can keep the DOM node and just updates it with new props;\n // 2. if the type is different and there is a new element, we create a new DOM node\n // 3. if the type is different and there is a old fiber, we remove the old node\n const element = elements[index];\n let newFiber = null;\n\n const sameType = \n oldFiber &&\n element &&\n element.type === oldFiber.type\n\n if(sameType) {\n // create newfiber keeping the DOM node from the old fiber and the props from the element\n newFiber = {\n type: oldFiber.type,\n dom: oldFiber.dom,\n props: element.props,\n parent: wipFiber,\n alternate: oldFiber,\n effectTag: \"UPDATE\",\n }\n }\n \n if(element && !sameType) {\n // to add the new node\n newFiber = {\n type: element.type,\n props: element.props,\n dom: null,\n parent: wipFiber,\n alternate: null,\n effectTag: \"PLACEMENT\",\n }\n }\n\n if(oldFiber && !sameType) {\n // to remove the old fiber's node, we dont't need to create a new fiber\n oldFiber.effectTag = \"DELETION\"\n deletions.push(oldFiber)\n }\n\n if(oldFiber) {\n oldFiber = oldFiber.sibling;\n }\n\n if(index === 0) {\n wipFiber.child = newFiber;\n } else if(element) {\n prevSibling.sibling = newFiber;\n }\n\n prevSibling = newFiber;\n index++;\n }\n}", "function applyToDOM(){\n\t\t\tvar hasSortedAll = elmObjsSorted.length===elmObjsAll.length;\n\t\t\tif (isSameParent&&hasSortedAll) {\n\t\t\t\tif (isFlex) {\n\t\t\t\t\telmObjsSorted.forEach(function(elmObj,i){\n\t\t\t\t\t\telmObj.elm.style.order = i;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (parentNode) parentNode.appendChild(sortedIntoFragment());\n\t\t\t\t\telse console.warn('parentNode has been removed');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar criterium = criteria[0]\n\t\t\t\t\t,place = criterium.place\n\t\t\t\t\t,placeOrg = place==='org'\n\t\t\t\t\t,placeStart = place==='start'\n\t\t\t\t\t,placeEnd = place==='end'\n\t\t\t\t\t,placeFirst = place==='first'\n\t\t\t\t\t,placeLast = place==='last'\n\t\t\t\t;\n\t\t\t\tif (placeOrg) {\n\t\t\t\t\telmObjsSorted.forEach(addGhost);\n\t\t\t\t\telmObjsSorted.forEach(function(elmObj,i) {\n\t\t\t\t\t\treplaceGhost(elmObjsSortedInitial[i],elmObj.elm);\n\t\t\t\t\t});\n\t\t\t\t} else if (placeStart||placeEnd) {\n\t\t\t\t\tvar startElmObj = elmObjsSortedInitial[placeStart?0:elmObjsSortedInitial.length-1]\n\t\t\t\t\t\t,startParent = startElmObj&&startElmObj.elm.parentNode\n\t\t\t\t\t\t,startElm = startParent&&(placeStart&&startParent.firstChild||startParent.lastChild);\n\t\t\t\t\tif (startElm) {\n\t\t\t\t\t\tif (startElm!==startElmObj.elm) startElmObj = {elm:startElm};\n\t\t\t\t\t\taddGhost(startElmObj);\n\t\t\t\t\t\tplaceEnd&&startParent.appendChild(startElmObj.ghost);\n\t\t\t\t\t\treplaceGhost(startElmObj,sortedIntoFragment());\n\t\t\t\t\t}\n\t\t\t\t} else if (placeFirst||placeLast) {\n\t\t\t\t\tvar firstElmObj = elmObjsSortedInitial[placeFirst?0:elmObjsSortedInitial.length-1];\n\t\t\t\t\treplaceGhost(addGhost(firstElmObj),sortedIntoFragment());\n\t\t\t\t}\n\t\t\t}\n\t\t}", "get $elements() {\n if (this.#cached$elements === undefined) {\n this.#cached$elements = $(this.elements);\n }\n return this.#cached$elements;\n }", "function updateDOM() {\n\tvar newTree = render(data);\n\tvar patches = diff(tree, newTree);\n\trootNode = patch(rootNode, patches);\n\ttree = newTree;\n}", "getChildren(): Array<Element>{\n return this._elements;\n }", "getElements() {\n return this.#elements;\n }", "function removeChildElements() {\n //grid-container holds images that are loaded in the dom as it's child nodes.\n let thumbnailDiv = document.getElementsByClassName(\"grid-container\")[0]\n\n //run a loop to remove child nodes\n while (thumbnailDiv.hasChildNodes()) {\n thumbnailDiv.removeChild(thumbnailDiv.firstChild);\n }\n}", "function applyChangesFromDom (binding, dom, yxml, _document) {\n if (yxml == null || yxml === false || yxml.constructor === YXmlHook) {\n return\n }\n const y = yxml._y;\n const knownChildren = new Set();\n for (let i = dom.childNodes.length - 1; i >= 0; i--) {\n const type = binding.domToType.get(dom.childNodes[i]);\n if (type !== undefined && type !== false) {\n knownChildren.add(type);\n }\n }\n // 1. Check if any of the nodes was deleted\n yxml.forEach(function (childType) {\n if (knownChildren.has(childType) === false) {\n childType._delete(y);\n removeAssociation(binding, binding.typeToDom.get(childType), childType);\n }\n });\n // 2. iterate\n const childNodes = dom.childNodes;\n const len = childNodes.length;\n let prevExpectedType = null;\n let expectedType = iterateUntilUndeleted(yxml._start);\n for (let domCnt = 0; domCnt < len; domCnt++) {\n const childNode = childNodes[domCnt];\n const childType = binding.domToType.get(childNode);\n if (childType !== undefined) {\n if (childType === false) {\n // should be ignored or is going to be deleted\n continue\n }\n if (expectedType !== null) {\n if (expectedType !== childType) {\n // 2.3 Not expected node\n if (childType._parent !== yxml) {\n // child was moved from another parent\n // childType is going to be deleted by its previous parent\n removeAssociation(binding, childNode, childType);\n } else {\n // child was moved to a different position.\n removeAssociation(binding, childNode, childType);\n childType._delete(y);\n }\n prevExpectedType = insertNodeHelper(yxml, prevExpectedType, childNode, _document, binding);\n } else {\n // Found expected node. Continue.\n prevExpectedType = expectedType;\n expectedType = iterateUntilUndeleted(expectedType._right);\n }\n } else {\n // 2.2 Fill _content with child nodes\n prevExpectedType = insertNodeHelper(yxml, prevExpectedType, childNode, _document, binding);\n }\n } else {\n // 2.1 A new node was found\n prevExpectedType = insertNodeHelper(yxml, prevExpectedType, childNode, _document, binding);\n }\n }\n}", "get elementCollection() {\n return this._elementCollection;\n }", "function setElements(index, subIndexes, children, parentElem, resolve) {\n\tchildren.forEach(function (child, childIndex) {\n\t\tvar actualIndex = index + subIndexes[childIndex];\n\t\tvar elementAtPosition = parentElem.childNodes[actualIndex];\n\t\tparentElem.replaceChild(child, elementAtPosition);\n\t});\n\tresolve();\n}", "function _makeDomArray(elem, clone) {\n if (elem == null) {\n return [];\n }\n if (isCheerio(elem)) {\n return clone ? cloneDom(elem.get()) : elem.get();\n }\n if (Array.isArray(elem)) {\n return elem.reduce((newElems, el) => newElems.concat(this._makeDomArray(el, clone)), []);\n }\n if (typeof elem === 'string') {\n return this._parse(elem, this.options, false, null).children;\n }\n return clone ? cloneDom([elem]) : [elem];\n}", "function qsa(parent, selector){return [].slice.call(parent.querySelectorAll(selector) )}", "refresh() {\n if (!isDOMReady) return;\n const { root, scope, outputs, title, listeners } = dom;\n const df = document.createDocumentFragment();\n if (title)\n df.appendChild(\n transformElem(\n {\n type: \"title\",\n text: title\n },\n dom\n )\n );\n this.forEach(userElem => {\n const { name } = userElem;\n let themeElem = transformElem(userElem, dom);\n const funcs = funcArr(userElem.transform);\n if (themeElem instanceof HTMLElement || Array.isArray(themeElem)) {\n themeElem = { elem: themeElem };\n }\n themeElem.elem = [].concat(themeElem.elem);\n const main = themeElem.elem[themeElem.main || 0];\n const evtElem = themeElem.evt\n ? main.querySelectorAll(themeElem.evt)\n : [main];\n const handle = {\n textInput: () => {\n let input = evtElem[0];\n if (name) {\n scope[name] = \"\";\n input.addEventListener(\"input\", e => {\n scope[name] = funcReduce(funcs, e.currentTarget.value);\n });\n }\n },\n checkbox: () => {\n evtElem.forEach(cur =>\n cur.addEventListener(\"change\", () => {\n if (name)\n scope[name] = Array.from(evtElem).reduce(\n (arr, cur) =>\n arr.concat(cur.checked ? cur.dataset.value : []),\n []\n );\n })\n );\n },\n radio: () => {\n evtElem.forEach(cur =>\n cur.addEventListener(\"change\", () => {\n if (name) scope[name] = cur.dataset.value;\n })\n );\n },\n output: () => {\n outputs.output.push({\n elem: evtElem[0],\n transform: userElem.transform\n });\n },\n canvas: () => {\n let { interval, draw } = userElem;\n const obj = {\n type: \"canvas\",\n canvas: evtElem[0],\n onUpdate: true,\n handler: draw\n };\n if (interval == null) interval = \"update\";\n if (typeof interval === \"number\") {\n obj.onUpdate = false;\n obj.interval = setInterval(handler, interval);\n }\n if (name) {\n listeners[name] = obj;\n scope[name] = obj.canvas;\n }\n outputs.canvas.push(obj);\n },\n file: () => {\n let { fileDisplay, fileButton, fileDragTo } = themeElem;\n const fileInput = document.createElement(\"input\");\n fileInput.type = \"file\";\n\n fileDisplay = fileDisplay ? main.querySelector(fileDisplay) : main;\n fileButton = fileButton ? main.querySelector(fileButton) : main;\n fileDragTo = fileDragTo ? main.querySelector(fileDragTo) : main;\n\n fileButton.addEventListener(\"click\", fileInput.click.bind(fileInput));\n\n Object.entries({\n drop: e => {\n e.preventDefault();\n var dt = e.dataTransfer;\n if (dt.items) {\n const item = dt.items[0];\n if (item.kind == \"file\") {\n haveFile(item.getAsFile());\n }\n } else {\n haveFile(dt.files[0]);\n }\n },\n dragover: e => e.preventDefault(),\n dragend: e => {\n var dt = e.dataTransfer;\n if (dt.items) {\n for (var i = 0; i < dt.items.length; i++) {\n dt.items.remove(i);\n }\n } else {\n e.dataTransfer.clearData();\n }\n }\n }).forEach(([evt, handler]) =>\n fileDragTo.addEventListener(evt, handler)\n );\n\n fileInput.addEventListener(\"input\", e =>\n haveFile(e.currentTarget.files[0])\n );\n function haveFile(file) {\n if (!file) return;\n fileDisplay.innerText = file.name;\n if (name) scope[name] = funcReduce(funcs, file.slice());\n }\n },\n button: () => {\n const listener = { type: \"button\", handler: userElem.handler };\n evtElem[0].addEventListener(\"click\", () => this.trigger(listener));\n if (name) this.listeners[name] = listener;\n },\n switch: () => {\n evtElem[0].addEventListener(\n \"change\",\n ({ currentTarget: { checked } }) => {\n scope[name] = checked;\n }\n );\n }\n };\n if (userElem.type in handle) handle[userElem.type]();\n themeElem.elem.forEach(df.appendChild.bind(df));\n });\n while (root.firstChild) root.removeChild(root.firstChild);\n this.root.appendChild(df);\n }" ]
[ "0.63356066", "0.5956346", "0.58293504", "0.5751801", "0.57017034", "0.56847286", "0.5682651", "0.56735563", "0.5668264", "0.56642616", "0.56423056", "0.56153494", "0.5580726", "0.557934", "0.5579089", "0.5572537", "0.5525278", "0.5513889", "0.55095214", "0.5501568", "0.5493998", "0.5493849", "0.5472469", "0.54683596", "0.5467701", "0.5442642", "0.54253924", "0.5418881", "0.5416436", "0.54086286", "0.54081213", "0.5406005", "0.53877896", "0.53868484", "0.53840286", "0.5368667", "0.5357648", "0.53533775", "0.53521407", "0.53511566", "0.53511566", "0.53511566", "0.53511566", "0.534242", "0.5329995", "0.5325301", "0.5319198", "0.5306758", "0.5297198", "0.5292201", "0.528259", "0.5277928", "0.5272673", "0.52708155", "0.5269662", "0.5269662", "0.5268558", "0.52602243", "0.5251088", "0.5250376", "0.5238933", "0.5237597", "0.5233276", "0.52299273", "0.5226496", "0.5213516", "0.52085674", "0.52085674", "0.52080643", "0.5197032", "0.5192088", "0.51895267", "0.5188966", "0.5188966", "0.5188966", "0.5188966", "0.5188966", "0.51836956", "0.5180312", "0.5175706", "0.5175706", "0.51682687", "0.5163802", "0.51626366", "0.515418", "0.5151095", "0.5145569", "0.51447964", "0.51440394", "0.5132034", "0.5131115", "0.5131073", "0.5128336", "0.5128002", "0.512553", "0.51212364", "0.51175296", "0.5112952", "0.51112753", "0.51052713", "0.5102932" ]
0.0
-1
ShiftRegister Constructor size: the size of the register (size of the array).
function ShiftRegister(size) { var self = this; if(!(self instanceof ShiftRegister)){ return new ShiftRegister(size); } self.register = []; for(var i=0; i<size; i++){ self.register.push("*"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_op_neon_rshl_s8()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s8});\n}", "set size(value) {}", "function Stack(size) {\n this.array = new Array(size);\n this.index = 0;\n this.size = size;\n}", "function gen_op_neon_rshl_s64()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s64});\n}", "function gen_op_neon_qshl_s8()\n{\n gen_opc_ptr.push({func:op_neon_qshl_s8});\n}", "function gen_op_neon_qrshl_s8()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_s8});\n}", "function gen_op_neon_rshl_u8()\n{\n gen_opc_ptr.push({func:op_neon_rshl_u8});\n}", "function BitCrush() {\n this.memory = 0;\n this.memoryA = 0;\n this.memoryB = 0;\n this.index = -2;\n}", "function gen_op_neon_shl_s8()\n{\n gen_opc_ptr.push({func:op_neon_shl_s8});\n}", "function gen_op_neon_qshl_s64()\n{\n gen_opc_ptr.push({func:op_neon_qshl_s64});\n}", "set arraySize(value) {}", "function Pack() {\n Object.defineProperty(this, \"length\", {set: setter});\n}", "function gen_op_neon_rshl_u64()\n{\n gen_opc_ptr.push({func:op_neon_rshl_u64});\n}", "function gen_op_neon_shl_s64()\n{\n gen_opc_ptr.push({func:op_neon_shl_s64});\n}", "grow() {\n const size = this.size;\n const list = new Array(size * 2);\n for (var i = 0; i < size; i++) list[i] = this.shift();\n this.size = list.length;\n this.mask = this.size - 1;\n this.top = size;\n this.btm = 0;\n this.list = list;\n this.fill(size);\n }", "function gen_op_neon_rshl_s16()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s16});\n}", "function gen_op_neon_qshl_u8()\n{\n gen_opc_ptr.push({func:op_neon_qshl_u8});\n}", "function gen_op_neon_rshl_s32()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s32});\n}", "function padding_size(nbits) {\n var n = nbits + 1 + 64\n return 512 * Math.ceil(n / 512) / 32;\n }", "constructor(size) {\r\n this.values = {};\r\n this.numberOfValues = 0;\r\n this.size = size;\r\n }", "function gen_op_neon_qrshl_u8()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_u8});\n}", "function gen_op_neon_shl_u8()\n{\n gen_opc_ptr.push({func:op_neon_shl_u8});\n}", "setSize(size) {\n this.size = size;\n }", "function gen_op_neon_qshl_s16()\n{\n gen_opc_ptr.push({func:op_neon_qshl_s16});\n}", "function gen_op_neon_qshl_s32()\n{\n gen_opc_ptr.push({func:op_neon_qshl_s32});\n}", "srlMem() {\n var i = MMU.rb(regHL[0]);\n var carry = (i & 0x01) ? F_CARRY : 0;\n i >>= 1;\n regF[0] = ((register[0]) ? 0 : F_ZERO) | carry;\n return 16\n }", "encoding(size) {\n assert(size==='L'||size==='W'||size==='B','size=\"'+size+'\"');\n // Extension word 15:D/A | 12:REGISTER{2..0} | 11:W/L | 8:0{2..0} | 0:Displacement{7..0}\n switch (this.type) {\n case OP_DREG: return [0b000, this.val];\n case OP_AREG: return [0b001, this.val];\n case OP_INDIRECT: return [0b010, this.val];\n case OP_POSTINCR: return [0b011, this.val];\n case OP_PREINCR: return [0b100, this.val];\n case OP_DISP16: return [0b101, this.val[1], this.val[0].value()&0xffff];\n case OP_INDEX: return [0b110, this.val[1], this.val[2]<<12|(this.val[3]?1<<11:0)|(this.val[0].value()&0xff)];\n case OP_ABSW: break;\n case OP_ABSL: {\n let val = this.val.value();\n return [0b111, 0b001, (val>>16)&0xfffff, val&0xffff];\n }\n case OP_DISP16PC: return [0b111, 0b010, (this.val[0].value()-2)&0xffff];\n case OP_INDEXPC: return [0b111, 0b011, this.val[1]<<12|(this.val[2]?1<<11:0)|((this.val[0].value()-2)&0xff)];\n case OP_IMMEDIATE: {\n let val = this.val.value();\n if (size === 'L') {\n val = [(val>>16)&0xfffff, val&0xffff];\n } else if (size === 'W') {\n val = [val&0xffff];\n } else {\n val = [val&0xff];\n }\n return [0b111, 0b100].concat(val);\n }\n case OP_REGLIST:\n break;\n }\n throw new Error('Operand.encoding not implemented for ' + op_type_str(this.type));\n }", "function makeArray(size) \n{\n\tthis.size = size;\n\treturn this;\n}", "function gen_op_neon_qrshl_s32()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_s32});\n}", "constructor(width){\n this.width = width;\n this.history = width;\n }", "constructor(width){\n this.width = width;\n this.history = width;\n }", "constructor(width){\n this.width = width;\n this.history = width;\n }", "function gen_op_neon_rshl_u32()\n{\n gen_opc_ptr.push({func:op_neon_rshl_u32});\n}", "function r$2(s,r){return new s(new ArrayBuffer(r*s.ElementCount*e$6(s.ElementType)))}", "setSize(size) {\n this.size = size;\n }", "push(x){\r\n this.stack.push(x);\r\n this.size++;\r\n }", "function gen_op_neon_rshl_u16()\n{\n gen_opc_ptr.push({func:op_neon_rshl_u16});\n}", "function gen_op_neon_qshl_u64()\n{\n gen_opc_ptr.push({func:op_neon_qshl_u64});\n}", "set stride(value) {}", "function gen_op_neon_qrshl_s16()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_s16});\n}", "function gen_op_neon_shl_u64()\n{\n gen_opc_ptr.push({func:op_neon_shl_u64});\n}", "function Accumulator(initsize) {\n this.buf = Buffer.alloc(nextPow2(initsize || 8192));\n this.readOffset = 0;\n this.writeOffset = 0;\n}", "function Accumulator(initsize) {\n this.buf = Buffer.alloc(nextPow2(initsize || 8192));\n this.readOffset = 0;\n this.writeOffset = 0;\n}", "function popWindowSizeReg(regx,regy,anonx,anony) {\n\tif (checkRegistration()) {\n\t\twindowsize = \"width=\"+regx+\",height=\"+regy;\n\t} else {\n\t\twindowsize = \"width=\"+anonx+\",height=\"+anony;\n\t}\nreturn windowsize;\n}", "constructor(size= 53) {\n this.keyMap = new Array(size)\n }", "function gen_op_shadd8_T0_T1()\n{\n gen_opc_ptr.push({func:op_shadd8_T0_T1});\n}", "function gen_op_neon_shl_s16()\n{\n gen_opc_ptr.push({func:op_neon_shl_s16});\n}", "size(val) {\n this._size = val;\n return this;\n }", "set length(value) {}", "set length(value) {}", "get nbRegisters() { return this._registers.map(r => r.nbNativeRegisters).reduce((p, c) => p + c); }", "function gen_op_neon_qshl_u32()\n{\n gen_opc_ptr.push({func:op_neon_qshl_u32});\n}", "function gen_op_neon_qshl_u16()\n{\n gen_opc_ptr.push({func:op_neon_qshl_u16});\n}", "constructor(name,buildYear,length,size = 3){\n\n super(name,buildYear);\n this.length = length;\n this.size = size;\n }", "function gen_op_neon_qrshl_u32()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_u32});\n}", "function gen_op_neon_shl_s32()\n{\n gen_opc_ptr.push({func:op_neon_shl_s32});\n}", "function r$3(s,r){return new s(new ArrayBuffer(r*s.ElementCount*e$r(s.ElementType)))}", "function gen_neon_get_scalar(/* int */ size, /* int */ reg)\n{\n if (size == 1) {\n gen_op_neon_getreg_T0(neon_reg_offset(reg >> 1, reg & 1));\n } else {\n gen_op_neon_getreg_T0(neon_reg_offset(reg >> 2, (reg >> 1) & 1));\n if (reg & 1)\n gen_op_neon_dup_low16();\n else\n gen_op_neon_dup_high16();\n }\n}", "constructor(size=53){\n this.keyMap=new Array(size);\n }", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "function gen_op_neon_qrshl_u16()\n{\n gen_opc_ptr.push({func:op_neon_qrshl_u16});\n}", "function gen_op_shsub8_T0_T1()\n{\n gen_opc_ptr.push({func:op_shsub8_T0_T1});\n}", "constructor(size = 53) {\n //give our array hashtable a size of 53\n this.keyMap = new Array(size); //create our neww array\n }", "shift(x, y)\n\t{\n\t\tthis.x += x;\n\t\tthis.y += y;\n\t}", "shift(x, y) {\n this.x += x;\n this.y += y;\n }", "function Vector(_contents, _length, _maxShift) {\n this._contents = _contents;\n this._length = _length;\n this._maxShift = _maxShift;\n }", "slaReg(register) {\n var co = register[0] & 0x80 ? F_CARRY : 0;\n register[0] <<= 1;\n regF[0] = register[0] ? 0 : F_ZERO;\n regF[0] = (regF[0] & ~F_CARRY) + co;\n return 8;\n }", "constructor(initialCapacity = 10) {\n }", "function gen_op_neon_shl_u16()\n{\n gen_opc_ptr.push({func:op_neon_shl_u16});\n}", "static get SIZE() { return 2000000; }", "setSize() {\n this.size.D1 = this.shape.D1*this.unit.X;\n this.size.D2 = this.shape.D2*this.unit.Y;\n }", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "encoding(size) {\n assert(size === 'L' || size === 'W' || size === 'B', 'size=\"' + size + '\"');\n // Extension word 15:D/A | 12:REGISTER{2..0} | 11:W/L | 8:0{2..0} | 0:Displacement{7..0}\n switch (this.type) {\n case OP_DREG:\n return [0b000, this.val];\n case OP_AREG:\n return [0b001, this.val];\n case OP_INDIRECT:\n return [0b010, this.val];\n case OP_POSTINCR:\n return [0b011, this.val];\n case OP_PREINCR:\n return [0b100, this.val];\n case OP_DISP16:\n return [0b101, this.val[1], this.val[0].value() & 0xffff];\n case OP_INDEX:\n return [0b110, this.val[1], this.val[2] << 12 | (this.val[3] ? 1 << 11 : 0) | this.val[0].value() & 0xff];\n case OP_ABSW:\n break;\n case OP_ABSL:\n {\n let val = this.val.value();\n return [0b111, 0b001, val >> 16 & 0xfffff, val & 0xffff];\n }\n case OP_DISP16PC:\n return [0b111, 0b010, this.val[0].value() - 2 & 0xffff];\n case OP_INDEXPC:\n return [0b111, 0b011, this.val[1] << 12 | (this.val[2] ? 1 << 11 : 0) | this.val[0].value() - 2 & 0xff];\n case OP_IMMEDIATE:\n {\n let val = this.val.value();\n if (size === 'L') {\n val = [val >> 16 & 0xfffff, val & 0xffff];\n } else if (size === 'W') {\n val = [val & 0xffff];\n } else {\n val = [val & 0xff];\n }\n return [0b111, 0b100].concat(val);\n }\n case OP_REGLIST:\n break;\n }\n throw new Error('Operand.encoding not implemented for ' + op_type_str(this.type));\n }", "function gen_op_neon_widen_s8()\n{\n gen_opc_ptr.push({func:op_neon_widen_s8});\n}", "function int64shr(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift);\n\t }", "constructor() {\n super();\n\n // simulate 11 input registers\n this._registers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n // simulate 11 holding registers\n this._holding_registers = [0, 0, 0, 0, 0, 0, 0, 0, 0xa12b, 0xffff, 0xb21a];\n\n // simulate 16 coils / digital inputs\n this._coils = 0x0000; // TODO 0xa12b, 1010 0001 0010 1011\n }", "setSize(size) {\n this.size = size;\n return this;\n }", "function gen_op_neon_shl_u32()\n{\n gen_opc_ptr.push({func:op_neon_shl_u32});\n}", "shift() {\n let ret = this[0];\n for (let i = 0; i < __classPrivateFieldGet(this, _length); ++i)\n this[i] = this[i + 1];\n delete this[__classPrivateFieldSet(this, _length, +__classPrivateFieldGet(this, _length) - 1)];\n return ret;\n }", "constructor(x, y, newLength) {\n super(x, y);\n\n let _length;\n\n this.setLength = (length) => {\n _length = length > 0 ? length : 1\n };\n\n this.getLength = () => {\n return _length;\n };\n\n this.setLength(newLength);\n }", "get size() {\n return this.shape[0] * this.shape[1];\n }", "function int64shr(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift);\r\n}", "shift(val){\n let newNode = new Node(val);\n if (this.length === 0){\n this.head = newNode;\n this.tail = newNode;\n } else {\n let oldHead = this.head;\n this.head = newNode;\n this.head.next = oldHead;\n oldHead.prev = this.head;\n }\n this.length++;\n return this;\n }", "_resize(size) {\n //copy the old pointer\n const oldPtr = this.ptr;\n //create more space for the new size\n this.ptr = newMem.allocate(size);\n //if there is not space, throw an error\n if (this.ptr === null) {\n throw new Error('Out of memory');\n }\n //copy the old array values, starting at the pointer, and add the additional length needed?\n newMem.copy(this.ptr, oldPtr, this.length);\n //empty the old memory space\n newMem.free(oldPtr);\n //increase the capacity value to the new capacity\n this._capacity = size;\n }", "function rltshift () {\n}", "incReg16(register) {\n register[0]++;\n return 4;\n }", "randomSize() {\n\t\tthis.randomNumber = Math.floor(Math.random() * 90) + 10;\n\t}", "function Square(size){\n this.size = size;\n \n }", "encodeSize(value) {\n\t\t\tthis.encodeInt(value);\n\t\t}", "constructor(numBuckets = 2) {\n // Initialize your buckets here\n this.count = 0;\n this.capacity = numBuckets;\n this.data = new Array(numBuckets).fill(null);\n // this.resizeCount = 0;\n }", "sraReg(register) {\n var ci = register[0] & 0x80;\n var co = register[0] & 1 ? F_CARRY : 0;\n register[0] = (register[0] >> 1) + ci;\n regF[0] = (register[0]) ? 0 : F_ZERO;\n regF[0] = (regF[0] & ~F_CARRY) + co;\n return 8;\n }", "function gen_op_ssub8_T0_T1()\n{\n gen_opc_ptr.push({func:op_ssub8_T0_T1});\n}", "constructor(size = 10){\n this.keyMap = new Array(size);\n }", "function MapTypeCGTilesPlus1() {\n\tthis.tileSize = new google.maps.Size( tile_size/2, tile_size/2 );\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}", "function getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}", "function getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}", "function getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}", "function getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}" ]
[ "0.49744785", "0.48931238", "0.48767668", "0.4842523", "0.4811722", "0.47866863", "0.47811702", "0.4776734", "0.476981", "0.4703187", "0.46999106", "0.46663585", "0.46489987", "0.4638917", "0.46156093", "0.45934215", "0.45885175", "0.45855165", "0.4582117", "0.45732978", "0.45546192", "0.45523405", "0.45321256", "0.4529707", "0.45037478", "0.45035097", "0.44988725", "0.44983992", "0.44937167", "0.44913578", "0.44913578", "0.44913578", "0.44886202", "0.44856244", "0.44760388", "0.44759196", "0.44754592", "0.44695163", "0.44608608", "0.4438582", "0.44291282", "0.44205463", "0.44205463", "0.44176957", "0.44094658", "0.44091007", "0.44012564", "0.43999326", "0.43875438", "0.43875438", "0.43859127", "0.43837824", "0.43653136", "0.43629408", "0.43557203", "0.43473172", "0.43336537", "0.4332451", "0.4322237", "0.43167248", "0.4315106", "0.43122798", "0.43068817", "0.43064618", "0.42943054", "0.42862692", "0.4286178", "0.42740726", "0.4265925", "0.42647606", "0.42623398", "0.42606467", "0.4259824", "0.4250499", "0.4249754", "0.4243973", "0.42418736", "0.42341426", "0.42151463", "0.42091647", "0.42036957", "0.41976106", "0.4195739", "0.41893092", "0.4188772", "0.41866952", "0.4180036", "0.41784236", "0.4178283", "0.41719568", "0.41571745", "0.4150091", "0.41450322", "0.41378534", "0.4135117", "0.41349086", "0.41349086", "0.41349086", "0.41349086", "0.41349086" ]
0.77090603
0
Node Constructor label: a string for simple Node with no children or an object from which the root node of the tree will be derived provided lfn and cfn label and callbacck functions provided. lfn: the label callback function, which must return a string label. Ignored if label is a string cfn: the children callback function, which must return an array of children from which child nodes will be derived. Ignored if label is a string.
function Node(label, lfn, cfn){ var self = this; if(!(self instanceof Node)){ return new Node(label, lfn, cfn); } if(typeof label === 'string' && label.length > 0){ self.tedlabel = label; self.tedchildren = []; }else if(typeof label === 'object' && !! lfn && !! cfn){ self.tedlabel = lfn(label); self.tedchildren = []; if(typeof self.tedlabel === 'string'){ var kids = cfn(label); if(!! kids){ for(var i=0; i<kids.length; i++){ var n = new Node(kids[i],lfn,cfn); if(!! n && !! n.tedlabel){ self.addkid(n); } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tree(label, left, right) {\n this.label = label;\n this.left = left;\n this.right = right;\n}", "function NodeLabels (view)\r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(view);\r\n }\r\n}", "function componentLabeledNode () {\n\n /* Default Properties */\n var color = \"steelblue\";\n var opacity = 1;\n var strokeColor = \"#000000\";\n var strokeWidth = 1;\n var radius = 8;\n var label = void 0;\n var display = \"block\";\n var fontSize = 10;\n var classed = \"labeledNode\";\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\");\n\n /**\n * Constructor\n *\n * @constructor\n * @alias labeledNode\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n\n // Size Accessor\n function sizeAccessor(_) {\n return typeof radius === \"function\" ? radius(_) : radius;\n }\n\n selection.each(function (data) {\n var r = sizeAccessor(data);\n\n var node = d3.select(this).classed(classed, true);\n\n node.append(\"circle\").attr(\"r\", r).attr(\"fill-opacity\", opacity).style(\"stroke\", strokeColor).style(\"stroke-width\", strokeWidth).style(\"fill\", color);\n\n node.append(\"text\").text(label).attr(\"dx\", -r).attr(\"dy\", -r).style(\"display\", display).style(\"font-size\", fontSize + \"px\").attr(\"alignment-baseline\", \"middle\").style(\"text-anchor\", \"end\");\n });\n }\n\n /**\n * Color Getter / Setter\n *\n * @param {string} _v - Color.\n * @returns {*}\n */\n my.color = function (_v) {\n if (!arguments.length) return color;\n color = _v;\n return this;\n };\n\n /**\n * Opacity Getter / Setter\n *\n * @param {number} _v - Level of opacity.\n * @returns {*}\n */\n my.opacity = function (_v) {\n if (!arguments.length) return opacity;\n opacity = _v;\n return this;\n };\n\n /**\n * Radius Getter / Setter\n *\n * @param {number} _v - Radius in px.\n * @returns {*}\n */\n my.radius = function (_v) {\n if (!arguments.length) return radius;\n radius = _v;\n return this;\n };\n\n /**\n * Label Getter / Setter\n *\n * @param {string} _v - Label text.\n * @returns {*}\n */\n my.label = function (_v) {\n if (!arguments.length) return label;\n label = _v;\n return this;\n };\n\n /**\n * Display Getter / Setter\n *\n * @param {string} _v - HTML display type (e.g. 'block')\n * @returns {*}\n */\n my.display = function (_v) {\n if (!arguments.length) return display;\n display = _v;\n return this;\n };\n\n /**\n * Font Size Getter / Setter\n *\n * @param {number} _v - Fint size.\n * @returns {*}\n */\n my.fontSize = function (_v) {\n if (!arguments.length) return fontSize;\n fontSize = _v;\n return this;\n };\n\n /**\n * Stroke Getter / Setter\n *\n * @param {number} _width - Width in px.\n * @param {string} _color - Colour.\n * @returns {*}\n */\n my.stroke = function (_width, _color) {\n if (!arguments.length) return [strokeWidth, strokeColor];\n strokeWidth = _width;\n strokeColor = _color;\n return this;\n };\n\n /**\n * Class Getter / Setter\n *\n * @param {string} _v - HTML class name.\n * @returns {*}\n */\n my.classed = function (_v) {\n if (!arguments.length) return classed;\n classed = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function Leaf() {}", "configureLabels() {\n this.label\n .attr(\"class\", \"lgv-label\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.children ? (d.y - (d.r * 0.9)) : d.y)\n .text(d => this.extractLabel(d));\n }", "function TreeNode(val, children){\n this.val = val;\n this.children = children || null;\n}", "function create_label(labelName, parent) {\r\n var label = document.createElement(\"label\");\r\n label.innerText = labelName;\r\n parent.appendChild(label);\r\n}", "function makeNode(id, label) {\n g.setNode(id, {\n label: label,\n style: \"fill: #afa\"\n });\n }", "function LTNode(jmpCmd, nodeType, parent, connection) {\n\tthis._id = LTNode.__nextId++;\t//assign node identifier\n\tthis._type = nodeType;\t\t\t//type of the node: root, non-terminal, or terminal\n\t//two next members are used exclusively by terminal node, other node types should\n\t//set them to NULLs\n\tthis._jmpCmd = jmpCmd;\t\t\t//keep reference to the jump command\n\tthis._parent = parent;\t\t\t//who owns this (logical tree) node (if this node is root,\n\t\t\t\t\t\t\t\t\t//\tthen parent is NULL)\n\tthis._children = [];\t\t\t//if this is a root or non-terminal then it has its children\n\t\t\t\t\t\t\t\t\t//\tnodes (however, for terminal there are no children)\n\tthis._con = connection;\t\t\t//type of logical connection: AND or OR\n\t\t\t\t\t\t\t\t\t//\tit is used by root or non-terminal, but not by terminal\n\t//next two members are used exclusively by root node\n\tthis._successCmd = null;\t\t//if condition succeeds, then it jumps to this command\n\t\t\t\t\t\t\t\t\t//\tif-then-else: successCmd=>then;\n\t\t\t\t\t\t\t\t\t//\twhile-loop: successCmd=>next iteration\n\tthis._failureCmd = null;\t\t//if condition fails, then it jumps to this command\n\t\t\t\t\t\t\t\t\t//\tif-then-else: failureCmd=>else or elseif;\n\t\t\t\t\t\t\t\t\t//\twhile-loop: failureCmd=>quit loop\n\tif( this._jmpCmd != null ){\n\t\tthis._cmpCmd =\t\t\t\t//the first argument of jump instruction has to be\n\t\t\tjmpCmd._args[0];\t\t//\tcomparison command\n\t\t//make sure that right now jump address is not known, i.e. second argument\n\t\t//of the jump (target 'Z') should not be inside the jump command\n\t\tif( this._jmpCmd._args.length != 1 ){\n\t\t\tthrow new Error(\"jump command should not know target at the time of logTree construction\");\n\t\t}\n\t}\n}", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "describe(label, fn) {\n if (this.ancestorTitles === undefined) this.ancestorTitles = [];\n this.getFullName = () => this.ancestorTitles.join(' ');\n this.ancestorTitles.push(label);\n fn.bind(this)();\n this.ancestorTitles.pop();\n }", "function Label() { // Labels (-1 means empty, -2 means undefined)\r\n this.even = undefined; // Even label: alternating path of even distance from root to vertex\r\n this.odd = []; // Odd label: base nodes of blossoms can have two\r\n}", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function Labeler(kb, LanguagePreference){\n this.kb = kb;\n // dump(\"\\nLabeler: INITIALIZED (...,\"+LanguagePreference+\")\\n\");\n var ns = tabulator.ns;\n var trim = function(str){return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');};\n this.isLanguagePreferred = 10; //how much you like your language\n //this.lang=lang; // a universal version? how to sort?\n this.preferredLanguages = [];\n if (LanguagePreference){\n var order = LanguagePreference.split(',');\n for (var i=order.length-1;i>=0;i--)\n\tthis.preferredLanguages.push(trim(order[i].split(\";\")[0]));\n }\n this.LanguagePreference = LanguagePreference;\n this.addLabelProperty(ns.link('message'),20); //quite a different semantic, cause confusion?\n \n this.addLabelProperty(ns.vcard('fn'),10);\n this.addLabelProperty(ns.foaf('name'),10);\n this.addLabelProperty(ns.dct('title'),8);\n this.addLabelProperty(ns.dc('title'),7);\n this.addLabelProperty(ns.rss('title'),6); // = dc:title?\n this.addLabelProperty(ns.contact('fullName'),4);\n this.addLabelProperty(kb.sym('http://www.w3.org/2001/04/roadmap/org#name'),4);\n this.addLabelProperty(ns.foaf('nick'),3);\n this.addLabelProperty(ns.rdfs('label'),2);\n var lb=this;\n \n // Note that adding a newPropertyAction has retrospecive effect\n tabulator.kb.newPropertyAction(ns.rdfs('subPropertyOf'), function(formula,subject,predicate,object,why) {\n if (!object.sameTerm(ns.rdfs('label'))) return; // Not doing transitive closure yet\n lb.addLabelProperty(subject);\n return;\n });\n/* \n var hashP = subject.hashString();\n var already;\n if (object.sameTerm(ns.rdfs('label'))) already=lb.addLabelProperty(subject, 3);\n if (already) return;\n \n var sts = kb.statementsMatching(undefined, subject); // Where was the subproperty used?\n for (var i=0;i< sts.length;i++){ // Where is the subproperty used?\n var st = sts[i];\n if (typeof st.object.lang !='undefined' && st.object.lang!=\"\" && st.object.lang != lb.lang\n ) continue;\n if (st.object.value == undefined) continue; // not literal - just in case\n var label = st.object.value.toLowerCase();\n // Insert the new entry into the ordered list\n for (var i=0;i<lb.entry.length;i++){ // O(n) bad!\n if (label> lb.entry[i][0].toLowerCase()){\n lb.entry.splice(i+1,0,[st.object,st.subject,3]);\n break;\n }\n }\n lb.optimize([st.object,st.subject,3]);\n }\n });\n*/\n\n}", "function NodeDef(){}", "function create(label) {\n return { label: label };\n }", "function Node(){}", "function TreeNode(id, label, tooltip, checkState, selected, exprEvalStr, target, enabled) {\n\tvar a = arguments;\n\t\n\tthis.clientHandler = new Array(); // ClientHandler associated with this node\n\t\n\tthis.id = id; // identifier for the tree node\n\tthis.label = label; // label to display on the node\n\tthis.parent = null; // the parent -> a tree group\n\tthis.tooltip = (a.length >= 3) ? tooltip : ''; // Tooltip\n\tthis.checkState = (a.length >= 4) ? checkState : CheckState.UNCHECKED; // indicates if the node is checked\n\tthis.selected = (a.length >= 5) ? selected : false; // true, if this is the selected node\n\tthis.exprEvalStr = (a.length >= 6) ? exprEvalStr : null; // RegEx to match for the image\n\tthis.target = (a.length >= 7) ? target : null; // The target attribute\n\tthis.enabled = (a.length >= 8) ? enabled : true; // indicates if this node was enabled\n\tthis.type = NodeType.NODE; // indicates a tree node\n}", "function Leaf() {\n}", "function NodeDef() {}", "function NodeDef() {}", "function NodeDef() {}", "function TNode(){}", "function node(){}", "function Label(props) {\n const {\n attached, children, color, corner, className, circular, detail, detailLink, floating, horizontal, icon,\n image, link, onClick, onClickDetail, onClickRemove, pointing, removable, ribbon, size, tag, text,\n ...rest,\n } = props\n\n const handleClick = e => onClick && onClick(e, props)\n const handleClickRemove = e => onClickRemove && onClickRemove(e, props)\n const handleClickDetail = e => onClickDetail && onClickDetail(e, props)\n\n const _component = image || link || onClick ? 'a' : 'div'\n\n const classes = cx('sd-label ui',\n size,\n color,\n useKeyOnly(floating, 'floating'),\n useKeyOnly(horizontal, 'horizontal'),\n useKeyOnly(tag, 'tag'),\n useValueAndKey(attached, 'attached'),\n useValueAndKey(corner, 'corner'),\n useKeyOrValueAndKey(pointing, 'pointing'),\n useKeyOrValueAndKey(ribbon, 'ribbon'),\n circular && (children && 'circular' || 'empty circular'),\n // TODO how to handle image child with no image class? there are two image style labels.\n (image || someChildType(children, Image) || someChildType(children, 'img')) && 'image',\n 'label',\n className\n )\n\n const _props = {\n className: classes,\n onClick: handleClick,\n ...rest,\n }\n\n const _detail = detail || detailLink\n const detailComponent = (detailLink || onClickDetail) && 'a' || detail && 'div'\n\n const _children = createFragment({\n icon: iconPropRenderer(icon),\n image: imagePropRenderer(image),\n text,\n children,\n detail: _detail && createElement(detailComponent, { className: 'detail', onClick: handleClickDetail }, _detail),\n remove: (removable || onClickRemove) && <Icon className='delete' onClick={handleClickRemove} />,\n })\n\n // Do not destructure createElement import\n // react-docgen only recognizes a stateless component when React.createElement is returned\n return React.createElement(_component, _props, _children)\n}", "function create(label) {\n return {\n label: label\n };\n }", "function create(label) {\n return {\n label: label\n };\n }", "function create(label) {\n return {\n label: label\n };\n }", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function Node() {}", "function CodeTreeNode(_type, _label, _parent, _sourceFile, _appId) {\n this.type = _type;\n this.label = _label;\n this.parent = _parent;\n this.childNodes = [];\n this.shouldAbstractOut = false;\n this.lineNumber = null;\n this.columnNumber = null;\n this.sourceFile = _sourceFile;\n this.appId = _appId;\n }", "function NSAppCrawlingTreeNode() {\n this.path = ''; // - not in use -\n this.parent = null; // parent node\n this.type = 'normal'; // - not in use - for source type strategy only\n this.depth = 0; // depth in parent\n this.actions = []; // user actions\n this.digest = null; // digest of current node\n this.reportSuite = null; // testing report suite\n this.repeatable = false; // whether the action in current node can repeat, true for user defined action\n this.text = ''; // used for ocr mode\n}", "function createlabel(label, callback) {\n // upload a label to the repository\n _post('createlabel', label, callback);\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Leaf(name) {\n this.name = name;\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label(text,point_posision) {\n this.tag =\"Label\";\n this.emptyContext = new Object();\n\n\n}", "function createLabel(label, id) {\n var elm_label = document.createElement('label');\n elm_label.className = '.label';\n elm_label.setAttribute('for', id);\n elm_label.innerHTML = label;\n return elm_label\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n\n labelRefs.bind(this, 'labelTarget');\n }", "function EqnLeaf()\n{\n // type - operator, number, id, variable - defined and wont change\n this.leafType = 0;\n this.leafValue = null;\n}", "function Node(id, desc, c) {\n\tthis.desc = desc;\n\tthis.id = id;\n\tthis.c = c;\n}", "function _addTreeElement(label) {\n\t\tvar treeitem = document.createElement('treeitem');\n\t\tvar treerow = document.createElement('treerow');\n\t\tvar treecell = document.createElement('treecell');\n\n\t\tif (label) treecell.setAttribute('label', label);\n\n\t\ttreerow.appendChild(treecell);\n\t\ttreeitem.appendChild(treerow);\n\t\ttreechildren.appendChild(treeitem);\n\t}", "function Node(type, parent) {\n this.type = type;\n this.parent = parent;\n this.root = parent ? parent.root : this;\n this.identifyer = parent ? (++parent.root._counter) : 0;\n\n // The specific constructor will set another value if necessary\n this._textLength = 0;\n\n this.tags = 0;\n this.density = -1;\n\n this.children = [];\n\n this._text = '';\n this._textCompiled = false;\n this._noneStyleText = '';\n this._noneStyleTextCompiled = false;\n\n this.blocky = false;\n this.blockyChildren = false;\n\n this.inTree = true;\n}", "function NodeDef() { }", "function NodeDef() { }", "setDefaultNodeLabel(e) {\n return ma(e) || (e = Qs(e)), this._defaultNodeLabelFn = e, this;\n }", "function renderNodeLabels(ctx, nodes_to_label, opacity) {\n ctx.fillStyle = 'black';\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center'; // ctx.globalAlpha = 1\n\n nodes_to_label // .filter(d => d.type === \"concept\" && (d.font_size > 7 || do_print_run))\n .filter(function (d) {\n return d.type === 'concept' && (d.font_size > 7 || do_print_run && d.font_size > 3 / sf_scale);\n }).forEach(function (d) {\n ctx.font = 'normal normal 300 ' + d.font_size + 'px ' + font_family;\n ctx.globalAlpha = opacity ? opacity : d.opacity;\n ctx.fillText(d.label.toUpperCase(), d.x, d.y);\n });\n ctx.globalAlpha = 1;\n } //function renderNodeLabels", "function Node(name) {\n this.name = name;\n this.children = [];\n}", "function processTreeNode(_node, _level, cb) {\n // console.log('processTreeNode _node: _level:',_node,_level);\n\n // increment node counter\n NUM = NUM + 1;\n // console.log('NUM: ',NUM)\n\n let newNode = _node;\n newNode.label = _node.name;\n newNode.parent = _node.parent_id;\n newNode.groups = _node.children;\n\n newNode.full = _node.full || \"\";\n newNode.description = _node.description || \"\";\n\n\n newNode.weight = _node.weight || null;\n newNode.status = _node.status || null;\n newNode.gcolor = _node.gcolor || null;\n\n newNode.polarity = _node.polarity || null;\n newNode.units = _node.units || null;\n newNode.target = _node.target || null;\n newNode.value = _node.datavalues;\n newNode.year = _node.year;\n newNode.datatrend = _node.datatrend || null;\n\n newNode.fiveyearvalue = _node.fiveyearvalue;\n newNode.fiveyearquartile = _node.fiveyearquartile;\n newNode.fiveyearrank = _node.fiveyearrank;\n\n newNode.rank = _node.rank || null;\n newNode.ranktrend = _node.ranktrend || null;\n\n newNode.ingroup = _node.ingroup || null;\n newNode.group = _node.group || null;\n newNode.parent = _node.parent || null;\n\n newNode.BRANCH = BRANCH;\n newNode.LEVEL = _level;\n newNode.PROCESSED = true;\n newNode.NUM = NUM;\n newNode.NTYPE = null;\n // console.log('converted newNode:', newNode)\n\n //\n // recursively call function for node children\n //\n let newNodeGroups = newNode.groups\n // console.log('newNodeGroups:',newNodeGroups)\n\n //\n // if no children/groups set node type to leaf and retrun to caller\n // if children set node type to branch and recriesively call processer\n //\n if ((newNodeGroups != undefined) && (newNodeGroups.length > 0)) {\n\n // set nodetype as branch because has children\n newNode.NTYPE = 'branch'\n BRANCH = BRANCH + 1; // new branch\n // console.log('BRANCH:',BRANCH)\n\n for (let g = 0; g < newNodeGroups.length; g++) {\n let groupNode = newNodeGroups[g]\n // console.log('groupNode:',groupNode)\n\n //\n // recursively call processor\n //\n processTreeNode(groupNode, _level + 1, function(err, results) {\n if (err) console.error(err)\n // console.log('end of branch groupNode results:',results)\n // if (cb) cb(null, results)\n return\n }) // end call processTreeNode\n\n } // end for \n\n }\n else {\n // console.log(' - else newNodeGroup is empty or undefined _node',_node)\n // recursive on banch complete - return to caller\n // set nodetype as leaf because has children thus end of branch\n newNode.NTYPE = 'leaf'\n LEAF = LEAF + 1; // new branch\n // console.log('LEAF:',LEAF)\n // console.log('calling callback -> newNode:',newNode)\n // if (cb) cb(null, newNode)\n return;\n\n } // end if\n\n\n }", "function Node(nodeCreatingOption){\n var options = nodeCreatingOption || {};\n\n // Copy all the expansion data for the specific system\n // usage, such as tree ui Node which might have expanded and selected\n // flags so the ui can use it to render correctly by basic cases so\n // we don't loose it.\n objectAssign(this, options);\n this.key = nodeCreatingOption.key || _generateKey();\n this.parent = options.parent || \"\";\n this.name = options.name || \"object\";\n this.label = options.label || \"object name\";\n this.type = new NodeType({\n typeName: options.type ? options.type.typeName : Types.String,\n displayTypeName: options.type ? options.type.displayTypeName : DisplayTypes.Text,\n options: options.type && options.type.options ? options.type.options : {defaultValue: null, items: []}\n });\n\n this.displayValidators = [];\n if (options.displayValidators && options.displayValidators.length > 0){\n options.displayValidators.forEach(function(item){\n this.displayValidators.push(clone(item));\n }.bind(this));\n }\n\n this.validators = [];\n if (options.validators && options.validators.length > 0){\n options.validators.forEach(function(item){\n this.validators.push(clone(item));\n }.bind(this));\n }\n\n this.nodes = _cloneNodes(nodeCreatingOption.nodes);\n}", "function TNode() { }", "function TNode() { }", "function renderNodeLabels(ctx, nodes_to_label, opacity) {\n ctx.fillStyle = 'black';\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center'; //Get all the nodes that need a label\n\n var nodes_big = nodes_to_label.filter(function (d) {\n return d.type === 'concept' && (d.font_size > 7 || do_print_run && d.font_size > 3 / sf_scale);\n }); //Draw all non-biome concept nodes\n\n nodes_big.filter(function (d) {\n return d.group !== 'biome';\n }).forEach(function (d) {\n ctx.font = 'normal normal 300 ' + d.font_size + 'px ' + font_family;\n ctx.globalAlpha = opacity ? opacity : d.opacity;\n ctx.fillText(d.label.toUpperCase(), d.x, d.y);\n }); //forEach\n\n ctx.globalAlpha = 1; //Draw the biome concept nodes\n\n nodes_big.filter(function (d) {\n return d.group === 'biome';\n }).forEach(function (d) {\n ctx.globalAlpha = opacity ? opacity : d.opacity; //Draw the icon on top\n\n if (d.img_loaded) {\n var radius = d.r - d.stroke_width * 1.5;\n drawImage(ctx, d, d.r * 0.7, radius);\n } //if\n //Change the opacity\n\n\n var col = d3__WEBPACK_IMPORTED_MODULE_6__[\"rgb\"](d.fill);\n var col_new = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + 0.7 + ')';\n ctx.fillStyle = col_new;\n ctx.font = 'normal normal 500 ' + d.font_size + 'px ' + font_family; // ctx.fillText(d.title.toUpperCase(), d.x, d.y)\n\n ctx.save();\n ctx.translate(d.x, d.y);\n drawTextAlongArc(ctx, d.title.toUpperCase(), 0, d.r * 0.8, 'up');\n ctx.restore();\n }); //forEach\n\n ctx.globalAlpha = 1;\n } //function renderNodeLabels", "function createNode (args) {\n let node = new Node()\n\n // The order of checks is important\n function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.replace(/^./, ch => ch.toUpperCase())\n return\n }\n\n // Type\n if (typeof p === 'function') {\n node.type = p\n return\n }\n\n // Children\n if (isArray(p)) {\n node.children = p\n return\n }\n\n // Attr\n if (typeof p === 'object') {\n node.attr = p\n return\n }\n\n // Content\n if (typeof p === 'string') {\n node.attr.content = p\n return\n }\n }\n\n while (args.length) {\n generate(args.shift())\n }\n\n if (!node.type) {\n throw new Error('Can not generate node type')\n }\n\n return node\n}", "function RNode(){}", "function label(str)\n{\n // do nothing\n}", "function Node() {\n}", "function Node (){\n this.Leafs = [];\n //Node Less Then\n this.Left = null;\n //Node Greater Then\n this.Right = null;\n this.Level = 0;\n this.SortingKey = 0;\n }", "constructor(val) {\n if (typeof val === 'undefined') {\n // Initialized with no root\n this.root = null;\n } else {\n // Initialize with a value\n const rootNode = new Node(val);\n this.root = rootNode;\n }\n }", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function LLNode (value) {\n this.value = value;\n this.next = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function TreeNode(val) {\n this.val = val;\n this.left = this.right = null;\n}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function Node(attribute) {\n _classCallCheck(this, Node);\n\n this._val = attribute;\n this._parent = null;\n this._children = [];\n }", "function Label(){\n this.createLabel =function(text,id){\n this.item=document.createElement('p');\n this.item.setAttribute(\"id\",id);\n var textLabel = document.createTextNode(text); \n this.item.appendChild(textLabel);\n \n },\n\n this.setText = function(text){\n this.item.innerHTML=text;\n\n }\n this.addtoDocument =function(){\n document.body.appendChild(this.item);\n }\n this.addtodiv=function(id){\n document.getElementById(id).appendChild(this.item);\n }\n}", "function TreeNode(val){\n\tthis.val = val\n\tthis.right = null;\n\tthis.left = null;\n}", "function createNode(n){\n this.val = n;\n}" ]
[ "0.5902229", "0.58443695", "0.5790681", "0.5682147", "0.56478506", "0.5490255", "0.5396654", "0.53645897", "0.5319086", "0.5309116", "0.5309116", "0.5309116", "0.5309116", "0.53013283", "0.5296153", "0.52926195", "0.52926195", "0.52858377", "0.5273435", "0.5257659", "0.5247712", "0.524393", "0.51998645", "0.51905036", "0.51905036", "0.51905036", "0.5188601", "0.51763684", "0.5172354", "0.51713675", "0.51713675", "0.51713675", "0.5163927", "0.5163927", "0.5163927", "0.5160707", "0.51415086", "0.51367885", "0.51367", "0.5112026", "0.5112026", "0.5103165", "0.51022404", "0.51022404", "0.5100668", "0.50937027", "0.50872564", "0.5087088", "0.50837874", "0.506531", "0.50609946", "0.5040712", "0.5040712", "0.5027869", "0.50182915", "0.5017994", "0.49907878", "0.49902788", "0.49839705", "0.49839705", "0.49731955", "0.4964831", "0.49573532", "0.49539754", "0.49448666", "0.49438462", "0.49411595", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49374998", "0.49306932", "0.49282452", "0.49282452", "0.49282452", "0.49282452", "0.49282452", "0.49282452", "0.49282452", "0.49173543", "0.49173543", "0.49173543", "0.49066612", "0.48942506", "0.48915413", "0.4887378" ]
0.8305698
0
Profile Constructor root: the root Node p: the p value in the PQGram algorithm q: the q value in the PQGram algorithm
function Profile(root, p, q){ var self = this; if(!(self instanceof Profile)){ return new Profile(root, p, q); } p = p || 2; q = q || 3; var ancestors = new ShiftRegister(p); self.list = []; self.profile(root, p, q, ancestors); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tree_init(q) {\n\n // create tree object\n var tree = {};\n\n // initialize with vertex for given configuration\n tree.vertices = [];\n tree.vertices[0] = {};\n tree.vertices[0].vertex = q;\n tree.vertices[0].edges = [];\n\n // create rendering geometry for base location of vertex configuration\n add_config_origin_indicator_geom(tree.vertices[0]);\n\n // maintain index of newest vertex added to tree\n tree.newest = 0;\n\n return tree;\n}", "buildPrimalSpanningTree() {\n\t\t// TODO\n\t\t// initialize all vertices\n\t\tfor (let v of this.mesh.vertices) {\n\t\t\tthis.vertexParent[v] = v;\n\t\t}\n\n\t\t// build spanning tree\n\t\tlet root = this.mesh.vertices[0];\n\t\tlet queue = [root];\n\t\twhile (queue.length > 0) {\n\t\t\tlet u = queue.shift();\n\n\t\t\tfor (let v of u.adjacentVertices()) {\n\t\t\t\tif (this.vertexParent[v] === v && v !== root) {\n\t\t\t\t\tthis.vertexParent[v] = u;\n\t\t\t\t\tqueue.push(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "initRRTConnect(q) {\n\t\t// create tree object\n\t\tconst tree = {};\n\n\t\t// initialize with vertex for given configuration\n\t\ttree.vertices = [];\n\t\ttree.vertices[0] = {};\n\t\ttree.vertices[0].vertex = q;\n\t\ttree.vertices[0].edges = [];\n\t\ttree.vertices[0].index = 0;\n\n\t\ttree.vertices[0].parent=null; // pointer to parent in graph along motion path\n\t\ttree.vertices[0].distance=0; // distance to start via path through parent\n\t\ttree.vertices[0].visited=false; // flag for whether the node has been visited\n\t\ttree.vertices[0].priority=null; // visit priority based on fscore\n\t\ttree.vertices[0].queued=false; // flag for whether the node has been queued for visiting\n\t\ttree.vertices[0].cost = 0;\n\n\t\t// create rendering geometry for base location of vertex configuration\n\t\tthis.add_config_origin_indicator_geom(tree.vertices[0]);\n\n\t\t// maintain index of newest vertex added to tree\n\t\ttree.newest = 0;\n\n\t\treturn tree;\n\t}", "function P(a,b,c){P.m.constructor.call(this,a);this.Ya=a.Ya||kg;this.Ze=a.Ze||lg;var e=[];e[y.Va]=new ye;e[y.ug]=new ye;e[y.Pa]=new ye;e[y.mf]=new ye;this.ll=e;b&&(this.Xa=b);c&&(this.mg=c);this.Mk=this.mg&&y.h.He();this.Wj=[];this.pe=new Wf(a.qc);this.Nc=this.options.ep?new zf(a.ep,a.cp):null;y.I&&y.I.we&&mg(this,y.Ln,y.I.we);y.Ec&&y.Ec.we&&mg(this,y.xr,y.Ec.we);y.Qa&&y.Qa.we&&mg(this,y.Jn,y.Qa.we)}", "constructor () {\n this.p = 1\n }", "function Prb(){this.j=0;this.F=[];this.C=[];this.L=this.R=this.g=this.H=this.Y=this.G=0;this.V=[]}", "function QuickPlanner(cgraph) {\n // The strength assignment\n this.strengths = new plan.NumericStrengthAssignment();\n this.cgraph = cgraph;\n }", "constructor() {\n this.parentPop = []; // Main population - invariant : always sorted, best indiv on the front\n this.matingPool = []; // Individuals chosen as parents are temporarily stored here\n this.childPop = []; // Child population for step 3 - 'produceOffspring'\n \n this.#fitsum = 0;\n \n // Init parentPop with new random individuals\n for (let i = 0; i < popsize; i++) {\n this.parentPop[i] = new Song();\n }\n }", "constructor (m, q) {\n this.m = m\n this.q = q\n }", "constructor(i, p, o, n, q1, q2, problem) {\n this._iterations = i;\n this._problem = problem;\n this._socialLearningRate = q2;\n this._cognitionLearningRate = q1;\n this._maxVelocity = 5;//problem.MAX_VALUE;\n this._minVelocity = -5;//problem.MIN_VALUE;\n this._neighborhood = o;\n this._individuals = [];\n this._particles = p;\n this._dimensions = n;\n this._bestGlobalFitness = 0;\n this._bestGlobalPosition = Array.from({ length: n }, () => Math.round(Math.random() * 11));\n }", "function Tree(numNodes, nodeList, nodeHash, edgeProbs, root){\n\n\t//properties\n\n\t//number of nodes in the tree\n\tthis.numNodes = numNodes;\n\n\t//list of nodes in the tree (of type Node)\n\tthis.nodeList = nodeList;\n\n\tthis.nodeHash = nodeHash;\n\n\tthis.root = root;\n\n\t//2-D array of the different edge probabilities\n\t//edgeProbs[i] = [startNode, endNode, probability]\n\t//where i is some index, start node is the node where\n\t//the directed edge start, end node is the node where\n\t//the directed edge ends, and probability is between 0 and 1\n\tthis.edgeProbs = edgeProbs;\n\n\t//transform edgeProbs into a matrix\n\tthis.newEdgeProbs = new Array(edgeProbs.length);\n\n\tthis.createNewEdgeProbs = function(){\n\t\tfor(var i = 0; i < edgeProbs.length; i++){\n\t\t\tthis.newEdgeProbs[i] = new Array(edgeProbs.length);\n\t\t}\n\t\tfor(var i = 0; i < edgeProbs.length; i++){\n\t\t\tvar first = edgeProbs[i][0];\n\t\t\tvar second = edgeProbs[i][1];\n\t\t\tvar third = edgeProbs[i][2];\n\t\t\tthis.newEdgeProbs[this.nodeHash[first].nodeId][this.nodeHash[second].nodeId] = third;\n\t\t}\n\t}\n\n\tthis.createNewEdgeProbs();\n\n\t/**\n\t\tget the node associated with a given id\n\t*/\n\tthis.getNodeById = function(theId){\n\t\treturn nodeList[theId];\n\t}\n\n\t/**\n\t\tget the node associated with a given label\n\t*/\n\tthis.getNodeByLabel = function(theLabel){\n\t\treturn nodeHash[theLabel];\n\t}\n\n\t/**\n\t\tget the node id associated with a given label\n\t*/\n\tthis.getNodeIdByLabel = function(theLabel){\n\t\treturn nodeHash[theLabel].nodeId;\n\t}\n\t/**\n\t\tget the node label for the node based on the node id\n\t*/\n\tthis.getNodeLabelById = function(theId){\n\t\treturn nodeList[theId].nodeLabel;\n\t}\n\n\t/**\n\t\tget the proability can go from idStart to idEnd\n\t*/\n\tthis.getDirectedProbabilityByIds = function (idStart, idEnd){\n\t\treturn this.newEdgeProbs[idStart][idEnd];\n\t}\n\n\t/**\n\t* update the correct edges given the barrier id\n\t* and values in each direction\n\t*/\n\tthis.updateEdgeValues = function(id, upstream, downstream){\n\t\t//user cannot change the values of the non-barrier edges\n\t\tif(id == -1){\n\t\t\treturn;\n\t\t}\n\t\tfor(var i = 0; i < this.edgeProbs.length; i++){\n\t\t\tif(edgeProbs[i][3] == id){\n\t\t\t\tedgeProbs[i][2] = upstream;\n\t\t\t\tedgeProbs[i+1][2] = downstream;\n\t\t\t\tthis.createNewEdgeProbs();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Get the id for the barrier that connects\n\t* idStart and idEnd\n\t*/\n\tthis.getBarrierId = function(idStart, idEnd){\n\t\tif(idStart==null || idEnd == null){\n\t\t\treturn;\n\t\t}\n\t\tfor(var i = 0; i < this.edgeProbs.length; i++){\n\t\t\tif(edgeProbs[i][0] == idStart && edgeProbs[i][1]==idEnd){\n\t\t\t\treturn edgeProbs[i][3];\n\t\t\t}\n\t\t}\n\t}\n}", "constructor(initial) {\n this.Solution = null;\n let pq = new PQ();\n pq.push(new Node(initial, null, 0));\n while (pq.size > 0) {\n let node = pq.pop();\n if (node.moves > 50) {\n console.log(\"huge\");\n break;\n }\n if (node.board.isGoal() == true) {\n this.Solution = node;\n let copy = node;\n while (copy != null) {\n this.stk.push(copy.board.board);\n copy = copy.previos;\n }\n break;\n }\n node.board.neighbors().forEach(n => {\n if (node.previos != null && node.previos.board.equals(n.board) == false) {\n pq.push(new Node(n, node, node.moves + 1));\n } else if (node.previos == null) {\n pq.push(new Node(n, node, node.moves + 1));\n }\n })\n }\n }", "function _main()\n{\n\nvar heap = new Heap();\n //operation sequence from the Figure :\n var ListOfSequence = [\n\t\t{KEY: 2, Vlaue: \"a\"},\n\t\t{KEY: 9, Vlaue: \"b\"},\n\t\t{KEY: 7, Vlaue: \"c\"},\n\t\t{KEY: 6, Vlaue: \"d\"},\n\t\t{KEY: 5, Vlaue: \"e\"},\n\t\t{KEY: 8, Vlaue: \"f\"}];\n\n\tfor (var i = 0; i < ListOfSequence.length; i++) {\n\t\theap.insert(ListOfSequence[i].KEY , ListOfSequence[i].Vlaue);\n\t}\n document.write(heap.show());\n heap.insert(10, \"g\");\n document.write(heap.show());\n heap.insert(15, \"h\");\n document.write(heap.show());\n\n\n // set input graph properties then implement the graph\n var g = new Graph();\n g.label = \"Exercise 9.2: 1b (Levitin, 3rd edition)\";\n g.readGraph(_v, _e);\n g.printGraph();\n\n\n\n\n/** print output of first prim------------------------------------------------*/\n\n document.write('<br>MST by first Prim<br>');\n\n g.primImpl1();\n for (var i = 0; i < g.Prim_Edge.length; i++) {\n document.write(\"(\", g.Prim_Edge[i].v, \",\", g.Prim_Edge[i].u, \")\");\n \tg.Prim_Edge.length-1 == i ? document.write(\".<p>\") : document.write(\", \");\n\t}\n\n/**print output of second prim---------------------------------------*/\n\ndocument.write(\"<br>MST by Prim2 (PQ-Heap): <br>\");\n g.primImpl2();\n\n for (var n = 0; n < g.verticesTree.length; n++) {\n if (g.verticesTree[n].parent != null) {\n document.write(\"(\", g.verticesTree[n].parent, \",\", g.verticesTree[n].V, \")\");\n g.Prim_Edge.length-1 == i ? document.write(\".<p>\") : document.write(\", \");\n } else if (g.verticesTree[n].parent == null) {\n document.write(\"(-, \", g.verticesTree[n].tree, \"), \");\n }\n }\n\n}", "constructor(p) {\n\t\tsuper(p);\n\t\tthis.#vars = [...this._pro.variables()];\n\t\tfor (const v of this.#vars) {\n\t\t\tv.solverObject = new DomainPruner(v.domain().size());\n\t\t}\n\t\tthis.#initializeRelatedConstraintTable();\n\t}", "constructor(papa,mummy,sivlings,belongs){ // constructor for creating propertirs \n this.father_name=papa\n this.mother_name=mummy\n this.sivlings=sivlings\n this.state=belongs\n }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "constructor(param) {\n /**\n * (aggregated) body in this quad\n * @type {object}\n */\n this.body = null;\n /**\n * tree representing the northwest quadrant\n * @type {object}\n */\n this.quad = null;\n this.NW = null;\n this.NE = null;\n this.SW = null;\n this.SE = null;\n /**\n * threshold\n * @type {number}\n */\n this.theta = 0.5;\n if (param != null)\n this.quad = param;\n }", "function P(){}", "root(p) {\n let q = p;\n while (q !== this.parent[q]) {\n // path compression - after getting the root of a node, set the root of visited node\n // to its parent\n this.parent[q] = this.parent[this.parent[q]];\n q = this.parent[q];\n }\n return q;\n }", "constructor(dim, min_dim, quad_max = 8, quad_min = 4){\n this.dim = dim\n this.max_depth = Math.floor( Math.log2(dim / min_dim) )\n this.quad_max = quad_max\n this.quad_min = quad_min\n this.root = new Quad()\n }", "insertTreeVertexNode(tree, q_node) { \n\t\ttree.vertices.push(q_node);\n\t}", "constructor() {\n this.nodeTree = {};\n this.numberOfValues = 0;\n }", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function pi(a){var b=qi;this.g=[];this.u=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.v=this.C=this.i=!1;this.h=0;this.b=null;this.l=0}", "function PQueue() {\n\n\tthis.pq = new Heap(); // requirement: Heap implementation\n\n\n\t// specify (design) methods\n\n\t/**\n Return true if queue empty\n @method\n */\n\tthis.isEmpty = isEmptyImpl;\n\n\n\t/**\n Remove/Return item with minimum priority\n @method\n */\n\tthis.deleteMin = deleteMinImpl;\n\n\n\t/**\n Insert/Update an item with priority\n @method\n */\n\tthis.insert = insertImpl;\n}", "constructor(root, parent, edges, value, hash){\n\n super(root, parent, edges, value);\n\n if ( !hash ) hash = Buffer.alloc(32);\n this.hash = hash;\n\n }", "function Pg() {\n this.b = null;\n this.a = [];\n }", "function robot_rrt_planner_init() {\n\n // form configuration from base location and joint angles\n q_start_config = [\n robot.origin.xyz[0],\n robot.origin.xyz[1],\n robot.origin.xyz[2],\n robot.origin.rpy[0],\n robot.origin.rpy[1],\n robot.origin.rpy[2]\n ];\n\n q_names = {}; // store mapping between joint names and q DOFs\n\n for (x in robot.joints) {\n q_names[x] = q_start_config.length;\n q_start_config = q_start_config.concat(robot.joints[x].angle);\n }\n\n q_L = q_start_config.length;\n\n // set goal configuration as the zero configuration\n var i; \n q_goal_config = new Array(q_start_config.length);\n for (i=0;i<q_goal_config.length;i++) q_goal_config[i] = 0;\n\n // CS148: add necessary RRT initialization here\n tree_a = tree_init(q_start_config);\n tree_b = tree_init(q_goal_config);\n\n eps = 0.5;\n K = 3;\n\n // make sure the rrt iterations are not running faster than animation update\n cur_time = Date.now();\n\n console.log(\"planner initialized\");\n}", "function Node (args) {\n\targs = args || {};\n\n\t// Private arguments from constructor\n\tvar p = args.p;\n\n\t// Public P5.Vector objects\n\tthis.start = args.position.copy() || p.createVector();\n\tthis.position = args.position.copy() || p.createVector();\n\tthis.velocity = args.velocity.copy() || p.createVector();\n\t\n\t// Public floats\n\tthis.neuron_timer = args.neuron_timer || 0;\n\tthis.max_depth = args.max_depth || 7;\n\tthis.depth = args.depth || 0;\n\tthis.mass = args.mass || 5;\n\n\t// Node ID\n\tthis.id = args.id || 0;\n\t\n\t// Not in constructor\n\tthis.acceleration = p.createVector(0,0);\n\tthis.timer = this.neuron_timer;\n\t\n\t// Setup public arrays for children Nodes and Adjacency List\n\tthis.children = [];\n\tthis.adj_list = [];\n\tthis.springs = [];\n\t\n\t// Public array of vectors to contain coordinates for Catmull Rom paths\n\tthis.curve_pts = []; // 4 pts\n\t\n\t// Node Object :: Can only ever have a single parent\n\tthis.parent == null;\n\n\t// Public Booleans\n\tthis.leaf = true;\n\tthis.size = false;\n\tthis.start_point = false;\n\tthis.dw = false; // Debugging Vel\n\tthis.sprung = false;\n\tthis.distribute = false;\n\n\t// Private variables\n\tvar radius = 0;\n\tvar wandertheta = 0;\n\tvar wan_const = 0.5;\n\tvar maxspeed = 1.5; // Default 2\n\tvar maxforce = p.random(0.8,1); // Default 0.05\n\tvar damping = 0.85;\n\tvar pow = 1000; // Huge starting multipliers!\n\n\t// Increment for each instantiation at a branch event\n\tthis.depth++;\n\n\t// Ensures that the definition of leaf is fresh\n\tthis.isLeaf = function () {\n\t\tvar _this = this;\n\t\treturn _this.children.length === 0;\n\t};\n\n\t// var n :: Node()\n\tthis.addChild = function(n) {\n\t\tvar _this = this;\n\t\tn.parent = _this;\n\t\t_this.children.push(n);\n\t} \n\n\t// var n :: Node()\n\tthis.addParent = function(n) {\n\t\tvar _this = this;\n\t\tn.addChild(_this);\n\t}\n\n\t// Set curve points\n\tthis.pt_0 = function() {\n\t\tvar _this = this;\n\t\tvar p_0 = p.createVector();\n\t\tif (_this.depth == 1 || _this.depth == 2) {\n\t\t\tp_0 = _this.position; \n\t\t\treturn p_0;\n\t\t} \n\t\telse {\n\t\t\treturn p_0.set(_this.parent.parent.position.x,_this.parent.parent.position.y);\n\t\t}\n\t}\n\n\tthis.pt_1 = function() {\n\t\tvar _this = this;\n\t\tvar p_1 = p.createVector();\n\t\tvar isAlone = _this.parent instanceof Node;\n\t\tif (!isAlone) {\n\t\t\tp_1 = _this.start.copy(); \n\t\t\treturn p_1;\n\t\t} \n\t\telse {\n\t\t\treturn p_1.set(_this.parent.position.x,_this.parent.position.y);\n\t\t}\n\t}\n\n\tthis.pt_2 = function() {\n\t\tvar _this = this;\n\t\tvar p_2 = p.createVector();\n\t\treturn p_2.set(_this.position.x, _this.position.y);\n\t}\n\n\tthis.pt_3 = function() {\n\t\tvar _this = this;\n\t\tvar p_3 = p.createVector();\n\t\tif (_this.children.length == 1) {\n\t\t\treturn p_3.set(_this.children[0].position.x,_this.children[0].position.y);\n\t\t} \n\t\telse if (this.children.length > 1) {\n\t\t\tfor (var i = 0; i < _this.children.length; i++) {\n\t\t\t\tp_3.add(_this.children[i].position);\n\t\t\t}\n\t\t\tp_3.div(_this.children.length);\n\t\t\treturn p_3;\n\t\t} \n\t\telse { // While we're growing\n\t\t\treturn p_3.set(_this.position.x,_this.position.y);\n\t\t}\n\n\t}\n\n\tthis.wander = function() {\n\t\tvar _this = this;\n\t\tvar wanderR = 25; \t\t\t\t\t\t// Radius for our \"wander circle\"\n\t\tvar wanderD = 80; \t\t\t\t\t\t// Distance for our \"wander circle\"\n\t\tvar change = 0.3;\n\t\t\n\t\twandertheta += p.random(-change,change); // Randomly change wander theta\n\n\t\t// Now we have to calculate the new position to steer towards on the wander circle\n\t\tvar circleloc = _this.velocity.copy(); \t\t// Start with velocity\n\t\t\tcircleloc.normalize(); \t\t\t// Normalize to get heading\n\t\t\tcircleloc.mult(wanderD); \t\t\t// Multiply by distance\n\t\t\tcircleloc.add(_this.position); // Make it relative to boid's position\n\n\t\tvar h = _this.velocity.heading(); \t\t// We need to know the heading to offset wandertheta\n\n\t\tvar circleOffSet = p.createVector(\n\t\t\twanderR * p.cos(wandertheta + h), \n\t\t\twanderR * p.sin(wandertheta + h)\n\t\t);\n\t\tvar target = p5.Vector.add(circleloc, circleOffSet);\n\n\t\t// Render wandering circle, etc. \n\t\tif (_this.dw) _this.drawWanderStuff(_this.position, circleloc, target, wanderR);\n\n\t\t// Returns call to seek() and a vector object\n\t\treturn _this.seek(target);\n\n\t}\n\n\t// A method just to draw the circle associated with wandering\n\t this.drawWanderStuff = function(loc,circle,target,rad) {\n\t\tp.push();\n\t\t\tp.stroke(100); \n\t\t\tp.noFill();\n\t\t\tp.ellipseMode(p.CENTER);\n\t\t\t// Outter Circle\n\t\t\tp.ellipse(circle.x,circle.y,rad*2,rad*2); \n\t\t\t// Inner Circle\n\t\t\tp.ellipse(target.x,target.y,4,4);\n\t\t\t// Line At target location\n\t\t\tp.line(loc.x,loc.y,circle.x,circle.y);\n\t\t\t// Line from center of Circle to Target\n\t\t\tp.line(circle.x,circle.y,target.x,target.y);\n\t\tp.pop();\n\t} \n\n\t// A method that calculates and applies a steering force towards a target\n\t// STEER = DESIRED MINUS VELOCITY\n\t// Consider using to attract towards another cell or synapse\n\t// Accepts P5.Vector for argument\n\n\tthis.seek = function(target) {\n\t\tvar _this = this;\n\t\tvar _target = target.copy();\n\t\t\n\t\t_target.sub(_this.position); // A vector pointing from the position to the _target\n\n\t\t// Normalize _target and scale to maximum speed\n\t\t_target.normalize();\n\n\t\tif (_this.distribute) {\n\t\t\t// Calculate distance from center\n\t\t\tvar center = p.createVector(p.width/2, p.height/2);\n\t\t\tvar cd = p.abs(p5.Vector.dist(_this.position, center));\n\t\t\ttarget.div(cd*cd*cd*cd*cd); // Weight by distance\n\t\t}\n\n\t\t_target.mult(maxspeed);\n\t\t// Steering = Desired minus Velocity\n\t\t_target.sub(_this.velocity);\n\t\t_target.limit(maxforce); // Limit to maximum steering force\n\n\t\treturn _target;\n\t}\n\n\t// Separation\n\t// Method checks for nearby nodes and steers away\n\t// Accepts Array as input\n\t// If called as spring, accepts neighbor_nodes object\n\n\tthis.separate = function(nodes) {\n\t\tvar _this = this;\n\t\tvar desiredseparation = 25.0;\n\t\tvar steer = p.createVector(0,0);\n\t\tvar count = 0;\n\t\tvar node;\n\n\t\t// For every node in the system that is a leaf, check if it's too close\n\t\tnodes.forEach(function(other) {\n\n\t\t \tif (_this.distribute) {\n\t\t \t\t// If we're in spring mode, desired separation = distance from this to other\n\t\t \t\t// Update desiredseparation to match starting position of adjacency list\n\t\t \t\tdesiredseparation = radius;\n\t\t \t}\n\t \t\t\n\t \t\t// Calc distance from growing nodes\n\t \t\t// Or the displacement of the system given a window resize event\n\t \t\t// Maybe even a mouse over c:\n\t\t\tvar d = p5.Vector.dist(_this.position, other.position);\t\n\t\t\t\n\t\t\t// If the distance is greater than 0 and less than an arbitrary amount (0 when you are yosurself)\n\t\t\tif ((d > 0) && (d < desiredseparation)) {\n\t\t\t\t// Calculate vector pointing away from neighbor\n\t\t\t\tvar diff = p5.Vector.sub(_this.position,other.position);\n\t\t\t\t\tdiff.normalize();\n\t\t\t\t\tdiff.div(d*d); \t\t\t\t// Weight by distance\n\t\t\t\tsteer.add(diff);\n\t\t\t\tcount++; \t\t\t\t\t// Keep track of how many\n\t\t\t}\n\t\t});\n\t\t// Average -- divide by how many\n\t\tif (count > 0) {\n\t\t\tsteer.div(count);\n\t\t}\n\t\t// As long as the vector is greater than 0\n\t\t// Using magSq() --> to avoid square root\n\t\tif (steer.magSq() > 0) {\n\t\t\t// Implement Reynolds: Steering = Desired - Velocity\n\t\t\tsteer.normalize();\n\t\t\tsteer.mult(maxspeed);\n\t\t\tsteer.sub(_this.velocity);\n\t\t\tsteer.limit(maxforce);\n\t\t}\n\n\t\treturn steer;\n\t}\n\n\t// Calculate force away from area\n\t// Weight by Distance\n\t// Inverse Square\n\tthis.check_edges = function() {\n\t\tvar _this = this;\n\t\tvar x,y;\n\t\tvar force = p.createVector();\n\t\tvar mult_x = 1;\n\t\tvar mult_y = 1;\n\n\t\t// Calculate 'x' edge offset\n\t\tif (_this.position.x < p.width / 2) {\n\t\t\tx = _this.position.x + radius;\n\t\t}\n\t\telse {\n\t\t\tx = p.width - _this.position.x + radius;\n\t\t\tmult_x = -1;\n\t\t}\n\n\t\t// Calculate 'y' edge offset\n\t\tif (_this.position.y < p.height / 2) {\n\t\t\ty = _this.position.y + radius;\n\t\t}\n\t\telse {\n\t\t\ty = p.height - _this.position.y + radius;\n\t\t\tmult_y = -1;\n\t\t}\n\n\t\tx = Math.max(x, 0.01);\n\t\ty = Math.max(y, 0.01);\n\n\t\t// Inverse Square\n\t\tx = mult_x / x;\n\t\ty = mult_y / y;\n\n\t\t// Set position\n\t\tforce.set(x,y);\n\n\t\treturn force;\n\t}\n\n\t// Calculate force away from area\n\t// Weight by Distance\n\t// Inverse Square\n\t/*\n\tthis.check_area = function(u,v) {\n\t\tvar _this = this;\n\t\tvar x,y;\n\t\tvar force = p.createVector();\n\n\t\t// Calculate 'x' edge offset\n\t\tif (_this.position.x < p.width / 2) {\n\t\t\tx = _this.position.x;\n\t\t}\n\t\telse {\n\t\t\tx = p.width - _this.position.y;\n\t\t}\n\n\t\t// Calculate 'y' edge offset\n\t\tif (_this.position.y < p.height / 2) {\n\t\t\ty = _this.position.y;\n\t\t}\n\t\telse {\n\t\t\ty = p.height - _this.position.y;\n\t\t}\n\n\t\t// Inverse Square\n\t\tx = 1 / x * x;\n\t\ty = 1 / y * y;\n\n\t\t// Set position\n\t\tforce.set(x,y);\n\n\t\t// Apply the force!\n\t\t_this.applyForce(force);\n\t}\n\t*/\n\n\t// Calculate initial distribution forces\n\t// !Important --> Must be called outside of node \n\t// !Important --> Requires list of nodes\n\tthis.spread = function(somas, rad) {\n\t\tvar _this = this;\n\t\tradius = rad;\n\t\t// Center point\n\t\tvar center = p.createVector(p.width/2, p.height/2);\n\n\t\t// Set distribute to true\n\t\t_this.distribute = true;\n\n\t\t// Test Radius\n\t\t// _this.render_radius();\n\t\t\n\t\tvar cen = _this.seek(center).mult(-1); // Simply seek away from center\n\t\tvar edg = _this.check_edges(); // Move away from edges\n\t\tvar sep = _this.separate(somas); // Move away from eachother\n\n\t\t// Carefully weight these forces\n\t\t// cen.mult(pow);\n\t\tedg.mult(pow);\n\t\tsep.mult(pow);\n\n\t\t// Add the force vectors to acceleration\n\t\t_this.applyForce(cen);\n\t\t_this.applyForce(edg);\n\t\t_this.applyForce(sep);\n\n\t\tpow *= 0.9;\n\t\tif (pow <= 1) {\n\t\t\tpow = 0;\n\t\t}\n\t}\n\n\t// We accumulate a new acceleration each time based on three rules\n\t// Accepts an Array of Node objects\n\tthis.expand = function(nodes) {\n\t\tvar _this = this;\n\t\tvar sep = _this.separate(nodes); \t\t\t\t// Separation\n\t\tvar ini = _this.seek(_this.findRoot(_this)).mult(-1); \t// Root Node (multiply by -1 to repel)\n\t\tvar wan = _this.wander(); \t\t\t\t// Wander\n\n\t\t// Carefully weight these forces\n\t\tsep.mult(1);\n\t\tini.mult(1);\n\t\twan.mult(wan_const);\n\n\t\t// Add the force vectors to acceleration\n\t\t_this.applyForce(sep);\n\t\t_this.applyForce(ini);\n\t\t_this.applyForce(wan);\n\t}\n\n\t// Simple method to sum forces\n\t// Accepts P5.Vector\n\tthis.applyForce = function(force) {\n\t\tvar _this = this;\n\t\tvar _force = force;\n\t\t// In spring mode, weight each nodes response by mass\n\t\tif (_this.sprung) {\n\t\t\t// _force.div(_this.mass);\n\t\t}\n\t\t_this.acceleration.add(_force);\n\t}\n\n\t// Method to update position\n\tthis.update = function() {\n\t\tvar _this = this;\n\t\t// Update velocity\n\t\t_this.velocity.add(_this.acceleration);\n\t\t// If we are a spring, at friction (lower energy)\n\t\tif(_this.sprung) {\n\t\t\t_this.velocity.mult(damping);\n\t\t\tmaxspeed = 100;\n\t\t}\n\n\t\tif (_this.velocity.magSq() < 0.1) _this.velocity.mult(0); \n\n\t\t// Limit speed\n\t\t_this.velocity.limit(maxspeed);\n\t\t_this.position.add(_this.velocity);\n\t\t// Reset accelertion to 0 each cycle\n\t\t_this.acceleration.mult(0);\n\t}\n\n\t// Draw a dot at position\n\tthis.render = function() {\n\t\tvar _this = this;\n\t\t// Basic Fractal Lines\n\t\t// p.stroke(41,59,73); // blue\n\t\tp.stroke(200); // white\n\t\tp.strokeWeight(1);\n\t\tp.noFill();\n\t\t\t\n\t\t// p.line(_this.start.x, _this.start.y, _this.position.x, _this.position.y);\n\t\t// Render Curves\n\t\tp.curve(\n\t\t\t_this.pt_0().x, _this.pt_0().y,\n\t\t\t_this.pt_1().x, _this.pt_1().y,\n\t\t\t_this.pt_2().x, _this.pt_2().y,\n\t\t\t_this.pt_3().x, _this.pt_3().y\n\t\t);\n\n\t\t// p.curve(\n\t\t// \tpts[0].x, pts[0].y,\n\t\t// \tpts[1].x, pts[1].y,\n\t\t// \tpts[2].x, pts[2].y,\n\t\t// \tpts[3].x, pts[3].y\n\t\t// );\n\n\t\t// For fun:\n\t\t// pts = pts\n\t\t// \t.map(function (v) {\n\t\t// \t\treturn [v.x, v.y]\n\t\t// \t})\n\t\t// \t.reduce(function (arr, vec) {\n\t\t// \t\tarr.push(vec[0], vec[1])\n\t\t// \t\treturn arr;\n\t\t// \t}, [])\n\n\t\t// p.curve.apply(p, pts);\n\n\t\t// Render Path Home\n\t\tif (_this.size) {\n\t\t\tp.noStroke();\n\t\t\t// p.fill(41,59,73); // blue\n\t\t\tp.fill(200); // white\n\t\t\tp.ellipse(\n\t\t\t\t_this.pt_1().x,\n\t\t\t\t_this.pt_1().y,\n\t\t\t\t5,\n\t\t\t\t5\n\t\t\t);\n\t\t\tp.ellipse(\n\t\t\t\t_this.position.x,\n\t\t\t\t_this.position.y,\n\t\t\t\t5,\n\t\t\t\t5\n\t\t\t);\n\t\t}\n\n\t\tif (_this.start_point) {\n\t\t\tp.noStroke();\n\t\t\tp.fill(200,0,0);\n\t\t\tp.ellipse(\n\t\t\t\t_this.position.x,\n\t\t\t\t_this.position.y,\n\t\t\t\t5,\n\t\t\t\t5\n\t\t\t);\n\t\t}\n\n\t\t// Draw Soma\n\t\tp.push();\n\t\t\t// p.fill(41,59,73); // blue\n\t\t\tp.fill(200); // white\n\t\t\t// if (_this.depth == 2) p.ellipse(_this.pt_1().x,_this.pt_1().y,15,15);\n\t\tp.pop();\n\t\t// Debug Neighborhood\n\t\tp.push();\n\t\t\t// p.noStroke();\n\t\t\t// p.fill(255,10);\n\t\t\t// p.ellipse(_this.position.x,_this.position.y,50,50);\n\t\t\t// p.fill(255,255);\n\t\tp.pop();\n\n\t}\n\n\tthis.render_radius = function() {\n\t\tvar _this = this;\n\n\t\t// Render Radius\n\t\t// console.log(radius);\n\t\tp.push();\n\t\t\tp.fill(200,100);\n\t\t\tp.ellipse(_this.position.x, _this.position.y, radius, radius);\n\t\tp.pop();\n\t}\n\n\t// Accepts an Array of Node Objects\n\tthis.grow = function(nodes) {\n\t\tvar _this = this;\n\t\tif (_this.isGrowing()) {\n\t\t\t_this.tick();\n\t\t\t_this.expand(nodes);\n\t\t\t_this.update();\n\t\t\t// Display Wandering Debug\n\n\t\t\t// Make leaves go crazy on final level\n\t\t\tif (_this.depth == (_this.max_depth - 1)) {\n\t\t\t\twan_const = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t_this.dw = false;\n\t\t}\n\t}\n\n\t// Recurse through nodes to root\n\t// Accepts Node object\n\t// Returns p5.Vector object\n\tthis.findRoot = function(n) {\n\t\tvar _this = this;\n\t\tif (n.parent == null) {\n\t\t\treturn n.position;\n\t\t}\n\t\telse {\n\t\t\treturn _this.findRoot(n.parent);\n\t\t}\n\t}\n\n\t// Recurse through nodes to root\n\t// Accepts Node object\n\t// Returns Node object\n\tthis.findSoma = function(n) {\n\t\tvar _this = this;\n\t\tif (n.parent == null) {\n\t\t\treturn n;\n\t\t}\n\t\telse {\n\t\t\treturn _this.findSoma(n.parent);\n\t\t}\n\t}\n\n\t// Calc T(--)\n\tthis.sub_t = function (mxd) {\n\t\tvar tt = mxd / 1.5;\n\t\treturn tt;\n\t}\n\n\t// Did the timer run out?\n\t// Returns boolean --> Growing?\n\tthis.tick = function () {\n\t\tvar _this = this;\n\t\tif ((_this.depth == 2) || (_this.depth == 3)) {\n\t\t\t_this.timer -= p.round(p.random(2,_this.sub_t(_this.max_depth)));;\n\t\t} \n\t\telse {\n\t\t\t_this.timer--;\n\t\t}\n\t}\n\n\tthis.isGrowing = function() {\n\t\tvar _this = this;\n\t\tif (_this.timer >= 0) {\n\t\t\t// Set branch point\n\t\t\treturn true;\n\t\t} \n\n\t\treturn false;\n\t}\n\n\tthis.parentIdx = function() {\n\t\tvar _this = this;\n\n\t\tif (_this.parent) {\n\t\t\tvar c;\n\t\t\tfor (var i = 0; i < _this.parent.children.length; i++) {\n\t\t\t\tc = _this.parent.children[i];\n\t\t\t\tif (c.id == _this.id) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\treturn \"potato\";\n\t\t}\n\t}\n\n\tthis.meta = function() {\n\t\tvar _this = this;\n\t\t// Render meta information on vertex\n\t\tvar str_id = String(_this.id + \":\" + _this.mass);\n\t\tp.push();\n\t\t\tp.fill(0,255,0).strokeWeight(0).textSize(10);\n\t\t\tp.text(str_id, _this.position.x, _this.position.y - 15);\n\t\tp.pop();\n\t}\n\n\t// Calculates adjacency list for generating tensive graph between a neighborhood of nodes\n\t// comprised of a parent, children and 2 closest non-related nodes\n\t/*\n\n\t\tThere is a mini bug in here~!\n\n\t*/\n\tthis.springify = function(nodes) {\n\t\tvar _this = this;\n\t\tvar ndist,\n\t\t\tn;\n\t\tvar min1_ref = nodes[0]; \t// Inititial + Arbitrary Min Distance Values\n\t\tvar min2_ref = nodes[1]; \t// Inititial + Arbitrary Min Distance Values\n\n\t\t// Set neuron to be a spring\n\t\t_this.sprung = true;\n\n\t\t// Create + Add a Spring object to springs array\n\t\tfunction getSprung(node) {\n\t\t\t// Make new Spring object\n\t\t\tvar s = new Spring ({\n\t\t\t\tnode1: _this,\n\t\t\t\tnode2: node,\n\t\t\t\tp: p,\n\t\t\t});\n\t\t\t// Add a new spring \n\t\t\t_this.springs.push(s);\n\t\t}\n\n\t\t\n\n\t\t// Check for child nodes, add to the adjacency list\n\t\t// for (var i = 0; i < _this.children.length; i++) {\n\t\t// \t// Create a new spring \n\t\t// \tgetSprung(_this.children[i]);\n\t\t// }\n\n\t\t// // Check for parent nodes, add to adjaceny list\n\t\tif (_this.parent) {\n\t\t\t// Create a new spring \n\t\t\tgetSprung(_this.parent);\n\t\t}\n\n\t\t/*\n\n\t\t// First sort\n\t\tif (distFrom(min2_ref) < distFrom(min1_ref)) {\n\t\t\tmin1_ref = nodes[1];\n\t\t\tmin2_ref = nodes[0];\n\t\t}\n\n\t\tNEIGHBOR: for (var i = 2; i < nodes.length; i++){\n\t\t\t\n\t\t\tn = nodes[i];\n\t\t\t\n\t\t\t// Make sure the node isn't already in our list\n\t\t\tfor (var j = 0; j < _this.springs.length; j++) {\n\t\t\t\tif (n.id == _this.springs[j].node2.id) {\n\t\t\t\t\tcontinue NEIGHBOR;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Avoid adding self to list\n\t\t\tif (n.id == _this.id) {\n\t\t\t\tcontinue NEIGHBOR;\n\t\t\t}\n\t\t\t// Check only nodes on same level\n\t\t\tif (n.depth !== _this.depth) {\n\t\t\t\tcontinue NEIGHBOR;\n\t\t\t}\n\t\t\t// Check for 2 closest nodes that are not also parent or child\n\t\t\tif (distFrom(n) < distFrom(min1_ref)) {\n\t\t\t\tmin2_ref = min1_ref;\n\t\t\t\tmin1_ref = n;\n\t\t\t} \n\t\t\telse if (distFrom(n) < distFrom(min2_ref)) {\n\t\t\t\tmin2_ref = n;\n\t\t\t}\n\t\t}\n\n\t\t// Add closest 2 neurons to neighborhood\n\t\tgetSprung(min1_ref);\n\t\tgetSprung(min2_ref);\n\n\t\t*/\n\n\t\t\n\n\t\tvar new_spring = _this.leftNode();\n\n\n\t\tif (new_spring && new_spring.id !== _this.id) {\n\t\t\tgetSprung(new_spring);\n\t\t}\n\t\t\n\t}\n\n\tthis.leftNode = function (depthx) {\n\n\t\tif (this.id === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t depthx = depthx === undefined ? 0 : depthx;\n\n\t var parentsC = this.parent.children;\n\t var parentIdx = null;\n\n\t for (var i = 0; i < parentsC.length; i++) {\n\t var other = parentsC[i];\n\n\t if (other.id === this.id) {\n\t parentIdx = i;\n\t }\n\t };\n\n\t // left most = 0\n\n\t if (parentIdx > 0 || this.parent.parent === undefined) {\n\t return parentsC[(parentIdx - 1).mod(parentsC.length)].rightMost(depthx);\n\t } else {\n\t return this.parent.leftNode(depthx + 1);\n\t }\n\t}\n\n\tthis.rightMost = function (depthx) {\n\t if (depthx === 0) {\n\t return this;\n\t }\n\n\t return this.children[this.children.length - 1].rightMost(depthx - 1);\n\t}\n\n\t// Method to be called on window resize to keep nodes in tension\n\t// MousePos for debugging \n\tthis.repel = function() {\n\t\tvar _this = this;\n\t\tif(p.mouseIsPressed) {\n\t\t\tvar mousePos = p.createVector(p.mouseX, p.mouseY);\n\n\t\t\t// Move soma\n\t\t\tvar soma = _this.findSoma(_this);\n\t\t\tsoma.position = mousePos;\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Update spring positions --> Run through array\n\t\t_this.springs.forEach(function(s) {\n\t\t\ts.update();\n\t\t\ts.display();\n\t\t});\n\t}\n\n\t// Method to shift nodes around\n\t// Only to be called once growing has completed!\n\t// Only to be called once springify has completed!\n\tthis.relax = function() {\n\t\tvar _this = this;\n\t\t_this.repel();\n\t\t_this.update();\n\t\t_this.meta();\n\t\t// Find position, then stop moving! --> Each resize event\n\t\t// if (damping > 0.1) damping *= 0.98;\n\t}\n\n\t// Create a new dendrite at the current position, but change direction by a given angle\n\t// Returns a new Node object\n\tthis.branch = function(angle, id) {\n\t\tvar _this = this;\n\t\t// What is my current heading\n\t\tvar theta = _this.velocity.heading();\n\n\t\t// New mass = square root of previous (hopefully all single operations :)\n\t\tvar new_mass = Math.max(1,(_this.mass /2));\n\n\t\t// What is my current speed\n\t\t// Can't see how this could be faster\n\t\tvar mag = _this.velocity.mag();\n\t\t// Turn me\n\t\ttheta += p.radians(angle);\n\t\t// Polar coordinates to cartesian!!\n\t\tvar newvel = p.createVector(mag * p.cos(theta),mag * p.sin(theta));\n\n\t\t// Create a new Node instance\n\t\tvar node = new Node ({\n\t\t\tneuron_timer: \t_this.neuron_timer * p.random(0.8,0.85),\n\t\t\tmax_depth: \t\t_this.max_depth,\n\t\t\tposition: \t\t_this.position,\n\t\t\tvelocity: \t\t\t newvel,\n\t\t\tdepth: \t\t\t_this.depth,\n\t\t\tmass: \t\t\t\t 1,\n\t\t\tid: \t\t\t\t id,\n\t\t\tp: \t\t\t\t\t p,\n\t\t});\n\t\t\n\t\t_this.addChild(node);\n\t\t_this.leaf = false;\n\t\t// Return a new Node\n\t\treturn node;\n\t}\n}", "function createTree(data, target, features,probabilityMultipler,gainMultipler) {\n //console.log(data.length);\n var targets = _.uniq(_.pluck(data, target));\n //console.log(targets);\n var sample = _.countBy(data, target);\n if (targets.length == 1) {\n return {\n type: NODE_TYPES.RESULT,\n val: targets[0],\n name: targets[0],\n alias: targets[0] + randomUUID(),\n probabilityMul: parseFloat(probabilityMultipler * 100).toFixed(2),\n probability: parseFloat(1 * 100).toFixed(2),\n total: data.length,\n sample: sample\n };\n }\n\n if (features.length == 0) {\n var topTarget = mostCommon(sample);\n return {\n type: NODE_TYPES.RESULT,\n val: topTarget.value,\n name: topTarget.value,\n alias: topTarget.value + randomUUID(),\n probabilityMul: parseFloat(topTarget.probability * probabilityMultipler * 100).toFixed(2),\n probability: parseFloat(topTarget.probability * 100).toFixed(2),\n total: data.length,\n sample: sample\n };\n }\n\n var bestFeature = maxGain(data, target, features);\n var remainingFeatures = _.without(features, bestFeature.element);\n var possibleValues = _.uniq(_.pluck(data, bestFeature.element));\n var featuresSample = _.countBy(data, bestFeature.element);\n //console.log('****Best Feature****');\n //console.log(bestFeature);\n var node = {\n name: bestFeature.element,\n alias: bestFeature.element + randomUUID()\n };\n \n node.type = NODE_TYPES.FEATURE;\n node.gain = parseFloat(bestFeature.gain * 100).toFixed(2);\n node.gainMul = parseFloat(bestFeature.gain * gainMultipler * 100).toFixed(2);\n node.total = data.length;\n node.sample = featuresSample;\n\n node.vals = _.map(possibleValues, function(v) {\n var _newS = data.filter(function(x) {\n return x[bestFeature.element] == v\n }); \n var child_node = {\n name: v,\n alias: v + randomUUID(),\n type: NODE_TYPES.FEATURE_VALUE\n };\n var elementProbValue = featuresSample[v]/data.length;\n child_node.probabilityMul = parseFloat(elementProbValue * probabilityMultipler * 100).toFixed(2); \n child_node.probability = parseFloat(elementProbValue * 100).toFixed(2);\n\n child_node.child = createTree(_newS, target, remainingFeatures,elementProbValue,bestFeature.gain);\n return child_node;\n });\n return node;\n }", "function forward$q(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = HALF_PI - lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - HALF_PI;\n } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - SPI : lon + SPI);\n } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = HALF_PI + lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + HALF_PI;\n } else if (lon < FORTPI && lon >= -FORTPI) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + SPI : -lon - SPI);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +HALF_PI);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +SPI);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -HALF_PI);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / SPI) * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += SPI;\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * SPI;\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}", "function P7a(){this.F=0;this.J=[];this.H=[];this.O=this.V=this.C=this.N=this.aa=this.L=0;this.ga=[]}", "function QJob (simulator, lon, lat, sog, cog, count) {\n this.simulator= simulator;\n this.lon = lon;\n this.lat = lat;\n this.cog = parseInt ((parseFloat(cog)+ (Math.random()*5)-2.5)*10)/10;\n this.sog = parseInt ((parseFloat(sog) + (Math.random()*5)-2.5)*100)/100;\n this.count = count;\n}", "constructor(params) {\n this.id = params.id;\n this.upper_length = params.upper_length;\n this.upper_width = params.upper_width;\n this.lower_length = params.lower_length;\n this.lower_width = params.lower_width;\n this.score = 0;\n this.fitness = 0;\n this.parents = [];\n this.colors = [];\n this.params = params;\n this.brain = new NeuralNetwork(4, 100, 2);\n \n\n this.init();\n }", "function MathNodeProto(){\n this.depth = function(isAlternate){\n isAlternate = (typeof isAlternate !== 'undefined' ? isAlternate : false);\n if(this.nodeDepth == null){\n if(isAlternate){this.setAlternateDepth();}\n else{this.setDepth();}\n }\n return this.nodeDepth;\n }\n this.setDepth = function(prevDepth){\n prevDepth = (typeof prevDepth !== 'undefined' ? prevDepth : -1);\n this.nodeDepth = prevDepth+1;\n for(var child in this.children()){\n this.children()[child].setDepth(this.nodeDepth);\n }\n }\n this.setAlternateDepth = function(){\n console.log(\"CALL TO ALTERNATE DEPTH\", this);\n if(!this.nodeDepth){\n this.nodeDepth = Math.max.apply(null, this.children().map(function(node){return node.setAlternateDepth()}).concat(0))+1;\n }\n return this.nodeDepth;\n }\n this.setParent = function(nodeParent){\n nodeParent = (typeof nodeParent !== 'undefined' ? nodeParent : null);\n this.parent = nodeParent;\n for(var child in this.children()){\n this.children()[child].setParent(this);\n }\n }\n \n this.calculateLeafIndex = function(prevIndex){\n prevIndex = (typeof prevIndex !== 'undefined' ? prevIndex : 0);\n var lastParamIndex = prevIndex;\n for (var child in this.children()){\n lastParamIndex = this.children()[child].calculateLeafIndex(lastParamIndex);\n }\n return lastParamIndex;\n }\n \n this.setPosition = function(){\n var posX = null;\n if(this.type == \"Number\" || this.type == \"Variable\"){\n posX = this.leafIndex*65;\n }\n else{\n for(var child in this.children()){\n this.children()[child].setPosition();\n }\n var childrenPosX = this.children().map(function(node){return node.position.x;})\n posX = arraySum(childrenPosX)/this.children().length;\n }\n var posY = this.depth()*60;\n this.position = {x:posX, y:posY};\n }\n this.root = function(){\n var parent = this;\n while(parent.parent != null){\n parent = parent.parent;\n }\n return parent;\n }\n this.replaceWith = function(node){\n var par = this.parent\n switch(par.type){\n case null: console.log(\"Error: replaceWith trace: null\", this, node);break; //If we're on an equation node. Not sure what to do here yet, if anything\n case \"Equation\": \n if(par.left === this){ par.left = node;}\n if(par.right === this){par.right = node;}\n break;\n case \"Op\":\n if(par.left === this){ par.left = node;}\n if(par.right === this){par.right = node;}\n break;\n case \"Function\":\n for (var c in par.params){\n if (this === par.params[c]){par.params[c] = node;}\n }\n break;\n case \"Parens\": break;\n if(par.child === this){ par.child = node;}\n break;\n case \"Variable\": console.log(\"Error: replaceWith trace: var\", this, node);break; //This can never happen\n case \"Number\": console.log(\"Error: replaceWith trace: num\", this, node);break; //This can never happen\n default: console.log(\"Error: replaceWith trace: default\", this, node);break;\n }\n //console.log(\"setParent in replace\", this, this.root());\n this.root().setParent(null); //reset the parent structure\n }\n this.swapWith = function(node){\n var tmp1 = this.deepCopy();\n var tmp2 = node.deepCopy();\n node.replaceWith(tmp1);\n this.replaceWith(tmp2);\n }\n}", "function PriorityQueue() {\n this.heap = [];\n this.size = 0;\n}", "function node_p(tree, context) {\n if (context.length == tree.max_depth) {\n return leaf_p(tree, context)\n }\n else {\n let [child_a, child_b] = tree.children(context)\n return avg([\n leaf_p(tree, context),\n node_p(tree, child_a) * node_p(tree, child_b)\n ])\n }\n}", "constructor() {\n // Logic\n this.mazeColumns = 18;\n this.mazeRows = 10;\n this.playerStartX = 0;\n this.playerStartY = 0;\n this.goalLocationX = this.mazeColumns - 1;\n this.goalLocationY = this.mazeRows - 1;\n this.algorithm = \"binaryTree\";\n\n // Graphics\n this.mazeSpriteX = 20;\n this.mazeSpriteY = 20;\n this.mazeSpriteHeight = 400;\n }", "function MathNodeProto(){\n this.depth = function(isAlternate){\n isAlternate = (typeof isAlternate !== 'undefined' ? isAlternate : false);\n if(this.nodeDepth == null){\n if(isAlternate){this.setAlternateDepth();}\n else{this.setDepth();}\n }\n return this.nodeDepth;\n }\n this.setDepth = function(prevDepth){\n prevDepth = (typeof prevDepth !== 'undefined' ? prevDepth : -1);\n this.nodeDepth = prevDepth+1;\n for(var child in this.children()){\n this.children()[child].setDepth(this.nodeDepth);\n }\n }\n this.setAlternateDepth = function(){\n console.log(\"CALL TO ALTERNATE DEPTH\", this);\n if(!this.nodeDepth){\n this.nodeDepth = Math.max.apply(null, this.children().map(function(node){return node.setAlternateDepth()}).concat(0))+1;\n }\n return this.nodeDepth;\n }\n this.setParent = function(nodeParent){\n nodeParent = (typeof nodeParent !== 'undefined' ? nodeParent : null);\n this.parent = nodeParent;\n for(var child in this.children()){\n this.children()[child].setParent(this);\n }\n }\n \n this.calculateLeafIndex = function(prevIndex){\n prevIndex = (typeof prevIndex !== 'undefined' ? prevIndex : 0);\n var lastParamIndex = prevIndex;\n for (var child in this.children()){\n lastParamIndex = this.children()[child].calculateLeafIndex(lastParamIndex);\n }\n return lastParamIndex;\n }\n \n this.setPosition = function(){\n var posX = null;\n if(this.type == \"Number\" || this.type == \"Variable\"){\n posX = this.leafIndex*65;\n }\n else{\n for(var child in this.children()){\n this.children()[child].setPosition();\n }\n var childrenPosX = this.children().map(function(node){return node.position.x;})\n posX = arraySum(childrenPosX)/this.children().length;\n }\n var posY = this.depth()*60;\n this.position = {x:posX, y:posY};\n }\n}", "function BPQ(capacity) {\n this.capacity = capacity;\n this.elements = [];\n}", "constructor(context) {\n // Takes in input from GeneratorModule GainNode\n this._context = context;\n this.input = new GainNode(this._context);\n this.output = new GainNode(this._context);\n \n // Nodes for delay parameter (param1)\n this._delay = new DelayNode(this._context);\n this._lfo = new OscillatorNode(this._context);\n this._feedback = new GainNode(this._context);\n this._depth = new GainNode(this._context);\n this.input.connect(this._delay).connect(this.output);\n this._lfo.connect(this._depth).connect(this._delay.delayTime);\n \n // Nodes for dry/wet parameter (param2)\n this._convolver = new ConvolverNode(this._context);\n this._wet = new GainNode(this._context);\n this._dry = new GainNode(this._context);\n \n // Nodes for panner parameter (param3)\n this._panner = new PannerNode(this._context);\n this.input.connect(this._panner).connect(this._wet).connect(this.output);\n this.input.connect(this._panner).connect(this._dry).connect(this.output);\n this._panner.panningModel = \"HRTF\";\n this._panner.positionY.value = 0.1;\n \n this._wet.gain.value = 0.5;\n this._dry.gain.value = 0.5;\n \n // Outputs to audioContext destination --> speakers\n this.input.connect(this._convolver).connect(this._wet).connect(this.output);\n this.input.connect(this._dry).connect(this.output);\n }", "function testPF (p, inc, pnc, mnc) {\n var M = parseInt(p) // Number of particles\n var P0 = inc // Initial noise covariance\n var Q = pnc // Process noise covariance\n var R = mnc // Measurement noise covariance\n var x = math.zeros(1, 100)\n var y = math.zeros(1, 100)\n x.subset(math.index(0, 0), math.multiply(math.sqrt(P0), randn(1, 1).subset(math.index(0, 0))))\n y.subset(math.index(0, 0), (h(math.matrix([[x.subset(math.index(0, 0))]])).subset(math.index(0, 0)) + math.sqrt(R) + randn(1, 1).subset(math.index(0, 0))))\n\n for (let t = 1; t < 100; t++) {\n x.subset(math.index(0, t), (f(math.matrix([[x.subset(math.index(0, t - 1))]]), (t - 1)).subset(math.index(0, 0)) + math.multiply(math.sqrt(Q), randn(1, 1).subset(math.index(0, 0)))))\n y.subset(math.index(0, t), (h(math.matrix([[x.subset(math.index(0, t))]])).subset(math.index(0, 0)) + math.multiply(math.sqrt(R), randn(1, 1).subset(math.index(0, 0)))))\n }\n\n store.commit('setMatrixTrue', x)\n var xhat = xhatPF(Q, P0, M, y)\n\n return xhat\n}", "function MinPQ() {\n this.array = [];\n}", "function TreeExpert_OG(max_depth) {\n this.BETATree= .55; this.cbetaTree= (1+this.BETATree) * Math.log(2/ (1+this.BETATree)) / (2*(1-this.BETATree)) ;\n this.tree = new CtxTree(this.BETATree, max_depth);\n this.last_y = -1; this.y = null; this.dy = null; this.p = null; this.win = null;\n\n // A mathy Helper function\n this.FTree= function(r) {\n if (r <= 0.5 - this.cbetaTree) { return 0\n } else if (r <= 0.5 + this.cbetaTree) { return .5 - (1 - 2 * r) / (4 * this.cbetaTree)\n } else { return 1 }\n };\n\n this.PREDICTION = function () {\n if (this.last_y == -1) {\n return 0.5;\n } else {\n return Math.abs(this.last_y - this.FTree( this.tree.get_pred_wt() / this.tree.get_sum_wt() ))\n }\n };\n \n\n // I added the \"freezeWeights\" parameter to schapire's code for testing stuff in the the \"data analysis\" section\n this.UPDATE = function(parm, freezeWeights=false) {\n this.p = parm >> 1; //<-- Parm is 2*comp_guess + human_guess\n this.y = parm & 1;\n this.win = (this.p==this.y)? 1:0;\n\n if (this.last_y != -1) {\n this.dy = (this.y != this.last_y)? 1:0;\n \n if( !freezeWeights ){ //<-- by default we update the weights\n this.tree.update_wt( this.dy);\n };\n this.tree.add_bit(this.dy);\n }\n this.tree.add_bit(this.win);\n this.last_y = this.y;\n return 0\n }\n \n\n \n \n}", "function AStar()\n{\n // The frontier for the IDA* search.\n this.frontier = new PriorityMinQueue();\n \n // Specifies where output info goes.\n this.htmlElement = \"\";\n \n // The starting node of the search (essential for search restarts).\n this.startNode = null;\n \n // Initialized high here\n this.nextCost = 100000;\n this.nextSet = false;\n \n}", "function pi(a,b){this.Ta=[];this.wd=a;this.Cc=b||n}", "constructor()\n {\n // Default result entries\n this.result = {children: []};\n this.entry = {resultIndex: 0, trialIndex: 0, chartType: \"\",\n correctAnswer: 0, participantAnswer:0};\n\n this.trialIndex = 0;\n }", "function tdb(){this.k=0;this.q=[];this.o=[];this.D=this.G=this.j=this.C=this.J=this.B=0;this.K=[]}", "function generateProbabilityGraph() {\n console.log('Creating probability graph nodes...');\n const subtopicGraph = {};\n\n const userHistory = generateUserHistory();\n\n for (let user in userHistory) {\n for (let i = 0; i < userHistory[user].length; i++) {\n let subtopic = userHistory[user][i];\n for (let j = i+1; j < userHistory[user].length; j++) {\n let otherSub = userHistory[user][j];\n //add for current subtopic...\n if (subtopicGraph[subtopic]) {\n subtopicGraph[subtopic].otherSubs[otherSub] ? subtopicGraph[subtopic].otherSubs[otherSub]++ : subtopicGraph[subtopic].otherSubs[otherSub] = 1;\n } else {\n subtopicGraph[subtopic] = {\n otherSubs: {},\n totalOtherViews: 0\n };\n subtopicGraph[subtopic].otherSubs[otherSub] = 1\n }\n\n //...and other subtopic\n if (subtopicGraph[otherSub]) {\n subtopicGraph[otherSub].otherSubs[subtopic] ? subtopicGraph[otherSub].otherSubs[subtopic]++ : subtopicGraph[otherSub].otherSubs[subtopic] = 1;\n } else {\n subtopicGraph[otherSub] = {\n otherSubs: {},\n totalOtherViews: 0\n };\n subtopicGraph[otherSub].otherSubs[subtopic] = 1;\n }\n\n subtopicGraph[subtopic].totalOtherViews++;\n subtopicGraph[otherSub].totalOtherViews++;\n\n }\n }\n }\n\n for (let subtopic in subtopicGraph) {\n let otherSubs = subtopicGraph[subtopic].otherSubs;\n let totalNum = subtopicGraph[subtopic].totalOtherViews;\n\n for (let otherSub in otherSubs) {\n otherSubs[otherSub] = otherSubs[otherSub] / totalNum;\n }\n\n }\n\n return subtopicGraph;\n\n}", "function PCelestial (util, pdata) {\n\n this.util = util; // PUtil object, instantated in plutonian-scene.js\n this.pdata = pdata; // PData objects, describes Hyg3 data and World data\n\n // data model for hyg3 database\n this.PCTYPES = this.pdata.PCTYPES;\n\n this.parsec = 3.26156; // light years in a parset\n\n this.dParsecUnits = 10; // scale parsec distances to the simulation\n this.dKmUnits = 2370; // 1 unit = 2370km, Pluto = 2370/2370 = 1.0\n this.dMUnits = 1000; // 1 unit = 1000 meters, Voyager 1000/1000 = 1.0\n this.dSpriteScreenSize = 1; // default size of Star sprites\n this.dSpriteScreenIndex = 4;\n this.dMaxHygDist = 100000;\n\n // SpriteManager for Hyg3 data\n this.spriteManager = null;\n this.SPRITE_INDEX_DEFAULT = 7;\n\n // WebGL\n this.maxTexSize = 2048; // minimum default for any modern videocard\n\n // SpriteManager and scene\n this.assetManager = null;\n\n // we don't do this for the luminosity classes, since they are in an Array, not an Object, and pre-sorted\n\n // stellar spectra\n this.spectra = new PSpectrum(util, pdata);\n\n // computations of planetary positions over time\n this.orrey = new POrrery();\n\n // see if WebWorker computation is available\n if (typeof(Worker) !== \"undefined\") {\n console.log(\"LOADING WORKER....................\")\n worker = new Worker('javascripts/plutonian-orrery-worker.js');\n } \n\n }", "function KDTree() {\n\tthis.root = null;\n}", "function sketch (p){\n\n const cols = GridConstants.num_cols;\n const rows = GridConstants.num_rows;\n let parentW = document.querySelector(\".sketch-container\").clientWidth;\n let parentH = document.querySelector(\".sketch-container\").clientHeight;\n let currGrid = [[]], nextGrid = [[]]\n let cellFill = \"#cc527a\", textFill = \"#D11554\", textStroke=\"#e8175d\";\n // textStroke2 = rgba(232, 23, 93, 0.4);\n let isBlasting = false, goForClear = 0;\n let generations = 0, isRandom = false;\n\n p.preload = () => {};\n\n const createCells = () => {\n for (let i=0; i<cols; i++){\n currGrid[i] = [];\n nextGrid[i] = [];\n for(let j=0; j<rows; j++){\n currGrid[i][j] = new Cell(p, i, j);\n nextGrid[i][j] = new Cell(p, i, j);\n }\n }\n };\n\n const stirChaos = () => {\n if(isBlasting == true){\n return;\n }\n for(let i=0; i<cols; i++){\n for(let j=0; j<rows; j++){\n currGrid[i][j].randomActive();\n currGrid[i][j].createRect();\n }\n }\n }\n \n // \"Props\" coming from React via P5Wrapper\n p.arbitrary = (props) => {\n console.log(props);\n if(props.data.isRandom == true && isBlasting == false){\n isRandom = true;\n stirChaos();\n } else {\n isRandom = false;\n }\n if(props.data.isClear == true){\n clearEm();\n }\n if(props.data.isRollin == true){\n isBlasting = !isBlasting;\n }\n }\n\n p.setup = () => {\n p.frameRate(15);\n p.pixelDensity(1);\n p.createCanvas(parentW,parentH);\n createCells();\n p.background(\"#e8175d\");\n p.textSize(480);\n p.textAlign(p.CENTER, p.CENTER);\n };\n\n\n\n p.draw = () => {\n if(isBlasting == true){\n judgement();\n }\n for(let i=0; i<cols; i++){\n for(let j=0; j<rows; j++){\n currGrid[i][j].setGeneration(generations);\n currGrid[i][j].createRect();\n\n }\n }\n p.textAlign(p.LEFT);\n drawText( parentW * 0.03);\n };\n\n p.mousePressed = () => {\n if(isBlasting == true){\n return;\n }\n for(let i=0; i<cols; i++){\n for(let j=0; j<rows; j++){\n currGrid[i][j].clicked(p.mouseX, p.mouseY);\n }\n }\n }\n\n const drawText = (x) => {\n if(generations != 0 && generations % 50 == 0){\n\n p.fill(241, 255, 192, 200);\n p.strokeWeight(8);\n p.text(generations, x, 200);\n\n window.setTimeout(()=>{\n p.stroke(232, 23, 93, 131)\n p.fill(232, 23, 93, 91);\n p.strokeWeight(8);\n p.text(generations, x, 200);\n },1700);\n }\n \n p.stroke(232, 23, 93, 131)\n p.fill(232, 23, 93, 91);\n p.strokeWeight(8);\n p.text(generations, x, 200);\n }\n\n const judgement = () => {\n \n for(let i=1; i<cols-1; i++){\n for( let j=1; j<rows-1; j++){\n let theLoving = 0;\n if(currGrid[i-1][j-1].getActivity() == true){theLoving++;}\n if(currGrid[i-1][j+1].getActivity() == true){theLoving++;}\n if(currGrid[i-1][j].getActivity() == true){theLoving++;}\n if(currGrid[i+1][j-1].getActivity() == true){theLoving++;}\n if(currGrid[i+1][j].getActivity() == true){theLoving++;}\n if(currGrid[i+1][j+1].getActivity() == true){theLoving++;}\n if(currGrid[i][j-1].getActivity() == true){theLoving++;}\n if(currGrid[i][j+1].getActivity() == true){theLoving++;}\n if(theLoving > 3 || theLoving < 2){\n if(currGrid[i][j].getActivity() == true){\n nextGrid[i][j].setActiveToFalse();\n }\n } else if (theLoving == 3) {\n console.log(currGrid[i][j].getActivity());\n if(currGrid[i][j].getActivity() == false){\n nextGrid[i][j].setActiveToTrue();\n }\n } else {\n nextGrid[i][j].setActivity(currGrid[i][j].getActivity());\n }\n }\n }\n\n swapJudgement();\n incrementGenerations();\n };\n\n const swapJudgement = () => {\n for(let i=0; i<cols; i++){\n for (let j = 0; j < rows; j++) {\n currGrid[i][j].setActivity(nextGrid[i][j].getActivity());\n }\n }\n }\n\n const incrementGenerations = () => {\n generations += 1;\n }\n\n const clearEm = () => {\n if(isBlasting == true){\n return;\n }\n for (let i=0; i<cols; i++){\n for (let j=0; j<rows; j++){\n currGrid[i][j].setActiveToFalse();\n }\n }\n generations = 0;\n }\n}", "function primImpl1()\n{\n // create nodes\n var n;\n // create vertices tree\n var verticesTree = [];\n\n // in this loop we should make all vertex unvisited\n // we will use variable un means unvisited\n for (var un = 0; un < this.nv; un++)\n {\n this.vert[un].visit = false;\n }\n\n // inatiat first index with first value on vert array\n verticesTree[0] = 0;\n this.vert[0].visit = true;\n\nthis.Prim_Edge[0] = {\n v: \"-\",\n u: verticesTree[0],\n w: \"-\"\n };\n\n var min = Infinity; // any number would be less than infinty\n\n for (var i = 1; i < this.nv; i++)\n {\n //get fringe vertices of the current vertext\n for (var j = 0; j < verticesTree.length; j++)\n {\n //get fringe vertices of the current vertext\n\t var incident_Edge = this.vert[verticesTree[j]].incidentEdges();\n //loop on every fringe vertex\n for (var k = 0; k < incident_Edge.length; k++)\n {\n //check every unvisited vertex to check if it can be visited in a shorter distance\n if (!this.vert[incident_Edge[k].adjVert_i].visit && incident_Edge[k].edgeWeight < min)\n {\n this.Prim_Edge[i] =\n (\n {\n v: verticesTree[j],\n u: incident_Edge[k].adjVert_i,\n w: incident_Edge[k].edgeWeight\n });\n //set the new weight as the minimum\n min = this.Prim_Edge[i].w;\n }\n }\n }\n n = this.Prim_Edge.length;\n verticesTree[verticesTree.length] = this.Prim_Edge[n - 1].u;\n\n // mark VerticesTree as visited\n this.vert[this.Prim_Edge[n - 1].u].visit = true;\n\n min = Infinity;\n }\n}", "fizzBuzzTree() {\n const newTree = new K_aryTree();\n newTree.root = JSON.parse(JSON.stringify(this.root));\n const queue = new Queue();\n queue.enqueue(newTree.root);\n\n while (queue.size) { \n let current = queue.dequeue().value; \n if (current.value % 3 === 0 && current.value % 5 === 0) {\n current.value = 'FizzBuzz';\n } else if (current.value % 3 === 0) {\n current.value = 'Fizz';\n } else if (current.value % 5 === 0) {\n current.value = 'Buzz';\n } else {\n current.value = `${current.value}`;\n }\n\n if (current.children.length) {\n for (let i = 0; i < current.children.length; i++) {\n queue.enqueue(current.children[i]);\n }\n }\n }\n return newTree;\n }", "function PSY() {\n /**\n * The dbQ stuff.\n */\n this.mask_adjust = 0.;\n /**\n * The dbQ stuff.\n */\n this.mask_adjust_short = 0.;\n /* at transition from one scalefactor band to next */\n /**\n * Band weight long scalefactor bands.\n */\n this.bo_l_weight = new_float(Encoder.SBMAX_l);\n /**\n * Band weight short scalefactor bands.\n */\n this.bo_s_weight = new_float(Encoder.SBMAX_s);\n }", "function PSY() {\n /**\n * The dbQ stuff.\n */\n this.mask_adjust = 0.;\n /**\n * The dbQ stuff.\n */\n this.mask_adjust_short = 0.;\n /* at transition from one scalefactor band to next */\n /**\n * Band weight long scalefactor bands.\n */\n this.bo_l_weight = new_float(Encoder.SBMAX_l);\n /**\n * Band weight short scalefactor bands.\n */\n this.bo_s_weight = new_float(Encoder.SBMAX_s);\n }", "function PQueue() {\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n\n // REPLACE\n this.queue = queue;\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n };\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n };\n\n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n };\n\n\n this.each = function (fn) {\n var i;\n for (i = offset; i < queue.length; i++) {\n fn(queue[i]);\n }\n };\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n };\n\n this.remove = function (item) {\n var index = queue.indexOf(item, offset);\n if (index === -1) {\n console.error('could not find item in queue to remove');\n } else {\n queue = queue.slice(offset, index).concat(queue.slice(index+1));\n offset = 0;\n }\n };\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n };\n }", "robot_rrt_planner_init() {\n\n\t\t// make sure the rrt iterations are not running faster than animation update\n\t\tthis.robot.cur_time = Date.now();\n\n\t\t// flag to continue rt iterations\n\t\tthis.robot.rrt_iterate = true;\n\t\tthis.robot.rrt_iter_count = 0;\n\t\t// initialize this.robot.connecting to false for (RRT-Connect)\n\t\tthis.robot.connecting = false;\n\t\t// generating path from q_init to _q_goal in T_ab\n\t\tthis.robot.generatingPathRRTConnect = false;\n\n\t\t// rrt step size\n\t\tthis.robot.eps = 0.4;\n\n\t\t// rrt* neighborhood size\n\t\tthis.robot.neighborhood = this.robot.eps * 2;\n\n\t\tthis.robot.thresh_rand = 0.4;\n\n\t\t// deal with margin when generate random \n\t\tthis.robot.margin_dist = 3;\n\n\t\tthis.robot.q_names = {}; // store mapping between joint names and q DOFs\n\t\tthis.robot.q_index = []; // store mapping between joint names and q DOFs\n\n\t\tthis.robot.rrt_alg = 2; // 0: basic rrt (OPTIONAL), 1: rrtConnect (REQUIRED), 2. rrtStar, 3. DFS\n\n\t\tthis.robot.search_result = \"starting\";\n\n\t\tthis.robot.search_stack = [];\n\n\t\t// starting base config\n\t\t// form configuration from base location and joint angles\n\t\tthis.robot.q_start_config = [\n\t\t\tthis.robot.origin.xyz[0],\n\t\t\tthis.robot.origin.xyz[1],\n\t\t\tthis.robot.origin.xyz[2],\n\t\t\tthis.robot.origin.rpy[0],\n\t\t\tthis.robot.origin.rpy[1],\n\t\t\tthis.robot.origin.rpy[2]\n\t\t];\n\n\t\tfor (const x in this.robot.joints) {\n\t\t\t// store mapping between joint names and q DOFs\n\t\t\t\t// accounts for base indices\n\t\t\tthis.robot.q_names[x] = this.robot.q_start_config.length;\n\t\t\tthis.robot.q_index[this.robot.q_start_config.length] = x;\n\t\t\tthis.robot.q_start_config = this.robot.q_start_config.concat(this.robot.joints[x].angle);\n\t\t}\n\n\t\t// set goal configuration as the zero configuration\n\t\tlet i; \n\t\tthis.robot.q_goal_config = new Array(this.robot.q_start_config.length);\n\t\tfor (i=0;i<this.robot.q_goal_config.length;i++) this.robot.q_goal_config[i] = 0;\n\n\t\tif (this.robot.rrt_alg === 1) { \n\t\t\t// initialize search tree from start configurations (RRT-based algorithms)\n\t\t\tthis.robot.T_a = this.initRRTConnect(this.robot.q_start_config);\n\t\t\t// also initialize search tree from goal configuration (RRT-Connect)\n\t\t\tthis.robot.T_b = this.initRRTConnect(this.robot.q_goal_config);\n\n\t\t\tthis.robot.q_init_node = this.robot.T_a.vertices[0];\n\t\t\tthis.robot.q_goal_node = this.robot.T_b.vertices[0];\n\t\t} else if (this.robot.rrt_alg === 2) { \n\t\t\t\n\t\t\tthis.robot.T = this.initRRTConnect(this.robot.q_start_config);\n\t\t}\n\t}", "function newpv(p, q) {\n var answer = p + q;\n if (p + q > 255) print(\"error: answer too big\");\n return answer;\n}", "P() {\n if (isNumber(this.next)) {\n this.operands.push(new Num(this.next));\n this.consume();\n }\n else if (this.next === '(') {\n this.consume();\n this.operators.push(sentinel);\n this.E();\n this.expect(')');\n this.operators.pop();\n }\n else if (unaryOperators[this.next]) {\n this.pushOperator(unary(this.next));\n this.consume();\n this.P();\n }\n else if (isVariable(this.next)) {\n const name = this.next;\n this.consume();\n\n if (this.next === '(') {\n const fn = new Func(name, 0)\n this.pushOperator(fn);\n this.consume();\n this.operators.push(sentinel);\n this.F(fn);\n this.expect(')');\n this.operators.pop();\n }\n else {\n this.operands.push(new Var(name));\n }\n }\n else error('Invalid syntax at \"' + this.next + '\"');\n }", "function makeParabolicPTgraph(tMax, positionMax, acceleration, initialVelocity, initialPosition) {\n if (acceleration === undefined) {acceleration = 1;}\n if (initialVelocity === undefined) {initialVelocity = 0;}\n if (initialPosition === undefined) {initialPosition = 0;}\n let positionFunction = ((t) => {return 0.5 * acceleration * t * t + initialVelocity * t + initialPosition;});\n if (positionMax === undefined) {positionMax = positionFunction(tMax);}\n\n let myGraph = new QuantitativeGraph(0,tMax,0,positionMax,1);\n myGraph.labelAxes('time (s)', 'position (m)');\n myGraph.addReferenceArray([tMax],[positionMax]);\n myGraph.addFunctionGraph(positionFunction, 0, tMax);\n\n return myGraph\n}", "constructor() {\n this.root = null\n this.nodes = [];\n this.output = \"\";\n this.charCodes = { \"codes\": [] };\n }", "function initTree() {\n console.log('initTree');\n gTree = new BinarySearchTree();\n}", "function pu() { this._penup = true; return this;}", "function fillProfQueue(){\r\n if(maxProfId != null){\r\n var c = Math.floor(Math.random() * maxProfId) + 1;\r\n profQ.push(c);\r\n }\r\n}", "function _generateKeyPair(state, options, callback) {\n\t if(typeof options === 'function') {\n\t callback = options;\n\t options = {};\n\t }\n\t options = options || {};\n\n\t var opts = {\n\t algorithm: {\n\t name: options.algorithm || 'PRIMEINC',\n\t options: {\n\t workers: options.workers || 2,\n\t workLoad: options.workLoad || 100,\n\t workerScript: options.workerScript\n\t }\n\t }\n\t };\n\t if('prng' in options) {\n\t opts.prng = options.prng;\n\t }\n\n\t generate();\n\n\t function generate() {\n\t // find p and then q (done in series to simplify)\n\t getPrime(state.pBits, function(err, num) {\n\t if(err) {\n\t return callback(err);\n\t }\n\t state.p = num;\n\t if(state.q !== null) {\n\t return finish(err, state.q);\n\t }\n\t getPrime(state.qBits, finish);\n\t });\n\t }\n\n\t function getPrime(bits, callback) {\n\t forge.prime.generateProbablePrime(bits, opts, callback);\n\t }\n\n\t function finish(err, num) {\n\t if(err) {\n\t return callback(err);\n\t }\n\n\t // set q\n\t state.q = num;\n\n\t // ensure p is larger than q (swap them if not)\n\t if(state.p.compareTo(state.q) < 0) {\n\t var tmp = state.p;\n\t state.p = state.q;\n\t state.q = tmp;\n\t }\n\n\t // ensure p is coprime with e\n\t if(state.p.subtract(BigInteger$3.ONE).gcd(state.e)\n\t .compareTo(BigInteger$3.ONE) !== 0) {\n\t state.p = null;\n\t generate();\n\t return;\n\t }\n\n\t // ensure q is coprime with e\n\t if(state.q.subtract(BigInteger$3.ONE).gcd(state.e)\n\t .compareTo(BigInteger$3.ONE) !== 0) {\n\t state.q = null;\n\t getPrime(state.qBits, finish);\n\t return;\n\t }\n\n\t // compute phi: (p - 1)(q - 1) (Euler's totient function)\n\t state.p1 = state.p.subtract(BigInteger$3.ONE);\n\t state.q1 = state.q.subtract(BigInteger$3.ONE);\n\t state.phi = state.p1.multiply(state.q1);\n\n\t // ensure e and phi are coprime\n\t if(state.phi.gcd(state.e).compareTo(BigInteger$3.ONE) !== 0) {\n\t // phi and e aren't coprime, so generate a new p and q\n\t state.p = state.q = null;\n\t generate();\n\t return;\n\t }\n\n\t // create n, ensure n is has the right number of bits\n\t state.n = state.p.multiply(state.q);\n\t if(state.n.bitLength() !== state.bits) {\n\t // failed, get new q\n\t state.q = null;\n\t getPrime(state.qBits, finish);\n\t return;\n\t }\n\n\t // set keys\n\t var d = state.e.modInverse(state.phi);\n\t state.keys = {\n\t privateKey: pki$1.rsa.setPrivateKey(\n\t state.n, state.e, d, state.p, state.q,\n\t d.mod(state.p1), d.mod(state.q1),\n\t state.q.modInverse(state.p)),\n\t publicKey: pki$1.rsa.setPublicKey(state.n, state.e)\n\t };\n\n\t callback(null, state.keys);\n\t }\n\t}", "function Node(x,y,G,i,j){\r\n // Parent node of this one \r\n this.parent = -1;\r\n // Location \r\n this.loc = {x:x,y:y};\r\n // Our G score value \r\n this.G = 0;\r\n // Our heuristic value \r\n this.H = 0;\r\n // indexs\r\n this.i = i;\r\n this.j = j;\r\n}", "constructor(\n /// The type of the top node.\n type, \n /// This node's child nodes.\n children, \n /// The positions (offsets relative to the start of this tree) of\n /// the children.\n positions, \n /// The total length of this tree\n length, \n /// Per-node [node props](#common.NodeProp) to associate with this node.\n props) {\n this.type = type;\n this.children = children;\n this.positions = positions;\n this.length = length;\n /// @internal\n this.props = null;\n if (props && props.length) {\n this.props = Object.create(null);\n for (let [prop, value] of props)\n this.props[typeof prop == \"number\" ? prop : prop.id] = value;\n }\n }", "function QuadTree()\n{\n this.level = 0;\n this.position = new Vec2();\n this.size = new Vec2();\n\n /**\n * Pool that is used for all internal quad trees.\n */\n this.pool = new ObjectPool(QuadTree);\n\n /**\n * @type {Array.<QuadTree>}\n */\n this.nodes = [];\n\n /**\n * @type {Array.<Entity>}\n */\n this.entities = [];\n}", "function PlanNode(predecessor, operator, subsequence, total_query_time) {\n this.predecessor = predecessor; // might be an array if this is a Union node\n this.operator = operator; // object from the actual plan\n this.subsequence = subsequence; // for parallel ops, arrays of plan nodes done in parallel\n if (total_query_time && operator['#time_absolute'])\n this.time_percent = Math.round(operator['#time_absolute']*1000/total_query_time)/10;\n }", "function Pi_hpq(p, q)\n{\n\tvar pi = Math.PI;\n\tvar pip = PiOverNSafe(p);\n\tvar piq = PiOverNSafe(q);\n\n\tvar temp = Math.pow(Math.cos(pip), 2) + Math.pow(Math.cos(piq), 2);\n\tvar hab = pi / Math.acos(Math.sqrt(temp));\n\n\tvar pi_hpq = pi / hab;\n\treturn pi_hpq;\n}", "function pp() {\n\tthis.shift = ['\\n']; // array of shifts\n\tthis.step = ' ', // 2 spaces\n\t\tmaxdeep = 100, // nesting level\n\t\tix = 0;\n\n\t// initialize array with shifts //\n\tfor(ix=0;ix<maxdeep;ix++){\n\t\tthis.shift.push(this.shift[ix]+this.step); \n\t}\n\n}", "constructor() {\n this.g = new Generators\n // Generator for Prime numbers\n this.allPrimes = function* allPrimes(startAt = 0) {\n for (let x of this.g.map(this.g.nat(startAt), x => { return {\n isPrime: this.isPrime(x),\n value: x\n }})) {\n if (x.isPrime) yield x.value\n }\n }\n\n this.randomPrimes = function* randomPrimes() {\n for (let x of this.g.map(this.g.rand(2999999999999999), x => [this.isPrime(x), x])) {\n if (x[0]) yield x[1]\n }\n }\n\n this.randomComposite = function* randomComposite() {\n const primes = this.randomPrimes(99999999999999) \n for (let x of primes) {\n const next = primes.next().value\n yield {\n composite: x*next,\n prime1: x,\n prime2: next,\n proof: ((x*next)/ x == next) ? \n `composite ${x*next} is composed of ${x}, and ${next}.[${(x*next)/x == next}]` :\n 'Cannot Prove. Precision Lost'\n }\n }\n }\n\n // Calculate if number is prime\n this.isPrime = function isPrime(toFactor) {\n const max = Math.ceil(Math.sqrt(toFactor + 1))\n if (toFactor == 1 || toFactor == 2 || toFactor == 3 || toFactor == 5) return true // Shortcut for easy values\n if (toFactor % 2 == 0 || toFactor % 3 == 0|| toFactor % 5 == 0) return false // Completely remove need to process evens, divisible by 3, and divisble by 5\n return this.g.forall(this.g.range(6, max + 1), x => toFactor % x)\n }\n }", "function main() {\n var P_temp = readLine().split(' ');\n var P = parseInt(P_temp[0]);\n var Q = parseInt(P_temp[1]);\n var N = 0;\n var M = 0;\n var E = []\n\tif (Q == 2) {\n\t // 2 is special\n\t // make star patterns!\n\t while ( P > 0 ) {\n\t\t//add a hub and three spars\n\t\tvar hub = N;\n var spars = 0\n\t\tN++;\n\t\tE.push([hub,N]);\n\t\tN++;\n\t\tM++;\n\t\tspars++;\n\t\tE.push([hub,N]);\n\t\tN++;\n\t\tM++;\n\t\tspars++;\n\t\tE.push([hub,N]);\n\t\tN++;\n\t\tM++;\n\t\tspars++;\n\t\tP--;\n\t\t//adding an additional spar makes spars*(spars-1)/2 new triplets\n\t\twhile ((spars*(spars-1)/2) <= P) {\n\t\t P -= (spars*(spars-1)/2);\n\t\t E.push([hub,N]);\n\t\t N++;\n\t\t M++;\n\t\t spars++;\n\t\t}\n\t }\n\t} else {\n\t // we make loop and nub patterns!\n\t while ( P>0) {\n\t\t//make a new loop of size 3(q-2)\n var start = N;\n N++;\n\t\tfor (var j=1; j<3*(Q-2); j++) {\n E.push([start+j-1,start+j]);\n M++;\n N++;\n\t\t}\n E.push([start+(3*(Q-2))-1,start]);\n M++;\n\t\t// now add nubs\n\t\tvar nub = 0;\n\t\twhile (P>0 && nub < Q-2) {\n\t\t var spars_0 = 0;\n\t\t var spars_1 = 0;\n\t\t var spars_2 = 0;\n\t\t while (P >= (spars_0+1)*(spars_1+1)*(spars_2+1)) {\n // add to all three\n E.push([start+nub,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_0++;\n E.push([start+nub+Q-2,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_1++;\n E.push([start+nub+Q+Q-4,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_2++;\n\t\t }\n\t\t while (P >= (spars_0+1)*(spars_1+1)*(spars_2)) {\n // add to two\n E.push([start+nub,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_0++;\n E.push([start+nub+Q-2,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_1++;\n\t\t }\n\t\t while (P >= (spars_0+1)*(spars_1)*(spars_2)) {\n // add to one\n E.push([start+nub,N]);\n\t\t\tN++;\n\t\t\tM++;\n\t\t\tspars_0++;\n\t\t }\n\t\t P -= spars_0*spars_1*spars_2\n\t\t nub++;\n\t\t}\n\t }\n\t}\n console.log([N,M].join(' '));\n for(var i=0; i<M; i++) {\n\tconsole.log(E[i].map(x=>x+1).join(' '));\n }\n}", "function RubixNode(state, parent, face, rots)\n{\n this.init(state,parent,face, rots); \n}", "function QuadTree(pLevel, pBounds)\n{\n\tvar MAX_OBJECTS = 10;\n\tvar MAX_LEVELS = 5;\n\n\tvar level;\n\tvar objects;\n\tvar bounds;\n\tvar nodes;\n\n\t/* Stuff set by the 'constructor' */\n\tthis.init = function(){\n\t\tlevel = pLevel;\n\t\tobjects = new Array();\n\t\tbounds = pBounds;\n\t\tnodes = new Array(4);\n\t};\n\n\t/* Clears the quadtree */\n\tthis.clear = function(){\n\t\tobjects.clear();\n\n\t\tfor(var i = 0; i < nodes.length; i++){\n\t\t\tif(nodes[i] != null){\n\t\t\t\tnodes[i].clear();\n\t\t\t\tnodes[i] = null;\n\t\t\t}\n\t\t}\n\t};\n\n\t/* Split the quadtree */\n\tthis.split = function(){\n\t\tvar subWidth = (bounds.getWidth() / 2);\n\t\tvar subHeight = (bounds.getHeight() / 2);\n\t\tvar x = bounds.getX();\n\t\tvar y = bounds.getY();\n\n\t\tnodes[0] = new QuadTree(level + 1, new Rectangle(x + subWidth, y, subWidth, subHeight));\n\t\tnodes[1] = new QuadTree(level + 1, new Rectangle(x, y, subWidth, subHeight));\n\t\tnodes[2] = new QuadTree(level + 1, new Rectangle(x, y + subHeight, subWidth, subHeight));\n\t\tnodes[3] = new QuadTree(level + 1, new Rectangle(x + subWidth, y + subHeight, subWidth, subHeight)); \n\t};\n\n\t/* Get the index of the parent node */\n\tthis.getIndex = function(pRect){\n\t\tvar index = -1;\n\t\tvar verticalMidpoint = bounds.getX() + (bounds.getWidth() / 2);\n\t\tvar horizontalMidpoint = bounds.getY() + (bounds.getHeight() / 2);\n\n\t\tvar topQuad = (pRect.getY() < horizontalMidpoint && pRect.getHeight() < horizontalMidpoint);\n\t\tvar bottomQuad = (pRect.getY() > horizontalMidpoint);\n\n\t\tif(pRect.getX() < verticalMidpoint && pRect.getX() + pRect.getWidth() < verticalMidpoint){\n\t\t\tif(topQuad){\n\t\t\t\tindex = 1;\n\t\t\t}else if(bottomQuad){\n\t\t\t\tindex = 2;\n\t\t\t}\n\t\t}else if(pRect.getX() > verticalMidpoint){\n\t\t\tif(topQuad){\n\t\t\t\tindex = 0;\n\t\t\t}else if(bottomQuad){\n\t\t\t\tindex = 3;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t};\n\n\t/* Insert objects into the QuadTree */\n\tthis.insert = function(pRect){\n\t\tif(nodes[0] != null){\n\t\t\tvar index = getIndex(pRect);\n\t\t\tif(index != -1){\n\t\t\t\tnodes[index].insert(pRect);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tobjects.push(pRect);\n\t\tif(objects.length > MAX_OBJECTS && level < MAX_LEVELS){\n\t\t\tif(nodes[0] == null){\n\t\t\t\tthis.split();\t//this refers to this.insert() ?\n\t\t\t}\n\t\t\tvar i = 0;\n\t\t\twhile(i < objects.length){\n\t\t\t\tvar index = getIndex(objects[i]);\n\t\t\t\tif(index != -1){\n\t\t\t\t\tnodes[index].insert(objects.splice(i,1)[0]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/* Return all objects */\n\tthis.retrieve = function(returnObjects, pRect){\n\t\tvar index = getIndex(pRect);\n\t\tif(index != -1 && nodes[0] != null){\n\t\t\tnodes[index].retrieve(returnObjects,pRect);\n\t\t}\n\t\treturnObjects.push(objects);\n\n\t\treturn returnObjects;\n\t};\n\n\t/* Constructor call */\n\tthis.init();\n}", "function Qa(a) {\n this.q = RegExp(\" \");\n this.u = \"\";\n this.j = new p();\n this.n = \"\";\n this.g = new p();\n this.m = new p();\n this.h = !0;\n this.o = this.k = this.w = !1;\n this.r = M.a();\n this.l = 0;\n this.b = new p();\n this.s = !1;\n this.i = \"\";\n this.a = new p();\n this.d = [];\n this.v = a;\n this.e = Ra(this, this.v);\n }", "constructor(P_props)\n {\n super (P_props);\n }", "function Steg(ppm) {\n this.ppm = ppm;\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}", "function newPhase() {\n\touter.clear(); q.clear(); link.fill(0); state.fill(0);\n\troots.clear();\n\tfor (let k = pmax; k >= 0; k--) {\n\t\tsteps++;\n\t\tif (!first[k]) continue;\n\t\tfor (let u = first[k]; u; u = plists.next(u)) {\n\t\t\tbase[u] = u; steps++;\n\t\t\tif (!match.at(u)) {\n\t\t\t\tstate[u] = 1;\n\t\t\t\tif (k > 0) roots.enq(u);\n\t\t\t}\n\t\t}\n\t}\n\tlet r = 0;\n\twhile (q.empty() && !roots.empty()) {\n\t\tr = roots.deq(); add2q(r);\n\t}\n\treturn r;\n}", "function EqnLeaf()\n{\n // type - operator, number, id, variable - defined and wont change\n this.leafType = 0;\n this.leafValue = null;\n}", "function PercussionPresets(){\n\n\tthis.input = audioCtx.createGain();\n\tthis.output = audioCtx.createGain();\n\tthis.startArray = [];\n\n}", "function QuadTree(X, Y, Width, Height, Parent) {\n if (typeof Parent === \"undefined\") { Parent = null; }\n _super.call(this, X, Y, Width, Height);\n //console.log('-------- QuadTree',X,Y,Width,Height);\n this._headA = this._tailA = new Phaser.LinkedList();\n this._headB = this._tailB = new Phaser.LinkedList();\n //Copy the parent's children (if there are any)\n if(Parent != null) {\n //console.log('Parent not null');\n var iterator;\n var ot;\n if(Parent._headA.object != null) {\n iterator = Parent._headA;\n //console.log('iterator set to parent headA');\n while(iterator != null) {\n if(this._tailA.object != null) {\n ot = this._tailA;\n this._tailA = new Phaser.LinkedList();\n ot.next = this._tailA;\n }\n this._tailA.object = iterator.object;\n iterator = iterator.next;\n }\n }\n if(Parent._headB.object != null) {\n iterator = Parent._headB;\n //console.log('iterator set to parent headB');\n while(iterator != null) {\n if(this._tailB.object != null) {\n ot = this._tailB;\n this._tailB = new Phaser.LinkedList();\n ot.next = this._tailB;\n }\n this._tailB.object = iterator.object;\n iterator = iterator.next;\n }\n }\n } else {\n QuadTree._min = (this.width + this.height) / (2 * QuadTree.divisions);\n }\n this._canSubdivide = (this.width > QuadTree._min) || (this.height > QuadTree._min);\n //console.log('canSubdivided', this._canSubdivide);\n //Set up comparison/sort helpers\n this._northWestTree = null;\n this._northEastTree = null;\n this._southEastTree = null;\n this._southWestTree = null;\n this._leftEdge = this.x;\n this._rightEdge = this.x + this.width;\n this._halfWidth = this.width / 2;\n this._midpointX = this._leftEdge + this._halfWidth;\n this._topEdge = this.y;\n this._bottomEdge = this.y + this.height;\n this._halfHeight = this.height / 2;\n this._midpointY = this._topEdge + this._halfHeight;\n }", "function buildDecisionTree() {\n //Building option pathway for Scenario 1\n var startNode = new TreeNode(\"root\", null);\n var neutralOption = new TreeNode(\"OK, join us next time if you can!\", scenario1Neutral);\n var probingOption = new TreeNode(\"What do you have on?\", scenario1Probing);\n startNode.descendants.push(neutralOption);\n startNode.descendants.push(probingOption);\n probingOption.descendants.push(new TreeNode(\"Alright, hope everything is ok, let us know if you need anything\", scenario1ProbingEnd));\n probingOption.descendants.push(new TreeNode(\"[Don't probe]\", scenario1ProbingEnd));\n\n current_decision = startNode;\n}", "function Qd() {\n this.m = [];\n this.g = [];\n this.s = [];\n this.l = {};\n this.h = null;\n this.i = []\n }", "function tree_p(tree) {\n return node_p(tree, '')\n}" ]
[ "0.60794765", "0.57156295", "0.55959386", "0.55622625", "0.5356073", "0.5319002", "0.5309989", "0.52788013", "0.52269065", "0.52200717", "0.520604", "0.5194858", "0.515756", "0.51566315", "0.51359355", "0.5121302", "0.5121302", "0.5121302", "0.5074427", "0.498923", "0.49823305", "0.49181426", "0.491281", "0.49003252", "0.48748225", "0.48748225", "0.48748225", "0.48748225", "0.48748225", "0.48748225", "0.485803", "0.48499024", "0.4828787", "0.48168927", "0.48146814", "0.48022562", "0.48000586", "0.47837403", "0.47604296", "0.47577035", "0.47455183", "0.47395432", "0.47378603", "0.47223738", "0.47128406", "0.47120005", "0.4704387", "0.47034895", "0.46953857", "0.468848", "0.4677027", "0.46633017", "0.46592677", "0.46427795", "0.46312055", "0.46275622", "0.46265212", "0.4625932", "0.46092457", "0.46084204", "0.46060088", "0.46060088", "0.45979953", "0.45778397", "0.45709622", "0.45668262", "0.45579988", "0.45575222", "0.45525828", "0.45502073", "0.4549532", "0.4548215", "0.45474985", "0.4541896", "0.45413467", "0.45389736", "0.45364392", "0.4535778", "0.45277306", "0.45205793", "0.45094684", "0.45077914", "0.4504852", "0.45038927", "0.4502943", "0.44912544", "0.44912544", "0.44912544", "0.44912544", "0.44912544", "0.44912544", "0.44912544", "0.44912544", "0.44911984", "0.44866565", "0.44859758", "0.4479792", "0.44788867", "0.44786817", "0.4476492" ]
0.6848942
0
Checks if user exists
userExists(user) { return this.users.indexOf(user)!==-1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfUserExists (callback) { \n connection.query(`SELECT * FROM user WHERE userid=${connection.escape(id)}`, (err, res)=>{\n if (err) {message.channel.send(embeds.errorOccured(message, err));}\n callback(res[0] !== undefined); \n });\n }", "doesUserExist(uname){\n\t\treturn db.one(`SELECT * FROM user_id WHERE uname=$1`, uname);\n\t}", "function doesUserExist(req, res, callback) {\n var user = req.body.username,\n pass = req.body.password;\n\n User.find({\n email: user\n }).count(function (err, count) {\n if (count > 0) {\n //username already exists\n console.log(\"Signup Error: \" + user + \" already exists\");\n res.jsonp({\n message: \"This user name already exists\"\n });\n } else {\n //username does not exist, create it\n console.log(\"User does not exist\");\n callback(req);\n res.jsonp({\n message: \"The user has been added\"\n });\n }\n });\n}", "async function checkIfUserExist () {\n try {\n const user = await fetch('https://mern-finalproj-api.herokuapp.com/Help4U/user/check', {\n method: 'POST',\n headers: new Headers({\n 'Content-Type': 'application/json; charset=utf-8'\n }),\n mode: 'cors',\n body: JSON.stringify({ google_id: response.googleId })\n\n }).then(user => user.json());\n\n if (user.status === 200 && user.data !== null) {\n // update admin access token - only for admin API requests\n if (user.data.admin == true) {\n updateAdminAccessToken(response);\n }\n\n setSession(response, user.data);\n history.replace('/home');\n }\n\n // user not exist, signup with google account\n if (user.status === 200 && user.data === null) {\n history.replace('/signup');\n }\n if (user.status === 500) {\n history.replace('/error');\n }\n } catch (e) {\n history.replace('/error');\n }\n }", "function userExists (username, db = connection) {\n return db('users')\n .count('id as n')\n .where('username', username)\n .then((count) => {\n return count[0].n > 0\n })\n}", "function checkIfUserExists(name){\n return Model.userExist(name);\n}", "function isUserExisting(username) {\n return new Promise(async (resolve, reject) => {\n try {\n if(!username) {\n throw new IncompleteDataError('The username is required to check if the user exists.');\n }\n\n const queryString = `SELECT COUNT(username) \n FROM vze_user \n WHERE username='${username}'`;\n\n const data = await helper.executeQuery(queryString);\n let isUserExisting = (data['count'] > 0);\n\n console.log('User \\'%s\\' exists: ', username, isUserExisting); \n resolve(isUserExisting);\n } catch(error) {\n reject(error);\n };\n });\n}", "async function userExist(user_id){\r\n const existing_in_users_table = await DButils.execQuery(`SELECT * FROM dbo.Users WHERE userId='${user_id}'`);\r\n if (existing_in_users_table.length==0){\r\n return false\r\n }\r\n return true\r\n}", "function doesUserExist(username, cb) {\n const query = `SELECT * FROM users WHERE username = '${username}'`;\n let sqlCallback = data => {\n //calculate if user exists or assign null if results is null\n const doesUserExist =\n data.results !== null ? (data.results.length > 0 ? true : false) : null;\n //check if there are any users with this username and return the appropriate value\n cb(data.error, doesUserExist);\n };\n connection.query(query, sqlCallback);\n}", "function userExists (userName, db = connection) {\n return db('users')\n .count('id as n')\n .where('user_name', userName)\n .then(count => {\n return count[0].n > 0\n })\n}", "async function checkUserExists(req, res, next) {\n try {\n const user = await UsersService.getById(\n req.app.get(\"db\"),\n req.params.user_id\n );\n\n if (!user)\n return res.status(404).json({\n error: `User doesn't exist`\n });\n\n res.user = user;\n next();\n } catch (error) {\n next(error);\n }\n}", "function checkIfUserExists(userId, response) {\n var usersRef = database.ref(USERS_LOCATION);\n usersRef.child(userId).once('value', function (snapshot) {\n var exists = (snapshot.val() !== null);\n //console.log(exists);\n userExistsCallback(exists, response);\n });\n }", "function userExists(username){\n\treturn username.toLowerCase() == 'admin';\n}", "function exists(user) {\n\tvar flag_e =false;\n\tfirebase.database().ref('users/' + user).once('value', function(snap) {\n\t\tif(snap.exists()){\n\t\t\tflag_e = true;\n\t\t}\n\t});\n\treturn flag_e;\n}", "async function checkUserExists(userRef) {\n // grab the user doc\n const userDoc = await userRef.get();\n // return true/false\n return userDoc.exists;\n}", "function userExists(username, callback){\n db.get(\"SELECT * FROM users WHERE username=?\",[username],function(err,res){\n if (callback) callback(res);\n if (res === undefined){\n console.log('dis undefined');\n return false\n }\n else return true;\n })\n}", "function checkIfUsernameExist(req, res, next) {\n models.user.findOne({\n where: {\n 'username':req.body.username\n }\n }).then( ( user) => {\n if (user) {\n res.status(400).send({error: \"The username is in use.\"});\n }\n });\n next();\n }", "exists(req, res) {\n let id = req.params.id;\n\n this.userdao.exists(id)\n .then(this.common.existsSuccess(res))\n .catch(this.common.findError(res));\n }", "async exists(email) {\n\n // parameter email doesn't exist\n if (!this._parameterExists(email)) {\n return false;\n }\n\n try {\n // user exists\n if (await this._count('users', 'email', { email }) === 1) {\n return true;\n }\n\n // user doesn't exist\n return false;\n } catch (err) {\n this.logger.error(err);\n return false;\n }\n }", "function tenantExists(tenant, callback) {\n // Create URL for user-manager request\n var userExistsUrl = userURL + '/pool/' + tenant.userName;\n\n // see if the user already exists\n request({\n url: userExistsUrl,\n method: \"GET\",\n json: true,\n headers: {\"content-type\": \"application/json\"}\n }, function(error, response, body) {\n if (error) {\n callback(false);\n } else if ((response != null) && (response.statusCode == 400)) {\n callback(false);\n } else {\n if (body.userName === tenant.userName) {\n callback(true);\n } else {\n callback(false);\n }\n }\n });\n}", "async function userExists(usr, pwd) {\n return await userModel.findOne({usuario: usr, password: pwd})\n}", "function userExists(username) {\n console.log(\"Search if user exists\", username)\n return findUserByName(username)\n .then(() => Promise.resolve(true))\n .catch(err => {\n if (err === exports.ERR_NOT_FOUND) {\n return Promise.resolve(false)\n }\n return Promise.reject(err)\n })\n}", "function checkUserExists(req, res, next){\r\n if(!req.body.name){\r\n return res.status(400).json({ error: 'User name is required'});\r\n }\r\n return next();\r\n}", "function doesUserExist (userList) {\n if (userList.data.length === 0) {\n throw new Error('no such user exists');\n }\n}", "hasUser(userId) {\n const result = this.data[userId];\n if (!result) return false;\n return true\n }", "function userExists(username, callback) {\n pool.getConnection(function(err, connection) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n connection.query('SELECT * FROM `User` WHERE `username` = ? LIMIT 1', [username], function(err, rows) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n // Release the connection\n connection.release();\n\n // Run callback\n callback(null, rows.length>0);\n });\n });\n}", "function existingUser(value, callback) {\n User.findOne({ '_id': value }, function (err, user){\n if (user){\n callback(true);\n } else {\n callback(false);\n }\n });\n}", "function doesUserExist(username) {\n\n return User.find({'username': username}, 'username password',{})\n // function (err, users) {\n // let doesUserExist = users !== null ? users.length > 0 : null;\n // if (err)\n // console.log(err+\" error\");\n // return reject(err);\n // console.log(doesUserExist+\" exists\");\n // resolve (doesUserExist)\n // });\n}", "function doesExist(newUser){\n\tuserObjects.forEach(user => {\n\t\tif(user.username === newUser.username){\n\t\t\treturn true\n\t\t}\n\t})\n\treturn false;\n}", "static async exists(email){\n let user = await User.findOne({where: {email: email}});\n return user !== null\n }", "function checkUserExists(username) {\n return new Promise((resolve, reject) => {\n User.findOne({\n where: {\n username: username\n }\n }).then(user => {\n if (user === null) {\n reject(new Error('no user exists by this name'));\n } else {\n resolve(user);\n }\n }).catch(err => {\n console.log(\"checkUserExists\", err);\n })\n });\n}", "function user_exists(email){\n\tvar user_array = get_user_array();\n\tif(user_array.length > 0){\n\t\tfor(var i=0; i<user_array.length; ++i){\n\t\t\tif(user_array[i].email == email) return true;\n\t\t}\n\t}\n\treturn false;\n}", "function doesUserExist(userName){\n\tvar logonFile = fs.readFileSync(USER_PATH + USER_INFO_FILE_NAME);\n\tvar users = JSON.parse(logonFile);\n\tvar exist = false;\n\n\tusers.forEach(function(user){\n\t\tif (user.userName.localeCompare(userName) === 0){\n\t\t\texist = true;\n\t\t}\n\t});\n\treturn exist;\n}", "function userExists(email){\n for(user in users){\n if(users[user].email === email){\n return true;\n }\n }\n return false;\n}", "async getExistingUser () {\n\t\tconst { email } = this.request.body.user;\n\t\tif (!email) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'user.email' });\n\t\t}\n\t\tconst users = await this.data.users.getByQuery(\n\t\t\t{\n\t\t\t\tsearchableEmail: decodeURIComponent(email).toLowerCase()\n\t\t\t},\n\t\t\t{\n\t\t\t\thint: UserIndexes.bySearchableEmail\n\t\t\t}\n\t\t);\n\t\tthis.existingUser = users.find(user => {\n\t\t\treturn (\n\t\t\t\t!user.get('deactivated') &&\n\t\t\t\t(user.get('teamIds') || []).length === 0\n\t\t\t);\n\t\t});\n\t}", "checkUsername(req, res) {\n const { username } = req.params;\n // Quick client-side username validation\n if (validateUser({ username }).length) {\n res.json({ data: { available: false, exists: false } });\n // Check for conflicts with other users\n } else {\n getAuth0User.byUsername(username)\n .then(user => res.json({ data: {\n available: !user,\n exists: !!user,\n } }));\n }\n }", "function userExists(userName, usersTable){\n\tif (usersTable[\"userName\"]) return true;\n\t\n\tlet userArray = Object.keys(usersTable);\n\tfor (let i = 0; i < userArray.length; i++) {\n\t\tif (sameUser(userName, userArray[i], usersTable))\n\t\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "function usernameExists(username) {\r\n\tUser.findOne({\r\n\t\twhere : {\r\n\t\t\tusername : username\r\n\t\t}\r\n\t}).then((user)=>{\r\n\t\treturn user;\r\n\t});\r\n}", "function checkIfUserAlreadyExists(req, res, next) {\n\tlet userEmail = req.body.email\n\n\tlet findUser = `SELECT COUNT(*) AS count FROM users WHERE email=\"${userEmail}\"`;\n\n\tconn.query(findUser, (err, result) => {\n\t\tif (err) {\n\t\t\tres.status(500).send({\n\t\t\t\t\"error\": \"Something Went Wrong\"\n\t\t\t})\n\t\t}\n\n\t\tif (result[0].count == 0) {\n\t\t\tnext()\n\t\t}\n\t\telse {\n\t\t\tres.status(200).send({\n\t\t\t\tsuccess: false,\n\t\t\t\t\"message\": \"User Already Exists With This Email.\"\n\t\t\t})\n\t\t}\n\t})\n}", "userExists(user) {\n // Temp variable for storing the user if found\n let temp = '';\n for (let i of this.users) {\n if (i === user) {\n console.log('user: ' + user + ' exists');\n temp = user;\n }\n }\n let exists = (temp !== '' && temp === user);\n if(temp === '') console.log('user: ' + user + ' does not exist');\n return exists;\n }", "function checkUser(users){\n\t\tif(users[0]){\n\t\t\tconsole.log('tried to register an existing user');\n\t\t\tres.send('you tried a bad user, you are a failure');\n\t\t}\n\t\telse database.insertUser(sess.username, sess.pswd, function (response){\n\t\t\tif(response.result.ok)res.send('everythingOK');\n\t\t\telse console.log('error adding new user');\n\t\t});\n\t}", "async checkUsername({request, response}) {\n let exist = await User.findBy('username', request.input('username'));\n return response.send(!!exist);\n }", "function checkUser(potentialUserName) {\n Meteor.call('users.checkUsername', {potentialUserName}, (error, count) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n } else {\n console.log(count)\n if (count > 0) {\n setUsernameFalse(potentialUserName)\n return false\n } else {\n setUsernameTrue(potentialUserName)\n return true\n }\n }\n });\n }", "function checkUser(userId){\n console.log(\"CouchDBServices.checkUser()\");\n var q = $q.defer();\n db.query('user/userExists', {\n key : userId,\n include_docs : false,\n limit : 1\n }).then(function (res) {\n console.log(\"success: \"+res);\n q.resolve(res);\n }).catch(function (err) {\n q.reject(err);\n console.log(\"err: \"+err);\n });\n return q.promise;\n }", "function userProfileExists(uid) {\n\n var defer = $q.defer();\n var result = false;\n\n firebase.database().ref('users/' + uid).once('value', function(snapshot) {\n if (snapshot.val() === null) {\n\n result = false;\n\n\n } else {\n\n result = true;\n }\n\n defer.resolve(result);\n\n })\n\n return defer.promise;\n\n }", "static async isRegisteredUsername(username) {\n let res = await db.query('SELECT * FROM users WHERE username = $1', [username]);\n return res.rowCount > 0;\n }", "function checkIfUserExist() {\n user\n .findOne()\n .or([{ email: email }, { username: username }])\n .exec(function(err, result) {\n if (err) throw err;\n if (result === [] || result === null || result === undefined) {\n // * SAVE NEW USER\n var userInstance = new user({\n firstName: firstName.toLowerCase(),\n lastName: lastName.toLowerCase(),\n username: username,\n email: email,\n password: password,\n role: \"user\"\n });\n\n // * HASH PASSWORD AND SAVE PROFILE\n bcrypt.genSalt(saltRounds, function(err, salt) {\n bcrypt.hash(password, salt, function(err, hash) {\n userInstance.password = hash;\n userInstance\n .save()\n .then(result => {\n req.session.userId = result._id;\n req.session.role = result.role;\n req.session.userName = result.username;\n\n // * CREATE POSTER PROFILE\n\n poster\n .findOne( { username: username } )\n .exec(function(err, resultPoster) {\n if (err) throw err;\n if (resultPoster === [] || resultPoster === null || resultPoster === undefined) {\n // * SAVE NEW USER\n var posterInstance = new poster({\n ownerUserName: username,\n });\n\n posterInstance\n .save()\n .then(resultPoster => {\n console.log(resultPoster);\n return res.redirect(\"/\");\n })\n .catch(function(err) {\n console.log(err);\n });\n }\n });\n\n })\n .catch(function(err) {\n console.log(err);\n });\n });\n });\n } else {\n let flashError = \"\";\n if (result.username === username) {\n flashError = \"Ce pseudo est déjà utilisé.\";\n }\n if (result.email === email) {\n flashError = \"Cet email est déjà utilisé.\";\n }\n if (result.username === username && result.email === email) {\n flashError = \"Ce pseudo et cet email sont déjà utilisés.\";\n }\n req.flash(\n \"wrong signup\",\n flashError + \" Veuillez réessayer.\"\n );\n return res.redirect(\"/account/signup\");\n }\n });\n }", "existUser(userId) {\n userId = userId || this.app_user.userId;\n return new Promise(resolve => {\n console.log('existUser: ' + userId);\n this.getUser(userId)\n .then(user_data => {\n resolve(user_data);\n })\n .catch(err => {\n console.log('existUser: Error', err);\n resolve(false);\n });\n });\n }", "function checkUser() {\n\tif (user) {\n\t\tconsole.log(\"Signed in as user \" + user.email);\n\t\t// console.log(user);\n\t\thideLoginScreen();\n\t} else {\n\t\tconsole.log(\"No user is signed in\");\n\t}\n}", "function checkRegistrationUser(username) {\n var blank = isBlank(username);\n var element = document.getElementById('username');\n var existence;\n if(blank) {\n\texistence = false;\n\tinputFeedback(element, existence, blank);\n } else {\n\texistence = checkUserExistence(username);\n\tinputFeedback(element, existence, blank);\n }\n}", "function existsUsername(user_input){\n for(let i in users){\n let user = users[i];\n if(user_input === user.username){\n return true;\n }\n }\n return false;\n}", "isUserLoggedIn() {\n //console.log(`User registered button should be present`);\n return this.userRegisteredButton.isExisting();\n }", "async exists(email, options = {}) {\n options = this.addAccessToken(options);\n options.params = { email };\n\n let response;\n try {\n response = await this.http.get(`/users/`, options);\n } catch (e) {\n return false;\n }\n\n return R.pathOr(false, [\"data\", \"id\"], response);\n }", "function check_if_user_is_known(doc) {\n\tlog.info(\"Checking is user %s is known.\", doc.owner);\n\treturn new Promise(function(resolve,reject) {\n\t\tusers.findOne({ login: doc.owner }, function(err,user) {\n\t\t\tlog.info(\"Checked if the user %s is known.\", doc.owner);\n\t\t\tif(err)\n\t\t\t\tthrow err;\n\t\t\tif(user)\n\t\t\t\tresolve(true);\n\t\t\telse\n\t\t\t\tresolve(false);\n\t\t});\n\t});\n}", "function isNewUser(id) {\n return users[id] == undefined;\n}", "function checkUser(username,pass,email,role){\n\tdatabase.ref('/users/'+username).once('value').then(function(ss){\n\t\tif(ss.val())\n\t\t{\n\t\t\tswal('Username already exist' ,'' ,'error');\n\t\t}\n\t\telse \n\t\t{\n\t\t\tregisterUser(username,pass,email,role);\n\t\t\tswal('Register success' ,'' ,'success').then((result) => {\n\t\t\t\twindow.location.reload();\n\t\t\t});\n\t\t}\n\t});\n}", "async function CheckUserExistence(userID) {\n try {\n await client.query(\"BEGIN\");\n await client.query(`INSERT INTO ${userDb}(discord_id) VALUES ($1)`, [userID])\n await client.query(\"COMMIT\");\n } catch (e) {\n await client.query(\"ROLLBACK\");\n }\n}", "function isUsernameAvailable(username) {\n userService.isUsernameAvailable(username).then(\n function (data) {\n validator('existLogin', data.data);\n })\n }", "static async checkUser(userId) {\n const query = 'SELECT * FROM \"Users\" WHERE user_id = $1';\n const user = await pool.connect(query, [userId]);\n if (user[0].is_admin === true) {\n return true;\n }\n return false;\n }", "async function isUserExist(email){\n const result = await User.find({email : email});\n if(result.length == 0)\n return false;\n\n return result[0];\n}", "function checkIfUserExists(name, redisClient) {\n return new Promise((resolve) => {\n redisClient.get(`${USER_PREFIX}${name}`, (err, res) => {\n resolve(Boolean(res));\n });\n });\n}", "function userExists(user) {\n for (var i = 0, len = registeredUsers.length; i < len; i++) {\n if (user.id === registeredUsers[i].id) {\n logger.log(\"User \"+user.id.yellow.bold+\" already registered, updating his socket \"+user.socket.green.bold);\n registeredUsers[i].socket = user.socket;\n return true;\n }\n }\n return false;\n }", "checkUsername(req, res, next){\n\n db.query(queries.selectUserWithUsername, [req.body.username], (err, results, fields) => {\n\n if (err) throw err;\n \n if (results.length === 0){\n req.usernameExists = false;\n } else {\n req.usernameExists = true;\n }\n next();\n });\n }", "async function userIsExist(userName) {\r\n try {\r\n const user = await User.findOne({\r\n where: {\r\n userName,\r\n },\r\n });\r\n if (user) {\r\n return user.toJSON();\r\n }\r\n return false;\r\n } catch (error) {\r\n console.error(error.message);\r\n return false;\r\n }\r\n}", "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}", "userIDExists(userID, callback) {\n let query = \"select count(*) as numberOfUsers from user where userID = \" + userID + \";\";\n this.selectQuery(query, (result) => {\n //wenn die Anzahl der user mit der angegebenen UserID 1 beträgt existiert dieser User -> true\n //ansonsten (bei 0) existiert dieser User nicht -> false\n callback(result[0].numberOfUsers == 1);\n });\n }", "function checkExistingAuth() {\n // const userRecord = configstore.get('user');\n // const tokens = configstore.get('tokens');\n // console.log({ tokens });\n //\n // if (userRecord && tokens) throw new Error('You are alread logged in!');\n\n return true;\n}", "function checkusername(req, res, next){\n var uname = req.body.uname;\n var checkNameExist = userModel.findOne({username: uname});\n checkNameExist.exec((err, data)=>{\n if(err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg: 'Username Already Exist' });\n }\n next();\n })\n }", "function checkIfUserExists(userId, authData, cb) {\n\n\tvar usersRef = new Firebase(\"https://phoodbuddy.firebaseio.com/users\");\n\tusersRef.once('value', function(snapshot){\n\t\tif(snapshot.hasChild(userId))\n\t\t{\n\t\t\tconsole.log(\"User Already Exists\");\n\t\t\tcb(false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar ref = new Firebase(\"https://phoodbuddy.firebaseio.com\");\n\n\t\t\tvar plannerJsonInit = {sunday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},monday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},tuesday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},wednesday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},thursday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},friday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},saturday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}},sunday:{\"breakfast\":{name:\"\",recipeId:\"\"},\"lunch\":{name:\"\",recipeId:\"\"},\"dinner\":{name:\"\",recipeId:\"\"}}};\n\n\t\tref.onAuth(function(authData)\n\t\t{\n\t\t\tif (authData)\n\t\t\t{\n\t\t\t\tconsole.log(\"This is a new user!\");\n\t\t\t\t// save the user's profile into the database so we can list users,\n\t\t\t\tref.child(\"users\").child(authData.uid).set({\n\t\t\t\t\tprovider: authData.provider,\n\t\t\t\t\tname: getName(authData), // retrieves name from payload\n\t\t\t\t\tprofile: {\n\t\t\t\t\t\tfname : \"\",\n\t\t\t\t\t\tlname : \"\",\n\t\t\t\t\t\temail : \"\", \n\t\t\t\t\t\tcity : \"\",\n\t\t\t\t\t\tstate : \"\", \n\t\t\t\t\t\tcountry : \"\",\n\t\t\t\t\t\tstreet : \"\", \n\t\t\t\t\t\tage : \"\",\n\t\t\t\t\t\tfavdish : \"\",\n\t\t\t\t\t\tfavdrink : \"\",\n\t\t\t\t\t\tgender : \"\",\n\t\t\t\t\t\tabout : \"\"\n\t\t\t\t\t},\n\t\t\t\t\tallergies: {\n\t\t\t\t\t\tcorn : false,\n\t\t\t\t\t\tegg : false,\n\t\t\t\t\t\tfish : false,\n\t\t\t\t\t\tglutten : false,\n\t\t\t\t\t\tmilk : false,\n\t\t\t\t\t\tpeanut : false,\n\t\t\t\t\t\t\"red-meat\" : false,\n\t\t\t\t\t\tsesame : false,\n\t\t\t\t\t\t\"shell-fish\" : false,\n\t\t\t\t\t\tsoy : false,\n\t\t\t\t\t\t\"tree-nut\" : false\n\t\t\t\t\t},\n\t\t\t\t\ttaste:{\n\t\t\t\t\t\tbitter: 2.5,\n\t\t\t\t\t\tsalty : 2.5,\n\t\t\t\t\t\tsour : 2.5,\n\t\t\t\t\t\tspicy : 2.5,\n\t\t\t\t\t\tsweet : 2.5\n\t\t\t\t\t},\n\t\t\t\t\thealth:{\n\t\t\t\t\t\thypertension : false,\n\t\t\t\t\t\thypotension : false,\n\t\t\t\t\t\t\"high-cholestorol\": false,\n\t\t\t\t\t\tdiabetes : false,\n\t\t\t\t\t\tvegetarian: false\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tref.child(\"grocery\").child(authData.uid).set({\n\t\t\t\t\t\"bakery\":{\n\t\t\t\t\t\tname:\"Bakery\"\n\t\t\t\t\t},\n\t\t\t\t\t\"bakingSpices\":{\n\t\t\t\t\t\tname: \"Baking and Spices\"\n\t\t\t\t\t},\n\t\t\t\t\t\"cannedGoods\":{\n\t\t\t\t\t\t\"name\": \"Beverages\"\n\t\t\t\t\t},\n\t\t\t\t\t\"cereals\":{\n\t\t\t\t\t\t\"name\": \"Cereals\"\n\t\t\t\t\t},\n\t\t\t\t\t\"condiments\":{\n\t\t\t\t\t\tname:\"Condiments\"\n\t\t\t\t\t},\n\t\t\t\t\t\"dairy\":{\n\t\t\t\t\t\tname: \"Dairy\"\n\t\t\t\t\t},\n\t\t\t\t\t\"frozen\":{\n\t\t\t\t\t\t\"name\": \"Frozen\"\n\t\t\t\t\t},\n\t\t\t\t\t\"meats\":{\n\t\t\t\t\t\t\"name\": \"Meats\"\n\t\t\t\t\t},\n\t\t\t\t\t\"miscellaneous\":{\n\t\t\t\t\t\t\"name\": \"Miscellaneous\"\n\t\t\t\t\t},\n\t\t\t\t\t\"produce\":{\n\t\t\t\t\t\t\"name\": \"Produce\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tref.child(\"planner\").child(authData.uid).set(plannerJsonInit);\n\t\t\t\tcb(true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcb(false);\n\t\t\t\tconsole.log(\"invalid payload\");\n\t\t\t}\n\t\t});\n\t\t}\n\t});\n}", "function userIsUnique(req, res, next) {\n // Check if user already exists in database\n db.none('SELECT password FROM users WHERE email = $1', req.body.email)\n .then(function (data) {\n // User doesn't exist, let's register it\n registerUser(req, res, next);\n })\n .catch(function (error) {\n // User is not unique, let's return error message\n return res.status(200)\n .json({\n status: 'errors',\n errors: [{\n param: 'email',\n msg: 'E-mail address is not unique!'\n }]\n });\n });\n}", "function check(email, username){\n var usrobj = userobj;\n var usrs = usrobj.users;\n //Checks login info with all objects of signup json object\n for (let index = 0; index < usrs.length; index++) {\n const obj = usrs[index];\n if(obj.email_address == email || obj.username == username) {\n return true;\n }\n }\n return false;\n}", "validate_user_exist(username){\n let user_exist = EXIST_ASYNC(username, function(err, response){\n if (err) {\n console.error(err);\n }\n });\n return user_exist;\n }", "function usernameAlreadyExists(username){\n return false;\n }", "userEnUso(nick)\n {\n const user = this.usuarios.find(usuario => usuario.nickName == nick)\n return user != undefined;\n }", "function userExist(login, callback){\n /*connection.connect(function(err) {\n if (err) {\n console.error('error connecting: ' + err.stack);\n return;\n }\n\n console.log('connected as id ' + connection.threadId);\n });*/\n var sql = \"SELECT count(*) as nbUser FROM users WHERE users.`login` = ?\";\n connection.query(sql,\n [login],\n function (error, results, fields) {\n if (error) {\n console.log(error);\n throw error;\n }\n //mainWindow.webContents.send('user-exist', results)\n //console.log(results[0].nbUser);\n //console.log(error);\n user_exist = false;\n //console.log(\"user.exist : function => \" + results[0].nbUser);\n if(results[0].nbUser >= 1){\n user_exist = true;\n }\n //user.exist = user_exist;\n return callback(user_exist);\n });\n //connection.end();\n}", "userExists(){\n // set Status for previous view in case server validation failed \n this.displayMode = 'none';\n this.isAgreed = false;\n // add xhr message into form error validation message object - will be shown on screen\n for(let i in this.messageService.xhr.warn){\n this.addform.emailid.$setValidity(i, !this.messageService.xhr.warn[i]);\n }\n\n this.abortForm = true;\n }", "function userExists(userName, config) {\n return __awaiter(this, void 0, void 0, function () {\n var wallet;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getWallet(config)];\n case 1:\n wallet = _a.sent();\n return [2 /*return*/, wallet.exists(userName)];\n }\n });\n });\n}", "async checkUserExists(email) {\n return new Promise(async (resolve, reject) => {\n try {\n const user = await UserModel.findOne({ email });\n resolve(user);\n } catch (err) {\n reject(err);\n }\n });\n }", "function createUser(){\n var info = getUserInfo();\n if (info.user.name === \"\" || info.user.username === \"\" || info.user.password === \"\"){\n alert(\"Must enter a Name, Username and Password\");\n }else{\n createUserAjax(info);\n }\n }", "async function validateUser(req, res, next){\n const username = req.body.username;\n const email = req.body.email;\n\n const usernameExists = await Users.findOne({where: {username:username}});\n const emailExists = await Users.findOne({where: {email:email}});\n\n if (usernameExists || emailExists){\n res.status(400).send({msg:'Username or email already exists'}); \n } else {\n next()\n }\n}", "isUser(userName, pass) {\n return this.users.find((u) => {\n return u.name == userName && u.pass == pass;\n });\n }", "function checkUserStatus() {\n if (firebase.auth().currentUser === null) { loadLoginPage(); }\n else { loadHomePage(); }\n }", "function checkUser (name, pass){\n for(var i=0;i<student.users.length;i++)\n {\n if (student.users[i].name==name && student.users[i].pwd==pass)\n { \n console.log(student.users[i].name+\" Exists\");\n return true;\n }\n }\n console.log(\"Check Username and Password\")\n return false;\n}", "function checkIfUserExists(userName){\n return user_Names[userName];\n}", "isUserExistenceAndUnique(username) {\n var connectionDB = this.connectDB()\n var checkExistenceAndUniqueProcess = connectionDB.then((connection) => {\n return new Promise((resolve, reject) => {\n connection.query('SELECT id FROM ' + dbTesterInfo +\n ' WHERE testerID = ?', username, (err, results, fields) => {\n\n if (!err) {\n if(results.length === 1) {\n connection.release()\n resolve()\n } else if (results.length === 0){\n connection.release()\n reject({err: {msg: 'This username does not exist!'}})\n } else {\n connection.release()\n reject({err: {msg: 'This username is duplicated!Please remove!'}})\n }\n } else {\n connection.release()\n reject({err: {msg: 'Lost database connection!'}})\n }\n })\n })\n }).catch((err) => {\n return Promise.reject(err)\n })\n return checkExistenceAndUniqueProcess\n }", "user(cb) {\n svclib.KVDataStore.get([{\n table: 'email_to_user',\n key: email,\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n const userId = items[0].value.userId;\n svclib.KVDataStore.get([{\n table: 'users',\n key: _.toString(userId),\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n return cb(null, items[0]);\n });\n });\n }", "function IsUseralreadyExist(user1)\n {\n for(var i=0;i<allUsers.length;i++)\n {\n if(allUsers[i].username==user1.username&&allUsers[i].userpassword==user1.userpassword)\n {\n alert(\"User already exit try Different Username\");\n return 0;\n }\n }\n return 1;\n\n }", "function isUsernameTaken(){\n return new Promise(function(resolve, reject){\n mysql.pool.getConnection(function(err, connection){\n if(err){return reject(err)};\n \n connection.query({\n sql: 'SELECT username FROM deepmes_auth_login WHERE username=?',\n values: [fields.username]\n }, function(err, results){\n if(err){return reject(err)};\n \n if(typeof results[0] !== 'undefined' && results[0] !== null && results.length > 0){\n let usernameTaken = 'Username is already taken.';\n reject(usernameTaken);\n } else {\n resolve();\n }\n\n });\n\n connection.release();\n\n });\n });\n }", "userPresent(username){\n console.log(\"userPreesent called\");\n \n if (this.users.length > 0) {\n for (var i =0; i < this.users.length; i++){\n if (this.users[i] === username){\n return true;\n }\n }\n }\n return false;\n }", "_checkUserExist (req, res, next) {\n Models.users.findOne({\n where: {\n email: req.body.email\n }\n }).then(function (result) {\n if (!result) {\n let error = new Error();\n error.message = \"User with this email does not exist\";\n error.status = 404;\n return next(error);\n }\n\n res.locals.user = result;\n next();\n })\n .catch(next);\n }", "function isUserPresent(response) {\n\n if(response) {\n\n UserService.setCurrentUser(response);\n\n // if success from user present change url to profile\n $location.url(\"/profile\");\n }\n }", "async checkForUser(){\n\n try{\n let results = await this.getUsers();\n //console.log(results)\n for(let i = 0; i < results.length; i++){\n if(results[i].FirstName === this.firstName && results[i].LastName === this.lastName ){\n console.log(\"Userfound\")\n console.log(results[i])\n return true\n }\n }\n console.log(\"Preparing to create new User\")\n return false\n }catch(e){\n console.error(e)\n }\n \n }", "function userExist(username) {\n return knex(TABLE_NAME)\n .count('id as n')\n .where({ username: username })\n .then((count) => {\n console.log('count in userQueries', count)\n return count[0].n > 0\n });\n}", "isUsernameAvailable(username) {\n return __awaiter(this, void 0, void 0, function* () {\n if (username == null) {\n throw new nullargumenterror_1.NullArgumentError('username');\n }\n return this.users.find(u => u.username == username) != null;\n });\n }", "function register (req, res, next) {\n users.exists(req.body.username)\n .then(exists => {\n if (exists) {\n return res.status(400).send({message: 'User exists'})\n }\n users.create(req.body.username, req.body.password)\n .then(() => next())\n })\n .catch(err => {\n res.status(400).send({message: err.message})\n })\n}", "async function auth(username, password)\n{\n var found = await userModel.exists(\n {\n username: username,\n password: password\n }\n );\n\n if (!found)\n {\n throw 'Incorrect username or password.';\n }\n\n return found;\n}", "handleSignUp() {\n const usersFound = firebase.database().ref('Usernames/').orderByKey().equalTo(this.state.username);\n usersFound.once('value', (snapshot) => {\n if (snapshot.val() !== null) {\n // username already exists, ask user for a different name\n console.log(\"username already exists\");\n this.setState({ errorMessage: \"Username already exists\" });\n }\n else {\n //username does not yet exist, go ahead and add new user\n console.log(\"username does not yet exist\");\n firebase\n .auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password)\n .then(() => this.createUser(this.state.username, this.state.email))\n .then(() => this.props.navigation.navigate('Login'))\n .catch(error => this.setState({ errorMessage: error.message }))\n }\n })\n }", "function isAuthenticated({ usuario, senha }) {\r\n return userdb.users.findIndex(user => user.usuario === usuario && user.senha === senha) !== -1\r\n }", "function userCheck(req, res, next) {\n if(new ObjectId(req.params.user_id).equals(req.user._id)){\n next();\n }else {\n res.status(401).send('You trying to access others data');\n }\n }", "function validateUser(req, username, password, done){\r\n var db = new sqlite3.Database(__dirname + '/db/blog.db');\r\n // select user from db based on username\r\n db.get ('SELECT userId, userName, password FROM user WHERE deleted IS NULL AND userName = ?', username, function(err, row){\r\n // if user does not exist from the database return false, else get the user\r\n if(!row){\r\n return done(null, false, req.flash('error', 'Incorrect Username or Password'));\r\n } else {\r\n var user = row;\r\n if(user.password == password){\r\n return done(null, user);\r\n }\r\n return done(null, false, req.flash('error', 'Incorrect Username or Password'));\r\n }\r\n });\r\n}" ]
[ "0.79690623", "0.75844246", "0.7557623", "0.74161494", "0.7377948", "0.73569006", "0.7304194", "0.7255781", "0.7238622", "0.71998715", "0.7175637", "0.7156744", "0.71453005", "0.7125911", "0.7112004", "0.7106464", "0.7099847", "0.7051613", "0.70508", "0.7044566", "0.70404834", "0.69861287", "0.6960835", "0.69592345", "0.695757", "0.6953136", "0.6935625", "0.69299656", "0.68890595", "0.68508095", "0.68153065", "0.68016917", "0.6782214", "0.677908", "0.6774732", "0.6771936", "0.676848", "0.6740325", "0.6724391", "0.67060995", "0.66863054", "0.6654761", "0.6646234", "0.6640304", "0.6630906", "0.6619463", "0.66151726", "0.6601242", "0.65986437", "0.659581", "0.65867645", "0.65663743", "0.65425223", "0.6528894", "0.6520185", "0.65185994", "0.6513228", "0.6499486", "0.64948267", "0.64679253", "0.64647514", "0.6460175", "0.64572775", "0.64570475", "0.6424642", "0.6372318", "0.6357668", "0.6353374", "0.6336378", "0.63340926", "0.633109", "0.63308877", "0.632371", "0.63091356", "0.6301842", "0.6290457", "0.62879056", "0.6283359", "0.62807673", "0.62771374", "0.6272365", "0.62654096", "0.6258566", "0.62579995", "0.6246002", "0.624362", "0.62414455", "0.6220682", "0.62141544", "0.62087655", "0.62083536", "0.6202368", "0.6193494", "0.61932814", "0.61926347", "0.6192621", "0.618947", "0.6177549", "0.6170988", "0.6153214" ]
0.7149536
12
Check if an user's password is equal to other one
checkPassword(user, password) { const index = this.users.indexOf(user); if(index!==-1) return this.passwords[index] === password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passwordMatch(password) {\n return password === admin.password;\n}", "checkPassword(password) {\n return password === this.password;\n }", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "function comparePasswords() {\n var validPassword = false;\n if ($scope.newUser.password === $scope.newUser.password) {\n validPassword = true;\n } else {\n validPassword = false;\n }\n return validPassword;\n }", "function passEquals(pw) {\n\treturn pw !== \"password\";\n}", "function idPassCheck(user, pw) {\n\treturn user !== pw;\n}", "passwordsMatch(passOne, passTwo) {\n return passOne === passTwo;\n }", "checkPassword(originalPwd){\n return bcrypt.compareSync(originalPwd, this.password);\n }", "checkPassword() {\n if(user.password === '12345'){\n console.log(' Logged in ');\n } else {\n console.log('cannot log in');\n }\n }", "async isSame(password, encrypted_password){\n const returned_password = await bcrypt.compare(password, encrypted_password);\n return returned_password; \n }", "isSamePassword(currentPassword, newPassword) {\n return currentPassword === newPassword;\n }", "checkPassword(loginPw) {\n return bycrypt.compareSync(loginPw, this.password)\n }", "function comparePass(userPassword, databasePassword) {\n return bcrypt.compareSync(userPassword, databasePassword);\n}", "function comparePass(userPassword, databasePassword) {\n return bcrypt.compareSync(userPassword, databasePassword);\n}", "function comparePass(userPassword, databasePassword) {\n return bcrypt.compareSync(userPassword, databasePassword);\n}", "async matchPassword(user, password) {\n const passwordHash = user.password;\n return bcrypt.compareSync(password, passwordHash);\n }", "checkPassword(loginPw) {\n // Using the keyword this, we can access this user's properties, \n // including the password, which was stored as a hashed string\n // compareSync confirms (true) or denies (false) that the supplied password\n // matches the hashed password stored on the object\n return bcrypt.compareSync(loginPw, this.password);\n }", "function checkPasswordOnLogin(email, pwd){\n \n //obtain the cookie and it splits the str with the ,'s\n user = getCookie(email).split(',');\n\n //returns if the passwords are the same so the user can access to his/her profile\n return user[1] === pwd\n}", "checkPwd() {\n const pwd = document.getElementById('newPwd').value,\n rpt = document.getElementById('repeatPwd').value;\n\n if (pwd !== rpt) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "comparePassword(testPwd) {\n return bcrypt.compare(testPwd, this.password)\n }", "function auth(user){\r\n\tif(getUserObjectByIDObject(user).password === user.password){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "checkPassword(loginPassword) {\n return bcrypt.compareSync(loginPassword, this.password);\n }", "function validateCreds(username, password){\n\tlet sql = \"SELECT salt, password FROM appuser WHERE username=?;\";\n\tdb.get(sql, [username], (err, row) => {\n\t\tresult = {};\n\t\tif (err) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif (!row) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\thashedPass = combineHash(\"\" + row.salt, password);\n\t\t\t\tif (!(hashedPass == row.password)) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn true;\n}", "function checkExistingPassword(password) {\n if (bcrypt.compareSync(password, databases.users[userId].password)){\n return true;\n }else{\n return false;\n }\n}", "function checkPasswordMatch(password, password2) {\r\n\r\n if (password.value !== password2.value) {\r\n showError(password2, `Passwords do not match`)\r\n };\r\n}", "isCorrectPassword(enteredPassword) {\n return User.encryptPassword(enteredPassword, this.salt) === this.password;\n }", "checkPassword(username, password) {\n let row = accountDB.getUser(username);\n if (row) {\n let [salt, passwordHash] = row.password.split(':');\n let passwordData = sha512(password, salt);\n return passwordHash === passwordData.hash;\n }\n return false;\n }", "checkPassword(pass) {\n // Hash the password and then check against the hash for extra security :^), I, however, ain't doing that here.\n const SECRETS = require(\"../secrets.json\");\n return SECRETS.channelPassword === pass;\n }", "function checkPasswordMatch() {\n var password = $(\"#password-input\").val();\n var confirmPassword = $(\"#password-check\").val();\n \n if (password !== confirmPassword){\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n }\n else{\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }\n }", "function valid_password_verify(pwd1, pwd2){\n\tif (pwd1 != pwd2){\n\t\treturn false;\n\t}\n\treturn true;\n}", "checkPassword(loginPw) {\n return bcrypt.compareSync(loginPw, this.password);\n }", "async function passwordAuth(password1, password2) {\n if (await bcrypt.compare(password1, password2)) {\n return true;\n }\n //What exit message should i use?\n return false;\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkPw( index, in_pw ) {\n\tvar retrieved_pw = registeredUsers[index].password;\n\tif (bcrypt.compareSync(in_pw, retrieved_pw) === false ) {\n\t\tconsole.log(\"checkPw(): failed password comparison!\");\n\t\treturn false;\n\t} else {\n\t\tconsole.log(\"checkPw(): passed password comparison\");\n\t\treturn true;\n\t}\n}", "function checkPassword(user, givenPassword) {\n return (user != null) && (user.password === givenPassword)\n }", "function checkPasswordMatch(input1, input2) {\n\tif (input1.value !== input2.value) {\n\t\tshowError(input2, 'Passwords do not match');\n\t}\n}", "function isValidPassword(password) {\n\n\n}", "function isUserEqual(x, y) {\n return true;\n }", "function isUserEqual(x, y) {\n return true;\n }", "function compareHash(user, password) {\n // Grab password from Db so we can compare it to payload pass\n var hash = user.local.password\n // Bcrpt password so no Hackers find it, although they probably will\n if (bcrypt.compareSync(password, hash) == true) {\n console.log(\"Password Matched\")\n return(user)\n } else {\n console.log(\"Email and Password do not match\")\n return(\"Email and Password do not match\")\n }\n}", "checkPassword(password) {\n return bcryptjs.compare(password, this.password_hash);\n }", "function passwordLookup(userPassword, users) {\n for (user in users) {\n if (userPassword === users[user][\"password\"]) {\n return true;\n }\n }\n return false;\n}", "checkPassword(password) {\n return bcrypt.compare(password, this.password_hash);\n }", "checkPassword(password) {\n return bcrypt.compare(password, this.password_hash);\n }", "checkPassword(password) {\n return bcrypt.compare(password, this.password_hash);\n }", "checkPassword(password) {\n return bcrypt.compare(password, this.password_hash);\n }", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "function validPassword (password) {\n return bcrypt.compareSync(password, this.local.password);\n}", "static async validateCredentials({ username, password }) {\n const query = {\n text: `SELECT \n username, password\n FROM \n Users\n WHERE \n username = $1;`,\n values: [username],\n };\n const {\n rows: [user],\n } = await db.query(query);\n if (!user) {\n return false;\n }\n return Password.compare({ password, compareTo: user.password });\n }", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}", "passwordDoesMatch(thePassword) {\n const didMatch = bcrypt.compareSync(thePassword, this.pwhash);\n return didMatch;\n }", "function checkPasswordMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Password does not matches\")\n }\n\n}", "function comparePassword(user, candidatePassword, cb) {\n bcrypt.compare(candidatePassword, user.password, (err, isMatch) => {\n cb(err, isMatch);\n });\n}", "isPasswordLogin() {\n\t\treturn (FlowRouter.getQueryParam('login') === 'password');\n\t}", "static async authenticate(username, password) { \n const { rows: [user] } = await db.query(`\n SELECT password\n FROM users\n WHERE username = $1;\n `, [username]);\n if (user && await bcrypt.compare(password, user.password))\n return true;\n return false;\n }", "function UserPWVerifier (email, pw){\n for (var user in users){\n let comparingPW = users[user]['password'];\n if ( (users[user]['email'] === email) && (bcrypt.compareSync(pw, comparingPW)) ){\n const CheckID = users[user]['id'];\n return CheckID;\n }\n }\n return false\n}", "function passwordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Paswords do not match\");\n }\n}", "checkCredentials(username, password) {\n if (!username || !password) return false;\n let userFound = User.getUserFromList(username);\n if (!userFound) return Promise.resolve(false);\n return bcrypt\n .compare(password, userFound.password)\n .then((match) => match)\n .catch((err) => err);\n }", "authenticateUser(password) {\n\t\treturn compareSync(password, this.password);\n\t}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Passwords do not match');\n }\n}", "static async authenticate(username, password) {\n\t\tconst result = await db.query(\"SELECT password FROM users WHERE username = $1\", [username]);\n\t\tconst user = result.rows[0];\n\t\treturn user && (await bcrypt.compare(password, user.password)) && user;\n\t}", "function isPasswordChicken(user) {\n if (user.password === \"chicken\") {\n return true;\n } else {\n return false;\n }\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "static async authenticate(username, password) {\n const result = await db.query(\n `SELECT password FROM users WHERE username = $1`,\n [username]);\n const user = result.rows[0];\n\n return user && await bcrypt.compare(password, user.password);\n }", "function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }", "passwordCheck(inputPassword) {\n return encrypt.compareSync(inputPassword, this.password);\n }", "function checkPassword (userId, password, done) {\n let query = \"SELECT password FROM User WHERE user_id = ?\";\n\n db.getPool().query(query, userId, function(err, rows) {\n if (err) {\n console.log(\"USER CHECK PASSWORD BY USERNAME OR EMAIL ERROR: \\n\" + err);\n return done(null);\n } else if (rows.length < 1) {\n return done(null);\n } else {\n return done(password === rows[0].password);\n }\n\n })\n}", "static async authenticate(username, password) {\n\n let user_data = await db.query(\n `select password from users where username = $1`,\n [username]\n )\n\n const result = user_data.rows.length ? \n await bcrypt.compare( password, user_data.rows[0].password ) \n : false\n\n return result\n }", "compareHash (password) {\n return bcrypt.compare(password, this.password)\n }", "is_authentic(){\n if (this.user){\n return this.user.has_password(this.password)\n }\n return false\n }", "function validPassword(password, userPass) {\n return bcrypt.compareSync(password, userPass);\n }", "function validPassword(password, userPass) {\n return bcrypt.compareSync(password, userPass);\n }", "function compare_pswd(entered, saved){\n newPswd = crypt.append(entered);\n return bcrypt.compareSync(newPswd, saved);\n}", "function compare(pw1, pw2) {\n if (pw1 === pw2)\n return true\n else\n return false\n}", "function otherUser() {\n\tvar listUsers = localStorage.getItem(\"tbUsers\");\n\tlistUsers = JSON.parse(listUsers);\n\tvar user = document.getElementById('username').value;\n\tvar pass = document.getElementById('password').value;\n\n\tfor (var u in listUsers) {\n\t\tvar usr=listUsers[u];\n\t\tif (usr.User == user && usr.Password == pass) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function validatePassword(entered_password, current_password) {\n return bcrypt.compareSync(entered_password, current_password);\n}", "function test(name, password) {\n if (name === 'elevenfiftyuser' && password === 'Letmein1234!') {\n return true;\n }\n else {\n return false;\n }\n}", "function matchingPasswords(){\n if(createRetypePassword == createPassword){\n return true;\n }else{\n return false;\n }\n}", "function checkPassword(username, password) {\n console.log(password)\n return db.User.findOne({username: username})\n .then(doc => {\n console.log('THE DOC:', doc);\n console.log('password in checkPassword:', password);\n return bcrypt.compareSync(password, doc.password, (err, res) => {\n return res;\n });\n })\n .catch(error => {\n console.log(error);\n })\n}", "async validatePassword(nickname, password) {\n const data = await this._getHashedPasswordQuery(nickname);\n if (!data)\n return false; // the nickname does not exist\n \n const hashedPassword = sha1(`${data.password_salt}${password}${this.passwordSalt_}`);\n return hashedPassword === data.password;\n }", "function passwordCheckOld() {\n if (\n document.querySelector(\".modifyPassword_form-password input\").value ==\n userObject.password\n ) {\n passwordCheckMatch();\n } else {\n document.querySelector(\".modifyPassword_paragraph-alert\").style.display =\n \"block\";\n document.querySelector(\".modifyPassword_paragraph-alert\").textContent =\n \"Wrong old password\";\n }\n}", "function checkPasswordsMatch() {\n\tif (password.value !== confirmPassword.value) {\n\t\tshowError(confirmPassword, 'Passwords do not match')\n\t}\n}", "function checkPasswords(input1, input2){\n if(input1.value !== input2.value){\n error(input2, \"Passwords are not matching!\");\n }\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function passChecker(pass, user) {\n if (pass == user) { pass_Criteria.push(\"Password equals username\" + \"\\n\"); }\n if (pass.length < 6) { pass_Criteria.push(\"Password is too short (min: 6 char)\" + \"\\n\"); }\n if (!pass.includes(\"$\") || !pass.includes(\"!\") || !pass.includes(\"#\")) { pass_Criteria.push(\"Password does not include a special character ($, #, !).\" + \"\\n\");}\n}", "function validatePasswordMatch(password, confirmPassword) {\n if (password === confirmPassword) {\n return true;\n } else {\n return \"Password do not match!\"\n }\n}", "function passValid(pass) {\n let hash = crypto.createHash('sha256');\n hash.update(pass + salt);\n return password === hash.digest('base64');\n}", "static async authenticate(username, password) {\n let userInfo = await db.query(\n `SELECT username, password\n FROM users\n WHERE username = $1`,\n [username]\n )\n\n if (await bcrypt.compare(password, userInfo.rows[0].password)) {\n this.updateLoginTimestamp(username)\n return true\n } else {\n return false\n }\n }", "checkPassword(password, hash) {\n return bcrypt.compareSync(password, hash);\n }", "static async authenticate(username, password) { \n const response = await db.query(\n `SELECT username,password FROM users WHERE username=$1`,[username]\n );\n const currentUser = response.rows[0];\n if(!currentUser) throw new ExpressError(\"Username not found\",404);\n \n const auth = await bcrypt.compare(password,currentUser.password)\n if(auth){\n return true;\n }else{\n return false;\n }\n }", "function checkPassword() {\n if (theUsername == \"appacademystudent\") {\n if (thePassword == \"pizza\") {\n alert(\"Access granted.\")\n } else {\n alert(\"Access denied.\")\n }\n }else {\n alert(\"I don't know that username.\")\n }\n}", "function passwordCheck (pass, email) {\n for (let key in users) {\n if (emailExist(email)) {\n if (users[key].password === pass) {\n return true\n }\n }\n } return false\n}", "function validPassA(pw1,currpw) {\n if(pw1 === currpw) {\n return \"Password matches old password.\";\n }\n return \"\";\n}", "async matchCredentials(email, password) {\n const userExists = await this.checkUserExists(email);\n let status = {};\n if (!userExists) {\n status = {\n message: \"User does not exist\",\n matched: false,\n userInfo: null,\n };\n } else {\n if (await bcrypt.compare(password, userExists.password)) {\n delete userExists.params;\n status = {\n message: \"Credentials matched\",\n matched: true,\n userInfo: userExists,\n };\n } else {\n status = {\n message: \"Credentials does not matched\",\n matched: false,\n userInfo: null,\n };\n }\n }\n\n return status;\n }", "async authenticate(username, password) {\n const FIND_HASHED_PASSWORD = `\n SELECT password FROM users WHERE username = $1`;\n\n let result = await dbQuery(FIND_HASHED_PASSWORD, username);\n if (result.rowCount === 0) return false;\n\n return bcrypt.compare(password, result.rows[0].password);\n }", "function validateAccount(name, pass){\r\n var de;\r\n\r\n for(var i = 0; i < userData.length; i++){\r\n de = crypt.decrypt(userData[i].password);\r\n if(userData[i].username == name && de == pass){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}", "function authorizer (name, password) { \n return currentUsers.some(user => user.name === name && user.pass === md5(password)) \n}" ]
[ "0.7993083", "0.7725003", "0.75892943", "0.7536197", "0.7526122", "0.7502932", "0.74807984", "0.74213004", "0.74120545", "0.73816967", "0.7310467", "0.7284708", "0.72674763", "0.72674763", "0.72674763", "0.7257321", "0.72466105", "0.7239797", "0.7224139", "0.71671844", "0.71339214", "0.7130158", "0.7108711", "0.7103717", "0.70986736", "0.7093173", "0.70861614", "0.7046177", "0.703064", "0.7008967", "0.7003967", "0.6964114", "0.69603014", "0.6956432", "0.6953685", "0.69532746", "0.69353753", "0.69114834", "0.6907076", "0.6907076", "0.6903968", "0.6881993", "0.6881909", "0.68818796", "0.68818796", "0.68818796", "0.68818796", "0.68733525", "0.68490577", "0.6843105", "0.683451", "0.68301654", "0.68079937", "0.67846465", "0.67841804", "0.6776459", "0.676992", "0.6750066", "0.6742692", "0.6730958", "0.6726631", "0.6715891", "0.67151177", "0.67100775", "0.6708263", "0.6705204", "0.6704646", "0.66863716", "0.6681834", "0.66792977", "0.6670822", "0.66521984", "0.6642566", "0.6642566", "0.6616456", "0.6614139", "0.6601764", "0.6601737", "0.6591841", "0.65896076", "0.6588112", "0.6587562", "0.6585715", "0.6567892", "0.65620136", "0.6561333", "0.65572804", "0.6550278", "0.6547774", "0.6544541", "0.6534041", "0.65291965", "0.6522706", "0.6515335", "0.6512855", "0.6509658", "0.6496565", "0.64880717", "0.6484363", "0.64815754" ]
0.7541683
3
Update a user's password if oldPassword correct
updatePassword(user, oldPassword, newPassword) { const index = this.users.indexOf(user); if (index!==-1) { if (this.checkPassword(user, oldPassword)) { this.passwords[index] = newPassword; return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateWithNewPassword() {\n if (this.compareOldPasswords() && this.compareNewPasswords()) {\n this.updateUser(this.state.newPassword);\n }\n }", "function updatePassword(req, res) {\n var User = mongoose.model('User');\n User.findOne({ _id: req.user._id }, function (err, user) {\n if (err) {\n res.send(common_1.send_response(null, true, \"User not found!\"));\n }\n else {\n var isAuth = user.authenticate(req.body.old_password);\n if (isAuth === true) {\n user.password = req.body.new_password;\n user.save(function (err, saved) {\n if (err) {\n res.send(common_1.send_response(null, true, common_1.parse_error(err)));\n }\n else {\n res.send(common_1.send_response(null, false, saved));\n }\n });\n }\n else {\n res.send(common_1.send_response(null, true, \"Old password is wrong!\"));\n }\n }\n });\n}", "function updateUserPassword(director, oldPassword, newPassword, callback) {\n User.findOne({ _id: director.usertoken }, function (err, result) {\n if (err) {\n callback(err, false);\n } else if (result) {\n bcryptjs.compare(oldPassword, result.local.password, function (err, res) {\n if (err) {\n callback(err, false);\n } else if (!res) {\n callback(null, true);\n } else {\n bcryptjs.genSalt(10, function (err, salt) {\n if (err) {\n callback(err, false);\n } else {\n bcryptjs.hash(newPassword, salt, function (err, hash) {\n if (err) {\n callback(err);\n } else {\n User.update({ _id: director.usertoken }, { \"local.password\": hash }, function (err) {\n if (err) {\n callback(err);\n } else {\n callback(null, false);\n }\n });\n }\n });\n }\n });\n }\n });\n }\n });\n}", "changePassword(req, res, next) {\n //TODO - update validator\n var userId = req.user._id;\n var oldPass = String(req.body.oldPassword);\n var newPass = String(req.body.newPassword);\n\n this.kernel.model.User.findOne({_id: userId})\n .then(user => {\n if (user.authenticate(oldPass)) {\n user.password = newPass;\n return this.kernel.model.User.update()\n .then(() => {\n res.status(204).end();\n })\n .catch(validationError(res));\n } else {\n return res.status(403).end();\n }\n });\n }", "function handlePassword(oldPassword, newPassword, confirmPass) {\n setUpdateDetAlert('')\n if (oldPassword !== user['password']) {\n setUpdateDetAlert('Current password incorrect!')\n return;\n }\n const testPass = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{6,16}$/\n if (!testPass.test(newPassword)){\n setUpdateDetAlert('Please enter a valid password')\n return;\n }\n\n if (newPassword !== confirmPass) {\n setUpdateDetAlert('Password and confirm password fields do not match!')\n return;\n }\n\n const updateDet = {...user}; // Copy user into updateDet\n updateDet['passWord'] = newPassword; // Change password field\n setUser(updateDet); //Set user\n setPasswordAlert('Password Changed!')\n }", "function updateUserPassword(username, oldPassword, newPassword, callback) {\n // Encypte passwords\n oldPassword = encryptePassword(oldPassword);\n newPassword = encryptePassword(newPassword);\n\n pool.getConnection(function(err, connection) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n connection.query('UPDATE `User` SET `password` = ? WHERE `username`=? AND `password`=?', [newPassword, username, oldPassword], function(err, result) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n // Release the connection\n connection.release();\n\n // Run callback\n callback(null, (result.affectedRows>0));\n });\n });\n}", "function passwordCheckOld() {\n if (\n document.querySelector(\".modifyPassword_form-password input\").value ==\n userObject.password\n ) {\n passwordCheckMatch();\n } else {\n document.querySelector(\".modifyPassword_paragraph-alert\").style.display =\n \"block\";\n document.querySelector(\".modifyPassword_paragraph-alert\").textContent =\n \"Wrong old password\";\n }\n}", "updateUserPassword() {\n ProfileActions.updateUserPassword(this.props.user_id, this.state.current_password, this.state.new_password);\n }", "async changePassword(req, res) {\n const user = res.locals.user\n const currentPass = req.body.current\n\n const newPass = req.body.new\n\n if (bcrypt.compareSync(currentPass, user.password)) {\n // Check for password minimums\n const passTestResult = owasp.test(newPass)\n if (!passTestResult.strong) {\n logger.log('error', 'Invalid new password entered')\n return res.status(400).json({\n msg: 'Invalid new password',\n errors: passTestResult.errors\n })\n }\n\n // If the user provided the correct password, and their new password meets the\n // minimum requirements, update their user record with the new password\n const userRecord = await db.User.findOne({\n where: { email: user.email }\n })\n await userRecord.updateAttributes({\n password: bcrypt.hashSync(newPass, 10)\n })\n logger.log('debug', 'Password successfully changed for: ', user.id)\n return res.status(200).json({\n success: true\n })\n } else {\n logger.log('debug', 'Incorrect password given during password change')\n return res.status(400).json({\n success: false,\n msg: 'Incorrect password'\n })\n }\n }", "function userUpdatePassword(req, cb){\n var email = req.body['email'] || req.user.email;\n var pass = req.body['pass'];\n log.info(\"user change password: \" + email + (email != req.user.email?\"(from: \"+req.user.email+\")\":\"\"));\n if(email != req.user.email && !req.user.isAdmin) return cb(errorsList['need-admin']);\n if(!pass) return cb(errorsList['parameter-missing']);\n users.updatePassword(email, pass, cb);\n}", "function changePass(oldPass, newPass, callback) {\n\tsendRequest({ request: 'change password', oldPassword: oldPass, newPassword: newPass }, callback);\n}", "async updatePassword({ userName, oldPassword, newPassword }) {\n const response = { success: false, message: '' };\n await this.findUser({ userName }).then((value) => {\n if (value) {\n if (bcrypt.compareSync(oldPassword, value.password)) {\n // TODO: Update password to new password (verify this is correct)\n const saltRounds = 10;\n const salt = bcrypt.genSaltSync(saltRounds);\n const password = bcrypt.hashSync(newPassword, salt);\n this.store.users.update({ password }, { where: { userName } });\n response.success = true;\n response.message = 'Successfully updated password';\n } else {\n response.message = 'Incorrect password';\n }\n } else {\n response.message = 'User does not exist';\n }\n });\n return JSON.stringify(response);\n }", "function changePasswordFn(newPassword) {\n var obj = {\n id : vm.userId,\n newPassword: newPassword\n };\n\n UserService\n .resetPassword(obj)\n .then(function (res) {\n var res = res.data;\n if (res.data && res.code === \"OK\") {\n vm.passForm.newPassword = '';\n vm.passForm.confirm_password = '';\n $('#password-strength-label').text('');\n $(\"#password-strength-label\").removeClass(\"p15 btn-rounded\");\n $('.strength-meter-fill').removeAttr('data-strength');\n $scope.setFlash('s', res.message);\n }\n },\n function (err) {\n if (err.data && err.data.message) {\n $scope.setFlash('e', err.data.message);\n }\n })\n }", "password_reset_old(new_password, old_password, user_id) {\n\t\t// get user old hashed password\n\t\tvar user_query = `query{user(ID:${user_id}){user_pass}}`;\n\t\treturn getAxiosGraphQLQuery(user_query).then(res => {\n\t\t\tvar user = res.data.data.user;\n\n\t\t\t// check if old password is correct\n\t\t\tvar pass_params = {\n\t\t\t\taction: \"check_password\",\n\t\t\t\tpassword: old_password,\n\t\t\t\thashed: user.user_pass\n\t\t\t};\n\t\t\treturn getPHPApiAxios(\"password_hash\", pass_params).then(res => {\n\t\t\t\tif (res.data == \"1\") {\n\t\t\t\t\treturn this.set_password(user_id, new_password);\n\t\t\t\t}\n\t\t\t\t// old password given is wrong\n\t\t\t\telse {\n\t\t\t\t\treturn AuthAPIErr.WRONG_PASS;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function changeAdminUserPassword(id, oldpw, newpw) {\n\n\tif ('undefined' !== typeof id && ('-h' === id || '--help' === id || 'help' === id)) {\n\t\n\t\tactionHelp(\"adminUser changePw\", 'Change password for an admin user.', '[id] [oldpassword] [newpassword]');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof id || '' === id) {\n\t\n\t\tconsole.log('Cannot change user password; user id invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof oldpw || '' === oldpw) {\n\t\n\t\tconsole.log('Cannot change user password; old password invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof newpw || '' === newpw) {\n\t\n\t\tconsole.log('Cannot change user password; new password invalid.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.changePw(id, oldpw, newpw, function(error, changed) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!changed) {\n\t\t\n\t\t\tconsole.log('User with id ' + id + ' does not exist. Use \"adminUser list\" to see all existing users.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\t\n\t\tconsole.log('Password for user has been updated (id ' + id + ').');\n\t\treturn process.exit();\n\t\n\t});\n\n}", "function updatePassword(user,password) {\n var userIndex = userDbStub.lastIndexOf(user);\n\n if (password !== '' && password !== undefined) {\n user.password = sha1(password);\n userDbStub[userIndex] = user;\n }\n \n return user;\n}", "function changePassword(uid, oldPassword, newPassword, callback) {\n const response = { status: 'ERROR', message: 'Password could not be changed due to technical problems.' };\n\n // Fetch the hash of the current password.\n db.get('SELECT password FROM Users WHERE id = ?', [uid], (err, row) => {\n if (!err) {\n const oldPass = row.password; // hashed version of the current password.\n const oldHash = bcrypt.hashSync(oldPassword, 10);\n\n bcrypt.compare(oldPassword, oldPass, (e, same) => {\n if (!e) {\n if (!same) {\n response.message = 'The current password was incorrect!';\n return callback(null, response);\n }\n\n const newHashed = bcrypt.hashSync(newPassword, 10);\n db.run('UPDATE Users SET password = ? WHERE id = ?', [newHashed, uid], (error) => {\n if (!error) {\n response.status = 'SUCCESS';\n response.message = 'Password was successfully changed!';\n }\n return callback(error, response);\n });\n } else {\n return callback(e, null);\n }\n });\n } else {\n return callback(err, null);\n }\n });\n}", "function changePassword(user, password) {\n return User.hashPassword(password).then(hash => {\n user.password = hash;\n return user.save();\n });\n}", "changePassword(context, { currentPassword, newPassword }) {\n return new Promise((resolve, reject) => {\n const user = pool.getCurrentUser();\n if (user == null) {\n reject(new Error('Unauthenticated'));\n } else {\n user.getSession(error0 => {\n if (error0) {\n reject(error0);\n } else {\n user.changePassword(\n currentPassword,\n newPassword,\n (error1, result) => {\n if (error1) {\n reject(error1);\n } else {\n resolve(result);\n }\n }\n );\n }\n });\n }\n });\n }", "isCorrectPassword(enteredPassword) {\n return User.encryptPassword(enteredPassword, this.salt) === this.password;\n }", "function editUser(){\n\tconst opsw = document.getElementById(\"opsw\").value;\n\tconst npsw = document.getElementById(\"npsw\").value;\n\tconst cpsw = document.getElementById(\"cpsw\").value;\n\tif(opsw != user_psw){\n\t\talert(\"Wrong old password\");\n\t}\n\telse if(npsw==\"\"){\n\t\talert(\"Password can't be empty\")\n\t}\n\telse if(npsw != cpsw){\n\t\talert(\"New passwords don't match\");\n\t}\n\telse{\n\t\tuser = {\"id\":0, \"password\":npsw};\n\t\tpostServerData(`/ws/users/${current_user_id}`,user,navig);\n\t}\n}", "function api_changepw(ctx, passwordkey, masterkey, oldpw, newpw, email) {\n var req,\n res;\n var oldkey;\n var newkey = prepare_key_pw(newpw);\n if (oldpw !== false) {\n var oldkey = prepare_key_pw(oldpw);\n // quick check of old pw\n if (oldkey[0] != passwordkey[0] || oldkey[1] != passwordkey[1] || oldkey[2] != passwordkey[2] || oldkey[3] != passwordkey[3]) return 1;\n if (oldkey[0] == newkey[0] && oldkey[1] == newkey[1] && oldkey[2] == newkey[2] && oldkey[3] == newkey[3]) return 2;\n }\n var aes = new sjcl.cipher.aes(newkey);\n // encrypt masterkey with the new password\n var cmasterkey = encrypt_key(aes, masterkey);\n req = {\n a: 'up',\n k: a32_to_base64(cmasterkey)\n };\n if (email.length) req.email = email;\n api_req(req, ctx);\n}", "onupdatePassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function verifyOldPassword() {\n return compose()\n .use(function(req, res, next) {\n console.log('verifying password');\n if(req.user.authenticate(req.body.oldPassword)) {\n console.log('password verified');\n next();\n } else {\n let err = new Error(\"Your current password is incorrect!\");\n return res.status(403).send(err);\n }\n });\n}", "checkPassword(originalPwd){\n return bcrypt.compareSync(originalPwd, this.password);\n }", "function resetPassword(oldPW, newPW) {\n\t\tvar url = Host + \"/LoginApiAction_password.action\";\n\t\tvar params = {\n\t\t\tjsession: $localStorage.currentUser.token,\n\t\t\tuserAccount: $localStorage.currentUser.username,\n\t\t\toldPwd: oldPW,\n\t\t\tnewPwd: newPW\n\t\t};\n\n\t\treturn returnHttp(url, params);\n\t}", "editUserPassword(user_id, pwd) {\r\n return axios.put(USER_API_BASE_URL + '/change_pwd/' + user_id + '/'+pwd);\r\n }", "async function changePassword(req, res) {\n /* check for needed values */\n const email = req.body.email;\n const currentPassword = req.body.currentPassword;\n const newPassword = req.body.newPassword;\n\n if (!email || !currentPassword || !newPassword) \n return res.status(401).send('Need to enter email, old password, and new password');\n\n /* check that values are valid */\n const user_id = await encryptEmail(email);\n const user = await userWithEmail(email);\n if (user === undefined || user_id != res.locals.userid) \n return res.status(401).send('Incorrect email');\n\n // if user exists, check that passwords match\n const passwordMatches = await passwordMatchesUser(user, currentPassword);\n if (!passwordMatches) \n return res.status(401).send('Incorrect current password');\n\n // new password should be valid\n if (newPassword.length < 6) \n return res.status(401).send('New password must be at least 6 characters');\n\n // if everything is valid, change the password and delete current auth token\n db.users[user_id].password = await encryptPassword(newPassword);\n db.writeUsers();\n delete db.auth[user_id];\n db.writeAuth();\n\n res.status(200).send('Password changed. Login again to proceed');\n}", "function hashPassword(next) {\n const user = this;\n\n // hash the password if it has been modified (or is new)\n if (!user.isModified('password')) next();\n\n // generate a salt\n bcrypt.genSalt(SALT_WORK_FACTOR, (saltError, salt) => {\n if (saltError) return next(saltError);\n\n // hash the password using our new salt\n return bcrypt.hash(user.password, salt, (hashError, hash) => {\n if (hashError) return next(hashError);\n\n // override the password with the hashed one\n user.password = hash;\n return next();\n });\n });\n}", "async ChangePasswordUser(username,password){\n User.update({username:username},{password:password},function(err){\n if(err) return console.error(err);\n })\n return \"succes\"\n }", "function changePassword(){\n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------Change Password--------------------------------\\n\\n\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n\tvar oldpass = readline.question(\"Enter your old password => \");\n\tconsole.log(\"------------------------------------------------------------------------------\")\n\tvar newpass = readline.question(\"Enter your new password => \");\n\tconsole.log(\"------------------------------------------------------------------------------\\n\")\n \t\tif(oldpass === data[0].password){\n \t\t\tmailcontroller.updatepassword(data[0].emailid,newpass,(err)=>{\n \t\t\t\tif(err) throw err;\n \t\t\t\telse\n \t\t\t\t\tconsole.log(\"\\n---------Password Changed successfilly!----------\");\n \t\t\t\t\tpassword = newpass;\n \t\t\t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n \t\t\t\t\thomeUI();\n \t\t\t})\n \t\t}else\n \t\t{\n \t\t\tconsole.log(\"\\n-----------Old Password does not match!------------------\");\n \t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n \t\t\thomeUI();\n \t\t}\n \t}\n\t\n \t});\n}", "function setPassword(req, res) {\n const curentPassword = req.body.password;\n const newPassword = req.body.new_password;\n const rePassword = req.body.re_password; // retyped new password\n if (\n curentPassword === undefined ||\n newPassword === undefined ||\n rePassword === undefined\n ) {\n // attrs missing\n res.status(403).json({\n valid: false,\n message: \"Missing attributes\",\n });\n } else {\n if (newPassword.length < 8 || newPassword.length > 16) {\n return res.status(403).json({\n valid: false,\n message: \"Password length should be greater than 8 lower than 16\",\n });\n }\n // check if new pass and re_pass match\n if (newPassword !== rePassword) {\n // pass dose not match\n res.status(406).json({\n valid: false,\n message: \"New password and Retyped password dose not match\",\n });\n } else {\n // new pass and re_pass matches\n const userId = req.params.id;\n User.findByPk(userId)\n .then((response) => {\n if (response === null) {\n res.status(404).json({\n valid: false,\n message: \"User not found\",\n });\n } else {\n // user found\n // validate if old pass matches saved pass\n if (passwordHash.verify(curentPassword, response.password)) {\n // send and saved pass matches\n response.password = passwordHash.generate(newPassword);\n response\n .save()\n .then((response) => {\n res.status(200).json({\n valid: true,\n message: \"Password changed\",\n });\n })\n .catch((err) => {\n res.status(500).json({\n valid: false,\n message: \"Password update error\",\n });\n });\n } else {\n res.status(406).json({\n valid: false,\n message: \"Password incorrect\",\n });\n }\n }\n })\n .catch((err) => {});\n }\n }\n}", "function password_changed(pwd_elem) {\n if($(pwd_elem).data(\"pwd_modified\") == false &&\n $(pwd_elem).data(\"pwd_orig\") == pwd_elem.value) {\n\t//This is the most straightforward case. This means that password was not modified at all.\n\t//User is using the same password that was entered by the browser.\n\t$(pwd_elem).data(\"pwd_stored\", true);\n\treturn;\n }\n if($(pwd_elem).data(\"pwd_modified\") == false &&\n $(pwd_elem).data(\"pwd_orig\") != pwd_elem.value &&\n $(pwd_elem).data(\"pwd_current\") == pwd_elem.value) {\n\t//This means that the user has actively modified the password sometime in the past.\n\t//So password stored is false.\n\t$(pwd_elem).data(\"pwd_stored\", false);\n\treturn;\n }\n if($(pwd_elem).data(\"pwd_modified\") == false &&\n $(pwd_elem).data(\"pwd_orig\") != pwd_elem.value &&\n $(pwd_elem).data(\"pwd_current\") != pwd_elem.value) {\n\t//In this case, user did edit the password, but then he changed username to some username\n\t//that also has the password stored but is not equal to default uesrname that browser enters.\n\t//Hence, the password is still stored in the browser.\n\t$(pwd_elem).data(\"pwd_stored\", true);\n\t$(pwd_elem).data(\"pwd_orig\", pwd_elem.value);\n\treturn;\n }\n if($(pwd_elem).data(\"pwd_modified\") == true) {\n\t//In this case, user did edit the password, but then he changed username to some username\n\t//that also has the password stored but is not equal to default uesrname that browser enters.\n\t//Hence, the password is still stored in the browser.\n\t$(pwd_elem).data(\"pwd_modified\", false);\n\t$(pwd_elem).data(\"pwd_stored\", false);\n\treturn;\n }\n}", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function updateUserPassword(answer){\n helpers.chosenUser.password = answer;\n helpers.rl.question('\\nOk, please enter the new age: ', updateUserAge);\n}", "function updatePassword(userID, newPassword){\n Account.collection.updateOne(\n {_id: mongoose.Types.ObjectId(userID)},\n {$set:{password:newPassword}});\n}", "async function password(authToken, oldPassword, newPassword) {\n // console.log(\"Password function is getting called!\");\n let responseData = {};\n\n try {\n const address = `${apiConfig.URL_SCHEME}://${apiConfig.IP}:${apiConfig.PORT}${apiConfig.EXT}/changeUser/password`;\n const payload = {\n oldPassword,\n newPassword,\n };\n const settings = {\n headers: {\n Authorization: authToken,\n },\n };\n\n const response = await axios.patch(address, payload, settings);\n\n responseData = response.data;\n } catch (error) {\n responseData = {\n success: false,\n message: 'Error contacting API server.',\n };\n }\n\n return responseData;\n}", "function updatePassword() {\n if (!newpassword || !confirmpassword) {\n res.send({ \"message\": \"fill all entries\" });\n }\n else {\n if (newpassword != confirmpassword) {\n res.send({ \"mesaage\": \"pasword not match\" });\n }\n else {\n bcrypt.genSalt(10, (err, salt) => {\n bcrypt.hash(newpassword, salt, (err, hash) => {\n if (err) throw err;\n newpassword = hash;\n\n var sql = require('mssql');\n const pool = new sql.ConnectionPool({\n user: 'sa',\n password: 'abcd',\n server: 'DESKTOP-VOMOOC8',\n database: 'auth'\n })\n\n var conn = pool;\n conn.connect().then(function (err) {\n if (err) console.log(err);\n var request = new sql.Request(conn);\n var q1 = \"update auth set password = '\" + newpassword + \"' where email = '\" + email + \"'\";\n request.query(q1, function (err, response) {\n if (err) { res.send(err); }\n res.send({ \"mesaage\": \"password has been changed\" });\n });\n })\n\n });\n });\n }\n }\n }", "setPassword(newPassword) {\n const salt = bcrypt.genSaltSync(10); \n const hash = bcrypt.hashSync(newPassword, salt);\n this.password = hash; \n\n }", "async function checkPassword(userID, request, response){\n let account = await db.getAccount(userID);\n if(account !== null){//If user entered the correct current password\n if(bcrypt.compareSync(request.body.currentPassword, account.getPassword())){\n //then update to new password\n db.updatePassword(userID,bcrypt.hashSync(request.body.newPassword, saltRounds));\n }\n }\n response.redirect(\"/User_Account\");\n}", "function setPassword(req, res) {\n console.log(req.body);\n let { token, password } = req.body;\n\n let cipher = crypto.createCipheriv(algorithm, new Buffer.from(key), iv);\n var encrypted = cipher.update(password, \"utf8\", \"hex\") + cipher.final(\"hex\");\n // var hashp = bcrypt.hashSync(password, 10);\n\n User.findOneAndUpdate(\n {\n passwordToken: token,\n passwordExpires: { $gt: Date.now() }\n },\n {\n $set: {\n password: encrypted,\n passwordToken: undefined,\n passwordExpires: undefined\n }\n },\n function(err, user) {\n console.log({ user });\n if (user) {\n send(\n \"Password changed DocMz\",\n user.email,\n \"Your password has been successfully changed\" +\n \"\\n\\n\" +\n \"Feel free to log in with your newly set password.\"\n );\n res.status(200).json({ status: true, message: \"Password Set\" });\n } else {\n res.status(404).json({ status: false, message: \"Token Expired\" });\n }\n }\n );\n}", "function changePassword(userID,newPassword,callback){\n // Throw exceptions.\n if (!Number.isInteger(userID)){\n throw \"userID must be integer.\";\n }\n if (typeof newPassword!='string' || newPassword.length<6){\n throw \"password must be string >=6 characters.\";\n }\n // Get salt.\n var queryDum = `\n SELECT\n password_salt\n FROM\n users\n WHERE\n user_id = ?\n `;\n var columnValues = [userID];\n queryXSS(queryDum,columnValues,function(err,rows,fields){\n if (err) {console.log(err);}\n var salt = rows[0]['password_salt'];\n // Salt and set new password.\n var bcrypt = require('bcrypt-nodejs');\n var passwordHash = bcrypt.hashSync(newPassword,salt);\n queryDum = `\n UPDATE\n users\n SET\n password_hash = ?,\n email_verified = 1\n WHERE\n user_id = ?\n `;\n columnValues = [passwordHash,userID];\n queryXSS(queryDum,columnValues,function(err,result){\n if (err) {console.log(err);}\n callback();\n });\n });\n}", "async isPasswordChangeValid() {\n const { t, currentPwdHash, generateAlert } = this.props;\n const currentPasswordHash = await getPasswordHash(this.state.currentPassword);\n if (!isEqual(currentPwdHash, currentPasswordHash)) {\n return generateAlert('error', t('incorrectPassword'), t('incorrectPasswordExplanation'));\n } else if (this.state.newPassword === this.state.currentPassword) {\n return generateAlert('error', t('oldPassword'), t('oldPasswordExplanation'));\n }\n this.passwordFields.checkPassword();\n }", "function setPswd (email, passwordold, passwordnew, callback) {\n authUsr(email, passwordold, function(e, r) {\n if (e) return callback(new Error(\"Password was wrong\"));\n if (r) {\n log(\"Update password for \" + email + \"from \" + passwordold + \" to \" + passwordnew);\n var salt = crypto.randomBytes(128).toString('base64');\n \n hash(passwordnew, salt, function(err, hashedPassword){\n if (err) throw err;\n credentials = {\"salt\": salt, \"password\": hashedPassword, \"verified\": r.verified}\n //TODO: Update log using a log object paradigm (log.js)\n\n client.HSET(NS+email, \"credentials\", JSON.stringify(credentials), callback);\n });\n } else {\n return callback(new Error(\"Password was wrong\"));\n };\n });\n}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "function validateUserChangePassword (input) {\n const schema = Joi.object({\n oldPassword: Joi.string()\n .required()\n .min(7)\n .max(50),\n\n newPassword: Joi.string()\n .required()\n .min(7)\n .max(50)\n });\n\n const result = schema.validate(input);\n return result;\n}", "function hashPassword (next) {\n\n let user = this._update ? this._update.$set : this;\n\n if (!user || !user.password) {\n return next();\n }\n\n createHash(user.password, (error, hash) => {\n\n if (error) {\n return next(error);\n }\n\n user.password = hash;\n return next();\n });\n}", "function changePassword (e) {\n e.preventDefault();\n if(validFieldsPassword()) {\n const formData = new FormData(),\n url = '/usuarios/contrasenia'\n\n formData.append('currentPassword', inpCurrentPassword.value)\n formData.append('newPassword', inpNewPassword.value)\n const options = {\n method: 'POST',\n body: formData\n }\n sendAjax(url, options)\n }\n }", "changeUserPassword() {\n // If user is signed in then redirect back home\n if (!this.authentication.user) {\n this.$location.path('/');\n }\n this.$http.post('/api/users/password', this.passwordDetails).success(\n (response) => {\n // If successful show success message and clear form\n this.passwordDetails = null;\n this.$state.transitionTo('settings.profile');\n this.toastr.success(\"Your password was changed successfully.\");\n }).error((response) => {\n this.toastr.error(response.message.message, 'Error');\n });\n }", "function updateUser() {\n // fields to update\n delete userParam.oldPassword;\n delete userParam.confirmPassword;\n var set = _.omit(userParam,'_id');\n \n // update password if it was entered\n if (userParam.password) {\n set.hash = bcrypt.hashSync(userParam.password, 10);\n }\n delete set.password;\n \n db.users.update({_id: mongo.helper.toObjectID(_id)}, {$set: set}, function(err){\n if(err) {\n deferred.reject(err);\n }\n deferred.resolve();\n });\n }", "updateUser(password = this.props.currentPassword) {\n this.props.updateUser({\n f_name: this.state.f_name,\n l_name: this.state.l_name,\n password: password\n });\n }", "static async updatePassword(req, res, next) {\n const user_id = req.user.result.id;\n const password = req.header(\"x-new-password\");\n if (!password) {\n return res.status(204).send({ \"Password not sent\": true });\n }\n try {\n const result = await UsersService.getUsersByPk(user_id);\n\n if (!result) {\n return res.status(204).send({ \"User found\": null });\n }\n\n const email = result.dataValues.email;\n\n const newPassword = await Crypt.generateHash(password);\n\n const update = await result.update({ password: newPassword });\n\n const token = await Crypt.generateToken(email);\n\n return res.send({ Updated: true, \" New token\": token });\n } catch (err) {\n next(err);\n }\n }", "changeUser(event) {\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n \n // if change email field, user['email'] will be changed\n // if change password field, user['password'] will be changed\n // if change confirm_password field, user['confirm_password'] will be changed\n\n this.setState({user});\n\n if (this.state.user.password !== this.state.user.confirm_password) {\n const errors = this.state.errors;\n errors.password = \"Password and Confirm Password don't watch\";\n this.setState({errors}); // refresh UI and state\n } else {\n const errors = this.state.errors;\n errors.password = '';\n this.setState({errors});\n }\n }", "update(req, res) {\n User.findOne({ where: { id: req.params.id } })\n .then((user) => {\n if (user) {\n if (req.params.id !== req.decoded.id.toString()) {\n res.status(403).send({ message: 'That action is not allowed. You can only edit your own password.' });\n } else if (!req.body.password || req.body.password === '') {\n res.send({ message: 'Please enter your new password!' });\n } else {\n user.updateAttributes({\n username: req.body.username || user.username,\n email: req.body.email || user.email,\n password: passwordHash.generate(req.body.password) || user.passsword,\n }).then(() => {\n res.status(200).send({ message: 'Your profile has been updated!' });\n });\n }\n } else {\n res.status(404).send({ message: 'User doesn\\'t exist!' });\n }\n });\n }", "changeUser(event){\n // get the current value\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n //setState\n this.setState({user: user});\n // handle error, password === confirm_password\n if(this.state.user['password'] !== this.state.user['confirm_password']){\n let errors = this.state.errors;\n errors.password = 'Do NOT match. Try Again.'\n this.setState({errors: errors});\n }else{\n let errors = this.state.errors;\n errors.password = '';\n this.setState({errors: errors});\n }\n \n }", "function updateUser(userID, password) {\n sqlDB\n .query(`UPDATE ${userTable} SET user_password = '${password}' WHERE id = '${userID}' AND email = ${email};`,\n function (err, results) {\n if (err) {\n return res.status(500).send(err);\n } else if (results.length > 0) {\n return res.status(200).send(\"User password updated\");\n }\n })\n }", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function update_password(){\n\tvar username = localStorage.getItem('username');\n\tvar password = localStorage.getItem('password');\n\tvar newPassword = $(\"#updatepassword\").val();\n\tif (password.trim()!==newPassword){\n\t\tpassword_check(newPassword).then(function(){\n\t\t\tlet inputs = {\n\t\t\t\t\t\t\tpassword: newPassword\n\t\t\t\t\t\t};\n\t\t\tlet params = {\n\t\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\t\turl: \"/api/user/edit_password/\"+username,\n\t\t\t\t\t\t\tdata: inputs\n\t\t\t\t\t\t};\n\t\t\t$.ajax(params).done(function(data) {\n\t\t\t\tlocalStorage.setItem('password', newPassword);\n\t\t\t\tdocument.getElementById(\"greetings\").innerHTML = \"Word is that you changed your pass...\";\n\t\t\t\tconsole.log(\"Password changed\")\n\t\t\t})\n\t\t}).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t});\n\t} else {\n\t\tdocument.getElementById(\"greetings\").innerHTML = \"Pass is still the same...\";\n\t}\n}", "function setUserPassword(newUserPassword) {\n bot.password = newUserPassword;\n rl.question(''\n + 'Please enter a secret key used to encrypt your credentials.\\n'\n + 'Make sure you remember this secret!\\n'\n , setSecret\n );\n}", "function ChangePassword() {\n\t}", "updatePassword(body) {\n return HTTP.post('users/updatePassword', body)\n }", "changePassword(event) {\n var newState = this.mergeWithCurrentState({\n password: event.target.value\n });\n\n this.emitChange(newState);\n }", "function postPassChange(password, newPassword, callback) {\n return fetch('/users/changepass', {\n method: 'POST',\n body: JSON.stringify({ password, newPassword }),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(formatJsonErrResponse)\n .then(callback)\n}", "function updatePassword(tablePkId, prevPassword){\r\n\tvar oldPassword = document.getElementById(\"oldPwdChgInptId\").value;\r\n\tvar newPassword = document.getElementById(\"newPwdChgInptId\").value;\r\n\tvar confirmPassword = document.getElementById(\"confirmPwdChgInptId\").value;\r\n\tif(validatePasswordEntries(oldPassword, newPassword, confirmPassword, prevPassword) == true) {\r\n\t\tvar newUserProf = Spine.Model.sub();\r\n\t\tnewUserProf.configure(\"/admin/facilitatorAccount/updatePasswordFacilitator\", \"valueDesc\", \"tablePkId\", \"facilitatorEmail\");\r\n\t\tnewUserProf.extend( Spine.Model.Ajax );\r\n\t\t//Populate the model with data to transfer\r\n\t\tvar modelPopulator = new newUserProf({ \r\n\t\t\tvalueDesc: encode(confirmPassword+confirmPassword),\r\n\t\t\ttablePkId: tablePkId,\r\n\t\t\tfacilitatorEmail: sessionStorage.getItem(\"jctEmail\")\r\n\t\t});\r\n\t\tmodelPopulator.save(); //POST\r\n\t\tnewUserProf.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t});\r\n\t\tnewUserProf.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\tif(statusCode == 200) {\r\n\t\t\t\tshowUserData(obj.existingUserDataList);\r\n\t\t\t\talertify.alert(\"Password has been updated successfully.\");\r\n\t\t\t\t$('#alertify-ok').click(function() {\t\r\n\t\t\t \tsessionStorage.clear();\r\n\t\t\t \twindow.location = \"../signup-page.jsp\";\r\n\t\t\t });\r\n\t\t\t\t/*populateUserData();\r\n\t\t\t\talertify.alert(\"Password has been updated successfully.\");\r\n\t\t\t\tvar passwordLength = ((obj.userPassword).length)/2;\r\n\t\t\t\tvar stringBuilder = \"\";\r\n\t\t\t\tfor(var i=0; i<passwordLength; i++){\r\n\t\t\t\t\tstringBuilder = stringBuilder + \"*\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdocument.getElementById(\"chgPwdInptId\").innerHTML = stringBuilder+\"&nbsp;&nbsp;<a href='#' onClick='editPassword(\"+obj.primaryKey+\", \"+obj.userPassword+\")' class= 'hyperlink_text' >edit</a>\";\r\n\t\t\t\tvar valueChgDiv = document.getElementById(\"pwdChgMainDiv\");\r\n\t\t\t\tvalueChgDiv.setAttribute(\"style\", \"display:none\");\t\r\n\t\t\t\tvar mainDiv = document.getElementById(\"divGeneralId\");\r\n\t\t\t\tmainDiv.setAttribute(\"style\", \"display:none\");\t*/\r\n\t\t\t} else if(statusCode == 500) {\r\n\t\t\t\t// Error Message\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function changePw () {\n var userid = $('#pwUserid').val();\n var currpw = $('#pwPassword').val();\n var newpw = $('#pwNew').val();\n var pw2 = $('#pwNew2').val();\n\n if ( newpw != pw2 ) {\n alert(\"The proposed password is not equal to the retyped password, returning.\");\n return;\n }\n\n alert('Calling changeMyPW.php');\n}", "editPasswordUser(hash: string, salt: string, email: string, callback) {\n super.query(\n 'UPDATE user SET hash = ?, salt = ? WHERE email = ?',\n [hash, salt, email],\n callback,\n );\n }", "function change(curpass, pass, passConfirm){\n if (curpass === \"\" || pass === \"\" || passConfirm === \"\"){\n setPWMessage();\n setSuccessMessage();\n setPWErrorMessage('Please fill in all fields');\n }\n else{\n // first check that old pw is correct for security\n axios.post('https://togethrgroup1.herokuapp.com/api/login', { \n UserName: username,\n Password: curpass\n })\n .then((response) => {\n console.log(response);\n if (pass != passConfirm){\n setPWMessage();\n setSuccessMessage();\n setPWErrorMessage('Passwords must match');\n }\n else {\n // hash pw\n axios.patch('https://togethrgroup1.herokuapp.com/api/editpassword', { \n id: userid,\n Password: pass\n })\n .then((response) => {\n console.log(response);\n setPWMessage();\n setPWErrorMessage();\n setSuccessMessage('Your password was updated!');\n }, (error) => {\n console.log(error);\n setPWMessage();\n setSuccessMessage();\n setPWErrorMessage('Something went wrong! Try again.');\n });\n }\n\n }, (error) => {\n console.log(error);\n setSuccessMessage();\n setPWErrorMessage();\n setPWMessage('Incorrect Password');\n });\n }\n }", "function changePW() {\n var currentPW = localStorage.getItem(\"storedPass\");\n var enteredPW = $(\"#enteredPW\").val();\n var newPW = $(\"#newPW\").val();\n var confirmPW = $(\"#confirmPW\").val();\n\n console.log(currentPW);\n\n if (enteredPW == \"\" || newPW == \"\" || confirmPW == \"\") {\n emptyAlert();\n } else {\n if (enteredPW == currentPW) {\n // if entered password matches database\n console.log(\"entered password matches stored password\");\n\n if (newPW == confirmPW) {\n //if new password and confirm password matches\n\n var settings = {\n url: `http://localhost:8080/api/update/pw/${userID}?address=${newPW}`,\n method: \"PUT\",\n timeout: 0,\n };\n\n $.ajax(settings).done(function (response) {\n console.log(\"password matches, update password\");\n successPWChange();\n });\n\n // update password\n } else {\n //if new password and confirm password DOESNT match\n wrongConfirmPass();\n }\n } else {\n //entered password doesnt match\n wrongPass();\n }\n }\n}", "function changePasswordHandler(element) {\n try {\n // Form values\n var oldPassword = document.getElementById(\"change-password-old\").value;\n var newPassword = document.getElementById(\"change-password-new\").value;\n var confirmNewPassword = document.getElementById(\"change-password-confirm\")\n .value;\n\n // Fetches the accounts table database\n var accountsFromLocalStorage = JSON.parse(storage.getItem(\"accounts\"));\n\n // Boolean that will decide whether to be able to edit password or not\n var editPassword = true;\n\n // Checks if old password is blank\n if (oldPassword == \"\") {\n alert(\"Please enter your old password.\");\n editPassword = false;\n }\n\n // Checks if new password is blank\n if (newPassword == \"\") {\n alert(\"Please enter your new password.\");\n editPassword = false;\n }\n\n // Checks if confirm password is blank\n if (confirmNewPassword == \"\") {\n alert(\"Please enter your new password to confirm.\");\n editPassword = false;\n }\n\n // Checks if password is the same with old password\n if (loggedInUser.password == oldPassword) {\n // Checks if all criteria is met and nothing is blank\n if (editPassword) {\n // Confirms if the new password is the same\n if (newPassword == confirmNewPassword) {\n // Checks whether password is strong or not\n if (StrengthChecker(newPassword)) {\n // Fetches the accounts database\n var accountsFromLocalStorage = JSON.parse(\n storage.getItem(\"accounts\")\n );\n\n // Iterates through the accounts\n for (let i = 0; i < accountsFromLocalStorage.length; i++) {\n // Temporarily stores current account in loop in a variable\n var account = accountsFromLocalStorage[i];\n\n // Checks if the account is the same as logged in user\n if (account.id == loggedInUser.id) {\n // Sets the new password\n account.password = newPassword;\n\n // Replaces current data with new data\n accountsFromLocalStorage[i] = account;\n\n // Updates the accounts table on local storage\n storage.setItem(\n \"accounts\",\n JSON.stringify(accountsFromLocalStorage)\n );\n\n //Removes the old data from the accounts table in the local storage\n storage.removeItem(\"loggedInUser\");\n alert(\n \"Successfully changed password. You will now be logged out.\"\n );\n\n // Redirects user to login page\n location.href = \"login.html\";\n break;\n }\n }\n } else {\n // Will display when new password is not strong enough\n alert(\n \"Password should be minimum 8 characters and only characters A-Z, a-z and '-' are acceptable for username.\"\n );\n }\n } else {\n // Will display when new and confirm password do not match\n alert(\"Passwords do not match.\");\n }\n }\n } else {\n // Will display when old and new password do not match\n alert(\n \"Your old password does not match with your current password. Please double check!\"\n );\n }\n } catch (e) {\n alert(e);\n }\n}", "checkPassword(password) {\n return password === this.password;\n }", "isSamePassword(currentPassword, newPassword) {\n return currentPassword === newPassword;\n }", "updateNewPassword(event) {\n const confirmPassword = this.state.confirm_password;\n if (event.target.value != confirmPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match'\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({\n valid_state_new: 'success',\n error_message: '',\n });\n }\n this.setState({new_password: event.target.value});\n }", "async beforeUpdate(updatedUserData) {\n updatedUserData.password = await bcrypt.hash(updatedUserData.password, 10);\n return updatedUserData;\n }", "onUpdate() {\n this.setState({ attemptedSubmit: true });\n if (this.state.changePassword) this.updateWithNewPassword();\n else this.updateUser();\n this.props.onReturn();\n }", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n if (update.password) {\n //ecnriptar pasword\n bcrypt.hash(update.password, null, null, function (err, hash) {\n var user = hash;\n update.password = user;\n\n\n Cliente.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n if (err) {\n res.status(500).send({\n message: 'Error al actualizar usuario'\n });\n } else {\n if (!userUpdated) {\n res.status(404).send({\n message: 'No se pudo actualizar usuario'\n });\n\n } else {\n res.status(200).send({\n user: userUpdated\n });\n\n }\n }\n });\n });\n\n } else {\n Cliente.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n if (err) {\n res.status(500).send({\n message: 'Error al actualizar usuario'\n });\n } else {\n if (!userUpdated) {\n res.status(404).send({\n message: 'No se pudo actualizar usuario'\n });\n\n } else {\n res.status(200).send({\n user: userUpdated\n });\n\n }\n }\n });\n }\n\n}", "function updateDBPassword(password, callback) {\n let user = firebase.auth().currentUser;\n // console.log(user);\n user.updatePassword(password).then(function () {\n callback();\n return codes.UPDATE_SUCCESS;\n });\n // .catch(function(error) {\n // throw new Error(`Password updation Error! Error code: ${error.errorCode}\\nError Message: ${error.errorMessage}`);\n // return codes.UPDATE_FAILIURE;\n // });\n}", "function change_password() {\n\tvar current_password = document.getElementById(\"current_password\").value;\n\tvar new_password = document.getElementById(\"new_password\").value;\n\tvar confirm_new_passord = document.getElementById(\"confirm_new_password\").value;\n\t\n\t// Check validity of given passwords\n\tif(new_password != confirm_new_passord) {\n\t\talert(\"Passwords do not match\");\n\t\treturn;\n\t} else if(new_password.length < 8) {\n\t\talert(\"New password is too short\");\n\t\treturn;\n\t}\n\tvar data = JSON.stringify({\n\t\tcurrent_password : current_password,\n\t\tnew_password : new_password\n\t});\n\tvar uri = getLink(\"UpdatePassword\");\n\t\n\tvar xhr = createRequest(\"POST\", uri);\n\txhr.setRequestHeader(\"Content-Type\", \"text/plain\")\n\txhr.onload = function() {\n\t\tif(xhr.status == 401) alert(\"Current password incorrect\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong on the server :/\");\n\t\telse {\n\t\t\tdocument.getElementById(\"current_password\").value = \"\";\n\t\t\tdocument.getElementById(\"new_password\").value = \"\";\n\t\t\tdocument.getElementById(\"confirm_new_password\").value = \"\";\n\t\t\talert(\"Password successfully changed!\");\n\t\t}\n\t}\n\txhr.send(data);\n\t\n}", "static async update(query, changes, hash = false) { // (NOT FINISHED - missing the checks for already existing username and email and the changing of role)\n if(!this.validate()) return new Error('VALIDATION')\n\n if (hash) changes = await this.hashPassword(changes)\n\n return await super.update(query, changes)\n }", "updatePassword(user) {\n return __awaiter(this, void 0, void 0, function* () {\n if (user == null) {\n throw new nullargumenterror_1.NullArgumentError('user');\n }\n let index = this.users.findIndex(u => u.id == user.id);\n if (index != -1) {\n this.users[index].passwordHash = user.passwordHash;\n }\n });\n }", "validateUserCredentials(oldPassword, newPassword, confirmNewPassword) {\n var msgToUser = \"\";\n var isValidUser = true;\n if (oldPassword == \"\") {\n msgToUser = \"Old Password is empty\";\n isValidUser = false;\n } else if (oldPassword == newPassword) {\n msgToUser = \"Old and New passwords must be different\";\n isValidUser = false;\n }\n else if (newPassword == \"\" || confirmNewPassword == \"\") {\n msgToUser = \"Please Enter New Passwords\";\n isValidUser = false;\n }\n else if (newPassword != confirmNewPassword) {\n msgToUser = \"New Passwords do not match\";\n isValidUser = false;\n }\n this.setState({ label: msgToUser });\n return isValidUser;\n }", "async changePassword(player) {\n const verifyCurrentPassword = await Question.ask(player, {\n question: 'Changing your password',\n message: 'Enter your current password to verify your identity',\n isPrivate: true, // display this as a password\n constraints: {\n validation: AccountDatabase.prototype.validatePassword.bind(\n this.database_, player.name),\n explanation: 'That password is incorrect. We need to validate this to make sure ' +\n 'that you\\'re really changing your own password.',\n abort: 'Sorry, we need to validate your identity!',\n }\n });\n\n if (!verifyCurrentPassword)\n return; // the user couldn't verify their current password\n\n // Give the |player| multiple attempts to pick a reasonably secure password. We don't set\n // high requirements, but we do need them to be a little bit sensible with their security.\n const password = await Question.ask(player, {\n question: 'Changing your password',\n message: 'Enter the new password that you have in mind',\n isPrivate: true, // display this as a password field\n constraints: {\n validation: AccountCommands.prototype.isSufficientlySecurePassword.bind(this),\n explanation: 'The password must be at least 8 characters long, and contain at ' +\n 'least one number, symbol or a character of different casing.',\n abort: 'Sorry, you need to have a reasonably secure password!'\n }\n });\n\n if (!password)\n return; // the user aborted out of the flow\n\n // The |player| must confirm that they indeed picked the right password, so we ask again.\n const confirmPassword = await Question.ask(player, {\n question: 'Changing your password',\n message: 'Please enter your password again to verify.',\n isPrivate: true, // display this as a password field\n constraints: {\n validation: input => input === password,\n explanation: 'You must enter exactly the same password again to make sure that ' +\n 'you didn\\'t accidentally misspell it.',\n abort: 'Sorry, you need to confirm your password!'\n }\n });\n\n if (!confirmPassword || confirmPassword !== password)\n return; // the user aborted out of the flow\n\n // Now execute the command to actually change the password in the database.\n await this.database_.changePassword(player.name, password);\n\n // Announce the change to administrators, so that the change is known by at least a few more\n // people in case the player forgets their new password immediately after. It happens.\n if (this.settings_().getValue('account/password_admin_joke')) {\n let fakePassword = null;\n switch (random(4)) {\n case 0:\n fakePassword = player.name.toLowerCase().replace(/[^a-zA-Z]/g, '');\n for (const [ before, after ] of [ ['a', 4], ['e', 3], ['i', 1], ['o', 0] ])\n fakePassword = fakePassword.replaceAll(before, after);\n\n break;\n case 1:\n fakePassword =\n player.name.toLowerCase().replace(/[^a-zA-Z]/g, '') +\n (random(1000, 9999).toString());\n break;\n case 2:\n fakePassword = '1' + player.name.toLowerCase().replace(/[^a-zA-Z]/g, '') + '1';\n break;\n case 3:\n fakePassword = ['deagle', 'sawnoff', 'gtasa', 'lvpsux', 'password'][random(5)];\n fakePassword += random(100, 999).toString();\n break;\n }\n\n this.announce_().announceToAdministrators(\n Message.ACCOUNT_ADMIN_PASSWORD_CHANGED2, player.name, player.id, fakePassword);\n } else {\n this.announce_().announceToAdministrators(\n Message.ACCOUNT_ADMIN_PASSWORD_CHANGED, player.name, player.id);\n }\n\n return alert(player, {\n title: 'Account management',\n message: `Your password has been changed.`\n });\n }", "function changePasswordCallback(result){\n switch (result.error){\n // If no error, show feedback \"password changed\"\n case API_NO_ERROR:\n info('sinfo', locale_strings['PASSWORD_CHANGED'], 4);\n $('change_password').reset();\n break;\n\n // If not logged in, show login page\n case API_NOT_LOGGEDIN:\n openLogin();\n break;\n\n // Provided actual password was wrong\n case API_WRONG_CREDENTIALS:\n info('sinfo', getErrorString(result.error), 4);\n $('cp_password').setValue(\"\");\n $('cp_password').shake();\n break;\n\n case API_INVALID_PASSWORD:\n info('sinfo', getString('NEW_PASS_INVALID') + '<br>' +\n getString('MIN_LENGTH') + ': ' + result.min + '<br>' +\n getString('MAX_LENGTH') + ': ' + result.max, 4);\n $('change_password').reset();\n $('change_password').shake();\n break;\n\n // Else show a info message\n default:\n info('sinfo', getErrorString(result.error), 4);\n $('change_password').reset();\n $('change_password').shake();\n break;\n }\n}", "function set_user_password(env, password) {\n env.auth.user.password = { plaintext: password };\n}", "constructor(currPassword, newPassword) {\n this.currentPassword = currPassword;\n this.newPassword = newPassword;\n }", "function handleAdminPasswordChange(event){\n setAdminPassword(event.target.value);\n }", "async beforeUpdate(updatedUserData) {\n updatedUserData.password = await bcrypt.hash(updatedUserData.password, 10);\n return updatedUserDatal\n }", "function saltHashPassword (user) {\n if(user.changed('password')){\n user.password = sha256(user.password, '123445678910');\n }\n}", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n this.isValidPassword(text);\n }", "function changePassword(login, password_hash) {\n return new Promise(async (resolve, reject) => {\n let con = await database.getConnection();\n \n con.connect(function(err) {\n if (err) reject({changed: false, error: err})\n var sql = `UPDATE users SET password = '${password_hash}' WHERE login = '${login}'`;\n con.query(sql, function (err, result) {\n if (err) reject({changed: false, error: err})\n resolve({changed: true});\n });\n });\n });\n}", "updateConfirmPassword(event) {\n const newPassword = this.state.new_password;\n if (event.target.value != newPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match',\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({valid_state_new: 'success'});\n }\n this.setState({confirm_password: event.target.value});\n }", "function updateUser(){\n // use save instead of update to trigger 'save' event for password hashing\n\t\nconsole.log('REQUEST IS ', req.body)\n\tif (!user.termsAccepted_v1) user.termsAccepted_v1 = false;\n user.set(req.body);\n user.save(function(err, user){\n \n // Uniqueness and Save Validations\n \n if (err && err.code == 11001){\n var duplicatedAttribute = err.err.split(\"$\")[1].split(\"_\")[0];\n req.flash('error', \"That \" + duplicatedAttribute + \" is already in use.\");\n return res.redirect('/account');\n }\n if(err) return next(err);\n \n // User updated successfully, redirecting\n \n req.flash('success', \"Account updated successfully.\");\n return res.redirect('/account');\n });\n }", "async setUserPassword (user) {\n\t\tconst passwordHash = await new PasswordHasher({\n\t\t\tpassword: 'temp123'\n\t\t}).hashPassword();\n\t\tconst updateData = { passwordHash };\n\t\tif (Commander.dryrun) {\n\t\t\tthis.log(`\\t\\tWould have set temporary password for user ${user.id}:${user.email}`);\n\t\t}\n\t\telse {\n\t\t\tawait this.data.users.updateById(user.id, updateData);\n\t\t\tthis.log(`\\t\\tSetting temporary password for user ${user.id}:${user.email}...`);\n\t\t}\n\t\tthis.verbose(updateData);\n\t\tObject.assign(user, updateData);\n\t}", "function changePassword(currentUserInfo) {\n var promise, wizardContainerSelector = \".dm-selectPassword\";\n\n cdm.stepWizard({\n extension: \"DomainTenantExtension\",\n steps: [\n {\n template: \"selectPassword\",\n data: {\n customerId: currentUserInfo.GoDaddyShopperId\n },\n onStepActivate: function () {\n Shell.UI.Validation.setValidationContainer(wizardContainerSelector);\n }\n }\n ],\n onComplete: function () {\n if (!Shell.UI.Validation.validateContainer(wizardContainerSelector)) {\n return false;\n }\n\n currentUserInfo.GoDaddyShopperPassword = $(\"#dm-password\").val();\n currentUserInfo.GoDaddyShopperPasswordChanged = true;\n promise = global.DomainTenantExtension.Controller.updateUserInfo(currentUserInfo);\n\n global.waz.interaction.showProgress(promise, {\n initialText: \"Reseting password...\",\n successText: \"Successfully reset the password.\",\n failureText: \"Failed to reset the password.\"\n });\n\n promise.done(function () {\n global.DomainTenantExtension.Controller.invalidateUserInfoCache();\n var portalUrl = global.DomainTenantExtension.Controller.getCurrentUserInfo().GoDaddyCustomerPortalUrl;\n window.open(portalUrl, \"_blank\");\n });\n }\n }, { size: \"small\" });\n }", "function setNewUserPassword (email, password) {\n const User = require('../lib/models/user');\n let user;\n\n User.findByEmail(email)\n .then((u) => {\n user = u;\n })\n .then(() => {\n // user does not exist already, proceed\n // encrypt password\n return User.encryptPassword(password);\n })\n .then((hash) => {\n console.info('Trying to save encrypted password:', email, hash, password);\n // create a new user with default role\n const data = {\n password: hash\n };\n return user.merge(data).save();\n })\n .then((user) => {\n console.log('Updated Password: ', user.email, user.id);\n })\n .error((err) => {\n console.log(err);\n })\n .finally(() => {\n process.exit();\n });\n}", "function updateUserPassword(){\n\t\tif($(\"#searchusername\").val() && $('#editpassword').val()){\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"../UserServlet\",\n\t\t\t\tdata: {\n\t\t\t\t\t\taction:'updateUserPassowrd',\n\t\t\t\t\t\tusername: $('#searchusername').val(),\n\t\t\t\t\t\tpassword:$('#editpassword').val()\n\t\t\t\t\t\t},\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tif(response.status==\"success\"){\n\t\t\t\t\t\t\talert('Password successfully updated');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(response.status==\"failure\") {\n\t\t\t\t\t\t\talert(response.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\tdataType: \"json\"\n\t\t});\n\t\t}\n\t\telse{\n\t\t\talert(\"Username or Password cannot be empty\");\n\t\t}\n\n\t}", "compareOldPasswords() {\n if (this.state.oldPassword !== this.props.currentPassword) {\n return false;\n }\n return true;\n }", "function checkExistingPassword(password) {\n if (bcrypt.compareSync(password, databases.users[userId].password)){\n return true;\n }else{\n return false;\n }\n}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "ChangesTheTenantAdministratorPassword(newPassword, serviceName) {\n let url = `/saas/csp2/${serviceName}/changeAdministratorPassword`;\n return this.client.request('POST', url, { newPassword });\n }", "function updateUser(req, res, next) {\n var user = new User();\n\n user.name = req.body.name;\n user.email = req.body.email;\n user.lastAccess = new Date();\n var password = req.body.password;\n\n user.setPassword(password);\n if(req.body.name && req.body.email && req.body.password && req.body.oldEmail){\n // Updates all data of specified user\n User.update({email: req.body.oldEmail}, {$set: {email: user.email, name: user.name, hash: user.hash,\n salt: user.salt, lastAccess: user.lastAccess}}, function (err, doc) {\n if(err){\n return resource.setResponse(res,\n {\n status: 500,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n } else {\n // Updates all other linked resources of user\n multiUpdate(req, user, function (err) {\n if (err) {\n return resource.setResponse(res,\n {\n status: 500,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n } else {\n return resource.setResponse(res,\n {\n status: 200,\n item: {\n \"error\": false,\n \"data\": {\n \"message\": \"Update user successful\",\n \"password\": password,\n \"url\": process.env.CURRENT_DOMAIN + \"/login\"\n }\n }\n }, next);\n }\n });\n }\n });\n } else {\n return resource.setResponse(res,\n {\n status: 400,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n }\n }" ]
[ "0.8578526", "0.8100662", "0.80044305", "0.78852594", "0.7716077", "0.75723225", "0.7542341", "0.752578", "0.75148785", "0.7506403", "0.74882436", "0.73823565", "0.73325926", "0.731935", "0.7284155", "0.7246132", "0.722099", "0.70926535", "0.70762515", "0.70733297", "0.70692873", "0.7067712", "0.703928", "0.70135623", "0.7006444", "0.6999702", "0.6993705", "0.69441104", "0.69271576", "0.69178355", "0.69161654", "0.6915844", "0.6912058", "0.68872446", "0.6860202", "0.68523604", "0.6822881", "0.68129635", "0.6811471", "0.6804372", "0.67781335", "0.6747147", "0.67442995", "0.6738831", "0.67375535", "0.6733872", "0.6731114", "0.6715749", "0.67113036", "0.6709337", "0.67065716", "0.67055583", "0.6697547", "0.6693434", "0.6680089", "0.6679165", "0.66776186", "0.6666351", "0.6664635", "0.66641134", "0.66532356", "0.6650613", "0.662893", "0.66282654", "0.6623355", "0.6601881", "0.6578988", "0.6575477", "0.65721244", "0.65680486", "0.65587366", "0.6551073", "0.654003", "0.6524646", "0.6522023", "0.6509008", "0.6495297", "0.64920545", "0.6487214", "0.64842474", "0.64815223", "0.64742804", "0.6468762", "0.64680827", "0.64623475", "0.6460406", "0.6456493", "0.6438396", "0.6436051", "0.6393675", "0.6393589", "0.639057", "0.63874716", "0.63815737", "0.6379955", "0.6378671", "0.63687176", "0.6363168", "0.6362352", "0.6359849" ]
0.804089
2
Add a user to session
login(user, password) { if(this.checkPassword(user, password)){ this.sessions.push(user); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser(req, res){ \t// request, response\n\treq.session.user = { \t// pushed onderstaande ingevulde data in req.session.user, zonder session, is het altijd geldig\n\t\temail: req.body.email,\n\t\tid: req.body.userName,\n\t\tpassword: req.body.password\n\t};\n\tconsole.log(req.session.user); \t// laat in de terminal de ingevulde gegevens zien\n\tres.redirect('voornaam/' + req.body.userName); \t// dit is de route + de unieke id (username)\n}", "function addUserToRequest(req, res, next) {\n // check if user is added to request\nif (req.user) return next(); \n // check to see if there is a session created\n if(req.session && req.session.userId){\n // find the user based on there id and then add them to the request object\n User.findById(req.session.userId, function(err, foundUser) {\n req.user = foundUser;\n next();\n });\n } else {\n next();\n };\n}", "function addSessionID(user, req) {\n req.session.userID = user.id;\n}", "function addUserSession(onloadHandler, errorHandler){\n\tvar url = urlroot+'AddSession/';\n\t\tvar data;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\tonload: onloadHandler,\n\t\t\tonerror: errorHandler\n\t\t});\n\t\txhr.open('GET', url, true);\n\t\t\n\t\tvar memberid = Ti.App.Properties.getString('memberId');\n\t\tvar fullName = Ti.App.Properties.getString('fullName');\n\t\t\n\t\tvar deviceId = Ti.Platform.id;\n\t\tvar user = '['+Ti.Platform.osname.toUpperCase()+'] ' + memberid +' - ' + fullName;\n\t\tvar data = {id : deviceId, ruser: user};\n\t\txhr.send(data);\n}", "add(req, res) {\n // Check if there's a user in the session - if not, don't add location\n if (req.session.user) {\n const name = req.body.name;\n const latitude = req.body.latitude;\n const longitude = req.body.longitude;\n const userId = req.session.user.id;\n\n Location.create({\n name: name,\n lat: latitude,\n lon: longitude,\n userId: userId,\n })\n .then((res) => {\n // Store the new location in the session\n let newUser = {\n ...req.session.user,\n locations: [\n ...req.session.user.locations,\n { name, lat: latitude, lon: longitude },\n ],\n };\n\n req.session.user = newUser;\n res.send(res);\n })\n .catch((err) => {\n res.send(err);\n });\n } else {\n // There's no user in the session\n res.render(\"login\", {\n title: \"The Weather App\",\n message: `Please login to add a location, ${err}`,\n });\n }\n }", "function attachUser () {\n return function (req, res, next) {\n if (req.session) {\n if (req.session.idToken) {\n // We have an id_token, let's check if it's still valid\n const decoded = jwt.decode(req.session.idToken)\n if (assertAlive(decoded)) {\n req.session.user_id = decoded.sub\n req.session.user = decoded.preferred_username\n req.session.user_picture = decoded.picture\n return next()\n } else {\n // no longer alive, let's flush the session\n req.session.destroy(function (err) {\n if (err) next(err)\n return next()\n })\n }\n }\n }\n next()\n }\n}", "function registerUser() {\n addUser()\n }", "function addUser() {\n }", "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "function addUser(user) {\n users.push(user);\n }", "function addUser(user) {\n\tdata.push(user);\n\tupdateDOM();\n}", "function addRoomUser(info) {\n\tvar dude = new PalaceUser(info);\n\tif (theRoom.lastUserLogOnID == dude.id && ticks()-theRoom.lastUserLogOnTime < 900) { // if under 15 seconds\n\t\ttheRoom.lastUserLogOnID = 0;\n\t\ttheRoom.lastUserLogOnTime = 0;\n\t\tif (!getGeneralPref('disableSounds')) systemAudio.signon.play();\n\t}\n\tif (theUserID == dude.id) {\n\t\ttheUser = dude;\n\t\tfullyLoggedOn();\n\t}\n\n\ttheRoom.users.push(dude);\n\tloadProps(dude.props);\n\tdude.animator();\n\tdude.grow(10);\n\tPalaceUser.setUserCount();\n}", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }", "function addUser({name, password}) {\n const a = findUser(name);\n const ic = generateInternalCode(name);\n if(a.i === ic) {\n return;\n } \n postUser(name, password);\n}", "async session(session, user) {\n //setting id on session\n session.id = user.sub;\n\n return session;\n }", "function addUser(user){\n signUpContainer.push(user);\n localStorage.setItem(\"users\" , JSON.stringify(signUpContainer)) ;\n messageSuccess();\n clearInputs();\n}", "function addUser() {\n const getParams = new URLSearchParams(location.search);\n const taskID = getParams.get('taskID');\n const userID = 1; // Get current userID from cookies?\n const params = new URLSearchParams('taskID=' + taskID + '&userID=' + userID);\n console.log('/task-add-user', params);\n fetch('/task-add-user', {method: 'post', body: params})\n .then(() => getTaskInfo());\n}", "function signup(req, res) {\n var newUser = new User({\n username: req.body.newUser,\n password: req.body.password\n });\n\n newUser.save(function(err, savedUser) {\n if (err) {\n renderError(res, 'Sorry, we were unable to create your account.');\n } else {\n req.session.user = savedUser._id;\n res.redirect('/tweets');\n }\n });\n}", "function addUser(u){\n users.push(new userModel.User(u.username, u.firstName, u.lastName, u.email, u.password));\n console.log('Added user ' + u.username);\n}", "addUser(user) {\n return Api.post(\"/admin/add-user\", user).then((r) => sendActionResult(r));\n }", "function generateSession (req, user, next) {\n if (user.sessionid) {\n req.session.sessionid = user.sessionid;\n next(null, req.session.sessionid);\n } else {\n req.session.sessionid = user.sessionid = String(uuid.v1());\n db.users.update({\n _id: user._id\n }, user, function (err) {\n next(err, req.session.sessionid);\n })\n }\n}", "function addAnotherUser() {\n // Need a unique id, will monotomically increase\n var id = getNextUserId();\n\n // Create and add the user to DOM\n createNewUser(id);\n\n // Make sure message about no users is hidden\n document.getElementById('no-added-users').style.display = 'none';\n\n // Always return false to disable the default action\n return false;\n}", "function logIn(req, data) {\n req.session.user = {\n _id: data._id,\n username: data.username\n };\n}", "function createSession(req, res) {\n User.findOne({ username: req.body.username }, function(err, user) {\n if (user && user.password == req.body.password) {\n // Sets the session user id to equal the logged in user id.\n req.session.user = user.id;\n console.log(\"user logged in \"+ req.body.username );\n res.status(200).send({\n \"user\" : user.id,\n \"username\" : user.username\n });\n } else {\n if (err) {\n console.log(err.message);\n } else {\n console.log(\"There's no user with those credentials!\");\n }\n res.sendStatus(400);\n }\n });\n}", "function setUser(user) {\n\t\t\tlocalStorage.addLocal('user', user);\n\t\t}", "function addUser(newUser) {\n userDataArray.push(newUser);\n updateDOM();\n}", "async addUser(name){\n return user.create(name)\n }", "function addFirstName(req, res){ \t// request, response\n\treq.session.user.firstName = req.body.firstName; // je slaat firstName op in de req.session.user\n\tconsole.log(req.session.user); \t// laat in de terminal de ingevulde gegevens zien\n\tres.redirect('geboortedatum/' + req.body.id); \t// dit is de route + de unieke id (username)\n}", "function addUser(object, done, next){\r\n User.create(object).then((user) => {\r\n return done(user);\r\n }).catch(next);\r\n}", "function signupUser(userData) {\n console.log(\"Add user\");\n $.post(\"/api/signup\", \n userData\n ).then(function (data) {\n sessionStorage.setItem(\"username\", userData.userName);\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(function (err) {\n sessionStorage.clear();\n console.log(err);\n });\n }", "function add_user(email, password, patients){\n\tif(user_exists(email)){\n\t\talert(\"User already exists\");\n\t\treturn false;\n\t}\n\n\tvar new_user = make_user(email, password, patients);\n\n\tvar user_array = get_user_array();\n\n\t// if(user_array.isArray){\n\t\ttry{\n\t\t\tuser_array.push(new_user);\n\t\t} catch(err) {\n\t\t\tuser_array = [ new_user ];\n\t\t}\n\t// } else {\n\t// \tuser_array = [ new_user ];\n\t// }\n\tset_user_array(user_array);\n\n\tconsole.log(\"users:{\" + localStorage['users'] + '}');\n\n\n\treturn true;\n}", "function addUser(email, password) {\n var newUserID = generateRandomString();\n\n users[newUserID] = {};\n\n //newUserID randomly generated\n users[newUserID].id = newUserID;\n //user will input email on form\n users[newUserID].email = email;\n //user will input password on form\n users[newUserID].password = password;\n\n return users[newUserID];\n}", "function createSession(){\t\t\t\n\t\t\tif(lc.user != null){\n\t\t\t\tsessionService.createSession(JSON.stringify(lc.user));\n\t\t\t\t$location.url(\"/dashboard\");\n\t\t\t}\n\t\t\t\n\t\t}", "function addNewUser() {\n}", "function addUser(username, email, password) {\n // This post will sign the user up\n $.post(\"/api/users\", {\n username: username,\n email: email,\n password: password\n }).then(function (data) {\n // This post will run after the user has be signed up\n // and log the user in\n $.post(\"/api/login\", {\n email: email,\n password: password\n }).then(function (data) {\n // Send the user to the page they were going to before they\n // needed to sign up\n window.location.replace(data);\n });\n });\n }", "register(userInfo) {\n return service\n .post('/user', userInfo)\n .then(res => {\n // If we have localStorage.getItem('user') saved, the application will consider we are loggedin\n sessionStorage.setItem('user', JSON.stringify(res.data))\n return res.data\n })\n .catch(errHandler)\n }", "function storeUserInfoInDatabase (response) {\n const auth0Id = response.data.sub // .sub is short for 'subject' on Auth0\n const db = req.app.get('db')\n return db.read_user(auth0Id).then(users => {\n if (users.length) {\n const user = users[0]\n req.session.user = user // Using sessions with Auth0\n res.redirect('/profile')\n } else {\n const createUserData = [\n auth0Id,\n response.data.email,\n response.data.name,\n response.data.picture\n ]\n return db.create_user(createUserData).then(newUsers => {\n const user = newUsers[0]\n req.session.user = user // Here is session again\n res.redirect('/profile')\n })\n }\n })\n }", "add(user) {\n return __awaiter(this, void 0, void 0, function* () {\n if (user == null) {\n throw new nullargumenterror_1.NullArgumentError('user');\n }\n this.users.push(user);\n });\n }", "function addUser(newUserList, requestUserId) {\n setUsers(newUserList)\n removeInviteUser(requestUserId)\n }", "function addUser (user) {\n return knex('users').insert(user)\n}", "async saveSessions () {\n\t\tawait this.request.data.users.updateDirect(\n\t\t\t{ id: this.request.data.users.objectIdSafe(this.user.id) },\n\t\t\tthis.op\n\t\t);\n\t}", "function addUser (source, sourceUser) {\r\n var user;\r\n if (arguments.length === 1) { // password-based\r\n user = sourceUser = source;\r\n user.id = ++nextUserId;\r\n return usersById[nextUserId] = user;\r\n } else { // non-password-based\r\n user = usersById[++nextUserId] = {id: nextUserId};\r\n user[source] = sourceUser;\r\n }\r\n return user;\r\n}", "function createSession(req, res, user) {\n req.session.regenerate(function () {\n req.session.loggedIn = true;\n req.session.user = user.id;\n req.session.username = user.username;\n req.session.msg = 'Authenticated as: ' + user.username;\n req.session.authy = false;\n req.session.ph_verified = false;\n res.status(200).json();\n });\n}", "function addUserToDB(id , name) {\n url = serverURL + \"/sendUserInfo\";\n sendPostRequest(url, {'id': id,'name': name});\n}", "function addGender(req, res){ \t// request, response\n\treq.session.user.gender = req.body.gender; \t// je slaat gender op in de req.session.user\n\tconsole.log(req.session.user); \t// laat in de terminal de ingevulde gegevens zien\n\tres.redirect('afbeeldingen/' + req.body.id); \t// dit is de route + de unieke id (username)\n}", "static async add(user) {\n // user.id = nextId++;\n // userExtent.push(user);\n // return user;\n if (!User.list().some(u => u.email.toLowerCase() === user.email.toLowerCase())) {\n user.id = nextId++;\n let hashedPass = await bcrypt.hash(user.passwordHash, 10)\n user.passwordHash = hashedPass\n userExtent.push(user);\n return true;\n }\n return false;\n }", "function addUser (source, userDoc, user_id) {\n // with every initial login, rebuild bigboard:\n// create_bigboard = require('./data/create_bigBoard').create_bigboard;\n// create_bigboard();\n\n var user;\n if (arguments.length === 1) { // password-based\n user = userDoc = source;\n user.id = user_id;\n return usersById[nextUserId] = user;\n } else { // non-password-based\n// user = usersById[user_id] = {id: user_id};\n// user[source] = sourceUser;\n user = usersById[user_id] = userDoc;\n }\n return user;\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "async function setSession(request,reply){\n request.session.set('user',{username:'alireza',password:'58300'})\n return \"User Session Is Set\"\n}", "async function add(req, res, next) {\n try {\n req.body.user = req.currentUser\n req.body.users = req.currentUser\n const playlist = await Playlist.create(req.body)\n await playlist.save()\n const user = await User.findById(req.currentUser._id)\n user.playlists.push(playlist)\n const savedUser = await user.save()\n res.status(200).json(savedUser)\n } catch (e) {\n next(e)\n }\n}", "function createUserSession(session) {\n return Session.create(session);\n}", "addUser(user) {\r\n return axios.post(USER_API_BASE_URL + '/signup/', user);\r\n }", "setSession(userId) {\n this.getSession().put(this.sessionKeyName, userId);\n this.getSession().regenerate();\n }", "addUser(user) {\r\n if (this.userUuids.indexOf(user.getUuid()) == -1) {\r\n this.userUuids.push(user.getUuid());\r\n this.update();\r\n }\r\n }", "function createUserId(req, res, next) {\n var model = req.getModel();\n\n// var userId = model.get('_session.userId');\n\n var userId = req.session.userId ;\n if (!userId) userId = req.session.userId = model.id();\n\n\n //var userId = model.id();\n model.set('_session.userId', userId);\n\n\n next();\n}", "static storeUser(user) {\n localStorage.setItem('userInfo', user);\n }", "function setUser(req, res, next) {\n const userId = req.body.userId\n if (userId) {\n req.user = users.find(user => user.id === userId)\n }\n next()\n}", "function addUser(str) {\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n getUsers();\n }\n };\n \n var obj = { \"role\" : str};\n obj = JSON.stringify(obj);\n xhttp.open(\"POST\", \"http://localhost:8080/api/user/addUser\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send(obj);\n }", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "function saveNewUser(user) {\n // gets userId from last user\n const allUsers = getAllUsers();\n user[0] = ++(allUsers.length);\n \n newUser.userId = user[0];\n newUser.firstName = user[1];\n newUser.lastName = user[2];\n newUser.email = user[3];\n newUser.password = user[4];\n \n if (allUsers[(allUsers.length-1)] == null) {\n allUsers[(allUsers.length-1)] = newUser;\n } else { allUsers.push(newUser); }\n \n setCurrentUser(user);\n setAllUsers(allUsers);\n }", "function submitNewUser() {\n var json = `{\"username\": \"${username}\", \"email\": \"${email}\", \n \"password\": \"${password}\", \"role\":\"${role}\"}`;\n\n fetch('http://localhost:9090/users/add', {\n method: 'POST',\n body: json,\n headers: {\n 'Authorization': `bearer ${localStorage.getItem('access_token')}`,\n 'Content-Type': 'application/json'\n }})\n .then(res => res.json())\n .then(alert('New user added to system!'))\n .catch(console.error());\n }", "function registerUser(newUserObj, done) {\n logger.info(\"Inside service method - register user\");\n newUserObj.userId = uuidv4();\n usersDao.addUser(newUserObj, done);\n}", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "async addUser(ctx) {\n try {\n var body = ctx.request.body;\n var user = new User();\n user.name = body.name;\n user.email = body.email;\n user.save();\n ctx.body = { status: 200, message: \"data save \", user: user }\n }\n catch (error) {\n ctx.throw(error)\n }\n }", "static add(user) {\n //wywołuje polecenie sql i zwraca promesę (Promise)\n return db.execute(\n 'insert into users (firstName, lastName) values (?, ?)',\n [user.firstName, user.lastName]\n );\n }", "function addText(req, res){ \t// request, response\n\n\treq.session.user.textProfile = req.body.textProfile; // je slaat textProfile op in de req.session.user\n\tdb.collection('user').insertOne(req.session.user, callback); // data van gebruiker (req.session.user) in database stoppen. Function callback af laten gaan\n\tfunction callback (err, result) {\t\t\t\t\t\t\t\t// keuze uit error of result\n\t\tif (err) throw err;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// geef error\n\t\tconsole.log('test:', result);\n\t\treq.session.user._id = result.insertedId;\t\t\t// zet de inserted (insertOne) id, die in result zit, in req.session.user._id, dus in _id. Local\n\t\tres.redirect('profiel/' + req.session.user._id); // dit is de route + de mongoDB id. Neemt deze data mee naar profiel/\n\t}\n}", "function add(newUser) {\n return db('users').insert(newUser);\n}", "async function add(user) {\n\t// sends info, gets id back\n\t// id is destructured from an array?\n\n\tclg(14, user)\n\tif (user.username && user.password && user.email) {\n\t\tconst [id] = await db('users').insert(user);\n\t\tclg(17, id)\n\n\t\treturn getById(id);\n\t} else {\n\t\treturn ({ err: \"Incomplete registration info. Check that all fields are sent.\" })\n\t}\n}", "function addUser(data){\n console.log(\"attempting to add user!\");\n $.ajax({\n method: \"POST\",\n url: \"/api/users\",\n data: data\n }).done(function(result){\n if (result.errors){\n result.errors.forEach(function(item){\n switch (item.path){\n case \"email\":\n if (item.validatorKey === \"not_unique\"){\n $(\"#sign-in-modal-error\").text(\"There is already an account with the email address.\");\n } else {\n $(\"#sign-in-modal-error\").text(\"That is not a valid email address.\");\n };\n break;\n case \"password\":\n $(\"#sign-in-modal-error\").text(\"Password must be at least eight characters.\");\n };\n });\n } else {\n sessionStorage.setItem(\"id\", result.id);\n sessionStorage.setItem(\"email\", data.email);\n sessionStorage.setItem(\"password\", data.password);\n document.getElementById('sign-in-modal').style.display='none';\n checkLogin();\n };\n }).fail(function(xhr, responseText, responseStatus){\n if (xhr){\n console.log(xhr.responseText);\n };\n });\n}", "function add(user) {\n return db(\"users\")\n .insert(user, \"id\")\n .then(([id]) => findInfoBy({ id }));\n}", "function loadUser(req, res, next) {\n if (!req.session.user_id) { return next(); }\n\n User.findOne({ _id: req.session.user_id }, function(err, user) {\n req.user = user;\n next(err);\n });\n}", "function addUser({id, username, email, password}, callback = (x, y) => y || x) {\n let users = getModel('users')\n return users.insert({\n id, username, email,\n password: hashString(password)\n }, (err, result) => {\n return users.findOne({id}, callback)\n })\n}", "function addUser (username, email, password, isAdmin) {\n const User = require('../lib/models/user');\n const roles = ['user'];\n\n if (isAdmin && isAdmin === true) {\n roles.push('admin');\n }\n\n User.findByEmailorUsername(username, email)\n .then((user) => {\n console.log('A user with this username/email already exists.', user.id);\n process.exit(1);\n })\n .error((err) => {\n // user does not exist already, proceed\n // encrypt password\n return User.encryptPassword(password);\n })\n .then((hash) => {\n console.info('Trying to save encrypted password:', username, hash);\n // create a new user with default role\n const newUser = new User({\n username: username,\n email: email,\n password: hash,\n roles: roles,\n isActive: true,\n verification: {\n token: undefined,\n isCompleted: true\n }\n });\n return newUser.save();\n })\n .then((user) => {\n console.log('Saved User: ', user.username, user.id);\n })\n .error((err) => {\n console.log(err);\n })\n .finally(() => {\n process.exit();\n });\n}", "addUser(user) {\n /* istanbul ignore else */\n if (!this.active_list) {\n this.active_list = [];\n }\n const index = this.active_list.findIndex((a_user) => a_user.email === user.email);\n /* istanbul ignore else */\n if (index < 0) {\n this.active_list = [...this.active_list, user];\n }\n this.setValue(this.active_list);\n this.search_str = '';\n }", "function addUser(user, callback){\n var newUser = new User(userToJson(user));\n newUser.save(callback);\n}", "function addUser(email, password) {\n let newUserId = \"\";\n do {\n newUserId = generateRandomString(6);\n } while(users[newUserId])\n users[newUserId] = {\n id: newUserId,\n email: email,\n password: bcrypt.hashSync(password, 10)\n };\n return newUserId;\n}", "function storeUserInfoInDatabse(userInfo) {\n const userData = userInfo.data;\n return req.app.get('db').find_user_by_user_id(userData.sub).then(users => {\n if (users.length) { // Users exist\n const user = users[0]; \n req.session.user = user;\n res.redirect('/'); // Take them to home page\n } else {\n const newUserData = [userData.sub, userData.email, userData.name, userData.picture];\n return req.app.get('db').create_user(newUserData).then(newUsers => {\n const newUser = newUsers[0]; \n req.session.user = newUser; \n res.redirect('/'); \n })\n }\n })\n }", "set user (value) {\n if (_user = value) {\n this.push();\n } else {\n this.clear();\n }\n }", "async function storeSessionIdOnSmoochUser(visitorId, sessionId) {\n\tawait smooch.appUsers.update(SMOOCH_APP_ID, visitorId, {\n\t\tproperties: { lastSessionId: sessionId }\n\t});\n\n\tconsole.info('Called storeSessionIdOnSmoochUser for', visitorId);\n}", "function addUser(user, callback) {\n\n var encrypted = encrypt(user.password, salt);\n\n var instance = new User();\n instance.username = user.username;\n instance.email = user.email;\n instance.password = encrypted;\n instance.access = user.access;\n\n instance.save(function (err) {\n if (err) {\n callback(err);\n }\n else {\n callback(null, instance);\n }\n\n });\n\n}", "function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUsers.push(obj);\n\t//obj = {};\n}", "async registerUser(userInfo) {}", "function addUser(username, password, callback) {\n\tvar instance = new MyUser();\n \tinstance.username = username;\n \tinstance.password = password;\n \tinstance.save(function (err) {\n\t if (err) {\n\t\t\tcallback(err);\n\t }\n\t else {\n\t \t callback(null, instance);\n\t }\n \t});\n}", "function getSessionUser (req, next) {\n console.log('IDs', req.query.sessionid, req.session.sessionid);\n if (!req.session.sessionid && !req.query.sessionid) {\n next(null, null);\n } else {\n // Normalize from query parameter or session.\n req.session.sessionid = req.query.sessionid || req.session.sessionid;\n\n // Find user.\n db.users.findOne({\n sessionid: req.session.sessionid\n }, function (err, user) {\n if (!user) {\n delete req.session.sessionid;\n }\n if (user) {\n user.id = user._id;\n }\n next(err, user);\n });\n }\n}", "function addNewUser(id, latestVisit, todayStart){\n if(!userInfoMap[id]){\n let newUser = new UserInfo(id, latestVisit);\n //Object.defineProperty(userInfoMap, id, {value:newUser, writable:true});\n userInfoMap[id] = newUser;\n userInfoUpdate(id, latestVisit, todayStart);\n return true;\n } else {\n return false;\n }\n}", "function setUser(user) {\n if (Meteor.isServer) {\n return;\n }\n\n if (user === null || typeof user === 'undefined') { // no one is logged in\n Raven.setUser(); // remove data if present\n return;\n }\n\n Raven.setUser({id: user._id, username: user.username});\n}", "function setUserSession(userId) {\n return new Promise((resolve, reject) => {\n axios.post(`${BASE_URL}/users/setuser`, {\n userId\n }).then(res => resolve(res.data))\n })\n}", "add(loginName) {\r\n return this.clone(SiteUsers_1, null).postCore({\r\n body: jsS(extend(metadata(\"SP.User\"), { LoginName: loginName })),\r\n }).then(() => this.getByLoginName(loginName));\r\n }", "function newSession(){\n\tvar userid = document.getElementById(\"userelement\").innerText;\n\t//console.log(session_name, userid, start, end);\n\tpostReq(session_name, userid, start, end);\n}", "add(user) {\n let mongo = new Mongo();\n return mongo.getNextSeq('user_id')\n .then(ret => {\n user.id = ret.seq;\n return mongo.insert(COLLECTION, user);\n });\n }", "saveSession(userInfo) {\r\n localStorage.setItem('Admin', userInfo.Admin)\r\n let userAuth = userInfo._kmd.authtoken\r\n localStorage.setItem('authToken', userAuth)\r\n let userId = userInfo._id\r\n localStorage.setItem('userId', userId)\r\n let username = userInfo.username\r\n localStorage.setItem('username', username)\r\n\r\n observer.onSessionUpdate()\r\n }", "function register() {\n User.register(self.user, handleLogin);\n }", "function addDateOfBirth(req, res){ \t// request, response\n\treq.session.user.dateOfBirth = req.body.dateOfBirth; // je slaat dateOfBirth op in de req.session.user\n\tconsole.log(req.session.user); \t// laat in de terminal de ingevulde gegevens zien\n\tres.redirect('provincie/' + req.body.id); \t// dit is de route + de unieke id (username)\n}", "function addUser(req, res) {\n global.logger.info(\"Received POST request: \" + JSON.stringify(req.body));\n res.status(200).send({\n added: true\n });\n}", "addUser(user) {\n return this.http.post(this.userUrl, user, httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"tap\"])((newUser) => this.log(`usuario agregado con id=${newUser.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"catchError\"])(this.handleError('addUser')));\n }", "function addUser(id,user_name,userCount,userColor){\n let newUser = {id, user_name,userCount,userColor};\n users.push(newUser);\n}", "function setUser(u) {\n user = u\n}", "addUser (name) {\n const newUser = new User(name);\n this.users.push(newUser); \n return newUser; \n }", "function saveToSessionStorage() {\n const passwordValue = password.value; // Get the password input value\n const usernameValue = username.value; // Get the username input value\n\n // The user object holds the username and password\n let user = {\n username: usernameValue,\n password: passwordValue,\n };\n\n // Store the user object in session storage.\n // Also store a boolean variable that identifies if the user is\n // logged in.\n sessionStorage.setItem(\"user\", JSON.stringify(user));\n sessionStorage.setItem(\"isValidUser\", JSON.stringify(true));\n}" ]
[ "0.7577944", "0.7225542", "0.71242", "0.70751405", "0.6982179", "0.69162214", "0.6889444", "0.6728965", "0.67114645", "0.6699833", "0.6627853", "0.66129285", "0.65930057", "0.65766394", "0.6514973", "0.6443293", "0.6434716", "0.6419496", "0.6407713", "0.6372069", "0.63461745", "0.6320611", "0.6285599", "0.62809855", "0.62538344", "0.62447786", "0.6231138", "0.62263685", "0.62239075", "0.6217217", "0.62016404", "0.6193481", "0.6189161", "0.6172826", "0.61704195", "0.616781", "0.616102", "0.61555266", "0.61504513", "0.61466277", "0.6146306", "0.6133114", "0.6128864", "0.6126691", "0.612024", "0.61153466", "0.6111655", "0.61069787", "0.61069787", "0.6082214", "0.607245", "0.6067674", "0.6061669", "0.60590273", "0.6046525", "0.60439044", "0.60065264", "0.60035765", "0.59926933", "0.5992297", "0.59788847", "0.59755206", "0.59725416", "0.5967688", "0.5966092", "0.59464353", "0.5940015", "0.5932863", "0.59180725", "0.5916625", "0.59126663", "0.5911031", "0.5910863", "0.59089357", "0.59075975", "0.59062827", "0.59057266", "0.59038424", "0.5902302", "0.5889575", "0.5888316", "0.5887519", "0.588744", "0.58868396", "0.5886785", "0.58856654", "0.588259", "0.58725065", "0.5872068", "0.5861083", "0.58608854", "0.5856092", "0.5854846", "0.58535457", "0.585322", "0.5853119", "0.5843835", "0.5840655", "0.5839039", "0.5834111" ]
0.5998808
58
Step 2: Get city name
function getCity(coordinates) { var xhr = new XMLHttpRequest(); var lat = coordinates[0]; var lng = coordinates[1]; // Paste your LocationIQ token below. xhr.open('GET', "https://us1.locationiq.com/v1/reverse.php?key=pk.49fd5203799fe38a65295fec96174630&lat="+lat+"&lon="+lng+"&format=json", true); xhr.send(); xhr.onreadystatechange = processRequest; xhr.addEventListener("readystatechange", processRequest, false); function processRequest(e) { if (xhr.readyState == 4 && xhr.status == 200) { var response = JSON.parse(xhr.responseText); var city = response.address.city; setAddr(response.address); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCityName() {\n cityNameValue = titleCase(cityName.value);\n weatherCurrentLocation.innerText = cityNameValue;\n cityName.value = ''; /* Clear placeholder */\n getWeatherData();\n}", "function returnCity() {\n\n}", "function getD1City(){\n return weatherObj.cityName\n}", "function get_current_city_name(callback) {\r\n var geocoder = new google.maps.Geocoder();\r\n var request = {\r\n location: new google.maps.LatLng(myLatitude, myLongitude)\r\n }\r\n \r\n geocoder.geocode(request, function (result, status) {\r\n if (status == google.maps.GeocoderStatus.OK) {\r\n result = result[0].address_components;\r\n \r\n // Loop through each response entry and construct the date accordingly\r\n myCity = '';\r\n var types_index;\r\n $.each(result, function (array_index, element) {\r\n // Find the city\r\n types_index = $.inArray('locality', element.types);\r\n if (types_index != -1) {\r\n myCity = result[array_index].long_name;\r\n }\r\n \r\n // Find the state\r\n types_index = $.inArray('administrative_area_level_1', element.types);\r\n if (types_index != -1) {\r\n myCity += ', ' + result[array_index].short_name;\r\n }\r\n });\r\n \r\n if (callback != undefined) {\r\n callback();\r\n }\r\n }\r\n });\r\n}", "function city_name(str) {\n if (str.length >= 3 && ((str.substring(0, 3) == 'Los') || (str.substring(0, 3) == 'New')))\n \n {\n return str;\n }\n \n return '';\n }", "getCityName() {\n Geocode.setApiKey(\"AIzaSyBQTJkuKvUP2y4uRp6kyzSxFm3IJpQMmuc\");\n Geocode.setLocationType(\"ROOFTOP\");\n Geocode.fromLatLng(\"48.8583701\", \"2.2922926\").then(\n (response) => {\n const address = response.results[0].formatted_address;\n let city, state, country;\n for (let i = 0; i < response.results[0].address_components.length; i++) {\n for (let j = 0; j < response.results[0].address_components[i].types.length; j++) {\n switch (response.results[0].address_components[i].types[j]) {\n case \"locality\":\n city = response.results[0].address_components[i].long_name;\n break;\n case \"administrative_area_level_1\":\n state = response.results[0].address_components[i].long_name;\n break;\n case \"country\":\n country = response.results[0].address_components[i].long_name;\n break;\n }\n }\n }\n console.log(city, state, country);\n console.log(address);\n },\n (error) => {\n console.error(error);\n }\n );\n }", "function getCity(lat, lon) {\n $.getJSON('https://api.opencagedata.com/geocode/v1/json?q=' + lat + ',' + lon + '&key=fdff99045fa8472c8f854a7dcb17e90a', function(location) {\n console.log(location.results[0].components.city);\n currCity = location.results[0].components.city;\n currState = location.results[0].components.state_code;\n currCountry = location.results[0].components.country;\n\n if (currCountry === 'United States of America') {\n $('#city').html(currCity + ', ' + currState);\n } else {\n $('#city').html(currCity + ', <br>' + currCountry);\n }\n });\n }", "function cityNames(city) {\n return (city[\"name\"])\n}", "function getCityName()\r\n{\r\n\tvar city_raw = document.getElementById('citySelect')[document.getElementById('citySelect').selectedIndex].innerHTML.split(\" \");\r\n\treturn city_raw[city_raw.length-1];\r\n}", "function getUserCityName(){\n var m_queryURL = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\"+userLatitude+\",\" + userLongitude + \"&key=\" + m_apiKey\n\n\n $.ajax({url: m_queryURL, method: 'GET'}).done(function(response) {\n $(\"#city\").val(response.results[3].formatted_address);\n });\n}", "function city(cityName) {\n if (cityName.charAt(0) == 'L' && cityName.charAt(1) == 'o' && cityName.charAt(2) == 's') {\n console.log(\"Los Angeles\")\n } else if (cityName.charAt(0) == 'N' && cityName.charAt(1) == 'e' && cityName.charAt(2) == 'w') {\n console.log('New York')\n } else {\n console.log(' ')\n }\n}", "_getName (properties) {\n const unknown = 'Uknownville, US'\n\n const relativeLocation = properties.relativeLocation\n if (relativeLocation == null) return unknown\n\n const props = relativeLocation.properties\n if (props == null) return unknown\n\n const { city = 'Uknownville', state = 'US' } = props\n\n return `${city}, ${state}`\n }", "function getCity(placemark) {\n return _getPlacemarkAttribute(placemark, 'LocalityName');\n }", "function getCityInfo(cityName) {\n var newCityInfo = {}; \n var openWeatherURL = endPoint + current + cityName + APIkey;\n\n $.ajax({\n url: openWeatherURL,\n method: \"GET\"\n }).then(function (response) {\n newCityInfo.name = response.name; \n newCityInfo.lat = response.coord.lat; \n newCityInfo.lon = response.coord.lon; \n lastSearchIndex = savedSearches.push(newCityInfo) - 1; \n setSavedSearches(); \n displaySavedSearches();\n displayWeatherData();\n })\n}", "function getCity(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT travelLocation_ID, city FROM travel_location \" +\n \"ORDER BY travelLocation_ID\",\n function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.city_display = results;\n complete();\n });\n }", "function getCityLocation(cityName) {\n var url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + cityName + \"&key=AIzaSyDXoktJ4NGVFwy52MuWTQMyNoNJzmIU3ck\"\n\n Fetcher(url)\n .then(cityMap => initMap(cityMap, cityName))\n .catch(err => console.log(\"A problem occured with your fetch operation\\n\", err.message))\n\n}", "getCity(){\n return this.city;\n }", "function showCityName () {\n var city = document.createTextNode(apiResult.name),\n displayCity = document.getElementById('city');\n\n displayCity.appendChild(city);\n }", "function getCityState(longitude, latitude) {\n reverseGeocode(longitude, latitude).then((data) => {\n let cityState = data.features[1].place_name;\n $('#cityState').text(cityState);\n }) //.then\n}", "function getCity() {\n // !!! This possibly returns null you must handle this!\n return localStorage.getItem(\"weather-app\");\n}", "getDepartureCity(city) {\n \t\t this.setState({ departureCity: city });\n\t\t //console.log(\"Departure city is: \" + city.title);\n }", "function getCityName(dataItems) {\n\treturn dataItems.map(item => /\\(([^)]+)\\)/.exec(item)[1]);\n}", "function cityCheck() {\n var cityLog = document.querySelector(\".city\");\n var city = response.city;\n console.log(city);\n\n cityLog.innerHTML += city;\n }", "function getCityData(city) {\n\t\t\tfor (var i = 0; i < cities.data.length; i++) {\n\t\t\t\tif (cities.data[i].name === city) {\n\t\t\t\t\treturn cities.data[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function getCity(name) {\n let uri = 'https://nominatim.openstreetmap.org/search?city='+name+'&format=json';\n $.getJSON(uri, function(data){\n if(data.length > 0) {\n map.setView([data[0]['lat'], data[0]['lon']]);\n getEvents();\n }\n });\n}", "function city() {\n let cityName = $(this).text();\n currentWeather(cityName);\n get5Day(cityName);\n}", "function askAndReturnSearchCity() {\n return readline.question('Digite uma cidade: ')\n }", "async function getCityInfoByName(city) {\n const url = `https://api.opencagedata.com/geocode/v1/json?q=${city}&key=${\n properties.opencage\n }&language=${locales.opencageLocal[localStorage.currentLocale]}`\n\n const res = await fetch(url)\n const data = await res.json()\n\n const { geometry } = data.results[0]\n addInformationAboutCity(data)\n getCityWeather(geometry)\n mapRender(geometry)\n\n if (fahrenheit.classList.contains(\"disabled\")) {\n fahrenheit.classList.remove(\"disabled\")\n celsius.classList.add(\"disabled\")\n }\n}", "getDestinationCity(city) {\n \t\t this.setState({ destinationCity: city });\n\t\t //console.log(\"Departure city is: \" + city.title);\n }", "function getName(lat, lon) {\n var cityName;\n\n if (lat != null && lon != null) {\n $.ajax({\n method: \"GET\",\n url: \"/weather/coords\",\n data: {\n lat: lat,\n lon: lon,\n },\n async: false,\n success: function (data) {\n cityName = data.name;\n },\n error: function (xhr, status, error) {\n var errorMessage = xhr.status + \": \" + xhr.statusText;\n console.log(\"Error: \" + errorMessage);\n cityName = null;\n },\n });\n }\n\n return cityName;\n}", "function getCity(lat, lng){\n //query google maps api for city name from the lat and lng\n $q(function(resolve, reject) {\n //gets current city data\n $http.get(\"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+lat+\",\"+lng)\n .success(\n function(cityResponse) {\n resolve(cityResponse);\n\n }, function(error) {\n // console.log(\"there was an error\");\n reject(error);\n }\n );\n }).then(function(returnCityData){\n self.cityState = returnCityData.results[0].formatted_address.split(\",\").splice(1).join(\", \");\n })\n }", "function getCityName(siteUrl, pincode_state_city_mapping_id,divId){\n var $_token = jQuery('#token').val();\n $.ajax({\n type: \"GET\",\n cache: false,\n headers: {'X-XSRF-TOKEN': $_token},\n url: siteUrl + \"/ajax/getCitynames/\" + pincode_state_city_mapping_id,\n async: true,\n success: function (msg) {\n $('#'+divId).val(msg);\n },\n });\n}", "function geoIdentify() {\n var searchCity = $(\"#inputGroupSelect03\").val();\n console.log(searchCity);\n localStorage.setItem(\"cityName\", searchCity);\n selectedCity = searchCity;\n $.ajax({\n url: apiBase + searchCity,\n method: \"GET\",\n }).done(function (response) {\n console.log(response);\n querySecondURL =\n response._embedded[\"city:search-results\"][0]._links[\"city:item\"].href;\n urbanSlug();\n });\n }", "function parseCityName(name){\n var parsedName = name[0].toUpperCase() + name.slice(1).toLowerCase();\n return parsedName;\n}", "function getCity() {\n if (localStorage.getItem('city') !== null) {\n city.textContent = localStorage.getItem('city');\n }\n}", "function getCityFromURL(search) {\n let city = search.split('=')[1]\n\n return city\n // TODO: MODULE_ADVENTURES\n // 1. Extract the city id from the URL's Query Param and return it\n\n}", "function noCityFound(){return {message:\"No city was found\"}}", "formatCity (city) {\n const words = city.split(' ');\n let newWords = [];\n for (let word of words) {\n word = word.slice(0,1).toUpperCase().concat(word.slice(1).toLowerCase());\n newWords.push(word);\n }\n return newWords.join(' ');\n }", "function getCity(req, res, next) {\n // get params\n const cityName = req.params.name;\n\n // add city\n cityService.getCity(cityName).then(function (data) {\n res.status(200).json({\n status: 'success',\n data: data,\n message: 'City Retrieved'\n })\n }).catch(function (err) {\n return next(err);\n })\n}", "function getCity(city) {\n searchHistoryGenerator(city);\n // format the openweather api\n const apiUrl = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&units=imperial&appid=6cc51fec452ce9ba1156eafe5282e54f\";\n \n fetch(apiUrl)\n .then(function(response) {\n // request was successful\n if (response.ok) {\n response.json().then(function(data) {\n const cityLat = data.city.coord.lat;\n const cityLon = data.city.coord.lon;\n cityText.innerHTML = data.city.name + \", \" + data.city.country + \" | \" + moment().format(\"MM/DD/YYYY\").toString() + \"<img src='https://openweathermap.org/img/wn/\" + data.list[0].weather[0].icon + \"@2x.png' />\";\n getCityWeather(cityLat, cityLon);\n });\n } else {\n alert(\"Error: \" + response.statusText);\n }\n })\n .catch(function(error) {\n alert(\"Unable to connect to OpenWeather\");\n });\n}", "function getCityData(cityName) { // e.g. cityName == 'Washington, DC'\n for (var i = 0; i < cities.length; i += 1) {\n if (cities[i].name === cityName)\n return cities[i];\n }\n console.log('Error: city not found.');\n return null;\n}", "function getLoc(cityName) {\n\tlet positie = \"\";\n\tgetData(`https://geocode.search.hereapi.com/v1/geocode?apiKey=${apiHereKey}&q=${cityName},%20NL`)\n\t.then(result => {\n\t\treturn result.json();\n\t})\n\n\t.then(coorData => {\n\t\tpositie = coorData.items[0].position;\n\t});\n\treturn positie;\n}", "function parseCityName(name) {\n var parsedName = name[0].toUpperCase() + name.slice(1).toLowerCase();\n return parsedName;\n}", "static getWeather(city) {\n return Promise.resolve(`The weather of ${city} is Cloudy`);\n }", "function locateCity(req, res, next) {\n // get params\n const cityName = req.body.name;\n const countryCode = req.body.country; \n\n // locate city\n cityService.locateCity(cityName, countryCode).then(function (data) {\n res.status(200).json({\n status: 'success',\n data: data,\n message: 'City GEO LOCALIZED'\n })\n }).catch(function (err) {\n return next(err);\n })\n}", "function getWeatherForCity(city) {\n var weatherUrl = \"http://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial&APPID=0eadf9a9141e80aed512ae6360edf643\";\n $.get(weatherUrl, processWeather);\n // .done(function(response){}) (don't put *all* of your code in here)\n // .fail(function(xhr){}) (acronym means XML HTTP Request)\n var cityNameSpan = document.getElementById('city-name');\n cityNameSpan.innerHTML = city;\n }", "function ReturnCityMap(a)\n{\n return a.city+ \"->\"+a.firstName;\n}", "function getCity(location) {\n\tconst key = \"41a33c1f6739002732956da85ecbd727\";\n\tconst url = `http://api.openweathermap.org/data/2.5/weather?q=${location}&units=metric&appid=${key}`;\n\tif (location === \"\") alert(\"enter a city\");\n\n\taxios\n\t\t.get(`${url}`)\n\t\t.then(({ data }) => {\n\t\t\tconsole.log(data);\n\t\t\tgetData(data);\n\t\t})\n\t\t.catch(function (error) {\n\t\t\tconsole.log(error);\n\t\t})\n\t\t.then(() => getWeather());\n\n\t//Get api Data\n\tfunction getData(data) {\n\t\tforecast.temperature = Math.floor(data.main.temp);\n\t\tforecast.description = data.weather[0].description;\n\t\tforecast.city = data.name;\n\t\tforecast.country = data.sys.country;\n\t\tforecast.image = data.weather[0].icon;\n\t}\n\n\t//Insert data into UI\n\tfunction getWeather() {\n\t\tcity.innerHTML = `${forecast.city},` + `${forecast.country}`;\n\t\tweather.innerHTML = `${forecast.description}`;\n\t\ttemp.innerHTML = `Current Temp:${forecast.temperature}&degC`;\n\t\ticon.innerHTML = `<img src=\"assets/${forecast.image}.png\">`;\n\n\t\tsearch.value = '';\n\t}\n}", "get city() { return this._city; }", "async function fetchCity(city) {\n\n const res = await fetch(`https://geocode.xyz/${city}?json=1`);\n const data = await res.json();\n console.log(`Place Name: ${city} Longiture: ${data.longt} Latitude: ${data.latt}`);\n\n}", "buildCity() {\n return `bcity ${this.id}`;\n }", "capitalCity(capital, countryName) {\n if(capital) {\n return `The capital of ${countryName} is ${capital}`\n } else {\n return `There is no capital city in ${countryName}!`\n }\n }", "static checkCity(city) {\n try {\n NonEmptyString.validate(city, CITY_CONSTRAINTS);\n return \"\";\n }\n catch (error) {\n console.error(error);\n return \"The address' city should not be empty or larger than 120 letters\";\n }\n }", "function getCityFromURL(search) {\n // TODO: MODULE_ADVENTURES\n // 1. Extract the city id from the URL's Query Param and return it\n return search.split(\"=\")[1];\n}", "function getCityInfoByName(city_name) {\n\tif (contents == null) {\n\t\tcontents = {};\n\t\tconst text = fs.readFileSync(csv_file, \"utf-8\");\n\t\tconst array = text.split(\"\\r\\n\");\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tconst line = array[i].split(\",\");\n\t\t\tif (i == 0) {\n\t\t\t\tkeys = line;\n\t\t\t} else {\n\t\t\t\tconst object = new Object();\n\t\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\t\tobject[keys[j]] = line[j];\n\t\t\t\t}\n\t\t\t\tif (line.length > 0) {\n\t\t\t\t\tcontents[line[0]] = object;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcity_inform = contents[city_name];\n\tconst city = new city_info();\n\tif (city_inform) {\n\t\tcity.name = city_name;\n\t\tcity.latitude = city_inform.lat;\n\t\tcity.longitude = city_inform.lng;\n\t\tcity.country = city_inform.country;\n\t\tcity.province = city_inform.province;\n\t\tcity.status = \"need update\";\n\t}\n\treturn city;\n}", "function getStudentCity(std_name) { // \"SK\"\n var obj = data.find(function(item) { return item.name == std_name });\n\n if (obj) {\n return obj.city;\n\n } else {\n return \"NO City Found\";\n }\n}", "function getCity(lat, lon, callback){\n $.ajax({\n url: 'http://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+lon,\n type: \"GET\"\n }).done(function(ret) { \n var indice = ret.results.length - 4,\n status = (ret.status == \"OK\" && ret.results),\n city;\n try{\n city = ret.results[indice].formatted_address;\n }catch(e){\n city = null;\n status = false;\n }\n callback(status,city);\n });\n}", "function availableCities() {\n let cities = [];\n Object.values(tdata).forEach(value => {\n let city = value.city.split(\" \");\n let city_name = \"\"\n for (let i=0; i < city.length; i++){\n let temp = city[i];\n city_name = city_name + temp[0].toUpperCase() + temp.substring(1) + \" \";\n };\n if(cities.indexOf(city_name) !== -1) {\n\n }\n else {\n cities.push(city_name);\n console.log(\"city_name\");\n };\n });\n return cities;\n}", "function getCity() {\n if (localStorage.getItem('city') === null || localStorage.getItem('city').length === 0) {\n city.textContent = 'Попробуй другой город';\n } else {\n city.textContent = localStorage.getItem('city');\n console.log('---', localStorage.getItem('city'));\n }\n}", "function displayCityState(city, state) {\n city = capitalize(city);\n state = capitalize(state);\n $('#js-city-state').append(`<h5>${city}, ${state}</h5>`);\n}", "function getLocationName(lat, long) {\n \n var geoApi = '9aebdd2fd11041c9bfe5604e053cf484'; // my OpenCage Geocoder API key\n \n var geocodeUrl = 'http://api.opencagedata.com/geocode/v1/json?q=' + lat + '+' + long + '&key=' + geoApi;\n \n $.getJSON(geocodeUrl, function(locationData) {\n // get the location string - only suburb\n var locationString = locationData.results[0].components.suburb;\n // append to HTML\n var location = $('<h2>').html(locationString);\n $('#location').append(location); \n });\n}", "function userCity(callback){\n prompt.get(\"Enter your current city\", function(err, userInput){\n if(err){\n \n }\n else{\n var city = userInput[\"Enter your current city\"];\n callback(null, city);\n }\n });\n}", "function cityFromHistory() {\n var city = $(this).text();\n queryCity(city);\n}", "async getLocationCity(latitude, longitude) {\r\n this.filterItemsJson = [];\r\n const apiCurrentLocation = `${process.env.GOOGLE_GEO_CODE_URL}${latitude},${longitude}&key=${this.apiKey}`;\r\n const filterItemsJson = await dxp.api(apiCurrentLocation);\r\n const currentCountryLocation = filterItemsJson.results[1].address_components;\r\n const city = this.findResult(currentCountryLocation, 'locality');\r\n const state = this.findResult(currentCountryLocation, 'administrative_area_level_1');\r\n const country = this.findResult(currentCountryLocation, 'country');\r\n const currentLocationSearch = {};\r\n currentLocationSearch['description'] = `${city}, ${state}, ${country}`;\r\n return currentLocationSearch;\r\n }", "async function fetchLatLngOfCity(city, state) {\n const apiKey = config.MAP_QUEST_API_KEY;\n const endpoint = `https://www.mapquestapi.com/geocoding/v1/address?key=${apiKey}&inFormat=kvp&outFormat=json&location=${city}, ${state}&thumbMaps=false`;\n \n \tconst response = await fetch(endpoint);\n \tconst json = await response.json();\n \n // Skip first element in json, which consists of unneeded headers.\n return json.results[0].locations[0].latLng;\n }", "function getCityLocation(data) {\n if (data) {\n let { results: res } = data;\n let { 0: obj } = res;\n let city = obj.address_components[0].long_name;\n let location = obj.geometry.location;\n let { lat, lng: lon } = location;\n lat = parseFloat(lat).toFixed(3);\n lon = parseFloat(lon).toFixed(3);\n APIrqs(lat, lon, city);\n\n }\n\n}", "function getCity(coordinates) {\n let xhr = new XMLHttpRequest();\n let lat = coordinates[0];\n let lng = coordinates[1];\n\n const apiKey = \"pk.f75abcdafba266c6c4295504f0d205a2\";\n // Paste your LocationIQ token below.\n xhr.open('GET', `https://us1.locationiq.com/v1/reverse.php?key=${apiKey}&lat=${lat}&lon=${lng}&format=json`, true);\n xhr.send();\n xhr.onreadystatechange = processRequest;\n xhr.addEventListener(\"readystatechange\", processRequest, false);\n\n function processRequest(e) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n let response = JSON.parse(xhr.responseText);\n let city = response.address.city;\n localStorage.setItem(\"current_city_name\", response);\n localStorage.setItem(\"current_city_name\", city);\n localStorage.setItem(\"current_state_name\", response.address.state);\n localStorage.setItem(\"lat\", lat);\n localStorage.setItem(\"lon\", lon);\n //localStorage.getItem(city)\n //console.log(city);\n return;\n }\n }\n}", "async function getCityByPincode() {\n var self = this;\n var nosql = new Agent();\n nosql.select('getcity', 'pincode_city').make(function (builder) {\n builder.like('pincodes', self.query.pincode);\n builder.first()\n })\n var getcity = await nosql.promise('getcity');\n if (getcity != null) {\n // if (getcity.regionname == \"Hyderabad City\") {\n // getcity.city = \"Hyderabad\";\n // } else {\n // getcity.city = getcity.regionname;\n // }\n\n self.json({\n status: true,\n data: getcity\n })\n } else {\n self.json({\n status: false,\n message: \"Invalid Pincode\"\n })\n }\n}", "function findCityName(){\n var ships = $.ajax({\n url: '/ships',\n async: false,\n dataType: 'json'\n }).responseJSON;\n ships.forEach(function (item) {\n if(item.ShipName === BOAT_NAME) BERTH_ID = item.BerthId;\n });\n\n var berths = $.ajax({\n url: '/berths',\n async: false,\n dataType: 'json'\n }).responseJSON;\n berths.forEach(function (item) {\n if(item.BerthId === BERTH_ID) BERTH_TOWN = item.BerthTownId;\n });\n\n var berthTownName = $.ajax({\n url: '/berthtowns',\n async: false,\n dataType: 'json'\n }).responseJSON;\n berthTownName.forEach(function (item) {\n if(item.BerthTownId === BERTH_TOWN) BERTH_TOWN_NAME = item.TownName;\n });\n return BERTH_TOWN_NAME;\n}", "function searchedCity(city) {\n let apiKey = \"47946c44662c2450dc8f43f4b76c1cb0\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric`;\n axios.get(`${apiUrl}&appid=${apiKey}`).then(showTemp);\n}", "function locationName(location){\n\t\t\tif (location.isCity) return location.name + \", \" + location.state;\n\t\t\telse return location.name;\n\t\t}", "function addCityName(city){\n\t\t$(\"#cityName\").html(city);\n\t}", "function getCityFromURL(search) {\n // TODO: MODULE_ADVENTURES\n // 1. Extract the city id from the URL's Query Param and return it\n const params = new URLSearchParams(search);\n const city = params.get('city')\n return city\n}", "function searchCity(li) {\n const city = li.innerText;\n fetch(`${api.base}weather?q=${city}&units=metric&APPID=${api.key}`)\n .then(weather => {\n return weather.json();\n })\n .then(displayResults)\n .catch(searchError);\n}", "function searchByCity(contact) {\n return contact.city + \" \" + contact.firstName + \" \" + contact.lastName;\n }", "function getCityPrettyDEP(s) {\r\n var res='';\r\n if (s.type) \r\n res += s.type + ' ';\r\n if (s.city) \r\n res += s.city;\r\n return res;\r\n}", "function getWoeidInfo(city, errorCallback, successCallback){\n request.get(\"https://www.metaweather.com/api/location/search/?query=\" + city, function(error, response){\n if(!error && response.statusCode == 200){\n var data = JSON.parse(response.body);\n if(data.length < 1){\n errorCallback(city);\n }else{\n successCallback({\n city: data[0].title,\n woeid: data[0].woeid,\n });\n }\n }else{\n errorCallback(city);\n }\n });\n}", "function getCityInfo() {\n return $.ajax({\n url: \"https://developers.zomato.com/api/v2.1/locations?query=\" + cityName,\n headers: {\"Accept\": \"application/json\", \"user-key\": \"19196cd7a5838aa26e070b8a475ef856\"},\n method: \"GET\",\n cors: true,\n success: function(data) {\n var citySTR = JSON.stringify(data);\n cityData = JSON.parse(citySTR);\n // Save the entity_ID and entity_type.\n entityID = cityData.location_suggestions[0].entity_id;\n entityType = cityData.location_suggestions[0].entity_type;\n console.log(\"---- City Data ----\")\n console.log(cityData);\n }\n })\n}", "function getCityWeather() {\n console.log(\"updated city is :\" + $(\"#inputCity\").val());\n ctyName = \"q=\" + $(\"input\").val() + \",\";\n getUpdatedWeather();\n\n }", "function getCity(id) {\n return new Promise((resolve) => {\n if (id) {\n if (typeof id === 'object') {\n // eslint-disable-next-line no-param-reassign\n id = id.id;\n }\n window.__CITY_API = CityAPI;\n CityAPI.get(id).then(response => {\n if (response && response.data) {\n resolve({\n value: response.data.id,\n label: response.data.name,\n });\n } else {\n resolve({ value: '', label: '' });\n }\n }).catch((/*response*/) => {\n resolve({ value: '', label: '' });\n });\n } else {\n resolve({ value: '', label: '' });\n }\n });\n}", "static findCity(long, lat) {\n return Promise.resolve(`London`);\n }", "getCityStateZip() {\n let city = \"city\";\n let state = \"state\";\n let zip = \"zip\";\n if (this.props.cardInfo.city) {\n city = this.props.cardInfo.city;\n } \n if (this.props.cardInfo.state) {\n state = this.props.cardInfo.state;\n }\n if (this.props.cardInfo.zip) {\n zip = this.props.cardInfo.zip;\n }\n\n return `${city}, ${state} ${zip}`;\n }", "async getPlace(){\n const place = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?key=${this.apiKeyGC}&latlng=${this.lat},${this.lon}`);\n const placeData = await place.json();\n let placeName;\n\n if(placeData.status == 'ZERO_RESULTS'){\n return 'Undisclosed Place Name';\n } else {\n placeName = placeData.plus_code.compound_code;\n if(placeName === undefined){\n return 'Undisclosed Place Name';\n } else {\n return placeName.slice(8);\n }\n }\n }", "function queryCity(city) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial&appid=\" + weatherKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n /* Hide results */\n $(\"#result-col\").addClass(\"hidden\");\n $(\"#current-date\").text(moment().format(\"M/D/YYYY\"));\n $(\"#current-city\").text(response.name);\n $(\"#current-temp\").text(parseFloat(response.main.temp).toFixed(1));\n $(\"#current-humid\").text(response.main.humidity);\n $(\"#current-wind\").text(response.wind.speed);\n $(\"#current-icon\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \".png\");\n\n /* Use lat/lon to query UVI and 5-day forecast */\n queryOneCall(response.coord.lon, response.coord.lat);\n\n saveCity(response.name);\n });\n}", "async function getCityWithSmallerNameOfEachState() {\n try {\n let allStatesAccounts = [];\n let allCities = [];\n let data = [];\n\n const allStates = await returnAllStates();\n \n allStatesAccounts = allStates.map((state) => state.Sigla);\n\n for (let state of allStatesAccounts) {\n data = JSON.parse(\n await fs.readFile(`${CitiesByStatesJsonOutput}${state}.json`)\n );\n\n data.Cities.sort();\n data.Cities.sort((a, b) => {return a.length - b.length;});\n allCities.push({ uf: state, cities: data.Cities[0] });\n }\n\n console.log('CIDADES COM O MENOR NOME DE CADA ESTADO--------------------->')\n console.log(allCities);\n console.log('');\n\n } catch (err) {\n console.log('ERRO: ' + err);\n }\n}", "function searchCity(city) {\n let apiKey = \"c2d9b90e33955a3023ce0c9c75586190\";\n let units = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(displayTemperature);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(displayForecast);\n}", "function getCityInput(){\n\t// Create the autocomplete object and associate it with the UI input control.\n \t// Restrict the search to the default country, and to place type \"cities\".\n \tautocomplete = new google.maps.places.Autocomplete((document.getElementById('ecity')), {\n\t\t\t\t\t\t\t\t\t\t\t\t\t types: ['(cities)'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t componentRestrictions: countryRestrict\n\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\tservice = new google.maps.places.PlacesService(map);\n\n\tautocomplete.addListener('place_changed', onPlaceChanged);\n}", "function getCityInfo() {\n var cityList = JSON.parse(localStorage.getItem(savedCitySearches));\n\n lastCityNumber = localStorage.getItem(lastCitySearch);\n\n //set global variable to list if value is returned\n if (cityList) {\n savedCities = cityList;\n displaySavedCities(); // Load displayed city list that user has previously searched\n displayOldData(); // Last viewed city displayed here\n }\n}", "function searchCity(city) {\n let apiKey = \"47b783e374dd1d17b34b52141082af29\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showWeather);\n\n apiUrlFor = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrlFor).then(showForecast);\n}", "function getCityName() {\n var cityName = document.querySelector(\"#cityname\").value;\n var cityName = cityName.toUpperCase();\n // validate whether cityname input field is empty or not\n if (cityName) {\n // call funtion to get forecast\n getForecast(cityName); \n }\n else {\n // Place message in city input declaring that field cannot be empty\n document.querySelector(\"#cityname\").setAttribute(\"placeholder\", \"Please Enter A City!\");\n }\n}", "function sevenEx(cityName) {\n let newCity = cityName.slice(0, 3);\n // console.log(newCity);\n newCity = newCity.toLowerCase();\n\n if (newCity == \"los\" || newCity == \"new\") {\n console.log(cityName);\n } else {\n console.log(\"\");\n }\n}", "function getCityId(city, date) {\n const apiUrl = `https://api.songkick.com/api/3.0/search/locations.json?query=${city}&apikey=lKGlBIRmnawI3yka`;\n\n fetch(apiUrl)\n .then(response => response.json())\n .then(responseJson => {\n if (responseJson.status === 'error') {\n throw new Error(responseJson.message)\n $('#map').hide();\n }\n getEvents(responseJson.resultsPage.results.location[0].metroArea.id, date)\n })\n .catch(error => {\n $('#error').text(`Something went wrong. Try again.`);\n });\n}", "function getWeather(city){\n fetch(`${api.webUrl}weather?q=${city}&units=metric&appid=${api.apiKey}`)\n .then(weather => {\n return weather.json();\n }).then(displayWeather);\n}", "function getLocationName(location) {\n $.ajax({\n \"url\": 'http://api.wunderground.com/api/6ea7cf3bc006012f/geolookup/q/' + location + '.json',\n \"method\": 'get',\n \"async\": true\n }).done(function(data) {\n var locationCity = data.location.city;\n var locationState = data.location.state;\n var locationName = locationCity.toUpperCase() + ', ' + locationState;\n // insert location name into DOM\n $('.location').text('WEATHER FORECAST FOR '+ locationName);\n }\n ).fail(function(data) {\n console.log('failed -- do nothing')\n // since this is a separate call that was done after the first call to the weather api\n // there is still a chance that the first call will continue to succeed and this one will fail\n // in the event this fails, we do not want to render anything -- we can prevent any rendering by simply\n // removing everything from the body\n $('body').empty();\n });\n }", "function getPlacename(location, lat, lng) {\n\t// Format coords into object Google likes\n\tvar lat_lng = { lat: lat, lng: lng };\n\n\tvar geocoder = new google.maps.Geocoder;\n\tgeocoder.geocode({ 'location': lat_lng }, function(results, status) {\n\t\tif (status === 'OK') {\n\t\t\tif (results[0]) {\n\t\t\t\t// Get the city name of the result\n\t\t\t\tvar result = results.length - 3;\n\t\t\t\tsetLocation(location, results[result].formatted_address);\n\t\t\t} else {\n\t\t\t\t// We still don't have a result, must be in the middle of the ocean\n\t\t\t\tsetLocation(location, 'Middle of Nowhere');\n\t\t\t}\n\t\t} else if (status == 'ZERO_RESULTS') {\n\t\t\t// We don't have a result, must be in the middle of the ocean\n\t\t\tsetLocation(location, 'Middle of Nowhere');\t\t\t\n\t\t} else {\n\t\t\t// Something went terribly wrong\n\t\t\tsetLocation(location, 'Somewhere');\t\t\t\n\t\t\tconsole.log('Geocoder failed due to: ' + status);\n\t\t}\n\t});\n}", "function getAddress(loc) {\n new google.maps.Geocoder().geocode({'location': loc}, function(results, status) {\n if (status === google.maps.GeocoderStatus.OK) {\n if (results[1]) {\n $scope.currentCity = (results[1].address_components[0] ? results[1].address_components[0].long_name : 'Some city') +', '+(results[1].address_components[2] ? results[1].address_components[2].short_name : results[1].address_components[1] ? results[1].address_components[1].short_name : '');\n } else {\n console.log('No results found');\n }\n } else {\n console.log('Geocoder failed due to: ' + status);\n }\n });\n }", "function parroquia(args) {\r\n let result = ecuador.data.lookupCities(args);\r\n results = result[0];\r\n let parroquia = [];\r\n for (var key in results.towns) {\r\n parroquia.push(results.towns[key].name);\r\n }\r\n return parroquia;\r\n}", "function getOtherLocation(){\n\tvar html = '';\n\tvar city = $('#city').val();\n\tvar state = $('#state').val();\n\n\thtml = '<h1>'+city+', '+state+'</h1>';\n\n\t$('#myLocation').html(html);\n\n\tgetWeather(city, state);\n}", "function getCityWeatherInfo(cityInput) {\n var lat, lon;\n if (cityInput) {\n var queryUrl = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityInput + \"&cnt=1&appid=\" + ApiKey;\n // This ajax call will get the latitude and longitude from the given city\n $.ajax({\n url: queryUrl,\n method: \"GET\",\n }).then(function (res) {\n lat = res.city.coord.lat;\n lon = res.city.coord.lon;\n var queryUrl2 = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=hourly,minutely&appid=\" + ApiKey;\n // This ajax call will get the weather data from the given latitude and longitude\n $.ajax({\n url: queryUrl2,\n method: \"GET\",\n }).then(function (res2) {\n getSetCityLocalStorage(cityInput);\n displayWeatherInfo(res2, cityInput);\n });\n });\n }\n}", "function getAddressCB(results) {\n\t\tif (results.length > 0)\n\t\t\tconsole.log(\"The city name is: \" + results[0].city);\n\t}", "get city(){return this._city;}" ]
[ "0.7910365", "0.75080913", "0.7418375", "0.72027516", "0.71152097", "0.70497406", "0.70489717", "0.6988971", "0.6970172", "0.6816711", "0.68163586", "0.6798283", "0.67380196", "0.6707313", "0.66852564", "0.66788787", "0.66734314", "0.66728", "0.66690534", "0.66648644", "0.6646586", "0.6646141", "0.66347116", "0.661317", "0.6611859", "0.66117907", "0.66078657", "0.6606583", "0.65968746", "0.65872127", "0.65827984", "0.65779185", "0.6574264", "0.6561552", "0.6551327", "0.6529014", "0.652826", "0.64891225", "0.6488957", "0.6467844", "0.6456097", "0.6448252", "0.6447084", "0.644411", "0.6442902", "0.6436571", "0.6429528", "0.64108354", "0.6404984", "0.6358774", "0.63376045", "0.6336725", "0.6336026", "0.6296849", "0.62836033", "0.62816995", "0.62707835", "0.62657267", "0.6263726", "0.6260954", "0.6250999", "0.62334645", "0.6230969", "0.62251127", "0.622366", "0.6216965", "0.62056184", "0.6199924", "0.61827433", "0.6180992", "0.61808795", "0.6177132", "0.61644346", "0.61603993", "0.61569154", "0.6152166", "0.61485285", "0.61423725", "0.61350095", "0.6132449", "0.60972315", "0.609525", "0.609394", "0.60885143", "0.6088206", "0.6085444", "0.6063009", "0.60536623", "0.6045566", "0.6040242", "0.6040172", "0.6037415", "0.60302186", "0.6029438", "0.600865", "0.5998389", "0.599564", "0.5992171", "0.5990052", "0.59772176", "0.59606475" ]
0.0
-1
Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. They usually appear for dates that denote time before the timezones were introduced (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 and GMT+01:00:00 after that date) DategetTimezoneOffset returns the offset in minutes and would return 57 for the example above, which would lead to incorrect calculations. This function returns the timezone offset in milliseconds that takes seconds in account.
function getTimezoneOffsetInMilliseconds(date) { var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); utcDate.setUTCFullYear(date.getFullYear()); return date.getTime() - utcDate.getTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "function getTimeZoneOffsetMinutes()\n{\n var offset = new Date().getTimezoneOffset();\n return offset;\n}", "function getTimezoneOffset(d, tz) {\n var ls = Utilities.formatDate(d, tz, \"yyyy/MM/dd HH:mm:ss\");\n var a = ls.split(/[\\/\\s:]/);\n //Logger.log(\"getTimezoneOffset:\" + tz + ' = ls = ' + ls + ' / a = ' + a)\n a[1]--;\n var t1 = Date.UTC.apply(null, a);\n var t2 = new Date(d).setMilliseconds(0);\n return (t2 - t1) / 60 / 1000;\n}", "function getTimeZoneOffsetHours()\n{\n var offset = new Date().getTimezoneOffset()/60;\n return offset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n }", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n }", "get timezoneOffset() {\n if (Date._timezoneOffsetStd === undefined) this._calculateOffset();\n return Date._timezoneOffsetStd;\n }", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n\t var date = new Date(dirtyDate.getTime());\n\t var baseTimezoneOffset = date.getTimezoneOffset();\n\t date.setSeconds(0, 0);\n\t var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\t return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n\t}", "get timezoneDSTOffset() {\n if (Date._timezoneOffsetDst === undefined) this._calculateOffset();\n return Date._timezoneOffsetDst;\n }", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE$1;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE$1 + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime())\n var baseTimezoneOffset = date.getTimezoneOffset()\n date.setSeconds(0, 0)\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function offset(timezoneOffset) {\n // Difference to Greenwich time (GMT) in hours\n var os = Math.abs(timezoneOffset);\n var h = String(Math.floor(os/60));\n var m = String(os%60);\n if (h.length == 1) {\n h = \"0\" + h;\n }\n if (m.length == 1) {\n m = \"0\" + m;\n }\n return timezoneOffset < 0 ? \"+\"+h+m : \"-\"+h+m;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n }", "function timezones_guess(){\n\n\tvar so = -1 * new Date(Date.UTC(2012, 6, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar wo = -1 * new Date(Date.UTC(2012, 12, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar key = so + ':' + wo;\n\n\treturn _timezones_map[key] ? _timezones_map[key] : 'US/Pacific';\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezone() {\n\tvar a = new Date();\n\tvar offset = a.getTimezoneOffset();\n\tvar nom = offset/60;\n\t\n\treturn nom;\n}", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function offset(timezoneOffset) {\n // Difference to Greenwich time (GMT) in hours\n var os = Math.abs(timezoneOffset);\n var h = String(Math.floor(os / 60));\n var m = String(os % 60);\n if (h.length === 1) {\n h = '0' + h;\n }\n if (m.length === 1) {\n m = '0' + m;\n }\n return timezoneOffset < 0 ? '+' + h + m : '-' + h + m;\n}", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function calcTime(timezone) {\r\n\tconst d = new Date(),\r\n\t\t\t\tutc = d.getTime() + (d.getTimezoneOffset() * 60000),\r\n\t\t\t\tnd = new Date(utc + (3600000 * timezone.offset));\r\n\r\n\treturn nd.toLocaleString();\r\n}", "function YGps_get_utcOffset()\n {\n var res; // int;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_UTCOFFSET_INVALID;\n }\n }\n res = this._utcOffset;\n return res;\n }", "function calculateClockOffset() {\n const start = Date.now();\n let cur = start;\n // Limit the iterations, just in case we're running in an environment where Date.now() has been mocked and is\n // constant.\n for (let i = 0; i < 1e6 && cur === start; i++) {\n cur = Date.now();\n }\n\n // At this point |cur| \"just\" became equal to the next millisecond -- the unseen digits after |cur| are approximately\n // all 0, and |cur| is the closest to the actual value of the UNIX time. Now, get the current global monotonic clock\n // value and do the remaining calculations.\n\n return cur - getGlobalMonotonicClockMS();\n}", "function d3_time_zone(d) {\n var z = d.getTimezoneOffset(),\n zs = z > 0 ? \"-\" : \"+\",\n zh = ~~(Math.abs(z) / 60),\n zm = Math.abs(z) % 60;\n return zs + d3_time_zfill2(zh) + d3_time_zfill2(zm);\n}", "function d3_time_zone(d) {\n var z = d.getTimezoneOffset(),\n zs = z > 0 ? \"-\" : \"+\",\n zh = ~~(Math.abs(z) / 60),\n zm = Math.abs(z) % 60;\n return zs + d3_time_zfill2(zh) + d3_time_zfill2(zm);\n}", "function getRawOffset(timeZoneId) {\n var janDateTime = luxon[\"DateTime\"].fromObject({\n month: 1,\n day: 1,\n zone: timeZoneId,\n });\n var julyDateTime = janDateTime.set({ month: 7 });\n var rawOffsetMinutes;\n if (janDateTime.offset === julyDateTime.offset) {\n rawOffsetMinutes = janDateTime.offset;\n }\n else {\n var max = Math.max(janDateTime.offset, julyDateTime.offset);\n rawOffsetMinutes = max < 0\n ? 0 - max\n : 0 - Math.min(janDateTime.offset, julyDateTime.offset);\n }\n return rawOffsetMinutes * 60 * 1000;\n }", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t * 1000);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),6,1);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t * 1000);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),6,1);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),0,7);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function calcTime(offset) {\r\n // create Date object for current location\r\n d = new Date();\r\n // convert to msec\r\n // add local time zone offset \r\n // get UTC time in msec\r\n utc = d.getTime() + (d.getTimezoneOffset() * 60000);\r\n // create new Date object for different city\r\n // using supplied offset\r\n nd = new Date(utc + (3600000*offset));\r\n // return time as a string\r\n return nd;\r\n}", "getDateOffset(date) {\n let currentTime = date ? new Date(date) : new Date();\n let currentOffset = date ? currentTime.getTimezoneOffset(): 0;\n return new Date(currentTime.getTime() +Math.abs(currentOffset*60000));\n }", "function tzParseTimezone(timezoneString, date) {\n var token;\n var absoluteOffset;\n\n // Z\n token = patterns.timezoneZ.exec(timezoneString);\n if (token) {\n return 0\n }\n\n var hours;\n\n // ±hh\n token = patterns.timezoneHH.exec(timezoneString);\n if (token) {\n hours = parseInt(token[2], 10);\n\n if (!validateTimezone()) {\n return NaN\n }\n\n absoluteOffset = hours * MILLISECONDS_IN_HOUR;\n return token[1] === '+' ? -absoluteOffset : absoluteOffset\n }\n\n // ±hh:mm or ±hhmm\n token = patterns.timezoneHHMM.exec(timezoneString);\n if (token) {\n hours = parseInt(token[2], 10);\n var minutes = parseInt(token[3], 10);\n\n if (!validateTimezone(hours, minutes)) {\n return NaN\n }\n\n absoluteOffset =\n hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE$1;\n return token[1] === '+' ? -absoluteOffset : absoluteOffset\n }\n\n // IANA time zone\n token = patterns.timezoneIANA.exec(timezoneString);\n if (token) {\n // var [fYear, fMonth, fDay, fHour, fMinute, fSecond] = tzTokenizeDate(date, timezoneString)\n var tokens = tzTokenizeDate(date, timezoneString);\n var asUTC = Date.UTC(\n tokens[0],\n tokens[1] - 1,\n tokens[2],\n tokens[3],\n tokens[4],\n tokens[5]\n );\n var timestampWithMsZeroed = date.getTime() - (date.getTime() % 1000);\n return -(asUTC - timestampWithMsZeroed)\n }\n\n return 0\n}", "function get_local_timezone() {\n var rightNow = new Date();\n var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0); // jan 1st\n var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st\n var temp = jan1.toGMTString();\n var jan2 = new Date(temp.substring(0, temp.lastIndexOf(\" \")-1));\n temp = june1.toGMTString();\n var june2 = new Date(temp.substring(0, temp.lastIndexOf(\" \")-1));\n var std_time_offset = ((jan1 - jan2) / (1000 * 60 * 60));\n var daylight_time_offset = ((june1 - june2) / (1000 * 60 * 60));\n var dst;\n if (std_time_offset == daylight_time_offset) {\n dst = \"0\"; // daylight savings time is NOT observed\n } else {\n // positive is southern, negative is northern hemisphere\n var hemisphere = std_time_offset - daylight_time_offset;\n if (hemisphere >= 0)\n std_time_offset = daylight_time_offset;\n dst = \"1\"; // daylight savings time is observed\n }\n\n return parseInt(std_time_offset*3600,10);\n}", "function timezone(offset) {\n var minutes = Math.abs(offset);\n var hours = Math.floor(minutes / 60);\n\tminutes = Math.abs(offset%60);\n var prefix = offset < 0 ? \"+\" : \"-\";\n//\tdocument.getElementById('atzo').innerHTML = prefix+hours+\":\"+minutes;\t\n return prefix+hours+\":\"+minutes;\t\n}", "function timezone() {\n if (typeof Intl === \"object\" && typeof Intl.DateTimeFormat === \"function\") {\n let options = Intl.DateTimeFormat().resolvedOptions();\n if (typeof options === \"object\" && options.timeZone) {\n return options.timeZone;\n }\n }\n if (typeof window.jstz === \"object\") {\n return window.jstz.determine().name();\n }\n if (typeof window.moment === \"object\" && typeof window.moment.tz === \"function\") {\n return window.moment.tz();\n }\n return null;\n}", "function deviceprint_timezone () {\n\t\tvar gmtHours = (new Date().getTimezoneOffset()/60)*(-1);\n\t\treturn gmtHours;\n\t}", "function YRealTimeClock_get_utcOffset()\n {\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_UTCOFFSET_INVALID;\n }\n }\n return this._utcOffset;\n }", "function getOffset(date, tzid) {\n if (tzid == null) {\n return null;\n\t}\n\n var exptz = tzs.waitFetch(tzid, date.substring(0, 4));\n var offset = null;\n\n if ((exptz == null) || (exptz.status != tzs.okStatus)) {\n\t return null;\n }\n\n var obs = exptz.findObservance(date);\n \n if (obs == null) {\n return null;\n\t}\n\n return obs.to / 60;\n}", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "function calcTime(offset) {\r\n // create Date object for current location\r\n d = new Date();\r\n // convert to msec\r\n // add local time zone offset \r\n // get UTC time in msec\r\n utc = d.getTime() + (d.getTimezoneOffset() * 60000);\r\n // create new Date object for different city\r\n // using supplied offset\r\n nd = new Date(utc + (3600000 * offset));\r\n // return time as a string\r\n return /*\"The local time is \" +*/ nd.toLocaleString();\r\n}", "function getTimeZone() {\n const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return (userTimeZone);\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function convertToUTCTimezone(date) {\n\t// Doesn't account for leap seconds but I guess that's ok\n\t// given that javascript's own `Date()` does not either.\n\t// https://www.timeanddate.com/time/leap-seconds-background.html\n\t//\n\t// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset\n\t//\n\treturn new Date(date.getTime() - date.getTimezoneOffset() * 60 * 1000)\n}", "function rR(a){a=-a.getTimezoneOffset();return null!==a?a:0}", "function fuso_loc(){\n // recupera il fuso orario e restituisce un valore in ore.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // per longitudini a est di GREENWICH il valore del fuso è negativo, positivo per quelle a ovest.\n\n var data = new Date();\n var fuso_lc = data.getTimezoneOffset()/60;\n\n return fuso_lc;\n\n}", "function calcTimeoutOffset() {\n var serverTime = getCookie(emxUIConstants.STR_AUTOLOGOUT_SERVERTIME);\n serverTime = serverTime==null ? null : Math.abs(serverTime);\n var clientTimeOffset = (new Date()).getTime() - serverTime;\n setCookie(emxUIConstants.STR_AUTOLOGOUT_CLIENTTIMEOFFSET, clientTimeOffset);\n\tcheckSession();\n}", "_getTimeOffset(timezone, geo, callback){\n let tz = new timezoneController(timezone);\n let first = (cb)=> {\n tz.requestTimezoneOffset(undefined, 'get', (err, tzOffset) => {\n if (err) {\n log.warn(new Error(`cDSF > Failed to run first step : ${err}`));\n return cb(null);\n }\n return cb('1. Found timezone Offset', tzOffset);\n });\n };\n let second = (cb)=>{\n tz.requestTimezoneOffsetByGeo({lat: geo[1], lon:geo[0]}, timezone, (err, tzOffset)=>{\n if(err){\n log.warn(new Error(`cDSF > Failed to run second step : ${err}`));\n return cb(null);\n }\n return cb('2. Found timezone Offset', tzOffset);\n });\n };\n let third = (cb)=>{\n let tzOffset = timezone.match(/\\d+/g).map(Number); // extract number from timezone string\n log.debug(`cDsf> TZ Offset : ${tzOffset[0]}`);\n if(tzOffset.length > 0 && tzOffset[0] >= 0 && tzOffset[0] < 24){\n return cb('3. Found timezone Offset', tzOffset[0] * 60 /* to make Minute*/);\n }\n return cb(null);\n };\n\n async.waterfall([first, second, third],\n (err, tzOffset)=>{\n if(tzOffset === undefined){\n err = new Error(`cDsf > Fail to get timezone!! tz[${timezone}], geo[${geo[0]}, ${geo[1]}`);\n log.error(err);\n return callback(err);\n }\n return callback(undefined, tzOffset);\n }\n );\n }", "function ntpTimestampToSecs (buf, offset = 0, currentMsecs = Date.now()) {\n let seconds = 0\n let fraction = 0\n for (let i = 0; i < 4; ++i) {\n seconds = (seconds * 256) + buf[offset + i]\n }\n for (let i = 4; i < 8; ++i) {\n fraction = (fraction * 256) + buf[offset + i]\n }\n // era correction\n const currentSecs = (currentMsecs / 1000) + SEVENTY_YEARS\n const era = Math.floor(currentSecs / TWO_POW_32)\n if (era) seconds += era * TWO_POW_32\n // consider an overflow at era change borders\n if (seconds - currentSecs > TWO_POW_16) seconds -= TWO_POW_32\n\n return ((seconds - SEVENTY_YEARS + (fraction / TWO_POW_32)) * 1000)\n}", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "function correctedTime(time) {\n\tconst timezoneOffsetMinutes = new Date().getTimezoneOffset();\n\t//console.log('timezoneOffsetMinutes', timezoneOffsetMinutes);\n\treturn time-(timezoneOffsetMinutes*60)\n}", "function getTime(t, tz) {\n date = new Date(t);\n offset = date.getTimezoneOffset() / 60;\n seconds = Math.floor((t / 1000) % 60);\n minutes = Math.floor((t / (1000 * 60)) % 60);\n hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n if (tz == 1) hours = hours - offset;\n hours = (hours < 10) ? \"0\" + hours : hours;\n minutes = (minutes < 10) ? \"0\" + minutes : minutes;\n seconds = (seconds < 10) ? \"0\" + seconds : seconds;\n return hours + \":\" + minutes + \":\" + seconds;\n}", "function parseTimezoneOffset(offset) {\n let [, sign, hours, minutes] = offset.match(/(\\+|-)(\\d\\d)(\\d\\d)/);\n minutes = (sign === '+' ? 1 : -1) * (Number(hours) * 60 + Number(minutes));\n return negateExceptForZero$1(minutes)\n}", "function tzParseTimezone(timezoneString, date, isUtcDate) {\n var token;\n var absoluteOffset; // Empty string\n\n if (!timezoneString) {\n return 0;\n } // Z\n\n\n token = patterns.timezoneZ.exec(timezoneString);\n\n if (token) {\n return 0;\n }\n\n var hours; // ±hh\n\n token = patterns.timezoneHH.exec(timezoneString);\n\n if (token) {\n hours = parseInt(token[1], 10);\n\n if (!validateTimezone(hours)) {\n return NaN;\n }\n\n return -(hours * MILLISECONDS_IN_HOUR);\n } // ±hh:mm or ±hhmm\n\n\n token = patterns.timezoneHHMM.exec(timezoneString);\n\n if (token) {\n hours = parseInt(token[1], 10);\n var minutes = parseInt(token[2], 10);\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n return hours > 0 ? -absoluteOffset : absoluteOffset;\n } // IANA time zone\n\n\n if (isValidTimezoneIANAString(timezoneString)) {\n date = new Date(date || Date.now());\n var utcDate = isUtcDate ? date : toUtcDate(date);\n var offset = calcOffset(utcDate, timezoneString);\n var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);\n return -fixedOffset;\n }\n\n return NaN;\n}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function calcTime(city, offset) {\r\n // create Date object for current location\r\n d = new Date();\r\n // convert to msec\r\n // add local time zone offset\r\n // get UTC time in msec\r\n utc = d.getTime() + (d.getTimezoneOffset() * 60000);\r\n // create new Date object for different city\r\n // using supplied offset\r\n return utc + 3600000*offset;\r\n\t//nd = new Date(utc + (3600000*offset));\r\n // return time as a string\r\n //return nd;\r\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function timeZoneGetter(width){return function(date,locale,offset){var zone=-1*offset;var minusSign=getLocaleNumberSymbol(locale,NumberSymbol.MinusSign);var hours=zone>0?Math.floor(zone/60):Math.ceil(zone/60);switch(width){case ZoneWidth.Short:return(zone>=0?'+':'')+padNumber(hours,2,minusSign)+padNumber(Math.abs(zone%60),2,minusSign);case ZoneWidth.ShortGMT:return'GMT'+(zone>=0?'+':'')+padNumber(hours,1,minusSign);case ZoneWidth.Long:return'GMT'+(zone>=0?'+':'')+padNumber(hours,2,minusSign)+':'+padNumber(Math.abs(zone%60),2,minusSign);case ZoneWidth.Extended:if(offset===0){return'Z';}else{return(zone>=0?'+':'')+padNumber(hours,2,minusSign)+':'+padNumber(Math.abs(zone%60),2,minusSign);}default:throw new Error(\"Unknown zone width \\\"\"+width+\"\\\"\");}};}" ]
[ "0.7557168", "0.7447146", "0.7216665", "0.7192961", "0.66518", "0.660281", "0.6577458", "0.65652114", "0.6525688", "0.6522826", "0.6516245", "0.6516245", "0.6516245", "0.6516245", "0.6516245", "0.6494224", "0.6472627", "0.6460252", "0.6460252", "0.6460252", "0.6460252", "0.6460252", "0.6460252", "0.6460252", "0.6449294", "0.6442438", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6424624", "0.6415267", "0.6409435", "0.6409435", "0.6409435", "0.6407775", "0.6383253", "0.6170562", "0.61437476", "0.6102801", "0.6066477", "0.5968988", "0.5968988", "0.59185976", "0.5914213", "0.5914213", "0.5878493", "0.5868845", "0.58459353", "0.584431", "0.58304876", "0.5773911", "0.5761139", "0.5719011", "0.5658254", "0.5647246", "0.5640407", "0.56257623", "0.5623805", "0.56133026", "0.5611561", "0.5579721", "0.55781645", "0.5530854", "0.5521039", "0.55197906", "0.54978883", "0.54672176", "0.5454851", "0.53840935", "0.5370419", "0.53646654", "0.53646654", "0.53646654", "0.53646654", "0.53646654", "0.5357713", "0.5344991", "0.53423715", "0.53423715", "0.5332064" ]
0.64295644
37
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCDayOfYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var timestamp = date.getTime(); date.setUTCMonth(0, 1); date.setUTCHours(0, 0, 0, 0); var startOfYearTimestamp = date.getTime(); var difference = timestamp - startOfYearTimestamp; return Math.floor(difference / MILLISECONDS_IN_DAY) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.6049883", "0.59848636", "0.597781", "0.5964695", "0.59625536", "0.5935919", "0.59132046", "0.5912539", "0.5899999", "0.5876853", "0.5876809", "0.5856117", "0.5838701", "0.58192056", "0.5814793", "0.57970077", "0.57834345", "0.5783378", "0.57791805", "0.5779038", "0.57623416", "0.5731826", "0.571694", "0.5704397", "0.5685704", "0.5678162", "0.56640106", "0.5662978", "0.563704", "0.563704", "0.563704", "0.563704", "0.563704", "0.5621341", "0.56044567", "0.5601874", "0.5599125", "0.5598524", "0.55816907", "0.55816907", "0.5579666", "0.5579666", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576714", "0.5573217", "0.55698395", "0.55585855", "0.5557752", "0.5554963", "0.55438346", "0.5535731", "0.55314535", "0.5521979", "0.5521649", "0.54970825", "0.54954106", "0.54935133", "0.54885375", "0.5485796", "0.5472865", "0.54430777", "0.5431842", "0.5431389", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCISOWeek(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var diff = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(date).getTime() - (0,_startOfUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(date).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6818263", "0.66675735", "0.64038146", "0.6337222", "0.6309952", "0.6283027", "0.6283027", "0.6246817", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.6148351", "0.611605", "0.60867715", "0.6081826", "0.6070095", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.6050723", "0.59839517", "0.5977788", "0.59661156", "0.59650147", "0.59380376", "0.59142625", "0.59135306", "0.5901477", "0.58808726", "0.5875957", "0.58579147", "0.5841916", "0.5820618", "0.5815399", "0.57979023", "0.5784579", "0.5784281", "0.5780232", "0.5780191", "0.5762234", "0.57339233", "0.5717017", "0.5705029", "0.5688007", "0.56801516", "0.5666705", "0.5664031", "0.563762", "0.563762", "0.563762", "0.563762", "0.563762", "0.5623627", "0.56067955", "0.56062245", "0.5599686", "0.5599149", "0.5582253", "0.5582253", "0.55804783", "0.55804783", "0.55779445", "0.55779445", "0.55779445", "0.55779445", "0.55779445", "0.5576072", "0.55750066", "0.55708504", "0.5559661", "0.5557244", "0.55562985", "0.554327", "0.5534789", "0.5533357", "0.5524325", "0.55227536", "0.5499471", "0.54958594", "0.54932123", "0.5489807", "0.54844004", "0.54771674", "0.5444072", "0.54332113", "0.54301596", "0.5424789", "0.5424789", "0.5424789", "0.5424789", "0.5424789", "0.5424789" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCISOWeekYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var year = date.getUTCFullYear(); var fourthOfJanuaryOfNextYear = new Date(0); fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuaryOfNextYear); var fourthOfJanuaryOfThisYear = new Date(0); fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuaryOfThisYear); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816884", "0.6668099", "0.64008635", "0.6334278", "0.6309822", "0.62825024", "0.62825024", "0.62465477", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.6146614", "0.6116046", "0.6086091", "0.6082476", "0.60684556", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60506004", "0.5984368", "0.59788543", "0.59643567", "0.5963185", "0.59365785", "0.5912818", "0.5912797", "0.58995575", "0.58785474", "0.58779204", "0.5854634", "0.58398324", "0.5819463", "0.58145314", "0.5796373", "0.5785015", "0.57837135", "0.57790035", "0.57785887", "0.5761885", "0.57318175", "0.5716324", "0.5705321", "0.56856954", "0.5679725", "0.56640476", "0.56636184", "0.56371653", "0.56371653", "0.56371653", "0.56371653", "0.56371653", "0.5620986", "0.56036574", "0.56012493", "0.5598785", "0.5598374", "0.5581853", "0.5581853", "0.55786055", "0.55786055", "0.55760944", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5572684", "0.55694616", "0.5559451", "0.5558959", "0.55552703", "0.5544236", "0.55370027", "0.5531777", "0.55228704", "0.55217004", "0.54965186", "0.5495736", "0.54954726", "0.548804", "0.5487037", "0.5473357", "0.5444697", "0.5433037", "0.54320884", "0.5423141", "0.5423141", "0.5423141", "0.5423141", "0.5423141", "0.5423141" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCWeek(dirtyDate, options) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var diff = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(date, options).getTime() - (0,_startOfUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(date, options).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.6049883", "0.59848636", "0.597781", "0.5964695", "0.59625536", "0.5935919", "0.59132046", "0.5912539", "0.5899999", "0.5876853", "0.5876809", "0.5856117", "0.5838701", "0.58192056", "0.5814793", "0.57970077", "0.57834345", "0.5783378", "0.57791805", "0.5779038", "0.57623416", "0.5731826", "0.571694", "0.5704397", "0.5685704", "0.5678162", "0.56640106", "0.5662978", "0.563704", "0.563704", "0.563704", "0.563704", "0.563704", "0.5621341", "0.56044567", "0.5601874", "0.5599125", "0.5598524", "0.55816907", "0.55816907", "0.5579666", "0.5579666", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576714", "0.5573217", "0.55698395", "0.55585855", "0.5557752", "0.5554963", "0.55438346", "0.5535731", "0.55314535", "0.5521979", "0.5521649", "0.54970825", "0.54954106", "0.54935133", "0.54885375", "0.5485796", "0.5472865", "0.54430777", "0.5431842", "0.5431389", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCWeekYear(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate, dirtyOptions); var year = date.getUTCFullYear(); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeekOfNextYear, dirtyOptions); var firstWeekOfThisYear = new Date(0); firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeekOfThisYear, dirtyOptions); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.6049883", "0.59848636", "0.597781", "0.5964695", "0.59625536", "0.5935919", "0.59132046", "0.5912539", "0.5899999", "0.5876853", "0.5876809", "0.5856117", "0.5838701", "0.58192056", "0.5814793", "0.57970077", "0.57834345", "0.5783378", "0.57791805", "0.5779038", "0.57623416", "0.5731826", "0.571694", "0.5704397", "0.5685704", "0.5678162", "0.56640106", "0.5662978", "0.563704", "0.563704", "0.563704", "0.563704", "0.563704", "0.5621341", "0.56044567", "0.5601874", "0.5599125", "0.5598524", "0.55816907", "0.55816907", "0.5579666", "0.5579666", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576714", "0.5573217", "0.55698395", "0.55585855", "0.5557752", "0.5554963", "0.55438346", "0.5535731", "0.55314535", "0.5521979", "0.5521649", "0.54970825", "0.54954106", "0.54935133", "0.54885375", "0.5485796", "0.5472865", "0.54430777", "0.5431842", "0.5431389", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCISOWeek(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var weekStartsOn = 1; var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6818263", "0.66675735", "0.64038146", "0.6337222", "0.6309952", "0.6283027", "0.6283027", "0.6246817", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.6148351", "0.611605", "0.60867715", "0.6081826", "0.6070095", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.60522497", "0.6050723", "0.59839517", "0.5977788", "0.59661156", "0.59650147", "0.59380376", "0.59142625", "0.59135306", "0.5901477", "0.58808726", "0.5875957", "0.58579147", "0.5841916", "0.5820618", "0.5815399", "0.57979023", "0.5784579", "0.5784281", "0.5780232", "0.5780191", "0.5762234", "0.57339233", "0.5717017", "0.5705029", "0.5688007", "0.56801516", "0.5666705", "0.5664031", "0.563762", "0.563762", "0.563762", "0.563762", "0.563762", "0.5623627", "0.56067955", "0.56062245", "0.5599686", "0.5599149", "0.5582253", "0.5582253", "0.55804783", "0.55804783", "0.55779445", "0.55779445", "0.55779445", "0.55779445", "0.55779445", "0.5576072", "0.55750066", "0.55708504", "0.5559661", "0.5557244", "0.55562985", "0.554327", "0.5534789", "0.5533357", "0.5524325", "0.55227536", "0.5499471", "0.54958594", "0.54932123", "0.5489807", "0.54844004", "0.54771674", "0.5444072", "0.54332113", "0.54301596", "0.5424789", "0.5424789", "0.5424789", "0.5424789", "0.5424789", "0.5424789" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCISOWeekYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var year = (0,_getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var fourthOfJanuary = new Date(0); fourthOfJanuary.setUTCFullYear(year, 0, 4); fourthOfJanuary.setUTCHours(0, 0, 0, 0); var date = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuary); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816884", "0.6668099", "0.64008635", "0.6334278", "0.6309822", "0.62825024", "0.62825024", "0.62465477", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.6146614", "0.6116046", "0.6086091", "0.6082476", "0.60684556", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60521436", "0.60506004", "0.5984368", "0.59788543", "0.59643567", "0.5963185", "0.59365785", "0.5912818", "0.5912797", "0.58995575", "0.58785474", "0.58779204", "0.5854634", "0.58398324", "0.5819463", "0.58145314", "0.5796373", "0.5785015", "0.57837135", "0.57790035", "0.57785887", "0.5761885", "0.57318175", "0.5716324", "0.5705321", "0.56856954", "0.5679725", "0.56640476", "0.56636184", "0.56371653", "0.56371653", "0.56371653", "0.56371653", "0.56371653", "0.5620986", "0.56036574", "0.56012493", "0.5598785", "0.5598374", "0.5581853", "0.5581853", "0.55786055", "0.55786055", "0.55760944", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5572684", "0.55694616", "0.5559451", "0.5558959", "0.55552703", "0.5544236", "0.55370027", "0.5531777", "0.55228704", "0.55217004", "0.54965186", "0.5495736", "0.54954726", "0.548804", "0.5487037", "0.5473357", "0.5444697", "0.5433037", "0.54320884", "0.5423141", "0.5423141", "0.5423141", "0.5423141", "0.5423141", "0.5423141" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCWeek(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.6049883", "0.59848636", "0.597781", "0.5964695", "0.59625536", "0.5935919", "0.59132046", "0.5912539", "0.5899999", "0.5876853", "0.5876809", "0.5856117", "0.5838701", "0.58192056", "0.5814793", "0.57970077", "0.57834345", "0.5783378", "0.57791805", "0.5779038", "0.57623416", "0.5731826", "0.571694", "0.5704397", "0.5685704", "0.5678162", "0.56640106", "0.5662978", "0.563704", "0.563704", "0.563704", "0.563704", "0.563704", "0.5621341", "0.56044567", "0.5601874", "0.5599125", "0.5598524", "0.55816907", "0.55816907", "0.5579666", "0.5579666", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576714", "0.5573217", "0.55698395", "0.55585855", "0.5557752", "0.5554963", "0.55438346", "0.5535731", "0.55314535", "0.5521979", "0.5521649", "0.54970825", "0.54954106", "0.54935133", "0.54885375", "0.5485796", "0.5472865", "0.54430777", "0.5431842", "0.5431389", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649" ]
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCWeekYear(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(options.firstWeekContainsDate); var year = (0,_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(dirtyDate, dirtyOptions); var firstWeek = new Date(0); firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeek.setUTCHours(0, 0, 0, 0); var date = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeek, dirtyOptions); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "parseUpdatedTime() {\n const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']\n \n // console.log(this.totalCases)\n const latestTsMs = this.totalCases.updated;\n const dateObj = new Date(latestTsMs);\n \n const timeObj ={\n month: monthArr[dateObj.getMonth()],\n date: ('0' + dateObj.getDate()).slice(-2),\n year: dateObj.getFullYear(),\n hours: ('0' + dateObj.getHours()).slice(-2),\n min: ('0' + dateObj.getMinutes()).slice(-2),\n timezone: `${dateObj.toString().split(' ')[5].slice(0, 3)} ${dateObj.toString().split(' ')[5].slice(3, 6)}`,\n }\n // console.log(timeObj)\n return timeObj;\n }", "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function zb(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "getUTCDate(timestamp = null) {\n return new Date().toISOString().replace(\"T\", \" \").split(\".\")[0];\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function dateUTC( date ) {\n\t\tif ( !( date instanceof Date ) ) {\n\t\t\tdate = new Date( date );\n\t\t}\n\t\tvar timeoff = date.getTimezoneOffset() * 60 * 1000;\n\t\tdate = new Date( date.getTime() + timeoff );\n\t\treturn date;\n\t}", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "liveDate(hour = TODAY_UTC_HOURS) {\n let curDate = new Date()\n if ( curDate.getUTCHours() < hour ) {\n curDate.setDate(curDate.getDate()-1)\n }\n return curDate.toISOString().substring(0,10)\n }", "get updateDate() {\n return moment.utc(this.update_time);\n }", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "get supportsTimezone() { return false; }", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function getCurrentUTCtime() {\n var date = new Date();\n var utcDate = date.toUTCString();\n\n // console.log(\"D----------------------------------------------\");\n // console.log(\"DATE: \",date);\n // console.log(\"UTC DATE: \",date.toUTCString());\n // console.log(\"D----------------------------------------------\");\n\n return utcDate;\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "function getDate(){\n let newDateTime = new Date().toUTCString();\n return newDateTime;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "getInvoiceDate() {\n const newVersionDate = new Date('2018-08-24T00:00:00.000Z');\n const createdDate = new Date(String(this.createdAt));\n if (createdDate > newVersionDate) {\n return String(moment.utc(this.createdAt).subtract(5, 'hours').format('L'));\n }\n return String(moment.utc(this._requests[0].createdAt).subtract(5, 'hours').format('L'));\n }", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function convertFromUTC(utcdate) {\n localdate = new Date(utcdate);\n return localdate;\n }", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "static currentDateToISOString()/*:string*/{\n const currentDateTime = new Date()\n currentDateTime.setMinutes(currentDateTime.getMinutes() - currentDateTime.getTimezoneOffset()) \n return currentDateTime.toISOString()\n }", "function getDateTime(){\n var date = new Date() \n var dateTime = date.toISOString()\n utc = date.getTimezoneOffset() / 60\n dateTime = dateTime.slice(0, 19)\n dateTime += '-0' + utc + ':00'\n return dateTime\n}", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[Xe]&&null==a._a[We]&&ib(a),a._dayOfYear&&(e=fb(a._a[Ve],d[Ve]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[We]=c.getUTCMonth(),a._a[Xe]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[Ye]&&0===a._a[Ze]&&0===a._a[$e]&&0===a._a[_e]&&(a._nextDay=!0,a._a[Ye]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ye]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function hb(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=gb(a),a._w&&null==a._a[$d]&&null==a._a[Zd]&&ib(a),a._dayOfYear&&(e=fb(a._a[Yd],d[Yd]),a._dayOfYear>oa(e)&&(l(a)._overflowDayOfYear=!0),c=sa(e,0,a._dayOfYear),a._a[Zd]=c.getUTCMonth(),a._a[$d]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[_d]&&0===a._a[ae]&&0===a._a[be]&&0===a._a[ce]&&(a._nextDay=!0,a._a[_d]=0),a._d=(a._useUTC?sa:ra).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[_d]=24)}}", "function formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + '-' +\n padZeros(date.getUTCMonth()+1, 2) + '-' +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}", "function utcDate(val) {\n return new Date(\n Date.UTC(\n new Date().getFullYear(),\n new Date().getMonth(),\n new Date().getDate() + parseInt(val),\n 0,\n 0,\n 0\n )\n );\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function fixedGMTString(datum)\n{\n var damals=new Date(1970,0,1,12);\n if (damals.toGMTString().indexOf(\"02\")>0) \n datum.setTime(datum.getTime()-1000*60*60*24);\n return datum.toGMTString();\n}", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "static isoDateTime(dateIn) {\n var date, pad;\n date = dateIn != null ? dateIn : new Date();\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n return Util.pad(n);\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "async function getTimezone(latitude, longitude) {\n try {\n let url = 'https://maps.googleapis.com/maps/api/timezone/json?location=';\n let uri = url + latitude + ',' + longitude + '&timestamp=' + timeStamp + '&key=' + googleKey;\n let response = await fetch(uri);\n \n if (response.ok) {\n let json = await (response.json());\n const newDate = new Date();\n\n // Get DST and time zone offsets in milliseconds\n offsets = json.dstOffset * 1000 + json.rawOffset * 1000;\n // Date object containing current time\n const localTime = new Date(timeStamp * 1000 + offsets); \n // Calculate time between dates\n const timeElapsed = newDate - date;\n // Update localTime to account for any time elapsed\n moment(localTime).valueOf(moment(localTime).valueOf() + timeElapsed);\n\n getLocalTime = setInterval(() => {\n localTime.setSeconds(localTime.getSeconds() + 1)\n time.innerHTML = moment(localTime).format('dddd hh:mm A');\n }, 1000);\n\n getWeather(latitude, longitude);\n\n return json;\n }\n } catch (error) {\n console.log(error);\n }\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "setResetAt(resetAt){\n return date.format(resetAt, 'YYYY-MM-DD HH:mm:ssZ');\n }", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "getDateTime(ts) {\n return dateProcessor(ts * 1000).getDateTime() + ' GMT';\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n \n \n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n \n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}", "function ib(a){var b,c,d,e,f=[];if(!a._d){\n// Default to current date.\n// * if no year, month, day of month are given, default to today\n// * if day of month is given, default month and year\n// * if month is given, default only year\n// * if year is given, don't default anything\nfor(d=hb(a),\n//compute day of the year from weeks and weekdays\na._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),\n//if the day of the year is set, figure out what it is\na._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];\n// Zero out whatever was not defaulted, including time\nfor(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];\n// Check for 24:00:00.000\n24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),\n// Apply timezone offset from input. The actual utcOffset can be changed\n// with parseZone.\nnull!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}" ]
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.60514134", "0.6049883", "0.59848636", "0.597781", "0.5964695", "0.59625536", "0.5935919", "0.59132046", "0.5912539", "0.5899999", "0.5876853", "0.5876809", "0.5856117", "0.5838701", "0.58192056", "0.5814793", "0.57970077", "0.57834345", "0.5783378", "0.57791805", "0.5779038", "0.57623416", "0.5731826", "0.571694", "0.5704397", "0.5685704", "0.5678162", "0.56640106", "0.5662978", "0.563704", "0.563704", "0.563704", "0.563704", "0.563704", "0.5621341", "0.56044567", "0.5601874", "0.5599125", "0.5598524", "0.55816907", "0.55816907", "0.5579666", "0.5579666", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576714", "0.5573217", "0.55698395", "0.55585855", "0.5557752", "0.5554963", "0.55438346", "0.5535731", "0.55314535", "0.5521979", "0.5521649", "0.54970825", "0.54954106", "0.54935133", "0.54885375", "0.5485796", "0.5472865", "0.54430777", "0.5431842", "0.5431389", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649", "0.5424649" ]
0.0
-1
! Chai jQuery plugin implementation.
function chaiJq(chai, utils) { "use strict"; // ------------------------------------------------------------------------ // Variables // ------------------------------------------------------------------------ var flag = utils.flag, toString = Object.prototype.toString; // ------------------------------------------------------------------------ // Helpers // ------------------------------------------------------------------------ /*! * Give a more useful element name. */ var _elName = function ($el) { var name = "", id = $el.attr("id"), cls = $el.attr("class") || ""; // Try CSS selector id. if (id) { name += "#" + id; } if (cls) { name += "." + cls.split(" ").join("."); } if (name) { return "'" + name + "'"; } // Give up. return $el; }; // ------------------------------------------------------------------------ // Type Inference // // (Inspired by Underscore) // ------------------------------------------------------------------------ var _isRegExp = function (val) { return toString.call(val) === "[object RegExp]"; }; // ------------------------------------------------------------------------ // Comparisons // ------------------------------------------------------------------------ var _equals = function (exp, act) { return exp === act; }; var _contains = function (exp, act) { return act.indexOf(exp) !== -1; }; var _exists = function (exp, act) { return act !== undefined; }; var _regExpMatch = function (expRe, act) { return expRe.exec(act); }; // ------------------------------------------------------------------------ // Assertions (Internal) // ------------------------------------------------------------------------ /*! * Wrap assert function and add properties. */ var _jqAssert = function (fn) { return function (exp, msg) { // Set properties. this._$el = flag(this, "object"); this._name = _elName(this._$el); // Flag message. if (msg) { flag(this, "message", msg); } // Invoke assertion function. fn.apply(this, arguments); }; }; /*! * Base for the boolean is("selector") method call. * * @see http://api.jquery.com/is/] * * @param {String} selector jQuery selector to match against */ var _isMethod = function (jqSelector) { // Make selector human readable. var selectorDesc = jqSelector.replace(/:/g, ""); // Return decorated assert. return _jqAssert(function () { this.assert( this._$el.is(jqSelector), "expected " + this._name + " to be " + selectorDesc, "expected " + this._name + " to not be " + selectorDesc ); }); }; /*! * Abstract base for a "containable" method call. * * @param {String} jQuery method name. * @param {Object} opts options * @param {String} opts.hasArg takes argument for method * @param {String} opts.isProperty switch assert context to property if no * expected val * @param {String} opts.hasContains is "contains" applicable * @param {String} opts.altGet alternate function to get value if none */ var _containMethod = function (jqMeth, opts) { // Unpack options. opts || (opts = {}); opts.hasArg = !!opts.hasArg; opts.isProperty = !!opts.isProperty; opts.hasContains = !!opts.hasContains; opts.defaultAct = undefined; // Return decorated assert. return _jqAssert(function () { // Arguments. var exp = arguments[opts.hasArg ? 1 : 0], arg = opts.hasArg ? arguments[0] : undefined, // Switch context to property / check mere presence. noExp = arguments.length === (opts.hasArg ? 1 : 0), isProp = opts.isProperty && noExp, // Method. act = (opts.hasArg ? this._$el[jqMeth](arg) : this._$el[jqMeth]()), meth = opts.hasArg ? jqMeth + "('" + arg + "')" : jqMeth, // Assertion type. contains = !isProp && opts.hasContains && flag(this, "contains"), have = contains ? "contain" : "have", comp = _equals; // Set comparison. if (isProp) { comp = _exists; } else if (contains) { comp = _contains; } // Second chance getter. if (opts.altGet && !act) { act = opts.altGet(this._$el, arg); } // Default actual value on undefined. if (typeof act === "undefined") { act = opts.defaultAct; } // Same context assertion. this.assert( comp(exp, act), "expected " + this._name + " to " + have + " " + meth + (isProp ? "" : " #{exp} but found #{act}"), "expected " + this._name + " not to " + have + " " + meth + (isProp ? "" : " #{exp}"), exp, act ); // Change context if property and not negated. if (isProp && !flag(this, "negate")) { flag(this, "object", act); } }); }; // ------------------------------------------------------------------------ // API // ------------------------------------------------------------------------ /** * Asserts that the element is visible. * * *Node.js/JsDom Note*: JsDom does not currently infer zero-sized or * hidden parent elements as hidden / visible appropriately. * * ```js * expect($("<div>&nbsp;</div>")) * .to.be.$visible; * ``` * * @see http://api.jquery.com/visible-selector/ * * @api public */ var $visible = _isMethod(":visible"); chai.Assertion.addProperty("$visible", $visible); /** * Asserts that the element is hidden. * * *Node.js/JsDom Note*: JsDom does not currently infer zero-sized or * hidden parent elements as hidden / visible appropriately. * * ```js * expect($("<div style=\"display: none\" />")) * .to.be.$hidden; * ``` * * @see http://api.jquery.com/hidden-selector/ * * @api public */ var $hidden = _isMethod(":hidden"); chai.Assertion.addProperty("$hidden", $hidden); /** * Asserts that the element value matches a string or regular expression. * * ```js * expect($("<input value='foo' />")) * .to.have.$val("foo").and * .to.have.$val(/^foo/); * ``` * * @see http://api.jquery.com/val/ * * @param {String|RegExp} expected value * @param {String} message failure message (_optional_) * @api public */ var $val = _jqAssert(function (exp) { var act = this._$el.val(), comp = _isRegExp(exp) ? _regExpMatch : _equals; this.assert( comp(exp, act), "expected " + this._name + " to have val #{exp} but found #{act}", "expected " + this._name + " not to have val #{exp}", exp, typeof act === "undefined" ? "undefined" : act ); }); chai.Assertion.addMethod("$val", $val); /** * Asserts that the element has a class match. * * ```js * expect($("<div class='foo bar' />")) * .to.have.$class("foo").and * .to.have.$class("bar"); * ``` * * @see http://api.jquery.com/hasClass/ * * @param {String} expected class name * @param {String} message failure message (_optional_) * @api public */ var $class = _jqAssert(function (exp) { var act = this._$el.attr("class") || ""; this.assert( this._$el.hasClass(exp), "expected " + this._name + " to have class #{exp} but found #{act}", "expected " + this._name + " not to have class #{exp}", exp, act ); }); chai.Assertion.addMethod("$class", $class); /** * Asserts that the target has exactly the given named attribute, or * asserts the target contains a subset of the attribute when using the * `include` or `contain` modifiers. * * ```js * expect($("<div id=\"hi\" foo=\"bar time\" />")) * .to.have.$attr("id", "hi").and * .to.contain.$attr("foo", "bar"); * ``` * * Changes context to attribute string *value* when no expected value is * provided: * * ```js * expect($("<div id=\"hi\" foo=\"bar time\" />")) * .to.have.$attr("foo").and * .to.equal("bar time").and * .to.match(/^b/); * ``` * * @see http://api.jquery.com/attr/ * * @param {String} name attribute name * @param {String} expected attribute content (_optional_) * @param {String} message failure message (_optional_) * @returns current object or attribute string value * @api public */ var $attr = _containMethod("attr", { hasArg: true, hasContains: true, isProperty: true }); chai.Assertion.addMethod("$attr", $attr); /** * Asserts that the target has exactly the given named * data-attribute, or asserts the target contains a subset * of the data-attribute when using the * `include` or `contain` modifiers. * * ```js * expect($("<div data-id=\"hi\" data-foo=\"bar time\" />")) * .to.have.$data("id", "hi").and * .to.contain.$data("foo", "bar"); * ``` * * Changes context to data-attribute string *value* when no * expected value is provided: * * ```js * expect($("<div data-id=\"hi\" data-foo=\"bar time\" />")) * .to.have.$data("foo").and * .to.equal("bar time").and * .to.match(/^b/); * ``` * * @see http://api.jquery.com/data/ * * @param {String} name data-attribute name * @param {String} expected data-attribute content (_optional_) * @param {String} message failure message (_optional_) * @returns current object or attribute string value * @api public */ var $data = _containMethod("data", { hasArg: true, hasContains: true, isProperty: true }); chai.Assertion.addMethod("$data", $data); /** * Asserts that the target has exactly the given named property. * * ```js * expect($("<input type=\"checkbox\" checked=\"checked\" />")) * .to.have.$prop("checked", true).and * .to.have.$prop("type", "checkbox"); * ``` * * Changes context to property string *value* when no expected value is * provided: * * ```js * expect($("<input type=\"checkbox\" checked=\"checked\" />")) * .to.have.$prop("type").and * .to.equal("checkbox").and * .to.match(/^c.*x$/); * ``` * * @see http://api.jquery.com/prop/ * * @param {String} name property name * @param {Object} expected property value (_optional_) * @param {String} message failure message (_optional_) * @returns current object or property string value * @api public */ var $prop = _containMethod("prop", { hasArg: true, isProperty: true }); chai.Assertion.addMethod("$prop", $prop); /** * Asserts that the target has exactly the given HTML, or * asserts the target contains a subset of the HTML when using the * `include` or `contain` modifiers. * * ```js * expect($("<div><span>foo</span></div>")) * .to.have.$html("<span>foo</span>").and * .to.contain.$html("foo"); * ``` * * @see http://api.jquery.com/html/ * * @param {String} expected HTML content * @param {String} message failure message (_optional_) * @api public */ var $html = _containMethod("html", { hasContains: true }); chai.Assertion.addMethod("$html", $html); /** * Asserts that the target has exactly the given text, or * asserts the target contains a subset of the text when using the * `include` or `contain` modifiers. * * ```js * expect($("<div><span>foo</span> bar</div>")) * .to.have.$text("foo bar").and * .to.contain.$text("foo"); * ``` * * @see http://api.jquery.com/text/ * * @name $text * @param {String} expected text content * @param {String} message failure message (_optional_) * @api public */ var $text = _containMethod("text", { hasContains: true }); chai.Assertion.addMethod("$text", $text); /** * Asserts that the target has exactly the given CSS property, or * asserts the target contains a subset of the CSS when using the * `include` or `contain` modifiers. * * *Node.js/JsDom Note*: Computed CSS properties are not correctly * inferred as of JsDom v0.8.8. Explicit ones should get matched exactly. * * *Browser Note*: Explicit CSS properties are sometimes not matched * (in contrast to Node.js), so the plugin performs an extra check against * explicit `style` properties for a match. May still have other wonky * corner cases. * * *PhantomJS Note*: PhantomJS also is fairly wonky and unpredictable with * respect to CSS / styles, especially those that come from CSS classes * and not explicity `style` attributes. * * ```js * expect($("<div style=\"width: 50px; border: 1px dotted black;\" />")) * .to.have.$css("width", "50px").and * .to.have.$css("border-top-style", "dotted"); * ``` * * @see http://api.jquery.com/css/ * * @name $css * @param {String} expected CSS property content * @param {String} message failure message (_optional_) * @api public */ var $css = _containMethod("css", { hasArg: true, hasContains: true, // Alternate Getter: If no match, go for explicit property. altGet: function ($el, prop) { return $el.prop("style")[prop]; } }); chai.Assertion.addMethod("$css", $css); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jQuery(arg1, arg2) {}", "function letsJQuery() {\r\n\tcreateOptionsMenu();\r\n\tpressthatButton();\r\n }", "function extendJQuery() {\n jQuery.extend(Object.create(null, {\n 'alert': { value: alert, configurable: true, enumerable: true, writable: true },\n 'confirm': { value: createShowShorthand('success', 'S011'), configurable: true, enumerable: true, writable: true, },\n 'notice': { value: createShowShorthand('info'), configurable: true, enumerable: true, writable: true, },\n 'warn': { value: createShowShorthand('warning', 'S012'), configurable: true, enumerable: true, writable: true, },\n 'alarm': { value: createShowShorthand('error', 'S013'), configurable: true, enumerable: true, writable: true, },\n }));\n }", "function Plugin( element, options ) {\n this.ele = element; \n this.$ele = $(element); \n this.options = $.extend( {}, defaults, options) ; \n \n this._defaults = defaults; \n this._name = pgn; \n\n this.init(); \n }", "function loadPlugin($){\n\n\t\t\tif( !options.jqueryUrl.wasAlreadyLoaded ){\n\t\t\t\twindow.jQuery_loadedByMochup = $;\n\t\t\t}\n\n\t\t\tif( !(window.JSON && JSON.stringify) && options.jsonUrl ){\n\t\t\t\t$.getScript( options.jsonUrl );\n\t\t\t}\n\n\t\t\tif( $.fn.mochup ){\n\t\t\t\t$(options.scope).mochup();\n\t\t\t}else{\n\t\t\t\t$.getScript( options.mochupUrl, function(){\n\t\t\t\t\t$(options.scope).mochup();\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function Plugin( element, options ) {\n\t\tthis.$element = $(element);\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "function Plugin(element, options) {\n\t\tthis.$element = $(element);\n\n\t\tthis.options = $.extend({}, defaults, options);\n\t\tthis.init();\n\t}", "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, linkOptions);\n }, 0, false);\n }", "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, linkOptions);\n }, 0, false);\n }", "function $(t,e){this.x=e,this.q=t}", "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, createLinkOptions());\n }, 0, false);\n }", "function _DefineJqueryPlugins(){\r\n\t\r\n\t\tfunction __define(){\r\n\t\t\r\n\t\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\t\t\t\r\n\t\t\t//If jQuery wasn't found, every x ms, check again\r\n\t\t\t//When it's found, define the plugin(s)\r\n\t\t\tif(!_jQueryDetected){\r\n\t\t\t\twindow.setTimeout(__define, _Config.jQueryCheckTimeout *= 1.01);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tjQuery.fn.extend({\r\n\t\t\t\tappendTemplates: function(){\r\n\r\n\t\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\t\targs[i] = args[i].Node;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.append(args);\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t/*\r\n\t\t\tvar __append = jQuery.fn.append;\r\n\r\n\t\t\tjQuery.fn.append = function(){\r\n\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t//Convert Templates and TemplateCollections to DOM elements\r\n\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\targs[i] = args[i].Element;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn __append.apply(this, args);\r\n\r\n\t\t\t};\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t};\r\n\t\r\n\t\t__define();\r\n\t\t\r\n\t}", "function Plugin (element, options)\n\t{\n\t\t// make \"this\" a unique var\n\t\tvar _this = this;\n\t\t// store the DOM element for global usage\n\t\tvar _element = element;\n\t\t// store the jQuery version of the DOM element for global usage\n\t\tvar _$element = $(element);\n\t\t// merge user defined options with the defaults\n\t\tvar _settings = $.extend({}, defaults, options);\n\n\t\tvar toggle = _$element.find(_settings['toggleSelector']);\n\t\tvar content = _$element.find(_settings['contentSelector']);\n\n\t\t// initialize the plugin by calling the init() method\n\t\tinit();\n\n\t\tfunction init()\n\t\t{\n\t\t\t// business logic for initialization\n\t\t\ttoggle = _$element.find(_settings['toggleSelector']);\n\t\t\tcontent = _$element.find(_settings['contentSelector']);\n\t\t\tcontent.hide();\n\t\t}\n\n\t\t// place all your other private functions here\n\n\t\t// public functions\n\t\t_this.open = function()\n\t\t{\n\t\t\tcontent.slideDown();\n\t\t}\n\t\t_this.close = function()\n\t\t{\n\t\t\tcontent.slideUp();\n\t\t}\n\n\t}", "function Plugin ( element, options ) {\n var self = this;\n\n self.el = element;\n self.$el = $(element);\n\n self.options = $.extend( {}, defaults, options);\n\n self._defaults = defaults;\n self._name = pluginName;\n\n // set the default state\n self.multiSelect = false;\n self.rangeSelect = false;\n self.$rangeRoot = null;\n self.$lastSelected = null;\n self.leftMouseDown = false;\n\n self._init();\n }", "function Plugin( element, options, callback ) {\r\n $self = this;\r\n $self.element = element;\r\n\r\n $self.options = $.extend( {}, defaults, options) ;\r\n $self._name = pluginName;\r\n $self.callback = callback;\r\n $self.selectedElement = {};\r\n\r\n $self.init();\r\n }", "function Plugin(element, options) {\n this.$el = $(element);\n this.options = $.extend({}, defaults, options);\n\t\tthis.percentScroll = 0;\n\t\tthis.lastScroll = undefined;\n this.markup();\n this.registerEvents();\n this.updateDisplay();\n }", "function Plugin( element, options ) {\n tabElement = $(element);\n switchElement = $(options.target);\n eventType = options.eventType || \"click\";\n actClassName = options.actClassName;\n callback = options.callback;\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n me = this;\n me.element = element;\n me.options = $.extend( {}, defaults, options) ;\n \n me._defaults = defaults;\n me._name = pluginName;\n \n me.init();\n }", "function Plugin(element, options) {\n this.$element = $(element);\n this.$submit = this.$element.find('button[type=\"submit\"]');\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n var metadata = this.$element.data();\n this.options = $.extend({}, defaults, options, metadata);\n //\n this._defaults = defaults;\n this._name = pluginName;\n\n //\n this.init();\n }", "function $(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(\"object\"===typeof Reflect&&\"function\"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}", "function Plugin( element, options ) {\n\n //SET OPTIONS\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n\n //REGISTER ELEMENT\n this.$element = $(element);\n\n //INITIALIZE\n this.init();\n }", "function Plugin( element, options, names) {\n this.element = element;\n \n this.last = null;\n \n options = options || function(){console.log('Test');return {};};\n\n this.options = $.extend( {}, defaults, options) ;\n\n this.names = $.extend( {}, team, names) ;\n \n this._defaults = defaults;\n\n this._name = pluginName;\n \n this.init();\n }", "function Plugin( element, options ) {\n this.$w = $(window);\n this.$el = $(element);\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.rangerin = {};\n this.$element = $(this.element);\n this.options = options;\n this.metadata = this.$element.data('options');\n this.settings = $.extend({}, defaults, this.options, this.metadata);\n this.init();\n }", "function Plugin ( element, options ) {\n this.element = element;\n\t\t\t this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function jQueryStub() {\n return this;\n}", "function Plugin( element, options ) {\n this.element = element;\n\n this.options = $.extend({ done: function(){} }, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.start();\n }", "function letsJQuery() {\r\n//make sure there is no conflict between jQuery and other libraries\r\n$j = $.noConflict();\r\n//notify that jQuery is running...\r\n $j('<div>jQuery is running!</div>')\r\n .css({padding: '10px', background: '#ffc', position: 'absolute',top: '0', width: '100%'})\r\n .prependTo('body')\r\n .fadeIn('fast')\r\n .animate({opacity: 1.0}, 300)\r\n .fadeOut('fast', function() {\r\n $(this).remove();\r\n });\r\n//start custom jQuery scripting.\r\nmain();\r\n}", "function Plugin( element, options ) {\n this.element = $(element);\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.label = $('[for=\"'+this.element.attr('id')+'\"]').attr('for', 'minict_'+this.element.attr('id'));\n\n this.init();\n }", "function dojQuery(arg, fn) {\n for (var _len = arguments.length, opts = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n opts[_key - 2] = arguments[_key];\n }\n\n // $ -> $\n var dojQueryElement = function dojQueryElement(el) {\n fn.apply(void 0, [el].concat(opts));\n return el;\n }; // HTML -> HTML\n\n\n var doHtmlString = function doHtmlString(html) {\n var el = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div>').html(html);\n dojQueryElement(el);\n return el.html();\n }; // pseudo-overloading\n\n\n if (typeof arg === 'string') {\n return doHtmlString(arg);\n }\n\n return dojQueryElement(arg);\n}", "function Plugin ( element, options ) {\n this.element = element;\n this.$element = $( element );\n this.content = this.$element.children()[0];\n this.$content = $( this.content );\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n // make the plugin data publicly accesible\n $.fn.rt.RT = this;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.$element = $(element);\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.dataTemple = dataTemple;\n this.init();\n }", "function Plugin( el, options ) {\n\t\tthis.$el = $(el);\n\t\t\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function Plugin( element, options )\n {\n \n this.element = element;\n\n this.options = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function PluginWrapper(options, comArgs) {\n if (this.length === 1 && !options && !comArgs) {\n return $(findPluginElement(this)).data(pluginDataName);\n }\n else {\n return this.each(function () {\n // if element already has a qbit then destroy\n var oldPlugin = $.data(this, pluginDataName);\n if (oldPlugin) {\n oldPlugin.destroy();\n $.removeData(this, pluginDataName);\n }\n\n // add jquery qbit plugin instance to element\n var newPlugin = new Plugin(this, options, comArgs);\n $.data(this, pluginDataName, newPlugin);\n newPlugin.queueQbit(newPlugin.settings.qbit, newPlugin.element);\n newPlugin.loadQbit(newPlugin.settings.qbit);\n });\n }\n }", "function Plugin(element, options) {\n this.element = $(element);\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this._init();\n }", "function updateJQuery($) {\n if (!$ || ($ && $.bridget)) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "function _apply_Gamay_jQueryExtensions(){\n\n /**\n * @description\n * Adding additional selector functions, to match elements with a specific text (node)\n * Credit to 'Mottie', source: https://gist.github.com/Mottie/461488\n */\n jQuery.extend( $.expr[\":\"], {\n containsExact: $.expr.createPseudo ? // case insensitive\n $.expr.createPseudo(function(text) {\n return function(elem) {\n return $.trim(elem.innerHTML.toLowerCase()) === text.toLowerCase();\n };\n }) :\n // support: jQuery <1.8\n function(elem, i, match) {\n return $.trim(elem.innerHTML.toLowerCase()) === match[3].toLowerCase();\n },\n\n containsExactCase: $.expr.createPseudo ? // case sensitive\n $.expr.createPseudo(function(text) {\n return function(elem) {\n return $.trim(elem.innerHTML) === text;\n };\n }) :\n // support: jQuery <1.8\n function(elem, i, match) {\n return $.trim(elem.innerHTML) === match[3];\n },\n\n containsRegex: $.expr.createPseudo ?\n $.expr.createPseudo(function(text) {\n var reg = /^\\/((?:\\\\\\/|[^\\/]) )\\/([mig]{0,3})$/.exec(text);\n return function(elem) {\n return RegExp(reg[1], reg[2]).test($.trim(elem.innerHTML));\n };\n }) :\n // support: jQuery <1.8\n function(elem, i, match) {\n var reg = /^\\/((?:\\\\\\/|[^\\/]) )\\/([mig]{0,3})$/.exec(match[3]);\n return RegExp(reg[1], reg[2]).test($.trim(elem.innerHTML));\n }\n\n });\n\n /**\n * @description\n * Get the tag name of an HTML element.\n * @returns {string} the tag name in lower case\n */\n jQuery.fn.Gamay_GetTagName = function() {\n return this.prop(\"tagName\").toLowerCase();\n };\n\n /**\n * @description\n * Check if an HTML element is direct child of 'html', 'body' or 'head'.\n * This function returns true if the criteria is correct, and false otherwise.\n * @returns {boolean}\n */\n jQuery.fn.Gamay_isElementChildOfBiggerContent = function() {\n var _parentTagName = this.parent().Gamay_GetTagName();\n return [\"html\",\"body\",\"head\"].indexOf(_parentTagName) !== -1;\n };\n\n /**\n * @description\n * Get the HTML environment of a element\n * @example\n * Given this html code:\n *\n * <header id=\"pageheader\">\n * <h1>some heading</h1>\n * <img id=\"imageID\" src=\"./img/someimage.jpg\">\n *\n * </header>\n *\n * If the element is the image element with @id = \"imageID\"\n * The HTML environment snapshot would be the parent element (header tag),\n * containing this image.\n *\n * If it is a direct child of 'html', 'body' or 'head',\n * the element and it innerHTML is returned.\n *\n * @returns {*} the html environment\n */\n jQuery.fn.Gamay_GetEnvironmentSnapshot = function() {\n if(this.Gamay_isElementChildOfBiggerContent()){\n return this.html(); //the element + its 'innerHTML'\n }else{\n return this.parent().html(); //the parent of the element + the parents 'innerHTML'\n }\n };\n }", "function updateJQuery($) {\n if (!$ || ($ && $.bridget)) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n this._filters = {};\n\n this.init();\n }", "function Plugin ( element, options ) { \n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.currentDate = new Date();\n this.events = options.events;\n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.$element = $(element);\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function ourJquery(elements){\r\n\r\n this.elements = elements;\r\n\r\n this.on = function(eventName, f){\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].addEventListener(eventName, f); \r\n }\r\n\r\n return this;\r\n }\r\n\r\n this.addClass = function(name){\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].classList.add(name); \r\n }\r\n\r\n return this;\r\n }\r\n\r\n this.removeClass = function(name){\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].classList.remove(name); \r\n }\r\n\r\n return this;\r\n }\r\n\r\n this.html = function(html){\r\n\r\n if(typeof(html) ==='undefined'){\r\n return this.elements[0].innerHTML;\r\n }\r\n\r\n for (let i = 0; i < this.elements.length; i++){\r\n this.elements[i].innerHTML = html;\r\n }\r\n return this;\r\n }\r\n\r\n this.fade = function(t, f) {\r\n for (let i = 0; i < this.elements.length; i++) {\r\n\r\n this.elements[i].addEventListener('click', function(){\r\n fade(this, t, f);\r\n }); \r\n }\r\n return this;\r\n }\r\n\r\n this.hide = function(){\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].style.display = 'none'; \r\n }\r\n\r\n return this;\r\n }\r\n\r\n this.show = function(){\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].style.display = 'block'; \r\n }\r\n\r\n return this;\r\n }\r\n\r\n this.click = function(f) {\r\n this.f = f;\r\n for (let i = 0; i < this.elements.length; i++) {\r\n this.elements[i].addEventListener('click', f); \r\n }\r\n\r\n return this;\r\n }\r\n}", "function letsJQuery() {\n get_layout();\n}", "function pluginloaded()\n{\r\n}", "function Plugin(element, options) {\n this.element = $(element);\n\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n if(element) this.init();\n }", "superagentTest() {\n $(function(){\n console.log(\"Superagent test\");\n });\n }", "function Plugin (element, options) {\n this.element = element;\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n\t\tthis.element = element;\n\t\tthis.$el = $(element);\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function Plugin(element, options) {\r\r\n this.element = element;\r\r\n this.options = $.extend({}, defaults, options);\r\r\n this._defaults = defaults;\r\r\n this._name = pluginName;\r\r\n this.init();\r\r\n }", "function Plugin( element, options ) {\n this.element = element;\n this.$element = $(element);\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin(el, options ) {\n this.el = el;\n this.$el = $(el);\n this.options = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n\t\tthis.element = $(element);\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery tem um método 'extend' que mescla o conteúdo de dois ou\n // mais objetos, armazenando o resultado no primeiro objeto. O primeiro\n // objeto geralmente é vazio já que não queremos alterar os valores\n // padrão para futuras instâncias do plugin\n this.options = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\t// jQuery has an extend method which merges the contents of two or\n\t\t// more objects, storing the result in the first object. The first object\n\t\t// is generally empty as we don't want to alter the default options for\n\t\t// future instances of the plugin\n\t\tthis.settings = $.extend({}, defaults, options);\n \tthis.settings.sub = $(this.settings.sub);\n \tthis.settings.link = $(this.settings.link);\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.init();\n\t}", "function Plugin(element, options) {\n this.element = element;\n\n // Merge the options given by the user with the defaults\n this.options = $.extend({}, defaults, options)\n\n // Attach data to the elment\n this.$el = $(el);\n this.$el.data(name, this);\n\n this._defaults = defaults;\n\n var meta = this.$el.data(name + '-opts');\n this.opts = $.extend(this._defaults, opts, meta);\n\n // Initialization code to get the ball rolling\n // If your plugin is simple, this may not be necessary and\n // you could place your implementation here\n this.init();\n }", "function Plugin(element, options) {\n\tthis.element = element;\n\n\tthis.options = $.extend({}, defaults, options);\n\n\tthis._defaults = defaults;\n\tthis._name = pluginName;\n\n\t// removes previous onClicks on the icon, if it exists\n\tjQuery(options.input).siblings('img').removeAttr('onClick').on('click', function() {\n\t\tjQuery(this).siblings(options.input).trigger('focus');\n\t});\n\n\t// if we have hidden fields we're setting, build them in the DOM\n\t// after our date input\n\tif(this.options.ashidden !== undefined) {\n\t\tvar inp = this.options.input;\n\t\tjQuery.each(this.options.ashidden, function(i, h) {\n\t\t\tif ($('#' + h).length < 1) {\n\t\t\t\tjQuery(inp).after('<input type=\"hidden\" name=\"' + h + '\" id=\"' + h + '\" value=\"\">');\n\t\t\t}\n\t\t});\n\t}\n\n\tthis.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\r\n\r\n\t\tthis.element = element;\r\n\t\tthis.$element = $(this.element);\r\n\t\tthis._name = pluginName;\r\n\t\tthis._defaults = $.fn[pluginName].defaults;\r\n\t\tthis.settings = $.extend(true, {}, this._defaults, options);\r\n\t\tthis.loadDependencies();\r\n\t\t\r\n\t}", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n var self = this;\n\n // Public attributes\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n this._ignoreHashChange = false;\n\n this.init();\n }", "function contruct() {\n\n if ( !$[pluginName] ) {\n $.loading = function( opts ) {\n $( \"body\" ).loading( opts );\n };\n }\n }", "function Plugin( element, options ) {\r\n\t\tthis.element = $(element);\r\n\t\tthis.options = $.extend( {}, defaults, options );\r\n\t\tthis._defaults = defaults;\r\n\t\tthis._name = pluginName;\r\n\r\n\t\tthis.init();\r\n\t}", "function Plugin ( element, options ) {\n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n \n // jQuery has an extend method that merges the \n // contents of two or more objects, storing the \n // result in the first object. The first object \n // is generally empty because we don't want to alter \n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n this._auth = {}\n this._publishButtonCss = publishButtonCss;\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function letsJQuery() {\r\n //alert($); // check if the dollar (jquery) function works\r\n //alert($().jquery); // check jQuery version\r\n }", "function Plugin(element, options) {\n\t\tthis.element = element;\n\t\tthis.$element = $(this.element);\n\t\tthis.options = $.extend({ }, defaults, options);\n\t\tthis.$content = this.$element.find(this.options.tabContent);\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t\n\t}", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n this._frame = 1;\n\t\tthis._shakeCounter;\n\t\t\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n\t\tthis.settings = {\n\t\t\t'date_object': new Date(),\n\t\t\t'selected_day': '',\n 'current_month': new Date().getMonth() + 1,\n 'current_year': new Date().getFullYear(),\n\t\t\t'selected_date': '',\n\t\t\t'allowed_formats': ['d', 'do', 'D', 'j', 'l', 'w', 'F', 'm', 'M', 'n', 'U', 'y', 'Y'],\n\t\t\t'month_name': ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t\t'date_formatting': {\n\t\t\t\t'weekdays': {\n\t\t\t\t\t'shorthand': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t\t\t\t\t'longhand': ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday','Friday', 'Saturday']\n\t\t\t\t},\n\t\t\t\t'months': {\n\t\t\t\t\tshorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul','Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\t\t\t\t\tlonghand: ['January', 'February', 'March', 'April', 'May', 'June', 'July','August', 'September', 'October', 'November', 'December']\n\t\t\t\t}\n\t\t\t}\n };\n\n\t\tthis.init();\n }", "function Plugin(element, options) {\n this.$el = $(element);\n\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this._timer = null;\n this._text = '';\n this._pos = 0;\n this._len = 0;\n this.init();\n }", "function letsJQuery() {\n // 1. Вместо верхнего баннера ставим форму поиска\r\n var search_form = $(\"form[name='findform']\").parent();\n $('#banner-td').html(search_form.html());\r\n search_form.html(\"&nbsp;\");\r\n \n // 3. Переделываем навигацию\n makeNavigation();\n // 2. Прифодим в порядок форму топика\n \n $('div#F').css({zIndex:10000, position: 'absolute', top: 120, backgroundColor: '#808080', padding:'1em', borderWidth: 'medium'}).hide();\n $('input#Submit').after(\"&nbsp;<input class='sendbutton' type='reset' value='Отменить' id='btn_cancel'>\");\n $('div#F').css({left: ($('body').width()-$('div#F').width())/2, });\n $('#newtopic_form').submit(function(){ hideForm('div#F');return true;});\n $('#btn_cancel').click(function(){hideForm(\"div#F\");});\n}", "function Plugin(element, options) {\n this.$el = $(element);\n this.options = $.extend({}, defaults, options);\n\t\tthis.options.value = this.options.value !== undefined ? this.options.value : this.options.checked;\n\t\tthis.radioGroup = null;\n this.init();\n }", "function Plugin ( element, options ) {\n\n\t\tthis.element = element;\n\t\tthis.$elem = $(this.element);\n\n\t\tthis.settings = $.extend( {}, defaults, options );\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\n\t}", "function Plugin (element, options) {\n this.element = element;\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\tthis.element = element;\n\n\t\t\t/**\n\t\t\t * jQuery has an extend method which merges the contents of two or\n\t\t\t * more objects, storing the result in the first object. The first object\n\t\t\t * is generally empty as we don't want to alter the default options for\n\t\t\t * future instances of the plugin\n\t\t\t */\n\t\t\tthis.settings = $.extend(true, {}, defaults, options );\n\t\t\tthis._defaults = defaults;\n\t\t\tthis._name = pluginName;\n\t\t\tthis._targetId = this.element.id;\n\n\t\t\t/**\n\t\t\t * Builder specific cache.\n\t\t\t */\n\t\t\tthis._html = [];\n\n\t\t\t/**\n\t\t\t * Get things going!\n\t\t\t */\n\t\t\tthis.init();\n\n\t\t\t/***** PUBLIC API METHODS *****/\n\t\t\tthis.api = {\n\t\t\t\t\"api.collect\": function () {\n\t\t\t\t\tlet _self = this;\n\t\t\t\t\tlet valuesToUse = [];\n\n\t\t\t\t\tfunction _nestedSelector ($el) {\n\t\t\t\t\t\t[...$el.find(\"> .list-item-template > input:checkbox\")].forEach(_ => { // for each immediate checkbox child of current element\n\t\t\t\t\t\t\tif (_self._isLeaf($(_).closest('.looksee')) && _.checked) { // if the current elemenet's parent <li> is a leaf item and is checked, store the value and move on\n\t\t\t\t\t\t\t\tvaluesToUse.push(_.dataset.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (_self._allChildrenChecked($(_).closest('.looksee'))) { // if the current element's parent <li> contains all checked checkboxes\n\t\t\t\t\t\t\t\tvaluesToUse.push(_.dataset.value); // push the current element's value to the array\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (!_self._isLeaf($(_).closest('.looksee'))) {\n\t\t\t\t\t\t\t\t_nestedSelector($(_).parent().next().find(\"> .looksee\")); // otherwise, run the _nestedSelector function on the current element's parent <li>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.settings.useParentValueWhenFull) {\n\t\t\t\t\t\t_nestedSelector(this.tree.find(\"> .looksee\"));\n\t\t\t\t\t\treturn valuesToUse;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn Array.from(this.tree.find(\"input.leaf:checkbox:checked\").map(function () {\n\t\t\t\t\t\t\treturn this.dataset.value;\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"api.filter\": function (str) {\n\t\t\t\t\tthis.filter(str);\n\t\t\t\t},\n\t\t\t\t\"api.buildList\": function (data, labelsAsValues = false) {\n\t\t\t\t\tthis.buildList(data, labelsAsValues);\n\t\t\t\t},\n\t\t\t\t\"api.reset\": function () {\n\t\t\t\t\tthis.tree.find(\"input:checkbox\").prop('checked', false);\n\t\t\t\t\tthis.tree.find(\"input:checkbox\").prop('indeterminate', false);\n\t\t\t\t}\n\t\t\t};\n\n\t\t}", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n \n this.init(); // this references the init() function in plugin_prototype\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n\r\n\r\n this.init();\r\n }", "function Plugin(element, options) {\n this.element = element;\n this.$element = $(element);\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n $(this.element).data(\"mSearchToggle\", this);\n }", "function Plugin(option) {\n return this.each(function () { // for each matching element, i.e. for each div with the class alert, we do the following\n // It is useful for a jQuery plugin to return the jQuery object (here probably $(\".alert\")), in order to use chaining.\n var $this = $(this) // this = the div with the alert class\n var data = $this.data('bs.alert') // get the value of the data bs.alert attached to our div, if it exists\n if (!data) $this.data('bs.alert', (data = new Alert(this)))\n // If not, we add that attached data (named bs.alert) and set it's value to an instance of Class Alert (defined above).\n // This means that Alert IS executed here. And this is the important part : we set here the click event listener.\n // I don't really get the point of attaching it with data association... maybe it's for not setting again the event listeners if we call the function with a parameter : $.fn.alert('close'). But wouldn't it be easier to use a \"if\" condition here?\n if (typeof option == 'string') data[option].call($this)\n // if we called $(\".alert\").alert('close'), so option here is \"close\", then we call here the close method of the data object (see the close method in Class Alert).\n })\n }", "#jqueryFade() {\n this.#jquery.on('click', () => {\n $('#alternative').fadeToggle(600);\n });\n }", "plugins(){\n Object.defineProperty(Object.prototype,'animate',{\n enumerable : false,\n configurable: true,\n value : function(prop,duration,cb){\n this.transition().attrs(prop).duration(duration).on('end',cb);\n }\n });\n Object.defineProperty(Object.prototype,'clear',{\n enumerable : false,\n configurable: true,\n value : function(){\n this.selectAll('*').remove();\n }\n });\n Object.defineProperty(Object.prototype,'setHeight',{\n enumerable : false,\n configurable: true,\n value : function(h){\n this.attrs({\n 'height' : h\n });\n }\n });\n }", "function Plugin( element, options ) {\n \n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t}", "function invoke(elem, pluginName, settings) {\n return $(elem)[pluginName](settings);\n}", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin ( element, options ) {\n this.element = element;\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n\n }", "function Plugin(element, options) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this._selected = undefined;\n this._isOpen = false;\n this.init();\n }", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\tthis.$element = $(element);\n\t\tthis.settings = $.extend( {}, defaults, options );\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.originalText = null;\n\t\tthis.currentText = null;\n\t\tthis.decodeStart = null;\n\t\tthis.init();\n\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n this.info = \"\";\n this.className = \"\";\n\t\t}", "function Plugin(element, options) {\n this.element = element;\n // jQuery has an extend method that merges the \n // contents of two or more objects, storing the \n // result in the first object. The first object \n // is generally empty because we don't want to alter \n // the default options for future instances of the plugin\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\tthis.settings = $.extend( {}, defaults, options );\n \n this.e = null;\n this.locks = 0;\n this.silentMode = false;\n this.timer = null;\n \n this.init();\n\t}", "function letsJQuery() {\r\n\r\n function printallmembers( obj ) {\r\n\tvar str = '';\r\n\tfor( var memb in obj )\r\n\t if (memb != 'unique') {\r\n\t\tstr += memb + ' = ' + obj[memb] + '\\n'; \r\n\t }\r\n\treturn str;\r\n }\r\n\r\n}", "initPlugins() {}", "initPlugins() {}", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element ) {\n this.element = element;\n this.jqElement = $(element);\n this.isScaleActive = false;\n\n this._defaults = defaults;\n this._name = pluginName;\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }" ]
[ "0.6655475", "0.6535609", "0.6201509", "0.61341715", "0.60110307", "0.5988286", "0.5922567", "0.58725655", "0.58725655", "0.5867902", "0.58612984", "0.5818488", "0.579289", "0.5791665", "0.5782357", "0.57613087", "0.57475364", "0.57458735", "0.5744094", "0.5741339", "0.5718205", "0.57081664", "0.5704437", "0.57041395", "0.5689163", "0.5682351", "0.5670879", "0.56700206", "0.5659358", "0.56480205", "0.56475306", "0.56428623", "0.5626668", "0.56260324", "0.5611128", "0.5592051", "0.55803806", "0.557189", "0.5571706", "0.55688536", "0.5568348", "0.55660003", "0.5554751", "0.5553434", "0.5552171", "0.55431134", "0.5537065", "0.5533741", "0.5530368", "0.5528975", "0.55220443", "0.55187464", "0.551592", "0.55104643", "0.55057997", "0.55016184", "0.55001026", "0.55001026", "0.54874754", "0.548471", "0.5474658", "0.5473468", "0.5472255", "0.5469749", "0.5458945", "0.54588914", "0.54585874", "0.5456402", "0.5443537", "0.543774", "0.5435713", "0.54305613", "0.5424731", "0.54233575", "0.5421583", "0.5421489", "0.5414476", "0.5398805", "0.539379", "0.5392034", "0.53904736", "0.53861517", "0.5385094", "0.53839403", "0.5383261", "0.53830725", "0.53816515", "0.53787243", "0.53766006", "0.5362037", "0.5360348", "0.5360189", "0.5357698", "0.5355113", "0.534531", "0.5342379", "0.5342379", "0.53374386", "0.53371763", "0.53356236" ]
0.5647664
30
! Wrap AMD, etc. using boilerplate.
function wrap(plugin) { "use strict"; /* global module:false, define:false */ if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { // NodeJS module.exports = plugin; } else if (typeof define === "function" && define.amd) { // AMD: Assumes importing `chai` and `jquery`. Returns a function to // inject with `chai.use()`. // // See: https://github.com/chaijs/chai-jquery/issues/27 define(["jquery"], function ($) { return function (chai, utils) { return plugin(chai, utils, $); }; }); } else { // Other environment (usually <script> tag): plug in to global chai // instance directly. root.chai.use(function (chai, utils) { return plugin(chai, utils, root.jQuery); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructAMD() {\n\n\t\t//create a library instance\n\t\treturn init();\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library;\n\t\t\tlibrary = factory('amd');\n\t\t\tlibrary.fork = init;\n\t\t\treturn library;\n\t\t}\n\t}", "function init() {\n\t\t\tvar library;\n\t\t\tlibrary = factory('amd');\n\t\t\tlibrary.fork = init;\n\t\t\treturn library;\n\t\t}", "function monkeyPatch() {\n return {\n transform: (code, id) => {\n const file = path.parse(id).base;\n\n // Only one define call per module is allowed by requirejs so\n // we have to remove calls that other libraries make\n if (file === 'FileSaver.js') {\n code = code.replace(/define !== null\\) && \\(define.amd != null/g, '0')\n } else if (file === 'html2canvas.js') {\n code = code.replace(/&&\\s+define.amd/g, '&& define.amd && false')\n }\n\n return code\n }\n }\n}", "function monkeyPatch() {\n return {\n transform: (code, id) => {\n var file = id.split('/').pop()\n\n // Only one define call per module is allowed by requirejs so\n // we have to remove calls that other libraries make\n if (file === 'FileSaver.js') {\n code = code.replace(/define !== null\\) && \\(define.amd != null/g, '0')\n } else if (file === 'html2canvas.js') {\n code = code.replace(/&&\\s+define.amd/g, '&& define.amd && false')\n }\n\n return code\n }\n }\n}", "function bEinject() {\n\ttry {\n\t\tif (module && module.exports) {\n\t\t\tmodule.exports = {\n\t\t\t\tAttribute,\n\t\t\t\tElement,\n\t\t\t\tbuiltins: {\n\t\t\t\t\tdoRandom,\n\t\t\t\t\tdoClock\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t} catch (err) {}\n}", "function amd(loader) {\n // by default we only enforce AMD noConflict mode in Node\n var isNode = typeof module != 'undefined' && module.exports;\n\n loader._extensions.push(amd);\n\n // AMD Module Format Detection RegEx\n // define([.., .., ..], ...)\n // define(varName); || define(function(require, exports) {}); || define({})\n var amdRegEx = /(?:^\\uFEFF?|[^$_a-zA-Z\\xA0-\\uFFFF.])define\\s*\\(\\s*(\"[^\"]+\"\\s*,\\s*|'[^']+'\\s*,\\s*)?\\s*(\\[(\\s*((\"[^\"]+\"|'[^']+')\\s*,|\\/\\/.*\\r?\\n|\\/\\*(.|\\s)*?\\*\\/))*(\\s*(\"[^\"]+\"|'[^']+')\\s*,?)?(\\s*(\\/\\/.*\\r?\\n|\\/\\*(.|\\s)*?\\*\\/))*\\s*\\]|function\\s*|{|[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*\\))/;\n\n var commentRegEx = /(\\/\\*([\\s\\S]*?)\\*\\/|([^:]|^)\\/\\/(.*)$)/mg;\n var stringRegEx = /(\"[^\"\\\\\\n\\r]*(\\\\.[^\"\\\\\\n\\r]*)*\"|'[^'\\\\\\n\\r]*(\\\\.[^'\\\\\\n\\r]*)*')/g;\n var cjsRequirePre = \"(?:^|[^$_a-zA-Z\\\\xA0-\\\\uFFFF.])\";\n var cjsRequirePost = \"\\\\s*\\\\(\\\\s*(\\\"([^\\\"]+)\\\"|'([^']+)')\\\\s*\\\\)\";\n var fnBracketRegEx = /\\(([^\\)]*)\\)/;\n var wsRegEx = /^\\s+|\\s+$/g;\n\n var requireRegExs = {};\n\n function getCJSDeps(source, requireIndex) {\n var stringLocations = [];\n\n var match;\n\n function inLocation(locations, index) {\n for (var i = 0; i < locations.length; i++)\n if (locations[i][0] < index && locations[i][1] > index)\n return true;\n return false;\n }\n\n while (match = stringRegEx.exec(source))\n stringLocations.push([match.index, match.index + match[0].length]);\n\n // remove comments\n source = source.replace(commentRegEx, function(match, a, b, c, d, offset){\n if(inLocation(stringLocations, offset + 1)) {\n return match;\n } else {\n return '';\n }\n });\n\n // determine the require alias\n var params = source.match(fnBracketRegEx);\n var requireAlias = (params[1].split(',')[requireIndex] || 'require').replace(wsRegEx, '');\n\n // find or generate the regex for this requireAlias\n var requireRegEx = requireRegExs[requireAlias] || (requireRegExs[requireAlias] = new RegExp(cjsRequirePre + requireAlias + cjsRequirePost, 'g'));\n\n requireRegEx.lastIndex = 0;\n\n var deps = [];\n\n var match;\n while (match = requireRegEx.exec(source))\n deps.push(match[2] || match[3]);\n\n return deps;\n }\n\n /*\n AMD-compatible require\n To copy RequireJS, set window.require = window.requirejs = loader.amdRequire\n */\n function require(names, callback, errback, referer) {\n // 'this' is bound to the loader\n var loader = this;\n\n // in amd, first arg can be a config object... we just ignore\n if (typeof names == 'object' && !(names instanceof Array))\n return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));\n\n // amd require\n if (names instanceof Array)\n Promise.all(names.map(function(name) {\n return loader['import'](name, referer);\n })).then(function(modules) {\n if(callback) {\n callback.apply(null, modules);\n }\n }, errback);\n\n // commonjs require\n else if (typeof names == 'string') {\n var module = loader.get(names);\n return module.__useDefault ? module['default'] : module;\n }\n\n else\n throw new TypeError('Invalid require');\n };\n loader.amdRequire = function() {\n return require.apply(this, arguments);\n };\n\n function makeRequire(parentName, staticRequire, loader) {\n return function(names, callback, errback) {\n if (typeof names == 'string')\n return staticRequire(names);\n return require.call(loader, names, callback, errback, { name: parentName });\n }\n }\n\n // run once per loader\n function generateDefine(loader) {\n // script injection mode calls this function synchronously on load\n var onScriptLoad = loader.onScriptLoad;\n loader.onScriptLoad = function(load) {\n onScriptLoad(load);\n if (anonDefine || defineBundle) {\n load.metadata.format = 'defined';\n load.metadata.registered = true;\n }\n\n if (anonDefine) {\n load.metadata.deps = load.metadata.deps ? load.metadata.deps.concat(anonDefine.deps) : anonDefine.deps;\n load.metadata.execute = anonDefine.execute;\n }\n }\n\n function define(name, deps, factory) {\n if (typeof name != 'string') {\n factory = deps;\n deps = name;\n name = null;\n }\n if (!(deps instanceof Array)) {\n factory = deps;\n deps = ['require', 'exports', 'module'];\n }\n\n if (typeof factory != 'function')\n factory = (function(factory) {\n return function() { return factory; }\n })(factory);\n\n // in IE8, a trailing comma becomes a trailing undefined entry\n if (deps[deps.length - 1] === undefined)\n deps.pop();\n\n // remove system dependencies\n var requireIndex, exportsIndex, moduleIndex;\n\n if ((requireIndex = indexOf.call(deps, 'require')) != -1) {\n\n deps.splice(requireIndex, 1);\n\n var factoryText = factory.toString();\n\n deps = deps.concat(getCJSDeps(factoryText, requireIndex));\n }\n\n\n if ((exportsIndex = indexOf.call(deps, 'exports')) != -1)\n deps.splice(exportsIndex, 1);\n\n if ((moduleIndex = indexOf.call(deps, 'module')) != -1)\n deps.splice(moduleIndex, 1);\n\n var define = {\n deps: deps,\n execute: function(require, exports, module) {\n\n var depValues = [];\n for (var i = 0; i < deps.length; i++)\n depValues.push(require(deps[i]));\n\n module.uri = loader.baseURL + module.id;\n\n module.config = function() {};\n\n // add back in system dependencies\n if (moduleIndex != -1)\n depValues.splice(moduleIndex, 0, module);\n\n if (exportsIndex != -1)\n depValues.splice(exportsIndex, 0, exports);\n\n if (requireIndex != -1)\n depValues.splice(requireIndex, 0, makeRequire(module.id, require, loader));\n\n var output = factory.apply(global, depValues);\n\n if (typeof output == 'undefined' && module)\n output = module.exports;\n\n if (typeof output != 'undefined')\n return output;\n }\n };\n\n // anonymous define\n if (!name) {\n // already defined anonymously -> throw\n if (anonDefine)\n throw new TypeError('Multiple defines for anonymous module');\n anonDefine = define;\n }\n // named define\n else {\n // if it has no dependencies and we don't have any other\n // defines, then let this be an anonymous define\n if (deps.length == 0 && !anonDefine && !defineBundle)\n anonDefine = define;\n\n // otherwise its a bundle only\n else\n anonDefine = null;\n\n // the above is just to support single modules of the form:\n // define('jquery')\n // still loading anonymously\n // because it is done widely enough to be useful\n\n // note this is now a bundle\n defineBundle = true;\n\n // define the module through the register registry\n loader.register(name, define.deps, false, define.execute);\n }\n };\n define.amd = {};\n loader.amdDefine = define;\n }\n\n var anonDefine;\n // set to true if the current module turns out to be a named define bundle\n var defineBundle;\n\n var oldModule, oldExports, oldDefine;\n\n // adds define as a global (potentially just temporarily)\n function createDefine(loader) {\n if (!loader.amdDefine)\n generateDefine(loader);\n\n anonDefine = null;\n defineBundle = null;\n\n // ensure no NodeJS environment detection\n var global = loader.global;\n\n oldModule = global.module;\n oldExports = global.exports;\n oldDefine = global.define;\n\n global.module = undefined;\n global.exports = undefined;\n\n if (global.define && global.define === loader.amdDefine)\n return;\n\n global.define = loader.amdDefine;\n }\n\n function removeDefine(loader) {\n var global = loader.global;\n global.define = oldDefine;\n global.module = oldModule;\n global.exports = oldExports;\n }\n\n generateDefine(loader);\n\n if (loader.scriptLoader) {\n var loaderFetch = loader.fetch;\n loader.fetch = function(load) {\n createDefine(this);\n return loaderFetch.call(this, load);\n }\n }\n\n var loaderInstantiate = loader.instantiate;\n loader.instantiate = function(load) {\n var loader = this;\n\n if (load.metadata.format == 'amd' || !load.metadata.format && load.source.match(amdRegEx)) {\n load.metadata.format = 'amd';\n\n if (loader.execute !== false) {\n createDefine(loader);\n\n loader.__exec(load);\n\n removeDefine(loader);\n\n if (!anonDefine && !defineBundle && !isNode)\n throw new TypeError('AMD module ' + load.name + ' did not define');\n }\n\n if (anonDefine) {\n load.metadata.deps = load.metadata.deps ? load.metadata.deps.concat(anonDefine.deps) : anonDefine.deps;\n load.metadata.execute = anonDefine.execute;\n }\n }\n\n return loaderInstantiate.call(loader, load);\n }\n}", "function wrap(err, js) {\r\n\t\tif (err) { return next(err); }\r\n\r\n\t\tvar deps = exports.dependencies(id, js), params = [], undef = '';\r\n\r\n\t\t// make sure require, exports, and module are properly passed into the factory\r\n\t\tif (/\\brequire\\b/.test(js)) { params.push('require'); }\r\n\t\tif (/\\bexports\\b/.test(js)) { params.push('exports'); }\r\n\t\tif (/\\bmodule\\b/.test(js)) { params.push('module'); }\r\n\r\n\t\t// make sure code follows the `exports` path instead of `define` path once wrapped\r\n\t\tif (/\\bdefine\\.amd\\b/.test(js)) { undef = 'var define;'; }\r\n\r\n\t\tif (deps.length) {\r\n\t\t\tdeps = ',' + JSON.stringify(params.concat(deps));\r\n\t\t} else if (params.length) {\r\n\t\t\tparams = [ 'require', 'exports', 'module' ];\r\n\t\t}\r\n\r\n\t\tjs = 'define(' + JSON.stringify(id) + deps + ',function(' + params + ')' +\r\n\t\t\t\t'{' + js + '\\n' + undef + '}' + // rely on hoisting for define\r\n\t\t\t');\\n';\r\n\t\tnext(null, js);\r\n\t}", "function require() { return {}; }", "function defineDependencies() {\n define('jquery', [], function () { return root.jQuery; });\n define('ko', [], function () { return root.ko; });\n define('sammy', [], function () { return root.Sammy; });\n }", "function FooBar() {\n // TODO: implement this module\n}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module(){}", "function Module(){}", "bootstrap() { }", "function AppUtils() {}", "function Utils() {}", "function Utils() {}", "function lt(t,i){return t(i={exports:{}},i.exports),i.exports}", "init() {\n // using shimmer directly cause can only be bundled in node\n shimmer.wrap(http, 'get', () => httpGetWrapper(http));\n shimmer.wrap(http, 'request', httpWrapper);\n shimmer.wrap(https, 'get', () => httpGetWrapper(https));\n shimmer.wrap(https, 'request', httpWrapper);\n\n module_utils.patchModule(\n 'fetch-h2/dist/lib/context-http1',\n 'connect',\n fetchH2Wrapper,\n fetch => fetch.OriginPool.prototype\n );\n // simple-oauth2 < 4.0\n module_utils.patchModule(\n 'simple-oauth2/lib/client.js',\n 'request',\n clientRequestWrapper,\n client => client.prototype\n );\n // simple-oauth2 >= 4.0\n module_utils.patchModule(\n 'simple-oauth2/lib/client/client.js',\n 'request',\n clientRequestWrapper,\n client => client.prototype\n );\n }", "function definition1() {\n\t\t\t\t\t\t\tlog('provide', '/app/js/example1', 'resolved', 'module');\n\n\t\t\t\t\t\t\treturn function appJsExample1() {\n\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}", "constructor() {\n // map with module filenames as keys\n this.modules = {};\n // global options\n this.options = {\n enableWrapping: true\n }\n }", "function Helper() {}", "function wrapAsModule(str, deps){\r\n\r\n\tvar depsStr;\r\n\tif(deps){\r\n\t\tvar list = [];\r\n\t\tfor(var p in deps){\r\n\t\t\tif(deps.hasOwnProperty(p)){\r\n\t\t\t\tlist.push(deps[p]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdepsStr = JSON.stringify(list) + ', ';\r\n\t} else {\r\n\t\tdepsStr = '';\r\n\t}\r\n\r\n\treturn '\\ndefine('+depsStr+'function(){\\n\\n' + str + '\\n\\n});';\r\n}", "function defineAMDModule (fn){\n\n\t\tif ( window.define === undefined ){\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isDefinedAsAMD ){\n\t\t\treturn true;\n\t\t}\n\n\t\t/* Using a named moduled is mantatory. See http://requirejs.org/docs/errors.html#mismatch */\n\t\twindow.define('errorlogger', [], fn);\n\n\t\tisDefinedAsAMD = true;\n\t\treturn true;\n\t}", "function register() {\n if (typeof window !== 'undefined') {\n (0, _doz.define)('your-component-tag', _src2.default);\n }\n}", "function Module() {\r\n}", "maybeWrap () {\n if (this.version === 1) {\n this.data.assets.forEach(asset => {\n if (asset.url === 'app.js' || asset.name === 'app.js') {\n const { code } = asset;\n\n if (code && !/(Ext\\.onReady\\(|Ext\\.application\\(|Ext.setup\\()/.test(code)) {\n asset.code = `Ext.onReady(function() {\\n\\n${code}\\n\\n});`;\n }\n }\n });\n }\n }", "function enhanceDefinedAMD(code) {\n var t = /ll\\/*l/; // uneven backslashes (single here)\n log('RESULTING CODE:\\n', enhanceDefinedAMD(code));\n}", "function wrap(fn) {\r\n // tslint:disable-next-line: no-unsafe-any\r\n Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[\"wrap\"])(fn)();\r\n}", "function Common() {}", "function define(factory){\n\t\tif(arguments.length == 2){ // precompiled version\n\t\t\tdefine.factory[arguments[1]] = factory\n\t\t\treturn\n\t\t}\n\t\tdefine.last_factory = factory // store for the script tag\n\t\t// continue calling\n\t\tif(define.define) define.define(factory)\n\t}", "function Adapter() {}", "function Bundler () {\n}", "function Adaptor() {}", "function _inject (f, m, script, q) {\n\t\t\n\t\tif(!_head) {\n\t\t\t_head = document.head || document.getElementsByTagName('head')[0];\n\t\t}\n\n\t\tscript = document.createElement(\"script\");\n\t\tscript.async = true;\n\t\tscript.src = f;\n\n\t\tfunction isReady (r) {\n\t\t\tr = script.readyState;\n\t\t\treturn (!r || r == \"complete\" || r == \"loaded\");\n\t\t}\n\n\t\t// Bind to load events\n\t\tscript.onreadystatechange = script.onload = function () {\n\t\t\tif (isReady()) {\n\t\t\t\tscript.onload = script.onreadystatechange = script.onerror = null;\n\t\t\t\tif (_defineQ.length > 0) {\n\t\t\t\t\tq = _defineQ.splice(0,1)[0];\n\t\t\t\t\tif (q) {\n\t\t\t\t\t\tq.splice(0,0, m); // set id to the module id before calling define()\n\t\t\t\t\t\tq.splice(q.length,0, true); // set alreadyQed to true, before calling define()\n\t\t\t\t\t\tdefine.apply(_root, q);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// TODO: Need to add support for load timeouts...\n\t\tscript.onerror = function (e) {\n\t\t\tscript.onload = script.onreadystatechange = script.onerror = null;\n\t\t\tthrow new Error(f + \" failed to load.\");\n\t\t};\n\n\t\t// Prepend the script to document.head\n\t\t_head.insertBefore(script, _head.firstChild);\n\t}", "function Util() {}", "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"retinajs/dist/retina\");\n\n require(\"bootstrap/dist/js/bootstrap.bundle\");\n\n\n\n $(document).ready(function () {\n require(\"./components/interractionObserver\")();\n });\n}", "function u(t,e){return t(e={exports:{}},e.exports),e.exports}", "function AeUtil() {}", "function Library() {\n \n}", "function wrap(fn) {\n return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[\"wrap\"])(fn)(); // tslint:disable-line:no-unsafe-any\n}", "function Utils(){}", "function Tools(){}", "function define(o) {\n \"use strict\";\n o.factory();\n}", "function makeRequire(dom, pathName) {\n return function(reqStr) {\n var o, scannable, k, skipFolder;\n\n if (config.logging >= 4) {\n console.debug('modul8: '+dom+':'+pathName+\" <- \"+reqStr);\n }\n\n if (reqStr.slice(0, 2) === './') {\n scannable = [dom];\n reqStr = toAbsPath(pathName, reqStr.slice(2));\n }\n else if (reqStr.slice(0,3) === '../') {\n scannable = [dom];\n reqStr = toAbsPath(pathName, reqStr);\n }\n else if (DomReg.test(reqStr)) {\n scannable = [reqStr.match(DomReg)[1]];\n reqStr = reqStr.split('::')[1];\n }\n else if (arbiters.indexOf(reqStr) >= 0) {\n scannable = ['M8'];\n }\n else {\n scannable = [dom].concat(domains.filter(function(e) {return e !== dom;}));\n }\n\n reqStr = reqStr.split('.')[0];\n if (reqStr.slice(-1) === '/' || reqStr === '') {\n reqStr += 'index';\n skipFolder = true;\n }\n\n if (config.logging >= 3) {\n console.log('modul8: '+dom+':'+pathName+' <- '+reqStr);\n }\n if (config.logging >= 4) {\n console.debug('modul8: scanned '+JSON.stringify(scannable));\n }\n\n for (k = 0; k < scannable.length; k += 1) {\n o = scannable[k];\n if (exports[o][reqStr]) {\n return exports[o][reqStr];\n }\n if (!skipFolder && exports[o][reqStr + '/index']) {\n return exports[o][reqStr + '/index'];\n }\n }\n\n if (config.logging >= 1) {\n console.error(\"modul8: Unable to resolve require for: \" + reqStr);\n }\n };\n}", "function require(name) {\n var mod = ModuleManager.get(name);\n if (!mod) {\n //Only firefox and synchronous, sorry\n var file = ModuleManager.file(name);\n var code = null,\n request = new XMLHttpRequest();\n request.open('GET', file, false); \n try {\n request.send(null);\n } catch (e) {\n throw new LoadError(file);\n }\n if(request.status != 200)\n throw new LoadError(file);\n //Tego el codigo, creo el modulo\n var code = '(function(){ ' + request.responseText + '});';\n mod = ModuleManager.create(name, file, code);\n }\n event.publish('module_loaded', [this, mod]);\n switch (arguments.length) {\n case 1:\n // Returns module\n var names = name.split('.');\n var last = names[names.length - 1];\n this[last] = mod;\n return mod;\n case 2:\n // If all contents were requested returns nothing\n if (arguments[1] == '*') {\n __extend__(false, this, mod);\n return;\n // second arguments is the symbol in the package\n } else {\n var n = arguments[1];\n this[n] = mod[n];\n return mod[n];\n }\n default:\n // every argyment but the first one are a symbol\n // returns nothing\n for (var i = 1, length = arguments.length; i < length; i++) {\n this[arguments[i]] = mod[arguments[i]];\n }\n return;\n }\n }", "function buildApp(){\n var idAlias={};\n //idAlias[__dirname + \"/node_modules/react/react.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/react-v0.12.2.min.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/jquery.js\"] = \"jquery\";\n\n /**\n * We want to expose our core modules so they can be referenced via 'core/modulename' instead of './js/core/modulename'\n * We also want to alias some of the third party libs, and expose them so they can be referenced via 'jquery', 'react', etc.\n */\n //var labeler = through.obj(function (module, enc, next) {\n // console.log('module id: ' + module.id);\n // //expose id as 'react' rather than 'nodemodules/react/react.js'\n // if(idAlias[module.id]){\n // module.id = idAlias[module.id];\n // //console.log('exposing new id: ' + module.id);\n // }\n //\n // //iterate over each dependency of the module\n // Object.keys(module.deps).forEach(function (key) {\n // console.log('dep: %s key: %s', module.deps[key], key);\n // //expose core by 'core/X' rather than './js/core/X'\n // // if(key.indexOf('js/') >= 0) //only expose/tinker with core\n // module.deps[key] = key;\n //\n // //if there's a dep on something we've aliased, point to the alias.\n // //e.g. instead of 'react':'some/really/long/path/react.js' do 'react':'react'\n // if(idAlias[module.deps[key]]){\n // //console.log('pointing to alias for key:' + key);\n // module.deps[key] = key;\n // }\n // });\n //\n // this.push(module);\n // next();\n //});\n\n\n\n\n function getAppFilePaths(){\n //var files =glob.sync(\"core/**/*.js*\", { //./src/js/\n // cwd: buildConfig.jsBaseDir\n //});\n //files = _.filter(files, function(filePath){\n // return filePath.indexOf('vendor/') < 0;\n //});\n var files = [];\n files.push(\"app2\");\n\n var withoutExtensions=[];\n files.forEach(function(file){\n withoutExtensions.push(file.replace('.jsx', '').replace('.js', ''));\n });\n\n console.log('app file paths:\\n ' + JSON.stringify(withoutExtensions, null, 4));\n return withoutExtensions;\n }\n //mixin some of the common transforms, paths, etc.\n var browserifyConfig = mixinCommonBrowserifyConfig({\n entries:[].concat(getAppFilePaths())\n });\n console.log('build:app browserify config: %s', JSON.stringify(browserifyConfig, null, 2));\n\n var bundler = browserify(browserifyConfig);\n\n // bundler.pipeline.get('label').splice(0, 1, labeler);//rename module ids\n\n //require any third party libraries.\n bundler.require(buildConfig.jsBaseDir + '/vendor/jquery.js', {expose:'jquery'}); //expose is how the modules require it. e.g. require('jquery');\n bundler.require(buildConfig.jsBaseDir + '/vendor/react-v0.12.2.min.js', {expose:'react'});\n\n return bundler\n .bundle()\n .pipe(source('bundle.js'))//the generated file name\n //.pipe(gStreamify(uglify(buildConfig.uglify)))\n .pipe(gulp.dest(buildConfig.jsDistDir));//where to put the generated file name\n}", "function translate(id, filename, buffer, options, next) {\r\n\tvar ext = (filename.match(extexp) || [])[1] || '',\r\n\t\tencoding = options.encoding || exports.defaults.encoding,\r\n\t\ttrans = options.translate, js, nowrap;\r\n\r\n\t// make a list of what not to wrap\r\n\tnowrap = options.nowrap || exports.defaults.nowrap;\r\n\tnowrap = [ 'define', 'define.min', 'define.shim' ].concat(nowrap);\r\n\t// should this code get wrapped with a define?\r\n\tnowrap = nowrap.some(function(no) {\r\n\t\treturn no.test ? no.test(id) : (no === id);\r\n\t});\r\n\r\n\t// convert commonjs to amd\r\n\tfunction wrap(err, js) {\r\n\t\tif (err) { return next(err); }\r\n\r\n\t\tvar deps = exports.dependencies(id, js), params = [], undef = '';\r\n\r\n\t\t// make sure require, exports, and module are properly passed into the factory\r\n\t\tif (/\\brequire\\b/.test(js)) { params.push('require'); }\r\n\t\tif (/\\bexports\\b/.test(js)) { params.push('exports'); }\r\n\t\tif (/\\bmodule\\b/.test(js)) { params.push('module'); }\r\n\r\n\t\t// make sure code follows the `exports` path instead of `define` path once wrapped\r\n\t\tif (/\\bdefine\\.amd\\b/.test(js)) { undef = 'var define;'; }\r\n\r\n\t\tif (deps.length) {\r\n\t\t\tdeps = ',' + JSON.stringify(params.concat(deps));\r\n\t\t} else if (params.length) {\r\n\t\t\tparams = [ 'require', 'exports', 'module' ];\r\n\t\t}\r\n\r\n\t\tjs = 'define(' + JSON.stringify(id) + deps + ',function(' + params + ')' +\r\n\t\t\t\t'{' + js + '\\n' + undef + '}' + // rely on hoisting for define\r\n\t\t\t');\\n';\r\n\t\tnext(null, js);\r\n\t}\r\n\r\n\t// find the translate function\r\n\ttrans = trans && (trans[filename] || trans[id] || trans[ext]);\r\n\tif (trans) { // user configured translation\r\n\t\treturn trans(\r\n\t\t\t{ id:id, filename:filename, buffer:buffer },\r\n\t\t\toptions, (nowrap ? next : wrap)\r\n\t\t);\r\n\t}\r\n\r\n\tjs = buffer.toString(encoding);\r\n\r\n\t// handle javascript files\r\n\tif ('js' === ext) {\r\n\t\treturn (nowrap ? next : wrap)(null, js);\r\n\t}\r\n\r\n\t// handle non-javascript files\r\n\tif ('json' !== ext) { js = JSON.stringify(js); } // export file as json string\r\n\tif (nowrap) { return next(null, 'return ' + js); }\r\n\treturn next(null, 'define(' + JSON.stringify(id) + ',' + js + ');\\n');\r\n}", "function Mixin() {}", "function boot_module() {\n var mtor = function() {};\n mtor.prototype = RubyModule.constructor.prototype;\n\n function OpalModule() {};\n OpalModule.prototype = new mtor();\n\n var module = new OpalModule();\n\n module._id = unique_id++;\n module._isClass = true;\n module.constructor = OpalModule;\n module._super = RubyModule;\n module._methods = [];\n module.__inc__ = [];\n module.__parent = RubyModule;\n module._proto = {};\n module.__mod__ = true;\n module.__dep__ = [];\n\n return module;\n }", "function boot_module() {\n var mtor = function() {};\n mtor.prototype = RubyModule.constructor.prototype;\n\n function OpalModule() {};\n OpalModule.prototype = new mtor();\n\n var module = new OpalModule();\n\n module._id = unique_id++;\n module._isClass = true;\n module.constructor = OpalModule;\n module._super = RubyModule;\n module._methods = [];\n module.__inc__ = [];\n module.__parent = RubyModule;\n module._proto = {};\n module.__mod__ = true;\n module.__dep__ = [];\n\n return module;\n }", "function _____SHARED_functions_____(){}", "function definition2(appJsExample1) {\n\t\t\t\t\t\t\tlog('provide', '/app/js/example2', 'resolved', 'module, with dependency');\n\n\t\t\t\t\t\t\treturn function appJsExample2() {\n\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}", "function ModuleWithProviders() {}", "function ModuleWithProviders() {}", "function ModuleWithProviders() {}", "function Common(){}", "function Core() {}", "function Core() {}", "function Core() {}", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "function bootstrapModule(id, factory) {\n //console.log('bootstrapModule', id, factory);\n\n if (!dependencies.hasOwnProperty(id)) {\n return;\n }\n \n dependencies[id].factory = factory;\n \n for (id in dependencies) {\n if (dependencies.hasOwnProperty(id)) {\n // this causes the function to exit if there are any remaining\n // scripts loading, on the first iteration. consider it\n // equivalent to an array length check\n if (typeof dependencies[id].factory === \"undefined\") {\n //console.log('waiting for', id);\n return;\n }\n }\n }\n\n // if we get past the for loop, bootstrapping is complete. get rid\n // of the bootstrap function and proceed.\n delete global.bootstrap;\n\n // Restore inital Boostrap\n if (initalBoostrap) {\n global.bootstrap = initalBoostrap; \n }\n\n // At least bootModule in order\n var mrPromise = bootModule(\"promise\").Promise,\n miniURL = bootModule(\"mini-url\"),\n mrRequire = bootModule(\"require\");\n\n callback(mrRequire, mrPromise, miniURL);\n }", "function makeRequire(mod, enableBuildCallback, altRequire) {\n var relMap = mod && mod.map,\n modRequire = makeContextModuleFunc(altRequire || context.require,\n relMap,\n enableBuildCallback);\n\n addRequireMethods(modRequire, context, relMap);\n modRequire.isBrowser = isBrowser;\n\n return modRequire;\n }", "function inject() {\n\t\tpaDebug('Injecting Maddock\\'s script');\n\t\tvar script = document.createElement(\"script\");\n\t\ttxt = main.toString();\n\t\tif (window.opera != undefined)\n\t\t\ttxt = txt.replace(/</g, \"&lt;\");\n\t\tscript.innerHTML = \"(\" + txt + \")();\";\n\t\tscript.type = \"text/javascript\";\n\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(script);\n\t\t//main();\n\t}", "function shimmedRequirejsDefine(name, deps, callback) {\n\t var modulesToExpose = _.isArray(name) ? name :\n\t _.isArray(deps) ? deps :\n\t parseDeps(name);\n\t exposeModules(modulesToExpose);\n\t warnOnPrivateModuleRequests(modulesToExpose);\n\t requirejsDefine.apply(null, arguments);\n\t }", "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1),__webpack_require__(36),__webpack_require__(820)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom, createReactClass) {\n\t if (!createReactClass) createReactClass = React.createClass;\n\t return factory(root, React, ReactDom, createReactClass);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n\t } else {\n\t // Browser globals (root is window)\n\t var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n\t root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n\t }\n\t }", "function prepareExports() {\n if (typeof define === 'function' && define.amd) {\n // AMD anonymous module\n define([\"knockout\"], attachToKo);\n } else if ('ko' in global) {\n // Non-module case - attach to the global instance, and assume\n // knockout-components.js is already loaded.\n attachToKo(global.ko);\n } else {\n throw new Error('Couldn\\'t find an instance of ko to attach to');\n }\n }", "function transform(/*loader*/) {\n return function(moduleMeta) {\n return moduleMeta;\n };\n }", "async function bootstrapLibrary(url, out, asBrowserModule = true, globalName) {\n module(url)._source = null\n let m = new LivelyRollup({ rootModule: module(url), asBrowserModule, globalName });\n m.excludedModules = ['babel-plugin-transform-jsx'];\n let res = await m.rollup(true, 'es2019')\n await resource(System.baseURL).join(out).write(res.min); \n}", "function includeHelpers(func) {\n\n // ## jam.identity()\n\n // Simple function that passes the values it receives to the next function.\n // Useful if you need a `process.nextTick` inserted in-between your call chain.\n func.identity = function(next) {\n function _identity(next) {\n var args = arguments;\n tick(function() {\n next.apply(this, replaceHead(args, null));\n });\n }\n\n // This function can also be passed to jam verbatim.\n return (typeof next === 'function') ?\n _identity.apply(this, arguments) :\n _identity;\n };\n\n // ## jam.nextTick()\n\n // Alias for `.identity`. Use when you need a `process.nextTick` inserted in-between\n // your call chain.\n func.nextTick = func.identity\n\n // ## jam.return( [args...] )\n\n // Returns a set of values to the next function in the chain. Useful when you want to\n // pass in the next function verbatim without wrapping it in a `function() { }` just\n // to pass values into it.\n func.return = function() {\n var args = toArgs(arguments);\n return function(next) {\n args.unshift(null);\n next.apply(this, args);\n };\n };\n\n // ## jam.null()\n\n // Similar to `.identity` but absorbs all arguments that has been passed to it and\n // forward nothing to the next function. Effectively nullifying any arguments passed\n // from previous jam call.\n // \n // Like `jam.identity`, this function can be passed to the jam chain verbatim.\n func.null = function(next) {\n function _null(next) { next(); }\n\n return (typeof next === 'function') ? _null.call(this, next) : _null;\n };\n\n // ## jam.call( function, [args...] )\n\n // Convenience for calling functions that accepts arguments in standard node.js\n // convention. Since jam insert `next` as first argument, most functions cannot be\n // passed directly into the jam chain, thus this helper function.\n // \n // If no `args` is given, this function passes arguments given to `next()` call from\n // previous function directly to the function (with proper callback) placement).\n // \n // Use this in combination with `jam.return` or `jam.null` if you want to control the\n // arguments that are passed to the function.\n func.call = function(func) {\n ensureFunc(func, 'function');\n\n var args = toArgs(arguments);\n args.shift(); // func\n\n if (args.length) { // use provided arguments\n return function(next) {\n args.push(next);\n func.apply(this, args);\n };\n\n } else { // use passed-in arguments during chain resolution\n return function(next) {\n args = toArgs(arguments);\n args.shift(); // move next to last position\n args.push(next);\n\n func.apply(this, args);\n };\n }\n };\n\n // ## jam.each( array, iterator( next, element, index ) )\n\n // Execute the given `iterator` function for each element given in the `array`. The\n // iterator is given a `next` function and the element to act on. The next step in the\n // chain will receive the original array passed verbatim so you can chain multiple\n // `.each` calls to act on the same array.\n // \n // You can also pass `arguments` and `\"strings\"` as an array or you can omit the array\n // entirely, in which case this method will assume that the previous chain step\n // returns something that looks like an array as its first result.\n // \n // Under the hood, a JAM step is added for each element. So the iterator will be\n // called serially, one after another finish. A parallel version maybe added in the\n // future.\n func.each = function(array, iterator) {\n if (typeof array === 'function') {\n iterator = array;\n array = null\n } else {\n ensureArray(array, 'array');\n }\n\n ensureFunc(iterator, 'iterator');\n\n return function(next, array_) {\n var arr = array || array_;\n\n // Builds another JAM chain internally\n var chain = jam(jam.identity)\n , count = arr.length;\n\n for (var i = 0; i < count; i++) (function(element, i) {\n chain = chain(function(next) { iterator(next, element, i); });\n })(arr[i], i);\n\n chain = chain(function(next) { next(null, arr); });\n return chain(next);\n };\n };\n\n // ## jam.map( array, iterator( next, element, index ) )\n\n // Works exactly like the `each` helper but if a value is passed to the iterator's\n // `next` function, it is collected into a new array which will be passed to the next\n // function in the JAM chain after `map`.\n // \n // Like with `each`, you can omit the `array` input, in which case this method will\n // assume that the previous chain step returns something that looks like an array as\n // its first result.\n func.map = function(array, iterator) {\n if (typeof array === 'function') {\n iterator = array;\n array = null;\n } else {\n ensureArray(array, 'array');\n }\n\n ensureFunc(iterator, 'iterator');\n\n return function(next, array_) {\n var arr = array || array_;\n\n // Builds another JAM chain internally and collect results.\n // TODO: Dry with .each?\n var chain = jam(jam.identity)\n , count = arr.length\n , result = [];\n\n for (var i = 0; i < count; i++) (function(element, i) {\n chain = chain(function(next, previous) {\n result.push(previous);\n iterator(next, element, i);\n });\n })(arr[i], i);\n\n chain = chain(function(next, last) {\n result.push(last);\n result.shift(); // discard first undefined element\n next(null, result);\n });\n\n return chain(next);\n };\n };\n\n // ## jam.timeout( timeout )\n\n // Pauses the chain for the specified `timeout` using `setTimeout`. Useful for\n // inserting a delay in-between a long jam chain.\n func.timeout = function(timeout) {\n ensureNum(timeout, 'timeout');\n\n return function(next) {\n var args = replaceHead(arguments, null);\n setTimeout(function() { next.apply(this, args); }, timeout);\n };\n };\n\n // ## jam.promise( [chain] )\n\n // Returns a JAM promise, useful when you are starting an asynchronous call outside of\n // the JAM chain itself but wants the callback to call into the chain. In other words,\n // this allow you to put a 'waiting point' (aka promise?) into existing JAM chain that\n // waits for the initial call to finish and also pass any arguments passed to the\n // callback to the next step in the JAM chain as well.\n //\n // This function will returns a callback that automatically bridges into the JAM\n // chain. You can pass the returned callback to any asynchronous function and the JAM\n // chain (at the point of calling .promise()) will wait for that asynchronous function\n // to finish effectively creating a 'waiting point'.\n //\n // Additionally, any arguments passed to the callback are forwarded to the next call\n // in the JAM chain as well. If errors are passed, then it is fast-forwarded to the\n // last handler normally like normal JAM steps.\n func.promise = function(chain) {\n chain = typeof chain === 'function' ? chain : // chain is supplied\n typeof this === 'function' ? this : // called from the chain variable\n ensureFunc(chain, 'chain'); // fails\n\n if (typeof chain === 'undefined' && typeof this === 'function') {\n chain = this;\n }\n\n var args = null, next = null;\n\n chain(function(next_) {\n if (args) return next_.apply(this, args); // callback already called\n next = next_; // wait for callback\n });\n\n return function() {\n if (next) return next.apply(this, arguments); // chain promise already called\n args = arguments; // wait for chain to call the promise\n };\n };\n\n // TODO: noError() ? or absorbError()\n return func;\n }", "function contruct() {\n\n if ( !$[pluginName] ) {\n $.loading = function( opts ) {\n $( \"body\" ).loading( opts );\n };\n }\n }", "function includeMainModule(amdConfig, bundleName) {\n amdConfig.include = amdConfig.include || [];\n amdConfig.include.push(bundleName + '/' + bundleName);\n}", "function Utils() {\n}", "function doSomething(){\n $(\"<p>Bad legacy module</p>\").appendTo($(\"body\"));\n}", "function makeRequire(m, self) {\n function _require(_path) {\n return m.require(_path);\n }\n\n _require.resolve = function(request) {\n return _module._resolveFilename(request, self);\n };\n _require.cache = _module._cache;\n _require.extensions = _module._extensions;\n\n return _require;\n}", "_initCommon() {\n // common.js initialization\n if (typeof Common !== 'undefined') {\n let common = new Common();\n }\n }", "function modules() {\n // Bootstrap JS\n let bootstrapJS = gulp.src('./node_modules/bootstrap/dist/js/*').pipe(gulp.dest('./libs/bootstrap/js'))\n\n // Font Awesome CSS\n let fontAwesomeCSS = gulp.src('./node_modules/@fortawesome/fontawesome-free/css/**/*')\n .pipe(gulp.dest('./libs/fontawesome-free/css'))\n\n // Font Awesome Webfonts\n let fontAwesomeWebfonts = gulp.src('./node_modules/@fortawesome/fontawesome-free/webfonts/**/*')\n .pipe(gulp.dest('./libs/fontawesome-free/webfonts'))\n\n // Jquery Easing\n let jqueryEasing = gulp.src('./node_modules/jquery-easing/*.js')\n .pipe(gulp.dest('./libs/jquery-easing'))\n\n // JQuery\n let jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ]).pipe(gulp.dest('./libs/jquery'))\n\n return merge(bootstrapJS, fontAwesomeCSS, fontAwesomeWebfonts, jquery, jqueryEasing)\n}", "function boot() {\n config();\n\n require([\"app\", \"modules/common/histogram\",\n \"modules/common/listTab\",\n \"modules/common/list\",\n \"modules/common/modal\",\n \"modules/common/region\",\n \"modules/common/iconbutton\",\n \"modules/common/togglebutton\",\n \"modules/common/toggleiconbutton\",\n \"modules/common/nativehtml\",\n \"modules/common/textArea\",\n \"modules/common/codeArea\",\n \"modules/common/gradient\",\n \"modules/common/color\"\n ], function (app) {\n app.start();\n })\n }", "finisher(clazz){window.customElements.define(tagName,clazz);}", "function prepareExports() {\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n // Node.js case - load KO synchronously\n var ko = require('knockout');\n var _ = require('underscore');\n var Backbone = require('backbone');\n module.exports = attach(ko, _, Backbone);\n } else if (typeof define === 'function' && define.amd) {\n define(['knockout', 'underscore', 'backbone'], attach);\n } else if ('ko' in global && '_' in global && 'Backbone' in global) {\n // Non-module case - attach to the global instance\n global.KnockedOut = attach(global.ko, global._, global.Backbone);\n }\n }", "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! react */ 1),__webpack_require__(/*! react-dom */ 32)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "function o(t,e){return e={exports:{}},t(e,e.exports),e.exports}", "function exports() {}", "function exports() {}", "function exports() {}", "function className(name,module){return function(target){target[\"__bjsclassName__\"]=name;target[\"__bjsmoduleName__\"]=module!=null?module:null;};}", "constructor() {\n super();\n\n this.generateModules();\n }", "function generateDefine(loader) {\n // script injection mode calls this function synchronously on load\n var onScriptLoad = loader.onScriptLoad;\n loader.onScriptLoad = function(load) {\n onScriptLoad(load);\n if (anonDefine || defineBundle) {\n load.metadata.format = 'defined';\n load.metadata.registered = true;\n }\n\n if (anonDefine) {\n load.metadata.deps = load.metadata.deps ? load.metadata.deps.concat(anonDefine.deps) : anonDefine.deps;\n load.metadata.execute = anonDefine.execute;\n }\n }\n\n function define(name, deps, factory) {\n if (typeof name != 'string') {\n factory = deps;\n deps = name;\n name = null;\n }\n if (!(deps instanceof Array)) {\n factory = deps;\n deps = ['require', 'exports', 'module'];\n }\n\n if (typeof factory != 'function')\n factory = (function(factory) {\n return function() { return factory; }\n })(factory);\n\n // in IE8, a trailing comma becomes a trailing undefined entry\n if (deps[deps.length - 1] === undefined)\n deps.pop();\n\n // remove system dependencies\n var requireIndex, exportsIndex, moduleIndex;\n\n if ((requireIndex = indexOf.call(deps, 'require')) != -1) {\n\n deps.splice(requireIndex, 1);\n\n var factoryText = factory.toString();\n\n deps = deps.concat(getCJSDeps(factoryText, requireIndex));\n }\n\n\n if ((exportsIndex = indexOf.call(deps, 'exports')) != -1)\n deps.splice(exportsIndex, 1);\n\n if ((moduleIndex = indexOf.call(deps, 'module')) != -1)\n deps.splice(moduleIndex, 1);\n\n var define = {\n deps: deps,\n execute: function(require, exports, module) {\n\n var depValues = [];\n for (var i = 0; i < deps.length; i++)\n depValues.push(require(deps[i]));\n\n module.uri = loader.baseURL + module.id;\n\n module.config = function() {};\n\n // add back in system dependencies\n if (moduleIndex != -1)\n depValues.splice(moduleIndex, 0, module);\n\n if (exportsIndex != -1)\n depValues.splice(exportsIndex, 0, exports);\n\n if (requireIndex != -1)\n depValues.splice(requireIndex, 0, makeRequire(module.id, require, loader));\n\n var output = factory.apply(global, depValues);\n\n if (typeof output == 'undefined' && module)\n output = module.exports;\n\n if (typeof output != 'undefined')\n return output;\n }\n };\n\n // anonymous define\n if (!name) {\n // already defined anonymously -> throw\n if (anonDefine)\n throw new TypeError('Multiple defines for anonymous module');\n anonDefine = define;\n }\n // named define\n else {\n // if it has no dependencies and we don't have any other\n // defines, then let this be an anonymous define\n if (deps.length == 0 && !anonDefine && !defineBundle)\n anonDefine = define;\n\n // otherwise its a bundle only\n else\n anonDefine = null;\n\n // the above is just to support single modules of the form:\n // define('jquery')\n // still loading anonymously\n // because it is done widely enough to be useful\n\n // note this is now a bundle\n defineBundle = true;\n\n // define the module through the register registry\n loader.register(name, define.deps, false, define.execute);\n }\n };\n define.amd = {};\n loader.amdDefine = define;\n }", "init() {\n module_utils.patchModule(\n 'bunyan',\n '_emit',\n emitWrapper,\n bunyan => bunyan.prototype\n );\n }", "init() {\n module_utils.patchModule(\n 'mysql2',\n 'query',\n mysqlQueryWrapper,\n mysql2 => mysql2.Connection.prototype\n );\n\n module_utils.patchModule(\n 'mysql2',\n 'execute',\n mysqlQueryWrapper,\n mysql2 => mysql2.Connection.prototype\n );\n\n module_utils.patchModule(\n 'mysql/lib/Connection.js',\n 'query',\n mysqlQueryWrapper,\n mysqlConnection => mysqlConnection.prototype\n );\n }", "function registerOfficialExpansions() {\n // this script contains the actual registration code;\n // it is in a separate library because we also register\n // expansions during testing\n useLibrary('res://talisman/register-exps.js');\n}", "function boot()\n {\n\t// scriptweeder ui's iframe, don't run in there !\n\tif (in_iframe() && window.name == 'scriptweeder_iframe')\t// TODO better way of id ?\n\t return;\n\tif (location.hostname == \"\")\t// bad url, opera's error page. \n\t return;\n\tassert(typeof GM_getValue == 'undefined', // userjs_only\n\t \"needs to run as native opera UserJS, won't work as GreaseMonkey script.\");\n\tif (window.opera.scriptweeder && window.opera.scriptweeder.version_type == 'extension')\t\t// userjs_only\n\t{\n\t my_alert(\"ScriptWeeder extension detected. Currently it has precedence, so UserJS version is not needed.\");\n\t return;\n\t}\n\t\n\tsetup_event_handlers();\n\twindow.opera.scriptweeder = new Object();\t// external api\n\twindow.opera.scriptweeder.version = version_number;\n\twindow.opera.scriptweeder.version_type = version_type;\t\n\tdebug_log(\"start\");\t\n }", "extend (config, ctx) {\n config.module.rules.push({\n test: require.resolve('snapsvg'),\n use: 'imports-loader?this=>window,fix=>module.exports=0',\n });\n }", "function define_helpers_registrator(Klass) {\n Klass.registerHelper = function (name, helper, options) {\n // Scenario: registerHelper('foo', foo_helper[, foo_opts]);\n if (_.isString(name)) {\n Klass.prototype[name] = helper;\n Klass.prototype.__helpers__[name] = {\n helper: helper,\n options: Object(options)\n };\n return;\n }\n\n // Scenario: registerHelper({ foo: foo_helper, ... });\n _.forEach(name, function (helper, name) {\n Klass.registerHelper(name, helper);\n });\n };\n}", "function Mixin() {\n\t}" ]
[ "0.7107031", "0.67358977", "0.6678734", "0.6667636", "0.665947", "0.62834316", "0.6251298", "0.61878985", "0.612553", "0.6080921", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.6014608", "0.6014608", "0.6007322", "0.60021186", "0.5977436", "0.5977436", "0.596044", "0.59175754", "0.5887313", "0.58730704", "0.5870859", "0.5825393", "0.58063126", "0.5753265", "0.5744599", "0.57251596", "0.5718302", "0.5712918", "0.5707133", "0.5698868", "0.5692808", "0.5690601", "0.5683138", "0.56769365", "0.56715685", "0.56698793", "0.56678754", "0.56624055", "0.56603485", "0.564687", "0.56444854", "0.5628296", "0.5617751", "0.5617307", "0.56148696", "0.5614309", "0.5595816", "0.5584712", "0.557331", "0.557331", "0.55584", "0.55578405", "0.5555322", "0.5555322", "0.5555322", "0.5547981", "0.55478656", "0.55478656", "0.55478656", "0.5536274", "0.5534934", "0.5525062", "0.55150676", "0.5502877", "0.5494107", "0.5489784", "0.54836756", "0.5481873", "0.54781896", "0.54709446", "0.5467463", "0.5460997", "0.5456196", "0.5451834", "0.54461724", "0.5443726", "0.5435973", "0.5432845", "0.5422092", "0.54169846", "0.54129034", "0.54077005", "0.54045755", "0.54045755", "0.54045755", "0.54032636", "0.53896904", "0.53884494", "0.53772044", "0.5374821", "0.5369572", "0.5366663", "0.5365092", "0.53470176", "0.5344187" ]
0.0
-1
value and returns the closest value to that target in the BST.
function findCLosestValInBST(tree, target) { const traverse = (tree, target, closest) => { if (tree === null) { return closest; } if (Math.abs(target - closest) > Math.abs(target - tree.value)) { closest = tree.value; } if (target < closest) { traverse(tree.left, target, closest); } else if (target > closest) { traverse(tree.right, target, closest); } else { return closest; } } return traverse(tree, target, tree.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findClosestValueInBst(tree, target) {\r\n return findClosestValueInBstHelper(tree, target, Infinity);\r\n}", "function findClosestValueInBst(tree, target) {\nlet currentNode = tree;\nlet closest = Infinity;\nwhile(currentNode !== null){\n if(Math.abs(target-currentNode.value) < Math.abs(target-closest)){\n closest = currentNode.value\n }\n if(currentNode.value > target){\n currentNode = currentNode.left\n } else {\n currentNode = currentNode.right\n } \n}\nreturn closest\n}", "function findClosestValueInBst(tree, target) {\n\treturn findClosestValueInBstHelper(tree, target, Infinity);\n}", "function findClosestValueInBst(tree, target) {\n return findClosestValueInBstHelper(tree, target, tree.value)\n }", "function findClosestValueInBst(tree, target) {\n let current = tree\n let closest = tree.value\n while (current) {\n if (Math.abs(current.value - target) < Math.abs(target - closest)) {\n closest = current.value\n }\n if (target > current.value) {\n current = current.right\n }\n else if (target < current.value) {\n current = current.left\n }\n else {\n return closest\n }\n }\n return closest\n}", "function closestValue(root, target) {\n return closestValueHelper(root, target, NUMBER.MAX_SAFE_VALUE, -1);\n}", "function findClosestValueInBst(tree, target) {\n // Write your code here.\n let current=tree;\n let closest=tree.value;\n\n while(current!==null){\n\n if(current.value===target){\n closest=current.value;\n break;\n }\n //if target-current.value is less than target-cloest, then the current value is smaller\n if(Math.abs(target-closest)>Math.abs(target-current.value)){\n closest=current.value;\n }\n\n //target<current.value then the number to the left has a higher chance being closer to it\n if(target<=current.value){\n current=current.left;\n }else if(target>current.value){\n current=current.right\n }\n }\n \n }", "function findClosestValueInBst(tree, target, closest = Infinity) {\n if (tree === null) return treet\n let currNode = tree\n\n while (currNode !== null) {\n if (Math.abs(target - closest) > Math.abs(target - currNode.value)) {\n closest = currNode.value\n }\n \n if (target > currNode.value) {\n currNode = currNode.right\n } else if (target < currNode.value) {\n currNode = currNode.left\n } else {\n break\n }\n }\n\n return closest\n}", "function findClosestValueInBst(tree, target, closest = Infinity) {\n\tif (tree === null) return closest\n\t\n\tif (Math.abs(target - closest) > Math.abs(target - tree.value)) {\n\t\tclosest = tree.value\n\t}\n\t\n\tif (target < tree.value) {\n\t\treturn findClosestValueInBst(tree.left, target, closest)\n\t} else if (target > tree.value) {\n\t\treturn findClosestValueInBst(tree.right, target, closest)\n\t} else {\n\t\treturn closest\n\t}\n}", "function findClosestValueinBSTHelper(tree,target,closest){\n if(tree===null) return closest;\n \n if(Math.abs(target-closest) > Math.abs(target-tree.value)){\n closest=tree.value\n }\n \n if(target<=tree.value){\n return findClosestValueInBstHelper(tree.left,target,closest)\n }else{\n return findClosestValueInBstHelper(tree.right,target,closest)\n }\n\n }", "findTarget(value) {\n if (value < this.value && this.left) {\n return this.left.findTarget(value);\n } else if (value >= this.value && this.right) {\n return this.right.findTarget(value);\n }\n\n return this;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest ( value, to ) {\r\n\t\treturn Math.round(value / to) * to;\r\n\t}", "function closest ( value, to ) {\r\n\t\treturn Math.round(value / to) * to;\r\n\t}", "function closest ( value, to ) {\n\t\t\treturn Math.round(value / to) * to;\n\t\t}", "function closest ( value, to ) {\r\n\t\t\treturn Math.round(value / to) * to;\r\n\t\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function BSTMin(){\n var walker = this.root;\n while (walker.left != null){\n walker = walker.left;\n }\n return walker.val;\n }", "min(){\r\n if(this.isEmpty()){\r\n console.log(\"Tree is empty!\");\r\n return null;\r\n }\r\n\r\n let runner = this.root;\r\n while(runner.left != null){\r\n runner = runner.left;\r\n }\r\n return runner.value;\r\n }", "get(value) {\n let node = this.root\n while (node != null) {\n if (value === node.value) return node.value\n else if (value < node.value) node = node.left\n else node = node.right\n }\n return null\n }", "findSmallest() {\n if (this.left) return this.left.findSmallest();\n return this.value;\n }", "function nearest(value, min, max)\n {\n if((value-min)>(max-value))\n {\n return max;\n }\n else\n {\n return min;\n }\n }", "min() {\n let currentNode = this.root;\n // continue traversing left until no more children\n while(currentNode.left) {\n currentNode = currentNode.left;\n }\n return currentNode.value;\n }", "min() {\n let currentNode = this.root;\n // Case for no root\n if(!currentNode) {\n throw new Error('This tree does not yet contain any values');\n return;\n }\n while(currentNode.left) {\n currentNode = currentNode.left;\n }\n return currentNode.value;\n }", "_getNearest(key, root, closest) {\n const result = this.compare(key, root.key);\n if (result === 0) {\n return root;\n }\n closest = this.distance(key, root.key) < this.distance(key, closest.key) ? root : closest;\n if (result < 0) {\n return root.left ? this._getNearest(key, root.left, closest) : closest;\n }\n else {\n return root.right ? this._getNearest(key, root.right, closest) : closest;\n }\n }", "findSmallest() {\n let node = this;\n while (node) {\n if (!node.left) return node.value;\n node = node.left;\n }\n }", "nextLarger (lowerBound) {\n\t\tif (!this.root) return null;\n\n\t\tlet queue = [ this.root ];\n\t\tlet closest = null;\n\n\t\twhile (queue.length) {\n\t\t\tlet current = queue.shift();\n\t\t\tif (current.val > lowerBound && (current.val < closest || closest === null)) {\n\t\t\t\tclosest = current.val;\n\t\t\t}\n\t\t\tif (current.left) queue.push(current.left);\n\t\t\tif (current.right) queue.push(current.right);\n\t\t}\n\t\treturn closest;\n\t}", "nextLarger(lowerBound) {\n \n // check for empty tree.\n if (!this.root) return null;\n \n let closestNumber = null; \n if (this.root.val > lowerBound) closestNumber = this.root.val; \n\n function nextLargerHelper(node) {\n \n // is leaf node? \n if (node === null) return; \n\n // check for winning condition.\n if ((node.val < closestNumber) && (node.val > lowerBound)) {\n closestNumber = node.val; \n }\n if (node.left !== null) {\n nextLargerHelper(node.left);\n }\n if (node.right !== null) {\n nextLargerHelper(node.right);\n }\n }\n nextLargerHelper(this.root);\n\n return closestNumber;\n }", "function get(root, value) {\n var x = _.cloneDeep(root)\n\n //Traverse tree by values until the specified value is reached\n while(!_.isNull(x)) {\n if( value > x.value ) {\n x = x.right\n } else if( value < x.value ) {\n x = x.left\n } else {\n return x\n }\n }\n}", "findValue(value) {\n // console.log(`looking for ${value} - current value ${this.value}`)\n if (value === this.value) return this;\n\n if (value < this.value && this.left) return this.left.findValue(value);\n else if (value > this.value && this.right)\n return this.right.findValue(value);\n\n return null;\n }", "function closestXIndex(target, spacing){\n spacing = spacing || 1;\n\n // Estimate index of closestXIndex using spacing\n var index = Math.round((target-this[0][0])/spacing);\n\n // If unable to estimate, check if first or last value is closer to target\n if(_.isUndefined(this[index])){\n if( (_.last(this)[0] - target) < (target - _.first(this)[0])){\n index = this.length-1;\n }else{\n index = 0;\n }\n }\n\n // Finds closestXIndex to within one\n while(!_.isUndefined(this[index-1]) && this[index][0] > target){\n index--;\n }\n while(!_.isUndefined(this[index+1]) && this[index][0] < target){\n index++;\n }\n\n // Now find out if this[index-1] or this[index] is closer to target\n if(_.isUndefined(this[index-1])){\n return index;\n }\n var diffLeft = target - this[index-1][0];\n var diffRight = this[index][0] - target;\n if(diffLeft < diffRight){\n return index-1;\n }else{\n return index;\n }\n}", "_getClosest(val) {\n return Math.floor(val / 17) * 17;\n }", "function findNearest(node, allEdges, targetVal) {\n\n function dfs(parentNode, allEdges, targetVal) {\n let children = getChildren(parentNode, allEdges);\n for (let i = 0; i < children.length; i++) {\n let childNode = children[i];\n if (visitedNode.has(childNode))\n continue;\n\n visitedNode.add(childNode);\n let nodeValue = ids.find((id, index) => index + 1 === childNode);\n if (nodeValue === targetVal)\n return node2Depth.get(parentNode) + 1;\n else {\n node2Depth.set(childNode, node2Depth.get(parentNode) + 1);\n let result = dfs(childNode, allEdges, targetVal);\n if (result !== undefined)\n return result;\n }\n }\n }\n\n let node2Depth = new Map(), visitedNode = new Set(); // the depth is counted from the nodeIndex\n node2Depth.set(node, 0);\n visitedNode.add(node);\n return dfs(node, allEdges, targetVal);\n }", "function BSTMax(){\n var walker = this.root;\n while (walker.right != null){\n walker = walker.right;\n }\n return walker.val;\n }", "getNearest(key) {\n return this._getNearest(key, this.root, this.root);\n }", "getClosest(arr, val) {\n return arr.reduce(function (prev, curr) {\n return (Math.abs(curr - val) < Math.abs(prev - val) ? curr : prev);\n });\n }", "findMaxValue() {\n\n let current = this.root;\n\n const findMax = (node) => {\n if (node === null) {\n return;\n }\n\n let actualMax = node.value;\n let leftSideMax = findMax(node.left);\n let rightSideMax = findMax(node.right);\n\n if (leftSideMax > actualMax) {\n actualMax = leftSideMax;\n }\n\n if (rightSideMax > actualMax) {\n actualMax = rightSideMax;\n }\n\n return actualMax;\n };\n\n return findMax(current);\n }", "nextLarger(lowerBound) {\n if (!this.root) {\n return null;\n }\n\n let count = [this.root];\n let closest = null;\n\n while (count.length) {\n const node = count.shift();\n const val = node.val;\n const HigherBound = val > lowerBound;\n const closestUpdate = val < closest || closest === null;\n\n if (HigherBound && closestUpdate) {\n closest = val;\n }\n\n if (val.left) {\n count.push(val.left);\n }\n if (val.right) {\n count.push(val.right);\n }\n }\n\n return closest;\n }", "function findtheBestOne(vals, target=1) {\n let closest = Number.MAX_SAFE_INTEGER;\n let index = 0;\n\n vals.forEach((num, i) => {\n let dist = Math.abs(target - num.output);\n\n if (dist < closest) {\n index = i;\n closest = dist;\n }\n });\n console.log(vals[index].output)\n return vals[index].id;\n}", "find(value) {\n // if we can't find the value we are looking for, return false\n if (this.root === null) return false;\n // create variable current to store the root\n var current = this.root,\n // set found as false because we haven't found what value we are looking for yet\n found = false;\n // while we haven't found the value and while we have a current/root\n while (current && !found) {\n // if the value is less than the parent/root\n if (value < current.value) {\n // we go left in this case and set current as current.left \n current = current.left;\n // if the value is greater than the parent/root\n } else if (value > current.value) {\n // we go right in this case and set current as current.right\n current = current.right;\n // else we found the value and we set found to true\n } else {\n found = true;\n }\n }\n // if we never find the we return undefined\n if (!found) return undefined;\n // return the current value we were searching for\n return current;\n }", "getClosestBaddie(v) {\n Utils.clearArray(_closestBaddie);\n this.entities.forEach(e => {\n if (e.killable && !e.killable.dead && e.targetable && e.name !== 'user') {\n _closestBaddie.push(e);\n }\n });\n\n if (_closestBaddie.length === 0) { return null; }\n\n let len = Infinity;\n let closest = _closestBaddie[0];\n\n _closestBaddie.forEach(l => {\n let d = Vec2.sub(l.pos, v).length();\n\n if (d <= len) {\n closest = l;\n len = d;\n }\n });\n\n return closest;\n }", "find(value) {\n if (!this.root) return false;\n if (value === this.root.value) return true;\n let current = this.root;\n while (true) {\n if (value > current.value) {\n if (!current.right) {\n return false;\n }\n current = current.right;\n if (value === current.value) {\n return current;\n }\n } else {\n if (!current.left) {\n return false;\n }\n current = current.left;\n if (value === current.value) {\n return current;\n }\n }\n }\n }", "max(){\r\n if(this.isEmpty()){\r\n console.log(\"Tree is empty!\");\r\n return null;\r\n }\r\n let runner = this.root;\r\n while(runner.right != null){\r\n runner = runner.right;\r\n }\r\n return runner.value;\r\n }", "minValue() {\n let currNode = this.top;\n let minValue = this.top.value;\n \n while (currNode.next) {\n if (currNode.next.value < minValue) minValue = currNode.next.value;\n currNode = currNode.next;\n }\n \n return minValue;\n }", "function closest(values, referenceValue) {\n return values.reduce(function (prev, curr) {\n return (Math.abs(curr - referenceValue) < Math.abs(prev - referenceValue) ? curr : prev);\n });\n}", "function secondLargestElement(tree) {\n var current = tree;\n var previous = tree.value;\n\n while (current) {\n if (current.left && !current.right) {\n previous = Math.max(current.value, previous);\n current = current.left;\n } else if (current.right) {\n previous = Math.max(current.value, previous);\n current = current.right;\n } else if (!current.right && !current.left) {\n return Math.min(previous, current.value);\n }\n\n }\n}", "findMin() {\n let current = this.root;\n\n // It will keep the last data until current left is null \n while(current.left !== null){\n current = current.left; \n }\n\n return current.data; \n }", "findMin() {\n let current = this.root;\n // Loop until the leftmost node (no left subtree).\n while (current.left !== null) {\n current = current.left;\n }\n return current.data;\n }", "function getNearest($select, value) {\n var delta = {};\n $select.children('option').each(function(i, opt){\n var optValue = $(opt).attr('value'),\n distance;\n\n if(optValue === '') return;\n distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "function getNearest($select, value) {\n var delta = {};\n $select.children('option').each(function(i, opt){\n var optValue = $(opt).attr('value'),\n distance;\n\n if(optValue === '') return;\n distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "getClosestStep(num) {\n num = this.bound(num);\n if (this.step) {\n const step = Math.round(num / this.step) * this.step;\n num = this.bound(step);\n }\n return num;\n }", "function getNearest($select, value) {\n var delta = {};\n $select.children('option').each(function(i, opt){\n var optValue = $(opt).attr('value'),\n distance;\n\n if(optValue === '') return;\n distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "find(val) {\n // if there is nothing in the tree, return undefined\n if(this.root === null) return undefined;\n // if there is a value then we can check the current Nodes \n let currentNode = this.root;\n \n // otherwise we have to traverse the tree based on the value \n while(true){\n // if the current Node value is the one we are searching for, then great we found it ! \n if(currentNode.val === val) return currentNode;\n // if the value of the currentnode is less than the value we want then we have to move right along the tree \n if(currentNode.val < val){\n // check if there is a right value from the current node \n if(currentNode.right === null){\n // if there isnt then we just return undefined \n return undefined;\n }else{\n currentNode = currentNode.right;\n }\n } else if(currentNode.val > val){\n // check if there is a right value from the current node \n if(currentNode.left === null){\n // if there isnt then we just return undefined \n return undefined;\n }else{\n currentNode = currentNode.left;\n }\n }\n\n }\n\n\n }", "function nearest(from) {\n\tvar to = indexOfMin(distances[from]);\n\tif (distances[from][to] < infinDist) {\n\t\tdistances[from][to] = distances[to][from]= infinDist;\n\t\treturn to;\n\t}\n\treturn -1;\n}", "min() {\n const minNode = this.findMinNode(this.root);\n if (minNode) {\n return minNode.key;\n }\n return null;\n }", "remove(value) {\n let currentNode = this.root\n let prevNode = this.root\n\n while(currentNode) { \n if( value === currentNode.value ) { \n let LR = (currentNode.value > prevNode.value)? 'right' : 'left'\n let nodeToUse\n\n //When the node is a leaf\n if( !currentNode.left && !currentNode.right )\n prevNode[LR] = null\n\n //Get lowest number from right direction\n if( currentNode.right ) {\n nodeToUse = currentNode.right\n let prevNodeToUSe\n\n if( nodeToUse.left ) {\n while( nodeToUse.left ) { \n prevNodeToUSe = nodeToUse\n nodeToUse = nodeToUse.left\n }\n currentNode.value = nodeToUse.value\n prevNodeToUSe.left = nodeToUse.right\n } else {\n currentNode.value = nodeToUse.value\n currentNode.right = nodeToUse.right\n }\n }\n \n //Get greatest number from left direction if there's not right direction\n if( currentNode.left && !currentNode.right ) {\n nodeToUse = currentNode.left\n let prevNodeToUSe\n\n if( nodeToUse.right ) {\n while( nodeToUse.right ) { \n prevNodeToUSe = nodeToUse\n nodeToUse = nodeToUse.right\n }\n currentNode.value = nodeToUse.value\n prevNodeToUSe.left = nodeToUse.right\n } else {\n currentNode.value = nodeToUse.value\n currentNode.right = nodeToUse.left\n }\n }\n\n return this\n }\n\n prevNode = currentNode\n\n if(value < currentNode.value) \n currentNode = currentNode.left\n else\n currentNode = currentNode.right\n }\n }", "find(val) {\n let currentNode = this.root;\n let found = false;\n\n if(val === currentNode.val) return currentNode;\n\n while(currentNode && !found){\n if(val < currentNode.val){\n currentNode = currentNode.left;\n } else if (val > currentNode.val){\n currentNode = currentNode.right;\n } else {\n found = true;\n }\n }\n\n if(!found) return undefined\n return currentNode;\n\n }", "find(val) {\n let currentNode = this.root;\n\n while(currentNode){\n if(currentNode.val > val){\n if(!currentNode.left) return ;\n if(currentNode.left.val === val) return currentNode.left;\n\n currentNode = currentNode.left\n }else if(currentNode.val < val){\n if(!currentNode.right) return ;\n if(currentNode.right.val === val) return currentNode.right;\n\n currentNode = currentNode.right\n }\n }\n\n return;\n }", "nextLarger(lowerBound) {\n\n if (this.root === null) return null;\n let result = null;\n let nodesToVisit = [this.root];\n\n while (nodesToVisit.length){\n\n let current = nodesToVisit.pop();\n\n if ((current.val > lowerBound) && ((current.val < result) || (result === null))){\n result = current.val;\n }\n\n if (current.left !== null){\n nodesToVisit.push(current.left);\n }\n if (current.right !== null){\n nodesToVisit.push(current.right);\n }\n }\n return result;\n }", "function getNearest($select, value) {\n\t var delta = {};\n\t $select.children('option').each(function(i, opt){\n\t var optValue = $(opt).attr('value'),\n\t distance;\n\t\n\t if(optValue === '') return;\n\t distance = Math.abs(optValue - value); \n\t if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n\t delta = {value: optValue, distance: distance};\n\t } \n\t }); \n\t return delta.value;\n\t }", "function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }", "_findMin() {\n if (!this.left) { // if there's no left child \n return this; // return the value of this.right that this function was called on\n }\n return this.left._findMin(); // run the findMin function recursively on this.left\n }", "function findMin(root) {\r\n // go as left as possible\r\n if (!root) return null;\r\n let current = root;\r\n\r\n while (current.left) {\r\n current = current.left;\r\n }\r\n return current;\r\n}", "get_position(value) {\n let current_node = this.root;\n var position;\n while (1) {\n if (current_node.value > value && current_node.left) {\n current_node = current_node.left;\n } else if (current_node.value < value && current_node.right || current_node.value == value && current_node.right) {\n current_node = current_node.right;\n } else {\n if (current_node.value > value) {\n position = 'left';\n } else {\n position = 'right';\n }\n return { 'node': current_node, 'branch': position }\n }\n }\n }", "_getClosestArrayItem(val, array) {\n let minimum = 999999;\n let out = 0;\n array.map((value, index) => {\n let dif = Math.abs(val-value);\n if(dif < minimum) {\n minimum = dif;\n out = index;\n }\n return value;\n });\n return parseInt(out, 10);\n }", "minimum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMinimum(this.root).key;\n }", "function getClosestDelta(n)\n{\n minDelta = Number.MAX_VALUE;\n for(index in n)\n {\n minDelta = (n[index] < minDelta) ? n[index] : minDelta;\n }\n return minDelta\n}", "findMinNode() {\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n var runner = this.head\n var temp = runner\n while (runner != null) {\n if ( temp.value > runner.value ){\n temp = runner\n }\n runner = runner.next;\n }\n return temp;\n }", "static closest(num, arr) {\n let curr = null;\n let diff = Infinity;\n arr.forEach((elem) => {\n let rect = elem.getBoundingClientRect();\n let val = rect.right - (rect.width / 2);\n let newdiff = Math.abs(num - val);\n if (newdiff < diff) {\n diff = newdiff;\n curr = elem;\n }\n });\n return curr;\n }", "function min() {\n var node = this.root;\n while( node.left != null ){\n node = node.left;\n }\n return node.data;\n}", "function findMin(root){\n let currNode = root;\n if(currNode.left == null){\n console.log(currNode.data);\n return currNode\n } else {\n return findMin(currNode.left);\n }\n}", "function findMin(root) {\r\n if (!root) return null\r\n \r\n while (root.left) root = root.left\r\n return root\r\n}", "function findMin(root){\n if (!root) return null;\n while (root.left){\n root = root.left;\n }\n return root;\n}", "function findSmallestDistance(){\n\tvar minimum=100000;\n\tvar node=-1;\n\tunvisited.forEach(function(item){\n\t\tif(distance[item]<=minimum){\n\t\t\tminimum=distance[item];\n\t\t\tnode=item;\n\t\t}\n\t})\n\tif(node==-1){\n\t\tconsole.log(\"this should never happen\");\n\t}\n\treturn node;\n}", "getLowestDistanceNode(unsettledNodes) {\n let lowest = null\n let lowestDistance = Number.MAX_SAFE_INTEGER\n for (let i = 0; i < unsettledNodes.length; i++) {\n let nodeDistance = unsettledNodes[i].distance\n if (nodeDistance < lowestDistance) {\n lowestDistance = nodeDistance\n lowest = unsettledNodes[i]\n }\n }\n\n return lowest;\n }", "find(value) {\n if (this.root === null) return false;\n let current = this.root;\n let found = false;\n while (current && !found) {\n if (value < current.value) {\n current = current.left;\n } else if (value > current.value) {\n current = current.right;\n } else {\n // have this return true for true or false version\n found = true;\n }\n }\n // remove this line for true or false version\n if (!found) return false;\n // have this return false for true or false version\n return current;\n }", "max() {\n let currentNode = this.root;\n // Case for no root\n if(!currentNode) {\n throw new Error('This tree does not yet contain any values');\n return;\n }\n while(currentNode.right) {\n currentNode = currentNode.right;\n }\n return currentNode.value;\n }" ]
[ "0.85533667", "0.85214084", "0.85127723", "0.85071725", "0.8410835", "0.8326483", "0.8198468", "0.8023728", "0.7982306", "0.7701382", "0.7350137", "0.684865", "0.6842396", "0.6823907", "0.6823907", "0.6816698", "0.6812664", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6810911", "0.6807704", "0.6807704", "0.6807704", "0.6807704", "0.6807704", "0.6807704", "0.6636178", "0.6576086", "0.6551696", "0.6487167", "0.64551544", "0.64529824", "0.6442244", "0.6352159", "0.6334791", "0.6275824", "0.62662244", "0.62434304", "0.6215946", "0.6208674", "0.6201974", "0.61955833", "0.619189", "0.6133481", "0.60853714", "0.6083963", "0.60718066", "0.6062792", "0.6045686", "0.60153264", "0.60136056", "0.6005864", "0.5985816", "0.592099", "0.5895767", "0.5889639", "0.587735", "0.58139175", "0.58139175", "0.57985467", "0.57683474", "0.5763116", "0.57394207", "0.5738592", "0.5702854", "0.57016885", "0.5699518", "0.56980073", "0.5691792", "0.568962", "0.568962", "0.568962", "0.568962", "0.568962", "0.568824", "0.56831765", "0.56641567", "0.56522214", "0.5644581", "0.562428", "0.56185246", "0.5609052", "0.5605463", "0.55603766", "0.55601734", "0.5542501", "0.55407894", "0.553078", "0.55249107", "0.55246353" ]
0.780807
9
let imgPath = "/images/";
function getRandom(){ do{ var getImage2 = imageArray[Math.floor(Math.random()*imageArray.length)]; } while(getImage1 == getImage2) console.log("getImage2 : "+getImage2); compareResult(imageArray.indexOf(getImage2)); return getImage2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "get imagePath(){\n return My_Resource +'/img/' + this.logoName;\n }", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "function image(relativePath) {\n return \"/static/editablegrid-2.0.1/images/\" + relativePath;\n}", "function imagesPath() {\n var href = $(\"link[href*=cleditor]\").attr(\"href\");\n return href.replace(/^(.*\\/)[^\\/]+$/, '$1') + \"images/\";\n }", "function imgsPath() {\n return src(files.imgPath)\n .pipe(browserSync.stream())\n // .pipe(imagemin())\n .pipe(dest('pub/images')\n );\n}", "function getImagePath(name) {\n return IMG_DIR + name + \".jpg\";\n}", "function image(relativePath) {\n\treturn \"img/core-img/\" + relativePath;\n}", "function imageUrl(filename) {\n return \"url(\" + imagesPath() + filename + \")\";\n }", "buildImgURL(string){\n const value = string.toLowerCase().split(' ').join('-');\n return process.env.PUBLIC_URL+'/'+value;\n }", "function buildAssetPath(imgSrc) {\n return `./dist/${imgSrc}`;\n}", "static imageUrlForRestaurant(restaurant) {\n let url = `/img/${(restaurant.photograph||restaurant.id)}-medium.jpg`;\n return url;\n }", "function getImgSrcPath(item) {\n splitPath = item.src.split(\"/\");\n spIndex = 0;\n path = \"\";\n \n for (i = 0; i < splitPath.length; i++) {\n if (splitPath[i] == \"img\") {\n spIndex = i;\n }\n }\n \n for (i = spIndex; i < (splitPath.length - 1); i++) {\n path = path + splitPath[i] + \"/\";\n }\n \n return path;\n}", "function getImagesPath() {\r\n\tvar strLoc = location.pathname;\r\n\tvar strPath = \"images\";\r\n\r\n//\tvar iPos = 1;\t\t\t\t\t\t\t// except document root (/)\r\n//\tiPos = strLoc.indexOf(\"/\",iPos) + 1;\t// except context root (/OpenOLAP/)\r\n\r\n//\twhile (true) {\r\n//\t\tiPos = strLoc.indexOf(\"/\",iPos);\r\n//\t\tif (iPos<0) {\r\n//\t\t\tbreak;\r\n//\t\t} else {\r\n//\t\t\tstrPath = \"../\" + strPath;\r\n//\t\t\tiPos++;\r\n//\t\t}\r\n//\t}\r\n\r\n\t//Objects.jspだったら、Root\r\n\tif(strLoc.indexOf(\"objects.jsp\")!=-1){\r\n\t\tstrPath=\"images\";\r\n\t}else{\r\n\t\tstrPath=\"../../images\";\r\n\t}\r\n\treturn strPath;\r\n}", "function obtainExternalPhotos() {\n const random = Math.floor(Math.random() * (paths.length));\n const pathImage = path.join(__dirname, \"../images/\" + paths[random])\n return pathImage;\n}", "function imgPath(imgNum){\n imgNum = String(imgNum);\n // check if image number needs zero padding\n if (imgNum.length < 2) {\n imgNum = '0' + imgNum;\n }\n // add properly padded number to path and return\n return 'images/pdxcg_' + imgNum + '.jpg';\n}", "function imgPath(imgNum){\n imgNum = String(imgNum);\n // check if image number needs zero padding\n if (imgNum.length < 2) {\n imgNum = '0' + imgNum;\n }\n // add properly padded number to path and return\n return 'images/pdxcg_' + imgNum + '.jpg';\n}", "getImageURL(img) {\n return img.src;\n }", "function getImage(fileKey) {\n return \"/images/\" + fileKey + \".jpg\";\n }", "function img(file) {\n return jg.os({android: '../images/' + file, iphone: 'images/' + file});\n}", "getImageSource(){\n return `assets/images/cards/${this.rank}_of_${this.suit}.png`;\n }", "function imageFolder(path) {\n var imagesFolder = path.dirname.split(config.paths.images)[1];\n if (imagesFolder) path.dirname = imagesFolder;\n return path;\n}", "static imageHolderUrlForRestaurant(restaurant) {\n let url = `/img/${(restaurant.photograph||restaurant.id)}-placeholder.jpg`\n return url;\n }", "function pathToImage(path) {\n let res = new Image();\n res.src = path;\n return res;\n}", "static imageUrlForRestaurantS(restaurant) {\r\n if (restaurant.photograph === undefined){\r\n return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\r\n }\r\n return (`/img/400_${restaurant.photograph}.jpg`);\r\n }", "static imageUrlForRestaurantL(restaurant) {\r\n if (restaurant.photograph === undefined){\r\n return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\r\n }\r\n return (`/img/800_${restaurant.photograph}.jpg`);\r\n }", "getImagesDir() {\n return path.join(this.uploadDir, 'images');\n }", "get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }", "async getLocalUriForImage() {\n const { image } = this.props.route.params;\n\n // Make sure the directory exists, and create the uri for the image in that directory\n await this.ensureDirExists();\n const localFileUri = this._imageDirectory + `${uuidv4()}.jpeg`;\n console.log(localFileUri);\n\n // Get data pertaining to the image if it already exists in the directory\n const fileInfo = await FileSystem.getInfoAsync(localFileUri);\n if (!fileInfo.exists) {\n await FileSystem.downloadAsync(image.downloadURL, localFileUri);\n }\n return localFileUri;\n }", "function cacheGetImgUrl(filePath)\n{\n var cacheImgName = cacheFileIsCachedReturnName(appServerUrlPreffix+\"/\"+filePath);\n //console.log(\"cacheImgName\" + cacheImgName);\n if(cacheImgName!=\"\")\n {\n return cachePreffix + \"/\" + cacheImgName;\n }\n else\n {\n\n // zalohuj\n ImgCache.cacheFile(appServerUrlPreffix+\"/\"+filePath,\n function(){\n //console.log(\"ukladam do cache: \" +filePath);\n },\n function(){\n console.log(\"error ulozeni obr do cache!\")\n }\n );\n\n return appServerUrlPreffix+\"/\"+filePath;\n }\n}", "function img() {\n return src(source + 'img/*.*')\n .pipe(dest(destination + 'img'));\n}", "function createImage(src = \"/\") {\n const image = document.createElement(\"img\");\n image.src = src;\n return image;\n}", "static imageSrcsetForRestaurant(restaurant) {\n const imageSrc = `/img/${(restaurant.photograph||restaurant.id)}`;\n return `${imageSrc}-small.jpg 240w,\n ${imageSrc}-medium.jpg 400w,\n ${imageSrc}-large.jpg 800w`;\n }", "function addPathToImage() {\n $(ctrl.imageTags).each(function (index) {\n if (ctrl.imageTags[index].hasAttribute('id')) {\n var imageSrc = ctrl.imageTags[index].getAttribute('id');\n $(ctrl.imageTags[index]).attr('src', oDataPath + \"/Asset('\" + imageSrc + \"')/$value\");\n }\n });\n }", "function getPath(number) {\n console.log(number)\n if (number == 1) {\n return \"images\\\\dice1.png\";\n } else if (number == 2) {\n return \"images\\\\dice2.png\";\n } else if (number == 3) {\n return \"images\\\\dice3.png\";\n } else if (number == 4) {\n return \"images\\\\dice4.png\";\n } else if (number == 5) {\n return \"images\\\\dice5.png\";\n } else {\n return \"images\\\\dice6.png\";\n }\n}", "function imageUrl(path) {\n try {\n return require('text!gcli/ui/' + path);\n }\n catch (ex) {\n var filename = module.id.split('/').pop() + '.js';\n var imagePath;\n\n if (module.uri.substr(-filename.length) !== filename) {\n console.error('Can\\'t work out path from module.uri/module.id');\n return path;\n }\n\n if (module.uri) {\n var end = module.uri.length - filename.length - 1;\n return module.uri.substr(0, end) + '/' + path;\n }\n\n return filename + '/' + path;\n }\n}", "function setImgFilepath(){\n Item.imgEl1.src = Item.objStore[Item.prevNum[0]].filepath;\n Item.imgEl1.alt = Item.objStore[Item.prevNum[0]].name;\n Item.imgEl2.src = Item.objStore[Item.prevNum[1]].filepath;\n Item.imgEl2.alt = Item.objStore[Item.prevNum[1]].name;\n Item.imgEl3.src = Item.objStore[Item.prevNum[2]].filepath;\n Item.imgEl3.alt = Item.objStore[Item.prevNum[2]].name;\n}", "function getImage(tipo,rarita) {\n\n return \"img/\"+tipo.toString()+rarita.toString()+\".jpg\";\n}", "function newPath(image){\n var image_upload_name = makeid(20);\n var extension = path.extname(image.name);\n console.log(image_upload_path_new);\n var image_upload_path_name = image_upload_path_new +\"/\"+image_upload_name + extension;\n\n name = image_upload_name;\n ext = extension;\n\n return image_upload_path_name;\n}", "function images() {\n return gulp.src( 'src/assets/img/**/*' )\n .pipe( gulp.dest( './build/assets/img' ) );\n}", "function viewImage(id,path_image) {\n var address='<img src={}>';\n document.getElementById(id).innerHTML=address.replace(\"{}\",path_image);\n}", "function renderImages() {\n imgElem.src = Actor.all[0].path;\n}", "static bluredImageUrlForRestaurant(restaurant) {\r\n // for development we need to remove \"/mws-restaurant-stage-1\"\r\n const url = window.location.href;\r\n if(url.startsWith('https')) {\r\n return (`/mws-restaurant-stage-1/img/${restaurant.photograph}`);\r\n }\r\n return (`/img/${restaurant.photograph || 10}-800_lazy_load.jpg`); \r\n }", "function getImage(city) {\n\n let lowerCity = city.replace(/\\s/g, '').toLowerCase();\n return \"images/\" + lowerCity + \".jpg\";\n\n}", "checkImg(el){\r\n let pathImg = el.poster_path\r\n let img = \"\"\r\n if(!pathImg){\r\n img = \"no-img.png\"\r\n }else{\r\n img = 'https://image.tmdb.org/t/p/w342/'+ pathImg\r\n }\r\n return img\r\n }", "get() {\n return `${process.env.APP_URL}/files/${this.path}`;\n }", "function App() {\n const imageUrl = \"https://picsum.photos/200/300\";\n\n return (\n <div>\n <h1>Image As URL</h1>\n {/** IMAGE AS URL */}\n <img src=\"https://picsum.photos/200/300\" alt=\"\" />\n <img src={imageUrl} alt=\"\" />\n\n {/** Image as file */}\n <h1>Image As Downloaded File</h1>\n <img src={imgMountain} alt=\"\" />\n </div>\n );\n}", "function setImageNE(img) {\n\t\tif (img.indexOf(\"/\") != -1) {\n\t\t\tthis.image = img;\n\t\t} else {\n\t\t\tthis.image = URL_IMAGES + img;\n\t\t}\n\t}", "function randomImg() {\n imgURL = images[Math.floor(Math.random() * images.length)];\n console.log(imgURL);\n}", "image(node, context) {\n const { origin, entering } = context;\n const result = origin();\n const httpRE = /^https?:\\/\\/|^data:/;\n if (httpRE.test(node.destination)){\n return result;\n }\n if (entering) {\n result.attributes.src = img_root + node.destination;\n }\n return result;\n }", "function ImageHelper() { }", "function getDefaultImage() {\n return defaultImagePath;\n }", "setPicturePath(n) {\n switch(n) {\n case\"Berzerker\":\n this.player_pic = \"images/Berzerker.jpg\"\n break;\n case\"Ranger\":\n this.player_pic = \"images/Ranger.jpg\"\n break;\n case\"Sorcerer\":\n this.player_pic = \"images/Sorcerer.jpg\"\n break;\n case\"Fairy\":\n this.player_pic = \"images/Fairy.jpg\"\n break;\n default:\n break;\n }\n\n }", "function imageToSrc(image) {\n let src = `https://farm${image.farm}.staticflickr.com/${image.server}/${image.id}_${image.secret}.jpg`\n return src\n}", "function image_name() {\n return program.user + '/' + program.image;\n}", "get assetPath() {}", "get assetPath() {}", "function createImage(promo,nombre){\n var img = document.createElement('img');\n\n img.setAttribute('src','assets/images/'+ promo + '/'+ nombre +'.jpg'); \n imagesContainer.appendChild(img);\n}", "getImage(){\n if(this.color == 'white'){\n return './img/pawn_white.svg';\n }\n else{\n return '../img/pawn_black.svg';\n }\n }", "function preload() {\n img = loadImage(\"../assets/Earth.png\");\n}", "function setImage(url) {\n let image = document.getElementById(\"sadAnimalImage\");\n image.src = url;\n}", "cargarunaImagen(valorI){\n return 'media/ImagenesDeIncidencia/'+valorI\n }", "function setImage(imageFileName) {\n let viewscreen = document.getElementById('viewscreen');\n viewscreen.src = 'images/' + imageFileName;\n}", "getImage(){\n return '';//This might change later, we will see what I want this to be\n }", "function randomimage(){\n var image_array = [\n '/homepage_images/img1.png',\n '/homepage_images/img2.png',\n '/homepage_images/img3.png',\n '/homepage_images/img4.png',\n '/homepage_images/img5.png',\n '/homepage_images/img6.png',\n '/homepage_images/img7.png',\n '/homepage_images/img8.png',\n '/homepage_images/img9.png',\n '/homepage_images/img10.png'\n];\nreturn image_array;\n}", "function findImage(){\n return db('images');\n}", "function pathFile(event){\n imageLoad = URL.createObjectURL(event.target.files[0]);\n loadImage(imageLoad, img => {\n image(img, 0, 0);\n })\n}", "constructor() {\n super(...arguments)\n this.bgURL = \"static/assets/images/bg.png\"\n this.groundURL = \"static/assets/images/ground.png\"\n this.avatarURL = \"static/assets/images/avatar.png\"\n this.squircleURL = \"static/assets/images/squircle.png\"\n this.squircleFillURL = \"static/assets/images/squircle_fill.png\"\n }", "function prepareUrl(imgObject) {\n return 'https://farm8.staticflickr.com/' + imgObject.server + '/'+ imgObject.id + '_' + imgObject.secret + '.jpg';\n}", "getPublicPathUrl() {\n return `${this.getServerUrl()}${this.publicPath}`;\n }", "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}", "function usePageBaseUrl (img)\r\n{\r\n\t// Gecko-based browsers act like NS4 in that they report this\r\n\t// incorrectly: they always return true.\r\n\t// However, they do have two very useful properties: naturalWidth\r\n\t// and naturalHeight. These give the true size of the image. If\r\n\t// it failed to load, either of these should be zero.\r\n\tif ((browser.IE && img.fileSize<=0) || (typeof img.naturalWidth != \"undefined\" && img.naturalWidth == 0)) {\r\n\t\tvar s = img.src;\r\n\t\tvar r1 = new RegExp(loadedFile,\"gi\");\r\n\t\tvar r2 = new RegExp(doc_root,\"gi\");\r\n\t\tif (loadedFile) {\r\n\t\t\ts = s.replace(r1,\"\");\r\n\t\t} else {\r\n\t\t\ts = s.replace(r2,\"\");\r\n\t\t}\r\n\t\timg.src = s;\r\n\t\t//if (this.img.getAttribute(\"realsrc\"))this.img.setAttribute(\"realsrc\", s);\r\n\t}\r\n}", "function imagePath(type, name) {\n\t var img = \"/assets/file-types/file.png\";\n\t var fileType = type.split('/')[1];\n\t var fileTypes = 'after-effects.pngai.pngaudition.pngavi.pngbridge.pngcss.pngcsv.pngdbf.pngdoc.pngdreamweaver.pngdwg.pngexe.pngfile.pngfireworks.pngfla.pngflash.pnghtml.pngillustrator.pngindesign.pngiso.pngjavascript.pngjpg.pngjson-file.pngmp3.pngmp4.pngpdf.pngphotoshop.pngpng.pngppt.pngprelude.pngpremiere.pngpsd.pngrtf.pngsearch.pngsvg.pngtxt.pngxls.pngxml.pngzip-1.pngzip.pngfolder.pngjpeg.pngdocx.png';\n\t fileTypes = fileTypes.split('.png');\n\t if (fileTypes.indexOf(fileType) != -1) {\n\t img = '/assets/file-types/' + fileType + '.png';\n\t } else if (fileTypes.indexOf(name.split('.')[1]) != -1) {\n\t img = '/assets/file-types/' + name.split('.')[1] + '.png';\n\t }\n\t return img;\n\t}", "function images() {\n return src('./src/images/**')\n .pipe(dest('./dist/images'));\n}", "function setImgSource(value) {\n switch(value) {\n case 1:\n return \"images/1.png\";\n case 2:\n return \"images/2.png\";\n case 3:\n return \"images/3.png\";\n case 4:\n return \"images/4.png\";\n case 5:\n return \"images/5.png\";\n case 6:\n return \"images/6.png\";\n default:\n break;\n }\n}", "setImgUrl(url) {\n this.setState({ imageurl: url });\n}", "function getServerPath(){\n return SERVER_PATH;\n }", "function getImageBaseUrl (url, config, item) {\n var baseUrl = ''\n if (item.use_file_server) {\n baseUrl = config.file_server\n }\n return baseUrl\n}", "get publicPath() { return path.resolve('./' + this.publicFolder + '/' )}", "function imageTask() {\n return src(files.imagePath)\n .pipe(dest(\"pub/pics\"))\n .pipe(browserSync.stream())\n}", "function displayImage(imagePath, response)\r\n{\r\n try\r\n {\r\n // read the image path from the local storage and add it to a var called img\r\n let img = fs.readFileSync(imagePath);\r\n console.log(img);\r\n response.writeHead(200, {'Content-Type': 'image/png' });\r\n response.end(img, 'binary');\r\n }\r\n catch(err)\r\n {\r\n console.log(err);\r\n response.writeHead(200, {'Content-Type': 'text/plain' });\r\n response.end('Image not found! \\n');\r\n }\r\n}", "function getCurrentButtonImgPath(index) {\n\tvar img_src = 'googleplusone/images/';\n\tswitch(index) {\n\t\tcase 0:\n\t\t\timg_src += 'standard.jpg';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\timg_src += 'small.jpg';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\timg_src += 'medium.jpg';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\timg_src += 'tall.jpg';\n\t\t\tbreak\n\t}\n\treturn img_src;\n}", "function GetRandomImage() {\n var files = imgAccess.GetImage();\n var filePath = util.ExtractFilePath(files);\n return (filePath);\n\n}", "function Image() {\n return (\n <div className=\"Image\">\n <img src={'/isa.JPG'} className=\"profile-pic\" alt=\"logo\" />\n \n </div>\n );\n }", "function getProfilePicURL(){\n\treturn student.path;\n}", "posterImg(poster) {\n return `https://image.tmdb.org/t/p/w342/${poster}`\n }", "function renderImage(img){\n$image.setAttribute('src', img)\n}", "async function insertFullImagePath(imageSelector) {\n 'use strict';\n var url = window.location.href;\n if (url.includes('.html')) {\n var url = url.substring(0, url.lastIndexOf(\"/\"));\n }\n var images = document.querySelectorAll(imageSelector);\n var i, currentImagePath, fullImagePath;\n for (i = 0; i < images.length; i += 1) {\n currentImagePath = images[i].getAttribute('src');\n fullImagePath = url + '/' + currentImagePath;\n images[i].setAttribute('src', fullImagePath);\n }\n }", "function getImagePath({ repo, url, branch }) {\n const root = `https://raw.githubusercontent.com/${repo}`;\n // If the URL is absolute (start with http), we do nothing...\n if (url.indexOf(\"http\") === 0) return url;\n\n // Special case: in Facebook Flux readme, relative URLs start with './'\n // so we just remove './' from the UL\n const path = url.indexOf(\"./\") === 0 ? url.replace(/.\\//, \"\") : url;\n\n // Add a querystring parameter to display correctly the SVG logo in `sindresorhus/ky` repo\n const isSvg = /\\.svg$/i.test(url);\n const queryString = isSvg ? \"?sanitize=true\" : \"\";\n\n // ...otherwise we create an absolute URL to the \"raw image\n // example: images in \"You-Dont-Know-JS\" repo.\n return `${root}/${branch}/${path}${queryString}`;\n}", "constructor(imgfile) {\n this.uniqueID = uuid.v4(); //will be _id field on mongoDB\n this.name = imgfile.filename;\n this.extType = imgfile.extension; \n \n this.path = (path.join(__dirname, '/public/', imgfile));\n\n // if (publicStatus === true) {\n \n // }\n // else\n // {\n // //private image handling here\n // }\n }", "function Header() {\n const [logoUrl] = useState('./logo-creasume.png');\n\n return(\n <Container>\n <img src={logoUrl} alt=\"Crea-Sume\"/>\n </Container>\n )\n}", "function hello(){\n\n return \"../assets/img/floorPlans/\" + localStorage.getItem(\"dest-value\") + \".png\";\n}", "function ItemImage(path) {\n this.path = '../lab/assets/' + path;\n this.clicked = 0;\n}", "function ImageWeather() {\n return <img src={imageWeather} alt=\"Logo\" style={{width: '200px', height: '170px'}} />;\n}", "function setimgsrc() {\n document.getElementById(\"mainimg\").src = \"http://\" + window.location.hostname + \":3001/?action=stream\";\n }", "function imgPrincipal(url) {\r\n let img_principal = `\r\n <img\r\n src=\"${url}\"\r\n style=\"width:300px;height:300px;\"\r\n />\r\n `;\r\n $(\"#img_principal\").html(img_principal);\r\n}", "function usePageBaseUrl (img)\n{\n\tif ((browser.IE && img.fileSize<=0) || (typeof img.naturalWidth != \"undefined\" && img.naturalWidth == 0)) {\n\t\tvar s = img.src;\n\t\tvar s3 = s;\n\t\tvar t = false;\n\t\tvar r1 = new RegExp(loadedFile,\"gi\");\n\t\tvar r2 = new RegExp(doc_root,\"gi\");\n\t\tif (loadedFile) {\n\t\t\ts = s.replace(r1,\"\");\n\t\t} else {\n\t\t\ts = s.replace(r2,\"\");\n\t\t}\n\t\tif (myBaseHref){\n\t\t\ts = s.replace(/file:\\/\\/\\//gi,\"\");\n\t\t\ts = myBaseHref + s;\n\t\t}\n\n\t\tif (s3)t = (s3.substr(0,1)==\"/\" || s3.indexOf(\"itpc://\")>=0 || s3.indexOf(\"http://\")>=0 || s3.indexOf(\"www.\")>=0 || s3.indexOf(\"https://\")>=0 );\n\t\tif (!t)\t{\n\t\t\timg.src = s;\n\t\t}\t\n\t}\n}", "function images() {\n return gulp.src('email/src/assets/img/**/*')\n .pipe($.imagemin())\n .pipe(gulp.dest('email/dist/assets/img'));\n}" ]
[ "0.77299327", "0.7654136", "0.72462916", "0.72104275", "0.7087227", "0.708234", "0.7048076", "0.7026005", "0.700661", "0.70017195", "0.69955456", "0.6915809", "0.68998396", "0.6869418", "0.6817347", "0.68095684", "0.67202955", "0.66891617", "0.6600167", "0.6600167", "0.6599158", "0.6512689", "0.6469086", "0.644231", "0.6429246", "0.64082605", "0.6388661", "0.6379241", "0.6360509", "0.6323142", "0.63061786", "0.62573195", "0.62568325", "0.6254978", "0.6246193", "0.6216913", "0.61847025", "0.6174199", "0.61446923", "0.614418", "0.6144125", "0.6119947", "0.61159027", "0.6100387", "0.6090083", "0.60756004", "0.60406494", "0.60364616", "0.6008386", "0.59954387", "0.59951603", "0.5993679", "0.5989687", "0.5942975", "0.5935864", "0.5926417", "0.5913727", "0.5911789", "0.58913165", "0.58913165", "0.5869682", "0.586673", "0.58500344", "0.58393896", "0.58180255", "0.5817084", "0.5812352", "0.58106554", "0.58093905", "0.5795663", "0.57903594", "0.57884735", "0.5784041", "0.5768968", "0.5765758", "0.5763294", "0.57620424", "0.57597494", "0.5749015", "0.574003", "0.57375276", "0.57331014", "0.5722032", "0.5719922", "0.5716696", "0.57156765", "0.5714989", "0.57109404", "0.5710938", "0.5706821", "0.5705665", "0.570123", "0.5697113", "0.5693022", "0.56881815", "0.5685094", "0.5683466", "0.5681568", "0.56782484", "0.5673772", "0.5666041" ]
0.0
-1
ComponentDidMount in Life cycle function be used
componentDidMount() { const token = localStorage.getItem("token"); this.setState({ token: token }); console.log("token", JSON.stringify(token)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componenetDidMount() { }", "componentDidMount() {\n\t\tthis.init();\n\t}", "componentDidMount()\n {\n\n }", "componentDidMount(){\n \n }", "componentDidMount() {\n \n }", "componentDidMount(){\n console.log(\"ComponentDidMount Execution\");\n\n }", "componentDidMount(){\n\n }", "componentDidMount(){\n\n }", "componentDidMount() { \n \n }", "componentDidMount(){\n }", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {\n\n\t}", "componentDidMount(){\n\n\n\n\n}", "componentDidMount() {\n\t\tthis.props.onLoad();\n\t}", "componentDidMount(){\n console.log(\">>>>in componentDidMount<<<<<\")\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\t\tthis.startup();\n\t}", "componentDidMount(){\n console.log('Life Cycle A - componentDidMount');\n }", "componentDidMount(){\n\n }", "componentDidMount(){\n\n }", "componentDidMount() {\n \n }", "componentDidMount() {\n \n }", "componentDidMount() {\n\t}", "componentDidMount() {\n\t}", "componentDidMount() {\n\t}", "componentDidMount(){\n }", "componentDidMount () {\n\n }", "componentDidMount(){\n console.log(\"ComponentdidMount\"); \n }", "componentDidMount () {\n\n }", "componentDidMount () {\n\n\t}", "componentDidMount () {\n\n\t}", "componentDidMount(){ //Cuando un compoennte se monta y se muestra en pantalla se llama este método\n console.log(\"did Mount\");\n }", "componentDidMount() {\n\t\tconsole.log('in componentDidMount');\n\t}", "function componentDidMount ()\n {\n\n }", "componentDidMount() {\n\t\tthis._loadInitialState().done();\n\t}", "componentDidMount() {\n console.log('componentDidMoun');\n }", "componentDidMount(){\n console.log(\"El componente se ha montado\")\n }", "componentDidMount() {\n this.componentLoaded = true;\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount(){\n }", "componentDidMount() {\n console.log('--------------------------- componentDidMount -----------------------------');\n }", "componentDidMount() {\n this.onLoad();\n }", "componentDidMount() {\n // console.log(\"=========================> componentDidMount\");\n }", "componentDidMount() {\n }", "componentDidMount() {\n }", "componentDidMount() {\n }", "componentDidMount(){\n// OnLoad function\n\nconsole.log(\"load complete\")\n}", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "componentDidMount () {\n }", "componentDidMount() {\r\n console.log(\"El componente se renderizó\");\r\n }", "componentDidMount () {\n this.init();\n }", "componentDidMount () {\n this.init();\n }", "componentDidMount () {\n this.init();\n }", "componentDidMount(){\n console.log('componentDidMount');\n }", "componentDidMount() {\n //\n }", "componentDidMount(props) {\n\n }", "componentDidMount(){\n console.log(\"LifeCycleA componentDidMount() is executed\");\n }", "componentDidMount() {\n this.props.onMount();\n }", "componentDidMount() {\n\t\tthis.setQueryInfo();\n\t\tthis.createChannel();\n\t}", "componentDidMount() {\n console.info(\"componentDidMount()\");\n }", "componentDidMount() {\n console.log('Component Did Mount');\n console.log('-------------------');\n\n }", "componentDidMount() {\n if (super.componentDidMount) super.componentDidMount();\n\n this.checkForStateChange(undefined, this.state);\n }", "componentDidMount() {\n\t\tconsole.log('jalan');\n\t}", "componentDidMount(){\n console.log('Component Did Mount')\n }", "componenetWillMount() { }", "componentDidMount() {\n }", "componentDidMount() {\n }", "componentWillMount(){\n console.log(\"ComponentWillMount Execution\");\n }", "componentDidMount() {\n console.log(\"Component mounted\");\n }", "componentDidMount() {\n console.log(\"component did mount\");\n }", "componentDidMount(){\n\t\tconsole.log(\"[Person.js] Inside componentDidMount \");\n\t}", "componentDidMount() {\n this.props.onLoad();\n }", "componentDidMount () {\n }", "componentDidMount() {\n this.componentData();\n }", "componentDidMount()\n\t{\n\t\tthis.loadData();\n\t}", "componentDidMount() {\n\n console.log(\"componentDidMount()\");\n\n window.readyForStuff = this.readyForStuff.bind(this);\n\n }", "componentDidMount(){\n console.log('component did mount...');\n }", "componentDidMount() {\n console.log('I am mounted')\n }", "componentDidMount() {\n console.log('componentDidMount()')\n }", "componentDidMount() {\n console.log('Mount');\n }", "componentDidMount() {\n console.log('sss');\n this.setProducts();\n this.setCategories();\n this.setDepartments();\n this.setColors();\n\n }" ]
[ "0.8610029", "0.83641243", "0.832006", "0.83050275", "0.8277858", "0.82470846", "0.82434", "0.82434", "0.82317054", "0.8221666", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.81917816", "0.81807387", "0.8176691", "0.8175564", "0.81754774", "0.81754774", "0.81754774", "0.81730396", "0.8168118", "0.8167797", "0.8167797", "0.8167735", "0.8167735", "0.81662685", "0.81662685", "0.81662685", "0.81573737", "0.81506884", "0.813688", "0.8135274", "0.8129188", "0.8129188", "0.8127711", "0.8103456", "0.8100835", "0.808861", "0.80822057", "0.80772513", "0.80704033", "0.8061148", "0.8061148", "0.8061148", "0.8061148", "0.8059848", "0.80470157", "0.80447626", "0.8034692", "0.8022618", "0.8022618", "0.8022618", "0.80134004", "0.7997728", "0.7983948", "0.79817694", "0.79750025", "0.79750025", "0.79750025", "0.7971546", "0.7970509", "0.79703265", "0.79688436", "0.7956046", "0.7946169", "0.7945067", "0.79267055", "0.79186636", "0.7908698", "0.78910786", "0.7886647", "0.7884932", "0.7884932", "0.7869049", "0.7865073", "0.785966", "0.78584284", "0.78472334", "0.78287816", "0.78261226", "0.78230935", "0.780083", "0.7790668", "0.77896154", "0.77847403", "0.7781597", "0.777705" ]
0.0
-1
reset Password Event Handler
resetPassword(event) { event.preventDefault(); let data = { password: this.state.password, confirmPassword: this.state.confirmPassword, }; //Calling the API using axios method resetPassword(data, this.state.token).then((response) => { if (response.status === 200) { this.setState({ message: "Password reset Successfully", }); } else { this.setState({ message: "Password is Not changed", snackbarmsg: " Make Sure that password & confirmPassword is correct", snackbaropen: true, }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onResetClicked() {\n let event = new Event(\"resetClicked\", this.passwordField.value);\n this.notifyAll(event);\n}", "function resetPassword(e) {\n e.preventDefault();\n\n axios\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\n security: questions,\n newPW: password,\n })\n .then((res) => {\n localStorage.setItem(\"token\", res.data);\n alert(\"Your password has been changed! Logging you in...\");\n router.push(\"/\");\n })\n .catch(() => {\n alert(\n \"Could not reset password! You likely had the wrong answers to the security questions\"\n );\n });\n }", "function resetPassword() {\r\n \tconsole.log(\"Inside reset password\");\r\n \t//self.user.userpassword = self.user.password;\r\n \tself.user.user_id = $(\"#id\").val();\r\n \tself.user.obsolete = $(\"#link\").val();\r\n \tdelete self.user.confpassword;\r\n \tUserService.changePassword(self.user)\r\n \t\t.then(\r\n \t\t\t\tfunction (response) {\r\n \t\t\t\t\tif(response.status == 200) {\r\n \t\t\t\t\t\tself.message = \"Password changed successfully..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.success');\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\twindow.setTimeout( function(){\r\n \t\t\t\t\t\t\twindow.location.replace('/Conti/login');\r\n \t\t\t\t \t}, 5000);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tself.message = \"Password is not changed..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.failure');\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t},\r\n \t\t\t\tfunction (errResponse) {\r\n \t\t\t\t\tconsole.log(errResponse);\r\n \t\t\t\t}\r\n \t\t\t);\r\n }", "passwordReset() {\n Actions.passwordReset();\n }", "function resetPassword() {\n\t\t\tif (vm.newPassword != \"\" && vm.newPassword == vm.confirmPassword) {\n\t\t\t\tvm.waiting = true;\n\t\t\t\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\n\t\t\t\t\tvm.success = 1;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t}, function(res) {\n\t\t\t\t\tvm.success = 0;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgui.alertError(\"Passwords do not match.\");\n\t\t\t}\n\t\t}", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "function changePasswordHandler(response) {\n messageData = JSON.parse(response);\n if (messageData.success) \n\tdocument.getElementById(\"changePasswordForm\").reset();\n}", "function onReset() {\n\tdocument.getElementById('username').value = \"\";\n\tdocument.getElementById('password').value = \"\";\n\tdocument.getElementById('email').value = \"\";\n\tdocument.getElementById('result').innerHTML = \"\";\n\tflagUsername = false;\n\tflagPassword = false;\n\tflagEmail = false;\n}", "async resetPassword({ view, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeResetPassword',\n header_msg: antl.formatMessage('main.change_password'),\n button_msg: antl.formatMessage('main.change_password'),\n })\n }", "function reset() { \n passwordLength = 0;\n specialCharacters = false;\n numbers = false;\n uppercase = false;\n lowercase = false;\n validInput = false;\n }", "function initReset() {\n\tnew JsNameFilter(\"userId\", \"nameInput\", window['g_basePath']);\n\t\n\tif ($(\"successM\").value != '') {\n\t\tMsgBox.message('重置密码成功');\n\t}\n\t\n\t$(\"successM\").value = '';\n\taddCustomCheck('reNewPW', getMessage('js.com.warning.0012'), 'mustsame', function(value) {\n\t\tif (value != $F('newPW')) return false;\n\t\treturn true;\n\t});\n}", "function reset(email, password, handler) {\n redis.del(email)\n users.update({\n password: bcrypt.hashSync(password, 10)\n }, {\n where: {\n email: email\n }\n }).then(function () {\n handler()\n })\n}", "function reset() {\n password = \"\";\n charactersToUse = \"\";\n lengthofPW = 0;\n\n\n\n}", "function reset() {\n keyDownEvents = [];\n keyUpEvents = [];\n passwordField.value = '';\n enterKeyTriggered = false;\n }", "function resetPassword(token) {\n const password = document.getElementsByName(\"reset-password\").item(0).value;\n if (password === \"\") {\n alert(\"The new password is empty\");\n return;\n }\n xhttp(\"POST\", \"reset.php\", { token: token, password: password }, (response) => {\n if (!response) {\n alert(\"The password couldn't be updated\");\n } else {\n alert(\"The new password was correctly set\");\n }\n quepasapp();\n });\n}", "resetPassword({ Meteor, Store, Bert }, data) {\n const { token, password } = data;\n const { dispatch } = Store;\n\n // Change state to password reset request\n dispatch(resetPasswordRequest());\n\n // Call reset password procedure\n Accounts.resetPassword(token, password, (error) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n // Change state to password reset error\n dispatch(resetPasswordError());\n } else {\n Bert.alert('Password reset!', 'success');\n // Change state to successful password reset\n dispatch(resetPasswordSuccess(Meteor.user()));\n\n // Redirect to home screen\n browserHistory.push('/');\n }\n });\n }", "function resetPassword() {\n password = randomnum();\n}", "function ChangePassword() {\n\t}", "onupdatePassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function resetChangePass(massage = \"\") {\n $(\"#successMassage\").html(massage);\n $(\"#verifyMassage\").html(\"\");\n $(\"#confirmMassage\").html(\"\");\n $('#currentPassword').val(\"\");\n $('#newPassword').val(\"\");\n $('#confirmPassword').val(\"\");\n}", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function resetPassword(){\n\t\tfirebase.auth().onAuthStateChanged(function(user) {\n\t if (user) {\n\t\tuser = firebase.auth().currentUser;\n\t\temail=user.email\n\t\t\t// alert(\"trying password reseet\");\n\t\tfirebase.auth().sendPasswordResetEmail(email).then(function() {\n\t\t // Password reset email sent.\n\t\t alert(\"email sent to: \"+email);\n\t\t})\n\t\t.catch(function(error) {\n\t\t // Error occurred. Inspect error.code.\n\t\t alert(\"error could not send email\");\n\t\t});\n\t }\n\t});\n}", "resetUserPassword() {\n this.security.resetUserPassword(this.passwordDetails, '/api/auth/reset/' + this.$stateParams.token)\n .then((response) => {\n this.passwordDetails = null;\n this.toastr.success(\"Your password was reset successfully.\");\n // Attach user profile\n this.authentication.user = response;\n // And redirect to the index page\n this.$state.go('home');\n })\n .catch((response) => {\n this.toastr.error(response.message.message, 'Error');\n });\n }", "function resetPassword(user, $event) {\n vm.working = true;\n authService.$resetPassword(user)\n .then(function (auth) {\n $mdToast.showSimple('Password reset. Check your email for login instructions.');\n })\n .catch(function (error) {\n $mdToast.showSimple(error.message || 'Error: Please try again.');\n })\n .finally(function () {\n vm.working = false;\n });\n }", "function changePasswordFn(newPassword) {\n var obj = {\n id : vm.userId,\n newPassword: newPassword\n };\n\n UserService\n .resetPassword(obj)\n .then(function (res) {\n var res = res.data;\n if (res.data && res.code === \"OK\") {\n vm.passForm.newPassword = '';\n vm.passForm.confirm_password = '';\n $('#password-strength-label').text('');\n $(\"#password-strength-label\").removeClass(\"p15 btn-rounded\");\n $('.strength-meter-fill').removeAttr('data-strength');\n $scope.setFlash('s', res.message);\n }\n },\n function (err) {\n if (err.data && err.data.message) {\n $scope.setFlash('e', err.data.message);\n }\n })\n }", "function postResetPassword() {\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\n if (validatePasswords !== true) {\n setSubmitResult(validatePasswords);\n setIsError(true);\n return;\n }\n setIsLoading(true);\n setIsError(false);\n axios.post(process.env.REACT_APP_API_LINK + \"/password/reset\", {\n \"email\": data.email,\n token,\n password\n }).then(result => {\n setIsLoading(false);\n if (result.status === 200) {\n setIsSuccess(true);\n data.onCloseModal();\n alert(\"Password Reset Successful!\")\n } else {\n setSubmitResult(\"An error has occurred, please contact an administrator.\")\n setIsError(true);\n }\n }).catch(e => {\n setIsLoading(false);\n setSubmitResult(e.response.data.error);\n setIsError(true);\n });\n }", "function restorePassword(form, email) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar auth = firebase.auth();\n\t\n\tauth.sendPasswordResetEmail(emailValue).then(function() {\n\t\t\tform.unbind().submit();\n\t\t}, function(error) {\n\t\t\t// console.log(error);\n\t\t\taddHidden(form, 'error', error.code);\n\t form.unbind().submit();\n\t\t});\n}", "passwordHandler () {\n this.password.errors = false;\n this.passwordImmediately();\n\n clearTimeout(this.password.timer);\n /* We are creating a new property named timer on the username property. But we want to reset this timer after each\n * keystroke.\n * Remember: What is difference between calling a method with () and without () in setTimeout() or any where else?\n * */\n this.password.timer = setTimeout( () => {\n this.passwordAfterDelay();\n }, 800);\n }", "changePassword(event) {\n var newState = this.mergeWithCurrentState({\n password: event.target.value\n });\n\n this.emitChange(newState);\n }", "_sendPasswordReset(user, password) {\n return this.mailer.reset({email: user.email, password: password})\n }", "handleReset() {\n\n }", "async resetPassword({auth,request,response}){\n try{\n // let password = await Hash.make(request.body.newPassword);\n let userDetails=await User.find(request.body.id);\n if(request.body.token && userDetails.passwordToken == request.body.token){\n userDetails.password = request.body.newPassword;\n userDetails.passwordToken = null;\n await userDetails.save();\n return _RL.apiResponseOk(response,Antl.formatMessage('messages.passwordReset'));\n }\n else{\n return _RL.unauthorized(response,Antl.formatMessage('messages.unauthorized'));\n } \n }\n catch(e){\n console.log(e)\n return _RL.unauthorized(response,Antl.formatMessage('messages.unauthorized'));\n } \n }", "resetPassword(event) {\n var email = this.state.email;\n firebase.auth().sendPasswordResetEmail(email).then(() => {\n this.setState({ success: true })\n }).catch((error) => {\n this.setState({ success: false })\n alert(error.message);\n });\n }", "function resetPassword(email){\n $.ajax({\n method: 'POST',\n url: \"inc/Auth/forget.php\",\n data: {email: email}\n }).done(function(msg){\n if(msg == 'user issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-exist').removeClass('novisible');\n displayError([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n if(msg == 'confirm issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-confirm').removeClass('novisible');\n displaySpecial([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n //ce msg est un retour de la fonction de mail et non de la fonction de reset\n if(msg == 'success')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.valid-forgot').removeClass('novisible');\n displaySuccess([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n });\n}", "function reset() {\n // Flag it to prevent double clicking, and visually communicate\n if ($scope.isSubmitting) {\n return;\n }\n\n $scope.isSubmitting = true;\n\n // Lets try to reset their password\n visitorApiService.resetPassword({\n key: $scope.key,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n // Unlock the submit button\n $scope.isSubmitting = false;\n\n if (response.error === null) {\n return response.result; // email\n } else {\n // Most common error is an expired key\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n })\n .then(function(email) {\n\n // Log them in now\n return visitorApiService.login({\n email: email,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n if (response.error !== null) {\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n });\n })\n .then(function() {\n // Request customer info\n return visitorLoginService.isLoggedIn(true);\n })\n .then(function() {\n // Get their cart info\n cartService.reload();\n })\n .then(function() {\n // Redirect them to their last page\n var path = angular.module(\"visitorModule\").back.path || '/account';\n $location.path(path);\n });\n\n }", "function handlePasswordReset(req, res) {\n csrf.verify(req);\n\n if (!verifyReferrer(req, '/account/passwordreset')) {\n res.status(403).send('Mismatched referrer');\n return;\n }\n\n var name = req.body.name,\n email = req.body.email;\n\n if (typeof name !== \"string\" || typeof email !== \"string\") {\n res.send(400);\n return;\n }\n\n if (!$util.isValidUserName(name)) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Invalid username '\" + name + \"'\"\n });\n return;\n }\n\n db.users.getEmail(name, function (err, actualEmail) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n if (actualEmail === '') {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: `Username ${name} cannot be recovered because it ` +\n \"doesn't have an email address associated with it.\"\n });\n return;\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Provided email does not match the email address on record for \" + name\n });\n return;\n }\n\n crypto.randomBytes(20, (err, bytes) => {\n if (err) {\n LOGGER.error(\n 'Could not generate random bytes for password reset: %s',\n err.stack\n );\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Internal error when generating password reset\"\n });\n return;\n }\n\n var hash = bytes.toString('hex');\n // 24-hour expiration\n var expire = Date.now() + 86400000;\n var ip = req.realIP;\n\n db.addPasswordReset({\n ip: ip,\n name: name,\n email: actualEmail,\n hash: hash,\n expire: expire\n }, function (err, _dbres) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n Logger.eventlog.log(\"[account] \" + ip + \" requested password recovery for \" +\n name + \" <\" + email + \">\");\n\n if (!emailConfig.getPasswordReset().isEnabled()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"This server does not have mail support enabled. Please \" +\n \"contact an administrator for assistance.\"\n });\n return;\n }\n\n const baseUrl = `${req.realProtocol}://${req.header(\"host\")}`;\n\n emailController.sendPasswordReset({\n username: name,\n address: email,\n url: `${baseUrl}/account/passwordrecover/${hash}`\n }).then(_result => {\n sendPug(res, \"account-passwordreset\", {\n reset: true,\n resetEmail: email,\n resetErr: false\n });\n }).catch(error => {\n LOGGER.error(\"Sending password reset email failed: %s\", error);\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Sending reset email failed. Please contact an \" +\n \"administrator for assistance.\"\n });\n });\n });\n });\n });\n}", "function managePasswordForgotten() {\n\t$('#passwordReset').click(function() { \n\t\t// We must reset the document and send a link to the registered email\n\t\t// to a form where the end user can update the password\n\t\tclearDocument();\n\t\tloadHTML(\"navbar.html\");\n\t\tnavbarHover();\n\t\t$(document.body).append(\"<center><h1>Please fill in the following form !</h1><center>\");\n\t\tloadHTML(\"passwordForgotten.html\");\n\t\tloadJS(\"js/forms.js\");\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\n loadHTML(\"footer.html\");\n\t});\n}", "resetPassword(token, data) {\n return this.post(`reset/password/${token}`, data);\n }", "function handleAdminPasswordChange(event){\n setAdminPassword(event.target.value);\n }", "function clearPasswordField(){\n var passwdField = Ext.getCmp('passwordid');\n if(passwdField){\n passwdField.reset();\n } \n}", "onClearInput() {\n console.log('Password clear input');\n this.sellerPasswordInput = '';\n }", "function resetPassword(req, res) {\n res.render(\"resetPassword\");\n}", "resetPassword(){\n firebase.auth().sendPasswordResetEmail(this.passwordChangeEmail)\n .then(() => alert(\"Password reset email sent\"))\n .catch((error) => this.setState({error:error.message}))\n }", "function handlePasswordResetPage(req, res) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: false\n });\n}", "resetPasswordInit(email) {\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\n }", "function fnReset()\n{\n\tdocument.getElementById(\"txtpwd\") = \"\";\n\tdocument.getElementById(\"txtemail\") = \"\";\n}", "function onPasswordSet() {\n // Back to main form\n hide(pwSetForm);\n show(mainForm);\n\n // Password was just set, so generate right away if\n // site is filled in.\n if (mainForm.siteHost.value) {\n generatePassword();\n } else {\n // If the site has not been filled in, focus it.\n mainForm.siteHost.focus();\n }\n }", "postresetpassword(emailResetPassword) {\n return apiClientEmail.post('/password/reset', {\n email: emailResetPassword,\n })\n }", "function resetUserPassword(req, res, next){\n /*\n * NOTE: parseValidateToken Must be called before this function in the\n * router in order to confirm that the token is valid.\n */\n User.findOne({\n _id: req.token.userID,\n email: req.token.userEmail\n }, function(err, user){\n // If an error occured with finding a user or the user is not verified\n if (req.token.type !== 'reset' || err || !user.isVerified){\n return res.status(500).send(\n utils.errorResponse('ER_SERVER', err)\n );\n }\n // Update the userr's password\n user.password = req.body.password;\n user.save(function(err){\n // If an error occured with saving the user\n if (err){\n return res.status(500).send(\n utils.errorResponse('ER_SERVER', err)\n );\n }\n return res.sendStatus(200);\n });\n });\n}", "function resetPass() {\n $('form#reset-pass').submit(function(e) {\n e.preventDefault()\n e.stopImmediatePropagation();\n var newPass = $('#user-reset-pass');\n var newPassAgain = $('#user-reset-pass-again');\n if (newPass.val() === newPassAgain.val()) {\n $.ajax({\n url: \"process/ajaxHandler.php\",\n method: \"POST\",\n dataType: \"JSON\",\n data: {\n action: \"resetPassword\",\n userNewPass: newPass.val()\n },\n success: function(response) {\n if (response.status == \"success\") {\n $('div#container').remove();\n $('body').append(\"<h3 class='successfully-change-pass-msg'>Your password successfully changed</h3>\");\n setTimeout(function() { window.location.replace(response.redirectAddress) }, 2000);\n } else if (response.status == \"error\") {\n alert(response.description)\n }\n }\n })\n } else {\n alert('password not match.')\n }\n })\n}", "function addEventHandlerForgotPasswordButton() {\n\td3.select(\"#forgot-password-button\").on(\"click\", function() {\n\t\td3.event.preventDefault();\n\t\tvar emailElement = d3.select(\"input[name=email]\");\n\t\tvar email = emailElement.property(\"value\");\n\t\tif(tp.util.isEmpty(email) || !validEmail(email)) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-reset-email-invalid\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\temailElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\t\tvar confirmDispatcher = tp.dialogs.showDialog(\"confirmDialog\", tp.lang.getFormattedText(\"password-reset-confirm\", email))\n\t\t\t.on(\"ok\", function() {\n\t\t\t\ttp.session.sendPasswordReset(email, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.error(error, data);\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"errorDialog\", \"#password-reset-failed\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Handle successful send passwors reset\n\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"messageDialog\", \"#password-reset-successful\");\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t})\n\t\t;\n\t});\n}", "function reset(e){\n \n}", "onnoPassword() {\n this.passwordValidationState = 'has-error';\n toastr.error(this.noPasswordMessage);\n this.noPasswordMessage = 'Please enter a password';\n }", "function clear_pwd_chng(){ $('#form_chng_pwd')[0].reset(); $(\"#chng_new_pwd\").val(''); $(\"#chng_new_pwd2\").val(''); $(\"#chng_old_pwd\").val(''); }", "function postResetPassword(data, textStatus, jqXHR, param) {\n\tvar user = param.user;\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar p = $('<p>');\n\tuiDiv.append(p);\n\tp.html('The password for \"' + user + '\" has been reset.');\n\tvar ul = $('<ul>');\n\tuiDiv.append(ul);\n\tvar li = $('<li>');\n\tul.append(li);\n\tli.html('New password: \"' + data[user] + '\"');\n}", "function resetpwRoute() {\n return \"/resetpw?username=\" + encodeURIComponent(user.username) + \"&schoolCode=\" + req.body.schoolCode + \"&school=\" + (user.school ? encodeURIComponent(user.school.name) : \"none\");\n }", "function resetLoginAndPassword() {\n\tsettings.set('User', {\n\t\t'SerialNo': 'null',\n\t\t'CtlUrl': 'null',\n\t\t'Mail': 'null',\n\t\t'Nick': 'null'\n\t});\n}", "resetPassword(actionCode, newPassword) {\n var accountEmail;\n let thisComponent = this;\n // Verify the password reset code is valid.\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\n var accountEmail = email;\n \n // TODO: Show the reset screen with the user's email and ask the user for\n // the new password.\n \n // Save the new password.\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\n // Password reset has been confirmed and new password updated.\n \n // TODO: Display a link back to the app, or sign-in the user directly\n // if the page belongs to the same domain as the app:\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\n \n // TODO: If a continue URL is available, display a button which on\n // click redirects the user back to the app via continueUrl with\n // additional state determined from that URL's parameters.\n }).catch(function(error) {\n // Error occurred during confirmation. The code might have expired or the\n // password is too weak.\n });\n }).catch(function(error) {\n // Invalid or expired action code. Ask user to try to reset the password\n // again.\n }).then(function() {\n thisComponent.props.history.push('/signin'); // redirect to home page\n });\n }", "function printResetPassword(token) {\n const main = document.getElementById(\"main\");\n main.innerHTML = `<div class=\"resetpage\">\n <div class=\"reset\">\n <h2>Reset password</h2>\n <form id=\"reset\">\n <label for=\"reset-password\">New password</label>\n <input type=\"password\" name=\"reset-password\" required>\n <br>\n <input type=\"submit\" value=\"Reset password\">\n </form>\n </div>\n </div>`;\n // when the user submits the form we call the function resetPassword()\n document.getElementById(\"reset\").addEventListener('submit', function(e) {\n e.preventDefault();\n resetPassword(token);\n })\n}", "function resetOrderEvent(event) {\n $(\"#confirmPasswordPopup\").modal('show');\n}", "function change_pass(event) {\r\n $('#old_pass').val($('#old_pass').val().replace(/\\s/g, ''));\r\n $('#new_pass').val($('#new_pass').val().replace(/\\s/g, ''));\r\n $('#cnf_pass').val($('#cnf_pass').val().replace(/\\s/g, ''));\r\n if ($(\"#old_pass\").val() != \"\") {\r\n $(\"#old_pass_error\").removeClass(\"has-error\");\r\n $(\"#old_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#new_pass\").val() != \"\") {\r\n $(\"#new_pass_error\").removeClass(\"has-error\");\r\n $(\"#new_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#cnf_pass\").val() != \"\") {\r\n $(\"#cnf_pass_error\").removeClass(\"has-error\");\r\n $(\"#cnf_pass_msg\").text(\"\");\r\n }\r\n $(\"#changeAfterSuccessMsg\").text(\"\");\r\n if (event.which == 13) {\r\n $('#change_pass_btn').click();\r\n return false;\r\n }\r\n}//change password end", "formResetCallback() {\n this.value = this.getAttribute('value') || '';\n this.onInput();\n }", "resetPass(e) {\n e.preventDefault();\n\n const dataResetPass = {\n email: this.state.secondEmail,\n token: this.state.token,\n password: this.state.newpass\n };\n\n if(dataResetPass.email && dataResetPass.token && dataResetPass.password \n && this.state.confNewPass !== ''){\n\n if(dataResetPass.email === this.state.firstEmail) {\n\n if(dataResetPass.password.match(/[a-zA-Z]/) \n && dataResetPass.password.match(/[!@#$%*()_+^&{}}:;?.]/) \n && dataResetPass.password.match(/[0-9]/) !== null && dataResetPass.password.length >= 6) {\n\n if(dataResetPass.password === this.state.confNewPass) {\n\n axios.post('http://localhost:7000/auth/reset_password', dataResetPass)\n .then(response => {\n if (response.data['validToken'] == false || response.data['validExpToken'] == false ){\n alert(\"Token Inválido\");\n }\n else{\n alert(\"Senha alterada com sucesso\");\n\n this.setState({\n firstEmail: '',\n secondEmail: '',\n token: '',\n password: ''\n });\n\n this.setState(state => ({\n activeStep: state.activeStep + 1,\n }));\n }\n });\n\n } else alert(\"Senhas não conferem. Por favor, verifique.\"); \n\n } else alert(\"Sua senha deve conter 6 caracteres, entre eles letra, número e caracter especial\")\n\n } else alert(\"Emails não conferem. Por favor, verifique.\"); \n\n } else alert('Por favor, preencha todos os campos.');\n\n }", "function change_password( formName, passData ){\n\t\t$(formName).on('submit', function(e){\n\t\t\te.preventDefault();\n\t\t\tvar newPassword = $(passData).val();\n\t\t\tvar url = $(formName).attr('action');\n\t\t\t//alert(newPassword + ', ' + url);\n\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: url,\n\t\t\t\tdata: { newPassword:newPassword },\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\t$(formName)[0].reset();\n\t\t\t\t\twindow.location = 'logout.php';\n\t\t\t\t},\n\t\t\t\terror: function(data){\n\t\t\t\t\tconsole.log('Error during the sending data...');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function resetpass() {\n\n var email = document.getElementById(\"resetpass\").value;\n\n $.post('server/resetpassword.php', { user_email: email }, function(data, status) {\n var json_data = JSON.parse(data)\n\n if (json_data.status == 1) {\n if (json_data.email_sent == 1) {\n $(document).Toasts('create', {\n class: 'bg-success',\n title: 'Succes!',\n subtitle: '',\n body: 'Instructiunile pentru resetarea parolei au fost trimise la adresa de email introdusa!'\n });\n } else if (json_data.registered_email == 0) {\n $(document).Toasts('create', {\n class: 'bg-warning',\n title: 'Atentie!',\n subtitle: '',\n body: 'Adresa de email introdusa nu este asociata unui cont!'\n });\n }\n } else {\n $(document).Toasts('create', {\n class: 'bg-danger',\n title: 'Eroare!',\n subtitle: '',\n body: 'A aparut o eroare, va rugam reincercati!'\n });\n }\n })\n}", "function forgetPassword(req, res) {\n res.render(\"forgetPassword\");\n}", "function resetPass() {\n howMany = (0);\n choices = [];\n newPass = (\"\");\n password = (\"\");\n}", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "handleReset() {\n this.setState({username: '', text: ''});\n resetForm();\n }", "function confirmPasswordReset (e) {\n e.preventDefault();\n showConfirmation(\"Are you sure you want to reset your password?\").then(function (confirmed) {\n if (confirmed) {\n sendResetPasswordEmail().then(function () {\n $(e.target).parent().html('Password Reset Email Sent.');\n });\n }\n }).catch(function (error) {\n showError(\"Response Error\", error);\n });\n}", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n this.isValidPassword(text);\n }", "function resetpassword()\n{\n\t$(\"#chkmsg\").html(\"\");\n\tvar email = $(\"#email\").val();\n\tconsole.log(email);\n\tvar password = $(\"#password\").val();\n\tvar pass = $(\"#pass\").val();\n\tif ( (password.length >= 8) && (pass.length >= 8) && (pass=password) )\n\t{\n\t\t$(\"#sub_btn\").attr(\"disabled\",\"disabled\").val('提交中..').css(\"cursor\",\"default\");\n\n\t\t$.ajax({\n\t\t\turl: \"../cgi/resetpwd.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: 'text',\n\t\t\tdata: {\n\t\t\t\t\"email\": email,\n\t\t\t\t\"password\": password,\n\t\t\t\t\"pass\": pass\n\t\t\t},\n\t\t\tsuccess: function(data){\n\t\t\t\tconsole.log(data)\n\t\t\t\tvar obj = eval('(' + data + ')')\n\t\t\t\tif (obj.error == \"none\")\n\t\t\t\t{\n\t\t\t\t\t$(\"#chkmsg\").html(obj.args.list);\n\t\t\t\t\t// $(\"#sub_btn\").removeAttr(\"disabled\").val('已提交').css(\"cursor\",\"pointer\");\n\t\t\t\t\t$(\"#sub_btn\").attr(\"disabled\",\"disabled\").val('已提交').css(\"cursor\",\"default\");\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tserverError(obj)\n\t\t\t}\n\t\t})\n\t}\n\telse\n\t{\n\t\tif ( password.length<8 )\n\t\t{\n\t\t\t$(\"#chkmsg\").html(\"新密码的长度必须大于或等于8位\");\n\t\t}\n\t\telse if ( pass != password )\n\t\t{\n\t\t\t$(\"#chkmsg\").html(\"两次输入的密码不相同\");\n\t\t}\n\t}\n}", "passwordreset(email) {\r\n return this.auth\r\n .sendPasswordResetEmail(email)\r\n .then(function () {\r\n alert(\"Email Sent!\");\r\n })\r\n .catch(function (error) {\r\n alert(\"An error occured. Please try again\");\r\n });\r\n }", "async function doneTyping() {\n let pwdErrorMsg = document.getElementById(\"pwdError\");\n\n let oldPassword = $('#oldPassword').val();\n let newpw = $('#newPassword').val();\n let cfmpw = $('#cfmNewPassword').val();\n let requestParameters = \"user_id=\" + userID + \"&password=\" + oldPassword + \"&checkOnly=1\";\n let response = await makeRequestxwwwFormURLEncode(hostname + \"/users/update/password\", \"POST\", requestParameters);\n\n response = JSON.parse(response)['response'];\n console.log(response)\n if(response == \"Valid Password\"){\n pwdErrorMsg.innerText = \"\";\n isOldPasswordValid = true;\n\n // If both fields are empty means user only entered oldpassword so far so no need to CheckPwd()\n if(newpw == \"\" && cfmpw == \"\"){\n document.getElementById(\"resetPassword\").disabled = true;\n return;\n }\n //Check if both passwords match again\n CheckPwd();\n if(isOldPasswordValid && isBothPasswordsSame){\n document.getElementById(\"resetPassword\").disabled = false;\n // checkForOldNewPasswordSame();\n \n }\n return;\n }\n\n pwdErrorMsg.style.color = \"red\";\n pwdErrorMsg.innerText = \"\";\n document.getElementById(\"resetSucess\").innerText = \"\";\n pwdErrorMsg.innerText = response;\n document.getElementById(\"resetPassword\").disabled = true;\n isOldPasswordValid = false;\n \n}", "function reset(inputs){\n\tlet ret = inputs.map(e => {\n e.value = \"\";\n if(e.id == \"Password\"){\n e.type = \"password\";\n }\n\t});\n}", "function PasswordSet()\n{\t\n\tif (window.event.keyCode == 13)\n\t{\n\t\t//\n\t\t// Decrypt the RCTicket\n\t\t//\n\t\tDecryptRCTicket();\n\t}\n\treturn;\n}", "_resetHandler() {\n const that = this;\n if (that.resetButton) {\n that.resetButton.remove();\n }\n that.appearanceTextBox.value = that.appearanceTextBox.dataset.defaultValue;\n that.appearanceTextBox.addEventListener('keydown', () => that._showResetButton(), { 'once': true });\n }", "function setPassword() {\n postPassword(\n success = function () {\n console.log('Password set');\n setPermissions();\n },\n error = null,\n email,\n password);\n }", "function passwordOnChange() {\n const pattern = \"^[a-zA-Z0-9_-]{6,20}$\";\n validate(this, pattern);\n}", "async storeResetPassword({ request, antl, session, response }) {\n const data = request.only(['token', 'key', 'password'])\n\n const user = await User.findBy('token', data.token)\n\n if (user === null || !user.activated || !(await User.validateHash(data.key, user.password_reset_hash))) {\n session.flash({error: antl.formatMessage('main.bad_activation_url') })\n return response.redirect('back')\n }\n\n let diff = (new Date()) - Date.parse(user.password_reset_time);\n if (diff > VALID_TIME)\n {\n session.flash({error: antl.formatMessage('main.outdated_link') })\n return response.redirect('back')\n }\n\n user.password = await Hash.make(data.password)\n user.password_reset_hash = null\n // Password reset time is not set to null, so that user can not spam password reset multiple times\n await user.save()\n\n session\n .flash({ success: antl.formatMessage('main.successfull_password_change') })\n return response.redirect('/signin')\n }", "@action.bound\n onPasswordChange(event) {\n this.password = event.target.value;\n }", "function resetUserPwd(username) {\r\n\tvar userId = $(\"#userIdRP\").val();\r\n\tvar email = $(\"#emailRP\").text();\r\n\tif (userId == \"0\") {\r\n\t\t$.modal.alert(strings['script.trySearch']);\r\n\t} else {\r\n\t\t$.modal.confirm(strings['msg.rp.confirm'] + username + \"?\", function() {\r\n\t\t\tblockUI();\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"GET\",\r\n\t\t\t\turl : \"resetUserPassword.do\",\r\n\t\t\t\tdata : \"username=\" + username + \"&email=\" + email,\r\n\t\t\t\tdataType : 'json',\r\n\t\t\t\tcache : false,\r\n\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\tunblockUI();\r\n\t\t\t\t\tif (data != null && data.resetPwdFlag == \"1\") {\r\n\t\t\t\t\t\t$(\"#passwordResetStatusMsgRP\").html(\"<span>\"+strings['msg.rp.success']+\"</span>\");\r\n\t\t\t\t\t\t$(\"#statusUsernameRP\").text(username);\r\n\t\t\t\t\t\tif (data.sendEmailFlag == \"1\") {\r\n\t\t\t\t\t\t\t$(\"#statusEmailRP\").html(\"<span style=\\\"color: green\\\">\"+strings['msg.rp.email.success']+\"</span>\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$(\"#statusEmailRP\").html(\"<span style=\\\"color: red\\\">\"+strings['msg.rp.email.failure']+\"</span>\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$(\"#passwordResetStatusRP\").attr(\"class\", \"wizard-fieldset fields-list\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$(\"#passwordResetStatusRP\").attr(\"class\", \"wizard-fieldset fields-list hidden\");\r\n\t\t\t\t\t\t$.modal.alert(strings['script.parent.passwordResetError']);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$('#userSearchRP').val(username);\r\n\t\t\t\t},\r\n\t\t\t\terror : function(data) {\r\n\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t$.modal.alert(strings['script.parent.passwordResetError']);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}, function() {\r\n\t\t\t// this function closes the confirm modal on clicking cancel button\r\n\t\t});\r\n\t}\r\n}", "changePassword (callback) {\n\t\t// capture the access token given in the response, we'll use this for the \n\t\t// actual test request, which is fetch the me-object for the user with the\n\t\t// new token\n\t\tsuper.changePassword((error, response) => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.token = response.accessToken;\n\t\t\tdelete this.data; // not needed for the test request\n\t\t\tcallback();\n\t\t});\n\t}", "function ResetCard({ email, onPasswordChange, submitForm, errorCode}) {\r\n return (\r\n <Card className=\"px-5 pt-4\">\r\n <Card.Header className=\"card-header-no-border\">\r\n <h2 className=\"font-weight-bold\">Resetting Password for:</h2 >\r\n <p className=\"mb-0\">{email}</p>\r\n </Card.Header >\r\n <Card.Body className=\"px-0\">\r\n {errorCode !== '' && <h6 className=\"text-danger\">{ }</h6>}\r\n <Form onSubmit={submitForm}>\r\n <Form.Group controlId=\"password\">\r\n <Form.Control\r\n className=\"py-4\"\r\n required\r\n type=\"password\"\r\n onChange={onPasswordChange}\r\n placeholder=\"New Password\" />\r\n </Form.Group>\r\n <Row className=\"mt-2 px-0\">\r\n <Col className=\"pr-3 py-1\">\r\n <CustomButton\r\n wide\r\n type=\"submit\"\r\n className=\"drop-shadow py-2\"\r\n > \r\n Save\r\n </CustomButton>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col className=\"mt-4\">\r\n <p className=\"main-text\">Don't have an account yet? <a href=\"/\">Sign up!</a></p>\r\n </Col>\r\n </Row>\r\n </Form>\r\n </Card.Body>\r\n </Card >\r\n );\r\n}", "forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }", "function handleClickReset() {\n // makes an HTTP request to the json server that handles the login logic to check if the reset link is valid\n axios\n .get(\"https://digital-skills-json-server.herokuapp.com\" + resetLink)\n .then((response) => {\n if (response.status === 200) {\n let e = {\n currentTarget: {\n id: \"Navigated to the Reset Password screen.\"\n }\n }\n props.logClick(e, 14);\n props.changeView(\"resetPassword\");\n } else {\n console.log(\"error\");\n }\n });\n }", "passwordChange(event){\n this.setState({\n password: event.target.value,\n passwordError:''\n });\n }", "function resetPassword(){\n $('#resetPassword').dialog({\n modal: true,\n draggable: false,\n width: 'auto',\n height: 'auto',\n buttons: {\n \"Update\": function(){\n // autenticate User\n if (cognitoUser != null) {\n cognitoUser.getSession(function(err, session) {\n if (err) {\n alert(err);\n return;\n }\n });\n }\n // end autenticate user\n let = oldPassword = $('#oldPassword').val();\n let newPassword = document.getElementById(\"newPassword\").value;\n if(newPassword === document.getElementById(\"newPasswordCheck\").value){\n cognitoUser.changePassword(oldPassword, newPassword, function(err, result){\n if(err){\n alert(err)\n return;\n }\n console.log('call result: ' + result)\n $(\"#resetPassword\").dialog('close');\n })\n }\n else{\n alert(\"New Password and retyped password does not match please try again\");\n }\n },\n \"Cancel\": function(){\n $(\"#resetPassword\").dialog('close');\n }\n }\n })\n \n}", "function resetPassword(oldPW, newPW) {\n\t\tvar url = Host + \"/LoginApiAction_password.action\";\n\t\tvar params = {\n\t\t\tjsession: $localStorage.currentUser.token,\n\t\t\tuserAccount: $localStorage.currentUser.username,\n\t\t\toldPwd: oldPW,\n\t\t\tnewPwd: newPW\n\t\t};\n\n\t\treturn returnHttp(url, params);\n\t}", "onPasswordChange(text) {\n this.props.passwordChange(text);\n }", "async passwordreset({ commit, dispatch }, form) {\n form.busy = true;\n try {\n await App.post(route(\"api.auth.reset-password\"), form).then(() => {\n commit(\"isAuthenticated\", {\n isAuthenticated: vm.$auth.check()\n });\n form.busy = false;\n });\n await dispatch(\"fetchMe\");\n } catch ({ errors, message }) {\n form.errors.set(errors);\n form.busy = false;\n }\n }", "function resetForm() {\n document.getElementById(\"loginForm\").reset();\n }", "async sendResetPassword({ request, antl, session, response }) {\n let data = request.only(['email'])\n\n try {\n await Recaptcha.validate(request.input('g-recaptcha-response'))\n } catch (errorCodes) {\n session\n .withErrors([{ field: 'recaptcha', message: antl.formatMessage('main.alert_recaptcha')}])\n .flashAll()\n return response.route('UserController.requireResetPassword')\n }\n\n let user = await User.findBy('email', sanitizor.normalizeEmail(data.email))\n if (!user || !user.activated) {\n session.flash({ error: antl.formatMessage('main.user_not_activated_not_registered') })\n return response.redirect('back')\n }\n\n if (user.password_reset_time) {\n let diff = (new Date()) - Date.parse(user.password_reset_time)\n if (diff < WAIT_TIME) {\n let min = Math.ceil((WAIT_TIME - diff)/60000.0)\n session.flash({ error: antl.formatMessage('main.email_rate_limit', { remaining: min }) })\n return response.redirect('back')\n }\n }\n\n let key = User.getToken()\n user.password_reset_time = new Date()\n user.password_reset_hash = await User.Hash(key)\n await user.save()\n\n Event.fire('mail:reset_password', {user, key})\n\n session.flash({ success: antl.formatMessage('main.email_sent') })\n return response.redirect('/')\n }", "reset(req, callback) {\n User.findOne({email: req.email},(err, res)=>{\n if(err)\n callback(err);\n else\n {\n if(config.token == req.token) {\n User.updateOne({email: res.email}, {password: this.hash(req.password)}, (err,info) => {\n if(err)\n callback(err);\n else\n callback(null, res);\n })\n }\n }\n })\n }", "function ResetPasswordModal(props) {\n\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n\n\n function clearForm() {\n setPassword(\"\");\n setConfirmPassword(\"\");\n }\n\n // call the callback function if the enter key was pressed in the event\n function callOnEnter(event, callback) {\n if(event.key === 'Enter') {\n callback();\n }\n }\n\n function onHide() {\n clearForm();\n props.onHide();\n }\n\n function onConfirm() {\n clearForm()\n props.onConfirm(password);\n }\n\n const passwordReady = password === confirmPassword && password !== '';\n\n return (\n\n <Modal show={props.show} onHide={onHide} >\n <Modal.Header closeButton>\n <Modal.Title>Reset Password</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Alert variant=\"warning\">\n This resets the password immediately. Use with Caution!\n </Alert>\n <div className=\"mb-3\">\n <label htmlFor=\"password\" className=\"form-label\"> New Password</label>\n <input type=\"password\" className=\"form-control\" id=\"password\" placeholder=\"Password\"\n value={password}\n onChange={e => setPassword(e.target.value)} />\n </div>\n <div className=\"mb-3\">\n <label htmlFor=\"confirmPassword\" className=\"form-label\">Confirm Password</label>\n <input type=\"password\" className=\"form-control\" id=\"confirmPassword\" placeholder=\"Confirm Password\"\n value={confirmPassword}\n onChange={e => setConfirmPassword(e.target.value)}\n onKeyPress={e => callOnEnter(e, onConfirm) }/>\n </div>\n </Modal.Body>\n <Modal.Footer>\n <Button variant=\"secondary\" onClick={onHide}>Close</Button>\n <Button variant=\"warning\" onClick={onConfirm} disabled={!passwordReady}>Save</Button>\n </Modal.Footer>\n </Modal>\n\n );\n}", "function ajaxCallForResettingPassword(resetEmail,resetPassword){\n // console.log(\"in resetPassword \",resetEmail,resetPassword);\n var data = {};\n data.resetEmail = resetEmail;\n data.resetPassword = resetPassword;\n\n $.ajax({\n url:\"/users/resetPassword\",\n type: 'POST',\n async: true,\n data: JSON.stringify(data),\n contentType: 'application/json',\n context: this,\n cache: false,\n processData: false,\n success: function(response) {\n console.log('Reset password succesfully',response);\n location.reload();\n },\n error: function(response) {\n console.log('Error with reset password ' + response.statusText);\n console.log(\"error page\");\n }\n });\n }", "resetPassword(id, data) {\n return axios\n .put(this.apiUrl() + `/users/${id}/password_reset/`, data, {\n headers: this.authHeader(),\n })\n }", "handleKeyDownPassword(e) {\n\t if(e.nativeEvent.key == \"Enter\"){\n\t this.searchAction(this.state.passwordValue);\n\t this.passwordTxt._root.clear();\n\t }\n\t}", "async reset({ request, params, response }) {\n /*** get the user update inputs */\n let { password } = request.only([\"password\"]);\n\n /** get the target user */\n try {\n const user = await User.query().where(\"id\", params.id).first();\n if (!user) {\n return response.status(404).send({\n message: \"not found\",\n });\n }\n /** update the user details */\n user.email = password;\n await user.save();\n\n return response.status(200).send({\n message: \"password updated\",\n });\n } catch (error) {\n return response.status(404).send({\n message: \"fail\",\n error: error,\n });\n }\n }", "function checkResetPassword(token) {\n xhttp(\"POST\", \"valid-reset-token.php\", { token: token }, (response) => {\n // clear the request\n request.delete(\"forgot\");\n if (!response) {\n // if the token is not valid\n alert(\"That token is invalid. If you need to reset your password, please insert your mail again for recovery\");\n // start again\n quepasapp();\n } else {\n // if the token is valid\n printResetPassword(token);\n }\n });\n}" ]
[ "0.7635913", "0.7550288", "0.7385838", "0.71022207", "0.6977799", "0.6921072", "0.6905678", "0.689869", "0.688927", "0.6833997", "0.68336475", "0.6820165", "0.68005306", "0.67034423", "0.6696703", "0.6637141", "0.66166055", "0.6589568", "0.6585242", "0.65844136", "0.65661967", "0.65337795", "0.6523409", "0.6490403", "0.6451847", "0.6433302", "0.6421087", "0.6410547", "0.6409826", "0.63950765", "0.6378892", "0.63693374", "0.63678104", "0.636112", "0.63467014", "0.6345848", "0.6342697", "0.6342574", "0.633936", "0.6332957", "0.6331388", "0.63147515", "0.6304108", "0.6297902", "0.62809926", "0.62570596", "0.62566787", "0.6225701", "0.6225656", "0.62034386", "0.6198593", "0.6165479", "0.6148523", "0.6148193", "0.6134215", "0.61056894", "0.61033183", "0.61024004", "0.6092073", "0.60914004", "0.608865", "0.6085269", "0.6076571", "0.6070992", "0.60687965", "0.6062843", "0.6039645", "0.6027751", "0.6025084", "0.60205925", "0.60194314", "0.6017632", "0.6014575", "0.6004899", "0.5987549", "0.59651923", "0.59639114", "0.5958126", "0.59477115", "0.5943558", "0.5928127", "0.5928122", "0.5925682", "0.5924831", "0.591928", "0.5912371", "0.5906481", "0.5906055", "0.59017307", "0.59010756", "0.5899155", "0.5894191", "0.5894008", "0.5889602", "0.5884757", "0.58815295", "0.5879705", "0.58796537", "0.58791864", "0.58755547" ]
0.60963684
58
setState for confirm password field
onChangeConfirmPassword(event) { if (event.target.value.length > 2) { this.setState({ helperText: "", error: false, confirmPassword: event.target.value, }); } else { this.setState({ helperText: "Invalid format", error: true, confirmPassword: event.target.value, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleChangeConfirmPassword(e) {\n this.setState({ confirmPassword: e.target.value });\n }", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "setConfirmPassword(newConfirmPassword) {\n this.setState({confirmPassword: newConfirmPassword});\n }", "passwordConfirmChanged(e) {\n this.setState({\n passwordConfirm: e.target.value\n });\n }", "updateConfirmPassword(event) {\n const newPassword = this.state.new_password;\n if (event.target.value != newPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match',\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({valid_state_new: 'success'});\n }\n this.setState({confirm_password: event.target.value});\n }", "handleConfirmPasswordChange(event) {\n const confirmedPassword = event.target.value;\n this.setState({confirmedPassword: confirmedPassword, message: this.defaultMessage});\n if (confirmedPassword === this.state.password) {\n this.setState({confirmPasswordStyle: 'register-valid'});\n } else {\n this.setState({confirmPasswordStyle: 'register-invalid'});\n }\n }", "updateNewPassword(event) {\n const confirmPassword = this.state.confirm_password;\n if (event.target.value != confirmPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match'\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({\n valid_state_new: 'success',\n error_message: '',\n });\n }\n this.setState({new_password: event.target.value});\n }", "_inputPass(password){\n this.setState({password:password})\n\n }", "passwordChange(event){\n this.setState({\n password: event.target.value,\n passwordError:''\n });\n }", "onupdatePassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "changePassword() {\n this.setState({ changePassword: !this.state.changePassword });\n }", "passwordOnChange (e) {\n this.setState({password_value: e.target.value});\n }", "passwordChanged(e) {\n this.setState({\n password: e.target.value\n });\n }", "handlePasswordChange(event) {\n const password = event.target.value;\n this.setState({password: password, message: this.defaultMessage});\n if (this.validPassword(password)) {\n this.setState({passwordStyle: 'register-valid'});\n } else {\n this.setState({passwordStyle: 'register-invalid'});\n }\n if (password === this.state.confirmedPassword) {\n this.setState({confirmPasswordStyle: 'register-valid'});\n } else {\n this.setState({confirmPasswordStyle: 'login-default'});\n }\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "typePassword(event) {\n this.setState({ password: event.target.value });\n }", "setPassword(newPassword) {\n this.setState({password: newPassword});\n }", "handleChangePassword(e) {\n this.setState({ password: e.target.value });\n }", "handleChangePassword(e) {\n this.setState({password: e.target.value});\n }", "updateCurrentPassword(event) {\n if (event.target.value === '') {\n this.setState({valid_state_current: 'error'});\n }\n else {\n this.setState({valid_state_current: 'success'});\n }\n this.setState({current_password: event.target.value});\n }", "handleChangepass(event) {\n this.setState({\n password: event.target.value,\n });\n }", "HandlePasswordChange(event) {\n\n this.setState({ Password: event.target.value });\n }", "updateInputValuePass(evt) {\n this.setState({\n password: evt.target.value\n });\n }", "handleClickShowPassword(event) {\n this.setState({\n showPassword: !this.state.showPassword\n });\n }", "passwordOnChange(event) {\n this.setState({ password: event.target.value });\n }", "handlePassInput(e) {\n this.setState({password: e.target.value});\n }", "onPasswordChange(event) {\n this.setState({\n password: event.target.value,\n });\n }", "handlePasswordChange(e) {\n\t\tthis.setState({password:e.target.value});\n\t}", "changePassword(event) {\n var newState = this.mergeWithCurrentState({\n password: event.target.value\n });\n\n this.emitChange(newState);\n }", "validerpasswordconfirmFelt(passwordconfirmVerdi) {\n var passwordconfirmValid = /^[a-zæøå 0-9]{6,}$/i;\n\t\tvar passwordconfirmValid = passwordconfirmVerdi;\n this.setState({passwordconfirmValid, passwordconfirmVerdi});\n }", "async onAcceptPassword() {\n const { currentPwdHash, setPassword, generateAlert, t } = this.props;\n const { newPassword } = this.state;\n const salt = await getSalt();\n const newPwdHash = await generatePasswordHash(newPassword, salt);\n changePassword(currentPwdHash, newPwdHash, salt)\n .then(() => {\n setPassword(newPwdHash);\n generateAlert('success', t('passwordUpdated'), t('passwordUpdatedExplanation'));\n this.props.setSetting('securitySettings');\n })\n .catch(() => generateAlert('error', t('somethingWentWrong'), t('somethingWentWrongTryAgain')));\n }", "_handleTogglePassword() {\n const {password} = this.state;\n this.setState({\n password: {\n open: !password.open\n }\n });\n }", "passwordChange(event) {\n\t\tevent.preventDefault();\n\t\tvar flag = (event.target.value.length >= 6);\n\t\tthis.setState({\n\t\t\tpwFilled: true,\n\t\t\tpwOk: flag,\n\t\t\tpassword: event.target.value\n\t\t})\n\t}", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n this.isValidPassword(text);\n }", "handleChangePassword(event) {\n\t\tthis.setState({\n\t\t\tpassword: event.target.value,\n\t\t});\n\t}", "togglePassword() { this.setState({ isShow: !this.state.isShow }) }", "handlePasswordFieldChange(e) {\n this.setState({\n password: e.target.value\n });\n}", "handlePasswordChange(event) {\n this.setState({password: event.target.value});\n event.preventDefault();\n }", "handlePasswordChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ password: processedData })\n }", "validate(t) {\n t.preventDefault();\n\n if (this.state.entered === this.state.password) {\n return this.setState({ open: false });\n } else {\n return this.setState({ error: \"Password Required\" });\n }\n }", "passwordFieldInputed(e) {\n let passwordValue = e.currentTarget.value;\n let passwordError = $(\"#password-error\");\n let errors = this.state.errors;\n if (passwordValue === \"\") {\n passwordError.css(\"display\", \"flex\").show();\n errors.password = \"Password field can't be empty.\";\n this.setState({errors});\n } else {\n passwordError.hide();\n errors.password = \"\";\n this.setState({errors});\n }\n }", "validatePassword() {\n if (this.state.password.length < 5) {\n this.setState({\n validPassword: false\n });\n }\n else {\n this.setState({\n validPassword: true\n });\n this.submitRequest();\n }\n }", "cnfPass() {\n if (this.state.password !== this.state.confrmPassword) {\n this.setState({\n confrmPasswordError: \"password not matched.\"\n })\n return true\n } else {\n this.setState({\n confrmPasswordError: \"\"\n })\n return false\n }\n\n }", "updatePassValue(evt){\n this.state.password=(evt.target.value); \n }", "async handlePasswordChange(e) {\n const oldUsername = this.state.username;\n await this.setState({\n username: oldUsername,\n password: e.target.value,\n });\n }", "confirmSubmission(){\n //check if no password is entered, if not alert the user\n if((this.state.passwordError === true || this.state.confrimPasswordError === true) || ((this.state.password===\"\" || this.state.confirmPassword === \"\"))){\n this.setState({\n passwordError: true,\n confrimPasswordError: true,\n displayWarning: true\n });\n }\n //all tests passed\n else{\n this.sendRequest();\n }\n }", "handlePwdChange(event) {\n this.setState({loginPwd: event.target.value});\n }", "checkPasswordButtonTyped() {\n if (this.state.password.length < 1) {\n Toast.show('Mot de passe indéfini', Toast.LONG);\n }\n else {\n return true;\n }\n }", "changeUser(event){\n // get the current value\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n //setState\n this.setState({user: user});\n // handle error, password === confirm_password\n if(this.state.user['password'] !== this.state.user['confirm_password']){\n let errors = this.state.errors;\n errors.password = 'Do NOT match. Try Again.'\n this.setState({errors: errors});\n }else{\n let errors = this.state.errors;\n errors.password = '';\n this.setState({errors: errors});\n }\n \n }", "onPasswordChange(text) {\n this.props.passwordChange(text);\n }", "updateUserPassword() {\n ProfileActions.updateUserPassword(this.props.user_id, this.state.current_password, this.state.new_password);\n }", "constructor(props) {\n super(props);\n\n this.state = {\n value: \"\",\n lock: \"locked\"\n };\n\n this.submitPassword = this.submitPassword.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.showContents = this.showContents.bind(this);\n this.showPassword = this.showPassword.bind(this);\n }", "passwordMatch(e) {\n e.preventDefault()\n let pass1 = document.getElementById(\"pass\");\n let pass2 = document.getElementById(\"pass2\");\n if (pass1.value === pass2.value) {\n this.setState({\n passMatch: false\n })\n }else {\n this.setState({\n passMatch: true\n })\n }\n }", "auth() {\n \tif(this.attempt == this.correct)\n \t{\n \t\tthis.invalid = false;\n this.setState((state) => {\n return{\n \talert: \"Please enter your password: \", \n \tplacemessage: 'Enter password...'\n };\n });\n this.passInput.clear();\n this.props.navigation.navigate('MainStack');\n\n \t}\n \telse\n \t{\n \t\tthis.setState((state) => {\n this.invalid = true;\n this.showErrorAnimation();\n return{alert: \"Incorrect password. Please try again:\"};\n });\n \t}\n }", "handleChangePassword(){\n if (\n this.state.password !== '' &&\n this.state.npassword !== '' &&\n this.state.cnpassword !== ''\n ) {\n if (this.state.password === this.state.user.password){\n if (this.state.npassword === this.state.cnpassword){\n fetch(myGet + '/' + this.state.user.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n \n password: this.state.npassword\n })\n })\n .then(() => this.props.fectchAccount())\n alert('The password has been successfully updated')\n } else{\n alert(\"The new password does not match\")\n } \n } else{\n alert('Check your password again')\n }\n } else {\n alert('Please enter avatar source')\n }\n }", "onChangePassword(event) {\n if (event.target.value.length > 7) {\n this.setState({\n helperTextpassword: \"\",\n error: false,\n password: event.target.value,\n });\n } else {\n this.setState({\n helperTextpassword: \"Password should be 7 letters\",\n error: true,\n password: event.target.value,\n });\n }\n }", "togglePwdLabel(){\n\t\tif (this.refs.pwd.value.length > 0){\n\t\t\tthis.setState({\n\t\t\t\tshowPwdLabel: false\n\t\t\t})\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tshowPwdLabel: true\n\t\t\t})\n\t\t}\n\t}", "enablePassword2Validation() {\n this.setState({\n validatePassword2: true,\n });\n console.log('validatePassword2:', 'true');\n }", "function setPasswordConfirmation(passwordConfirmation) {\n this._passwordConfirmation = passwordConfirmation;\n}", "function testConfirmPassword(event){\n // != 0 is to prevent default from changing when there's no password input\n if (passRecieved.value == confirmRecieved.value && passRecieved.value.length != 0) {\n confirmPassTagRecieved.innerHTML = 'Your password matches.';\n confirmPassTagRecieved.classList.add('confirmPassCorrect');\n confirmPassTagRecieved.classList.remove('confirmPassIncorrect');\n checkConfirmPassword = true;\n } else {\n confirmPassTagRecieved.innerHTML = 'Your password doesn\\'t match.';\n confirmPassTagRecieved.classList.add('confirmPassIncorrect');\n confirmPassTagRecieved.classList.remove('confirmPassCorrect');\n checkConfirmPassword = false;\n }\n}", "function handlePasswordChange(form, value) {\n let currentFormstate = form.getFormstate();\n if (rff.isInputDisabled(currentFormstate)) {return;}\n if (form.clearConfirmPassword) {\n currentFormstate = rff.setValueAndClearStatus(currentFormstate, 'confirmPassword', '');\n }\n currentFormstate = rff.changeAndValidate(currentFormstate, 'password', value, form);\n form.setFormstate(currentFormstate);\n}", "password() {\n\n const obj = validate.password(this.state.password)\n const error = obj.error\n const boolval = obj.boolval\n\n this.setState({\n passwordError: error\n })\n\n return boolval\n }", "validateForm() {\n return (this.state.oldPassword.length > 0 && \n this.state.newPassword.length > 0 &&\n this.state.newPassword === this.state.confirmPassword);\n }", "showPasswordToggle() {\n this.setState({showPassword: !this.state.showPassword})\n\n // set defaults\n this.setState({\n \t\tinputFieldType: this.props.type,\n \t\tshowPasswordStyle: style.iconEye\n\t })\n\n // override when toggled.\n if (this.state.showPassword){\n this.setState({\n\t\t inputFieldType: 'text',\n\t\t showPasswordStyle: style.dontShowPasswordIconEye\n\t })\n }\n }", "onnoPassword() {\n this.passwordValidationState = 'has-error';\n toastr.error(this.noPasswordMessage);\n this.noPasswordMessage = 'Please enter a password';\n }", "function checkConfirmPassword() {\n var password = $modalPass.val();\n var confirmPassword = $modalConfirmPass.val();\n if (password !== confirmPassword) {\n $confirmPasswordError.html(\"Passwords Did Not Match\");\n $confirmPasswordError.show();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n confirmPasswordError = true;\n } else {\n $confirmPasswordError.hide();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "onUpdate() {\n this.setState({ attemptedSubmit: true });\n if (this.state.changePassword) this.updateWithNewPassword();\n else this.updateUser();\n this.props.onReturn();\n }", "handleClick_confirm() {\n this.setState({confirmed: true});\n }", "@action.bound\n onPasswordChange(event) {\n this.password = event.target.value;\n }", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "validatePassword(event) {\n if (_.isEmpty(event.target.value)) {\n this.setState({\n passwordError:\"Password cannot be blank\",\n });\n } else {\n this.setState({\n passwordError: \"\",\n });\n }\n }", "editPassword() {\n this.openChangePasswordModal();\n }", "function handleAdminPasswordChange(event){\n setAdminPassword(event.target.value);\n }", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "function update_confirmation_button_status()\n {\n const is_valid_password = validate_password(),\n is_valid_repeated_password = validate_repeated_password();\n\n if (is_valid_password && is_valid_repeated_password)\n {\n domanip.enable(DOM.confirm_new_password_button);\n DOM.confirm_new_password_button.style.visibility = \"visible\";\n }\n else\n {\n domanip.disable(DOM.confirm_new_password_button);\n DOM.confirm_new_password_button.style.visibility = \"hidden\";\n }\n }", "validateVPassword() {\n if (this.state.password && this.state.vpassword === this.state.password) {\n return 'success';\n }\n else if(this.state.vpassword) {\n return \"error\";\n }\n }", "compareNewPasswords() {\n if (this.state.newPassword !== this.state.confirmPassword) {\n return false;\n }\n return true;\n }", "togglePasswordMode() {\n this.passwordMode = !this.passwordMode;\n if (this.passwordMode)\n this.editableNode.classList.add(\"passwordInput\");\n else\n this.editableNode.classList.remove(\"passwordInput\");\n }", "handleTextElementChange(event) {\n this.setState({\n [event.target.name]: event.target.value\n })\n\n if (this.state.password !== this.state.repeatPassword) {\n \n }\n }", "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "constructor(props) {\n super(props);\n this.state = {\n password: \"\",\n passwordError: false,\n passwordErrorMessage: \"\",\n newPassword: \"\",\n newPasswordConfirm: \"\",\n newPasswordError: false,\n newPasswordErrorMessage: \"\",\n newPasswordConfirmError: false,\n newPasswordConfirmErrorMessage: \"\",\n };\n\n this.handlePassword = this.handlePassword.bind(this);\n this.handleNewPassword = this.handleNewPassword.bind(this);\n\n this.handleNewPasswordConfirm = this.handleNewPasswordConfirm.bind(this);\n\n this.handleUpdatePassword = this.handleUpdatePassword.bind(this);\n }", "constructor(props) {\n super(props);\n this.state = { \n password: \"\",\n error: \"\"\n };\n }", "getInitialState() {\n\t\treturn {\n\t\t\tinputType: PasswordFormInput.inputTypes.PASSWORD\n\t\t};\n\t}", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n}", "function confirmPasswordMatch() {\n const passwordField = document.querySelector(\"#password\");\n const confirmPassword = document.querySelector(\"#confirm-password\");\n const passwordWarningText = document.querySelector(\".confirm-warning\");\n\n if (confirmPassword.value !== passwordField.value) {\n confirmPassword.classList.remove(\"valid\");\n confirmPassword.classList.add(\"invalid\");\n passwordWarningText.classList.remove(\"hidden\");\n }\n else {\n passwordWarningText.classList.add(\"hidden\");\n }\n\n}", "ondoesNotMatch() {\n this.passwordValidationState = 'has-error';\n toastr.error(this.passwordDoesNotMatchMessage);\n this.passwordDoesNotMatchMessage = 'Passwords do not match.';\n }", "updateWithNewPassword() {\n if (this.compareOldPasswords() && this.compareNewPasswords()) {\n this.updateUser(this.state.newPassword);\n }\n }", "function validateConfirmPassword(model, formstate, form) {\n formstate = rff.setCustomProperty(formstate, 'confirmPassword', 'suppressFeedback', false);\n\n const present = model.confirmPassword.trim() !== '';\n\n if (form.passwordRequired && !present) {\n return rff.setInvalid(formstate, 'confirmPassword', 'Confirm Password is required.');\n }\n\n if (model.password !== model.confirmPassword) {\n return rff.setInvalid(formstate, 'confirmPassword', 'Password confirmation does not match.');\n }\n\n if (!present && form.ignoreEmptyPasswordField) {\n // When editing an account, since it's an entirely optional field, do not light up an *empty* confirmation field valid/green.\n formstate = rff.setCustomProperty(formstate, 'confirmPassword', 'suppressFeedback', true);\n }\n\n return rff.setValid(formstate, 'confirmPassword', '');\n}", "changeUser(event) {\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n \n // if change email field, user['email'] will be changed\n // if change password field, user['password'] will be changed\n // if change confirm_password field, user['confirm_password'] will be changed\n\n this.setState({user});\n\n if (this.state.user.password !== this.state.user.confirm_password) {\n const errors = this.state.errors;\n errors.password = \"Password and Confirm Password don't watch\";\n this.setState({errors}); // refresh UI and state\n } else {\n const errors = this.state.errors;\n errors.password = '';\n this.setState({errors});\n }\n }", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "handlePassCodeInput(passcode) {\r\n if (this.getScreenState() === passCodeScreenStates.FIRST_ENTRY_SCREEN) {\r\n this.setState({\r\n enteredPassCode: passcode,\r\n confirmationFailed: false\r\n });\r\n this.resetVirtualKeyboardTextState();\r\n } else if (this.getScreenState() === passCodeScreenStates.CONFIRM_SCREEN) {\r\n if (passcode === this.state.enteredPassCode) {\r\n this.savePassCode(passcode);\r\n } else {\r\n this.setState({\r\n enteredPassCode: null,\r\n confirmationFailed: true\r\n });\r\n this.resetVirtualKeyboardTextState();\r\n }\r\n }\r\n }", "_showPassword() {\n const that = this;\n\n if (that.disabled || !that.showPasswordIcon) {\n return;\n }\n\n that.$.input.type = 'text';\n that._passwordIconPressed = true;\n }", "_handleChangePass(e) {\n this.setState({\n contactPass: e.target.value\n });\n }", "function onCheckPW() {\r\n if ($(this).val() === $('#id_password2').val()) {\r\n this.setCustomValidity('');\r\n } else {\r\n this.setCustomValidity('Passwords must match.');\r\n }\r\n }", "settingsPasswordResults(values) {\n const { updatePasword, addNotification } = this.props; // eslint-disable-line\n const credentials = {\n oldPassword: values.oldPassword,\n newPassword: values.newPassword\n };\n\n updatePasword(credentials)\n .then((response) => {\n if (response.payload.status === 200) {\n this.setState({ registered: false});\n addNotification(strings.passwordSaveNotify, 'success', 'tc');\n }\n });\n }", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "function passwordChanged(input, output) {\n\t\tif( input.value.length < 8 ) {\n\t\t\t// Master-password size smaller than minimum allowed size\n\t\t\t// Provide a masked partial confirm-code, to acknowledge the user input\n\t\t\tvar maskedCode='';\n\t\t\tswitch(Math.floor(input.value.length*4/8)) {\n\t\t\t\tcase 1: maskedCode='#'; break;\n\t\t\t\tcase 2: maskedCode='##'; break;\n\t\t\t\tcase 3: maskedCode='###'; break;\n\t\t\t}\n\t\t\toutput.value=maskedCode;\n\t\t} else {\n\t\t\toutput.value = confirmCode(input.value);\n\t\t}\n\t\tvaluesChanged();\n\t}", "toPassword() {\n if (this.pwd_field && this.pwd_field.nativeElement) {\n this.pwd_field.nativeElement.focus();\n this.focus = 'password';\n }\n }", "_handleClick() {\n if ((this.state.typeName === 'password' && this.state.isPristine) || (this.state.typeName === 'password' && !this.state.isPristine)) {\n this.setState({\n typeName: 'text',\n toggleLabelState: 'Hide ' + this.props.type,\n isPristine: false\n });\n } else {\n this.setState({\n typeName: 'password',\n toggleLabelState: this.props.toggleLabel,\n });\n }\n\n }" ]
[ "0.8042668", "0.80321753", "0.80039626", "0.7950488", "0.7546916", "0.7546359", "0.7483683", "0.7459078", "0.7431498", "0.7412072", "0.73574615", "0.73203635", "0.73006654", "0.7277289", "0.72759783", "0.72759783", "0.72451246", "0.7221198", "0.7186857", "0.7182852", "0.717318", "0.7169139", "0.71641845", "0.71606797", "0.7153395", "0.71472627", "0.71156496", "0.71040523", "0.7092157", "0.70896477", "0.7044236", "0.70285624", "0.7026964", "0.70247227", "0.69936717", "0.69371265", "0.6934352", "0.6897867", "0.6893201", "0.6820939", "0.6770452", "0.6742535", "0.67423636", "0.67336476", "0.67289984", "0.67273116", "0.66813743", "0.6667847", "0.66081", "0.6579891", "0.6575173", "0.6574135", "0.65740716", "0.6566508", "0.6554002", "0.6552995", "0.6550357", "0.65425205", "0.65338534", "0.6526967", "0.64916646", "0.6489225", "0.64876324", "0.6474073", "0.64310384", "0.6417408", "0.6411455", "0.64059997", "0.64022416", "0.64002997", "0.6399672", "0.639627", "0.63928765", "0.63889164", "0.6387773", "0.63827187", "0.6375687", "0.6372149", "0.63673097", "0.636228", "0.6357933", "0.63427734", "0.6320943", "0.6312201", "0.63087904", "0.6306817", "0.6287134", "0.6281859", "0.6279505", "0.6279323", "0.6276212", "0.62685806", "0.62674814", "0.6247107", "0.62462866", "0.6238981", "0.6230183", "0.62278736", "0.6222517", "0.6198643" ]
0.7127698
26
setState for password field
onChangePassword(event) { if (event.target.value.length > 7) { this.setState({ helperTextpassword: "", error: false, password: event.target.value, }); } else { this.setState({ helperTextpassword: "Password should be 7 letters", error: true, password: event.target.value, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_inputPass(password){\n this.setState({password:password})\n\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "passwordOnChange (e) {\n this.setState({password_value: e.target.value});\n }", "passwordChanged(e) {\n this.setState({\n password: e.target.value\n });\n }", "typePassword(event) {\n this.setState({ password: event.target.value });\n }", "handleChangePassword(e) {\n this.setState({password: e.target.value});\n }", "handleChangePassword(e) {\n this.setState({ password: e.target.value });\n }", "handleChangepass(event) {\n this.setState({\n password: event.target.value,\n });\n }", "HandlePasswordChange(event) {\n\n this.setState({ Password: event.target.value });\n }", "passwordChange(event){\n this.setState({\n password: event.target.value,\n passwordError:''\n });\n }", "onupdatePassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "setPassword(newPassword) {\n this.setState({password: newPassword});\n }", "changePassword() {\n this.setState({ changePassword: !this.state.changePassword });\n }", "passwordOnChange(event) {\n this.setState({ password: event.target.value });\n }", "updateInputValuePass(evt) {\n this.setState({\n password: evt.target.value\n });\n }", "handlePasswordChange(e) {\n\t\tthis.setState({password:e.target.value});\n\t}", "onPasswordChange(event) {\n this.setState({\n password: event.target.value,\n });\n }", "handlePassInput(e) {\n this.setState({password: e.target.value});\n }", "handlePasswordFieldChange(e) {\n this.setState({\n password: e.target.value\n });\n}", "changePassword(event) {\n var newState = this.mergeWithCurrentState({\n password: event.target.value\n });\n\n this.emitChange(newState);\n }", "handleChangePassword(event) {\n\t\tthis.setState({\n\t\t\tpassword: event.target.value,\n\t\t});\n\t}", "handlePasswordChange(event) {\n this.setState({password: event.target.value});\n event.preventDefault();\n }", "_handleTogglePassword() {\n const {password} = this.state;\n this.setState({\n password: {\n open: !password.open\n }\n });\n }", "handlePasswordChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ password: processedData })\n }", "handlePwdChange(event) {\n this.setState({loginPwd: event.target.value});\n }", "passwordChange(event) {\n\t\tevent.preventDefault();\n\t\tvar flag = (event.target.value.length >= 6);\n\t\tthis.setState({\n\t\t\tpwFilled: true,\n\t\t\tpwOk: flag,\n\t\t\tpassword: event.target.value\n\t\t})\n\t}", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "handleChangeConfirmPassword(e) {\n this.setState({ confirmPassword: e.target.value });\n }", "async handlePasswordChange(e) {\n const oldUsername = this.state.username;\n await this.setState({\n username: oldUsername,\n password: e.target.value,\n });\n }", "updatePassValue(evt){\n this.state.password=(evt.target.value); \n }", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n this.isValidPassword(text);\n }", "handleClickShowPassword(event) {\n this.setState({\n showPassword: !this.state.showPassword\n });\n }", "updateCurrentPassword(event) {\n if (event.target.value === '') {\n this.setState({valid_state_current: 'error'});\n }\n else {\n this.setState({valid_state_current: 'success'});\n }\n this.setState({current_password: event.target.value});\n }", "setConfirmPassword(newConfirmPassword) {\n this.setState({confirmPassword: newConfirmPassword});\n }", "passwordConfirmChanged(e) {\n this.setState({\n passwordConfirm: e.target.value\n });\n }", "passwordFieldInputed(e) {\n let passwordValue = e.currentTarget.value;\n let passwordError = $(\"#password-error\");\n let errors = this.state.errors;\n if (passwordValue === \"\") {\n passwordError.css(\"display\", \"flex\").show();\n errors.password = \"Password field can't be empty.\";\n this.setState({errors});\n } else {\n passwordError.hide();\n errors.password = \"\";\n this.setState({errors});\n }\n }", "constructor(props) {\n super(props);\n\n this.state = {\n value: \"\",\n lock: \"locked\"\n };\n\n this.submitPassword = this.submitPassword.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.showContents = this.showContents.bind(this);\n this.showPassword = this.showPassword.bind(this);\n }", "handlePasswordChange(event) {\n const password = event.target.value;\n this.setState({password: password, message: this.defaultMessage});\n if (this.validPassword(password)) {\n this.setState({passwordStyle: 'register-valid'});\n } else {\n this.setState({passwordStyle: 'register-invalid'});\n }\n if (password === this.state.confirmedPassword) {\n this.setState({confirmPasswordStyle: 'register-valid'});\n } else {\n this.setState({confirmPasswordStyle: 'login-default'});\n }\n }", "togglePassword() { this.setState({ isShow: !this.state.isShow }) }", "toPassword() {\n if (this.pwd_field && this.pwd_field.nativeElement) {\n this.pwd_field.nativeElement.focus();\n this.focus = 'password';\n }\n }", "validatePassword() {\n if (this.state.password.length < 5) {\n this.setState({\n validPassword: false\n });\n }\n else {\n this.setState({\n validPassword: true\n });\n this.submitRequest();\n }\n }", "handleTextElementChange(event) {\n this.setState({\n [event.target.name]: event.target.value\n })\n\n if (this.state.password !== this.state.repeatPassword) {\n \n }\n }", "enablePassword2Validation() {\n this.setState({\n validatePassword2: true,\n });\n console.log('validatePassword2:', 'true');\n }", "updateNewPassword(event) {\n const confirmPassword = this.state.confirm_password;\n if (event.target.value != confirmPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match'\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({\n valid_state_new: 'success',\n error_message: '',\n });\n }\n this.setState({new_password: event.target.value});\n }", "getInitialState() {\n\t\treturn {\n\t\t\tinputType: PasswordFormInput.inputTypes.PASSWORD\n\t\t};\n\t}", "onPasswordChange(text) {\n this.props.passwordChange(text);\n }", "showPasswordToggle() {\n this.setState({showPassword: !this.state.showPassword})\n\n // set defaults\n this.setState({\n \t\tinputFieldType: this.props.type,\n \t\tshowPasswordStyle: style.iconEye\n\t })\n\n // override when toggled.\n if (this.state.showPassword){\n this.setState({\n\t\t inputFieldType: 'text',\n\t\t showPasswordStyle: style.dontShowPasswordIconEye\n\t })\n }\n }", "togglePasswordMode() {\n this.passwordMode = !this.passwordMode;\n if (this.passwordMode)\n this.editableNode.classList.add(\"passwordInput\");\n else\n this.editableNode.classList.remove(\"passwordInput\");\n }", "togglePwdLabel(){\n\t\tif (this.refs.pwd.value.length > 0){\n\t\t\tthis.setState({\n\t\t\t\tshowPwdLabel: false\n\t\t\t})\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tshowPwdLabel: true\n\t\t\t})\n\t\t}\n\t}", "@action.bound\n onPasswordChange(event) {\n this.password = event.target.value;\n }", "_showPassword() {\n const that = this;\n\n if (that.disabled || !that.showPasswordIcon) {\n return;\n }\n\n that.$.input.type = 'text';\n that._passwordIconPressed = true;\n }", "togglePassword()\n {\n\n let passwordInputField = $('#password');\n\n if ( passwordInputField.attr('type') === 'password' )\n\n passwordInputField.attr('type', 'text');\n\n else\n\n passwordInputField.attr('type', 'password');\n\n }", "_handleChangePass(e) {\n this.setState({\n contactPass: e.target.value\n });\n }", "updateConfirmPassword(event) {\n const newPassword = this.state.new_password;\n if (event.target.value != newPassword) {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Passwords do not match',\n });\n }\n else if (event.target.value === '') {\n this.setState({\n valid_state_new: 'error',\n error_message: 'Password cannot be blank.',\n });\n }\n else {\n this.setState({valid_state_new: 'success'});\n }\n this.setState({confirm_password: event.target.value});\n }", "updateUserPassword() {\n ProfileActions.updateUserPassword(this.props.user_id, this.state.current_password, this.state.new_password);\n }", "constructor() {\n super();\n this.state = {\n password: '',\n };\n }", "constructor() {\n super();\n this.state = {\n password: '',\n };\n }", "validate(t) {\n t.preventDefault();\n\n if (this.state.entered === this.state.password) {\n return this.setState({ open: false });\n } else {\n return this.setState({ error: \"Password Required\" });\n }\n }", "function setPassword() {\n postPassword(\n success = function () {\n console.log('Password set');\n setPermissions();\n },\n error = null,\n email,\n password);\n }", "password() {\n\n const obj = validate.password(this.state.password)\n const error = obj.error\n const boolval = obj.boolval\n\n this.setState({\n passwordError: error\n })\n\n return boolval\n }", "async handleUsernameChange(e) {\n const oldPassword = this.state.password;\n await this.setState({\n username: e.target.value,\n password: oldPassword,\n });\n }", "changeUser(event){\n // get the current value\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n //setState\n this.setState({user: user});\n // handle error, password === confirm_password\n if(this.state.user['password'] !== this.state.user['confirm_password']){\n let errors = this.state.errors;\n errors.password = 'Do NOT match. Try Again.'\n this.setState({errors: errors});\n }else{\n let errors = this.state.errors;\n errors.password = '';\n this.setState({errors: errors});\n }\n \n }", "constructor(props) {\n super(props);\n\n this.state = {\n icEye: 'visibility-off', // default icon to show that password is currently hidden\n password: '', // actual value of password entered by the user\n showPassword: true, // boolean to show/hide the password\n\n password: '',\n userData: {},\n };\n }", "constructor(props) {\n super(props);\n this.state = { \n password: \"\",\n error: \"\"\n };\n }", "get password() {\n return this.form.controls.password;\n }", "passwordMatch(e) {\n e.preventDefault()\n let pass1 = document.getElementById(\"pass\");\n let pass2 = document.getElementById(\"pass2\");\n if (pass1.value === pass2.value) {\n this.setState({\n passMatch: false\n })\n }else {\n this.setState({\n passMatch: true\n })\n }\n }", "_changePassword(i, isNegative, evt) {\n const passwords = isNegative ? this.props.data.passwords1 : this.props.data.passwords;\n const newPasswords = R.clone(passwords) || [];\n\n if (R.length(evt.target.value) == 1) {\n if (isNegative) {\n this.negativePasswordFieldRecords[i].length = 0;\n } else {\n this.passwordFieldRecords[i].length = 0;\n }\n }\n\n newPasswords[i] = evt.target.value;\n\n var changed = isNegative ? {\n passwords1: newPasswords\n } : {\n passwords: newPasswords\n }\n var newState = this._mergeWithCurrentState(changed);\n\n this._emitChange(newState);\n }", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n}", "onChangeConfirmPassword(event) {\n if (event.target.value.length > 2) {\n this.setState({\n helperText: \"\",\n error: false,\n confirmPassword: event.target.value,\n });\n } else {\n this.setState({\n helperText: \"Invalid format\",\n error: true,\n confirmPassword: event.target.value,\n });\n }\n }", "disablePassword2Validation() {\n this.setState({\n validatePassword2: false,\n password2Invalid: false,\n });\n console.log('validatePassword2:', 'false');\n }", "constructor(props) {\n super(props);\n this.state = {\n password: \"\",\n passwordError: false,\n passwordErrorMessage: \"\",\n newPassword: \"\",\n newPasswordConfirm: \"\",\n newPasswordError: false,\n newPasswordErrorMessage: \"\",\n newPasswordConfirmError: false,\n newPasswordConfirmErrorMessage: \"\",\n };\n\n this.handlePassword = this.handlePassword.bind(this);\n this.handleNewPassword = this.handleNewPassword.bind(this);\n\n this.handleNewPasswordConfirm = this.handleNewPasswordConfirm.bind(this);\n\n this.handleUpdatePassword = this.handleUpdatePassword.bind(this);\n }", "function passwordOnChange() {\n const pattern = \"^[a-zA-Z0-9_-]{6,20}$\";\n validate(this, pattern);\n}", "function setPassword(password) {\n\t\tthis.password = password;\n\t}", "passwordHandler () {\n this.password.errors = false;\n this.passwordImmediately();\n\n clearTimeout(this.password.timer);\n /* We are creating a new property named timer on the username property. But we want to reset this timer after each\n * keystroke.\n * Remember: What is difference between calling a method with () and without () in setTimeout() or any where else?\n * */\n this.password.timer = setTimeout( () => {\n this.passwordAfterDelay();\n }, 800);\n }", "function togglePwdField() {\n\n console.log('change pwd field');\n var pwdField = document.getElementById('pwd-field');\n var value = pwdField.value;\n\n if (pwdField.type == 'password') {\n pwdField.type = 'text';\n } else {\n pwdField.type = 'password';\n }\n\n pwdField.value = value;\n\n}", "function handleAdminPasswordChange(event){\n setAdminPassword(event.target.value);\n }", "checkPasswordButtonTyped() {\n if (this.state.password.length < 1) {\n Toast.show('Mot de passe indéfini', Toast.LONG);\n }\n else {\n return true;\n }\n }", "validatePassword(event) {\n if (_.isEmpty(event.target.value)) {\n this.setState({\n passwordError:\"Password cannot be blank\",\n });\n } else {\n this.setState({\n passwordError: \"\",\n });\n }\n }", "toggleInputType() {\n\t\tconst inputType = this.state.inputType == PasswordFormInput.inputTypes.PASSWORD\n \t\t? PasswordFormInput.inputTypes.TEXT\n \t\t: PasswordFormInput.inputTypes.PASSWORD;\n \tthis.setState({inputType: inputType});\n\t}", "_handleClick() {\n if ((this.state.typeName === 'password' && this.state.isPristine) || (this.state.typeName === 'password' && !this.state.isPristine)) {\n this.setState({\n typeName: 'text',\n toggleLabelState: 'Hide ' + this.props.type,\n isPristine: false\n });\n } else {\n this.setState({\n typeName: 'password',\n toggleLabelState: this.props.toggleLabel,\n });\n }\n\n }", "showPassword(e) {\n\t\tif(e){\n\t\t\tvar x = document.getElementById(\"exampleInputPassword1\");\n\t\t if (x.type === \"password\") {\n\t\t x.type = \"text\";\n\t\t } else {\n\t\t x.type = \"password\";\n\t\t }\n\t\t}\n\t}", "async onAcceptPassword() {\n const { currentPwdHash, setPassword, generateAlert, t } = this.props;\n const { newPassword } = this.state;\n const salt = await getSalt();\n const newPwdHash = await generatePasswordHash(newPassword, salt);\n changePassword(currentPwdHash, newPwdHash, salt)\n .then(() => {\n setPassword(newPwdHash);\n generateAlert('success', t('passwordUpdated'), t('passwordUpdatedExplanation'));\n this.props.setSetting('securitySettings');\n })\n .catch(() => generateAlert('error', t('somethingWentWrong'), t('somethingWentWrongTryAgain')));\n }", "editPassword() {\n this.openChangePasswordModal();\n }", "function toggle_pw_field(e){\n e.preventDefault();\n\n var pw_field = document.getElementById('signup__password');\n if( pw_field.type=='password' ){\n pw_field.type = 'text';\n\n } else {\n pw_field.type = 'password';\n }\n\n return false;\n}", "changeUser(event) {\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n \n // if change email field, user['email'] will be changed\n // if change password field, user['password'] will be changed\n // if change confirm_password field, user['confirm_password'] will be changed\n\n this.setState({user});\n\n if (this.state.user.password !== this.state.user.confirm_password) {\n const errors = this.state.errors;\n errors.password = \"Password and Confirm Password don't watch\";\n this.setState({errors}); // refresh UI and state\n } else {\n const errors = this.state.errors;\n errors.password = '';\n this.setState({errors});\n }\n }", "handleConfirmPasswordChange(event) {\n const confirmedPassword = event.target.value;\n this.setState({confirmedPassword: confirmedPassword, message: this.defaultMessage});\n if (confirmedPassword === this.state.password) {\n this.setState({confirmPasswordStyle: 'register-valid'});\n } else {\n this.setState({confirmPasswordStyle: 'register-invalid'});\n }\n }", "function PasswordEntry(password) {\n passwordText.value = password;\n //console.log (PasswordEntry);\n}", "auth() {\n \tif(this.attempt == this.correct)\n \t{\n \t\tthis.invalid = false;\n this.setState((state) => {\n return{\n \talert: \"Please enter your password: \", \n \tplacemessage: 'Enter password...'\n };\n });\n this.passInput.clear();\n this.props.navigation.navigate('MainStack');\n\n \t}\n \telse\n \t{\n \t\tthis.setState((state) => {\n this.invalid = true;\n this.showErrorAnimation();\n return{alert: \"Incorrect password. Please try again:\"};\n });\n \t}\n }", "function ChangePassword() {\n\t}", "_emailChange(text){\n this.setState({\n loginEmail: text\n })\n }", "get password (){\n return this.#password\n }", "function togglePassword()\n{\n var passwordField = document.getElementById('inputPassword');\n if(passwordField.type === \"password\")\n {\n passwordField.type = \"text\";\n }\n else\n {\n passwordField.type = \"password\";\n }\n}", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function togglePassword(obj, e) {\n\t\t\t\t//alert($(obj).html());\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\t\t\t\t//var upass = document.getElementsByClassName('upass');\n\t\t\t\tvar field = $(obj).parent().parent().find(\".togglePassword\");\n\t\t\t\tvar type = field.attr('type');\n\t\t\t\t\n\t\t\t\t//alert('Type: '+type+'; Val: '+field.val());\n\t\t\t\t\n\t\t\t\tif(type == \"password\"){\n\t\t\t\t\t//field.type = \"text\";\n\t\t\t\t\tfield.attr('type', 'text');\n\t\t\t\t\t$(obj).html(\"Hide\");\n\t\t\t\t} else {\n\t\t\t\t\t//field.type = \"password\";\n\t\t\t\t\t$(obj).html(\"Show\");\n\t\t\t\t\tfield.attr('type', 'password');\n\t\t\t\t}\n\t\t\t}", "function focusPassword() {\n\t$.password.focus();\n}", "function toggle_password() {\n let x = $(\"#password\");\n if(x.attr(\"type\") === \"password\") {\n x.attr(\"type\",\"text\");\n } else {\n x.attr(\"type\",\"password\");\n }\n}", "checkPassword(password) {\n return password === this.password;\n }", "function changePaswordType(){\r\n\r\n var newPw=dojo.byId('dojox_form__NewPWBox_0'),\r\n veryPw=dojo.byId('dojox_form__VerifyPWBox_0');\r\n if(newPw.getAttribute('type')=='password' && veryPw.getAttribute('type')=='password'){\r\n newPw.setAttribute('type','text');\r\n veryPw.setAttribute('type','text');\r\n }else{\r\n newPw.setAttribute('type','password');\r\n veryPw.setAttribute('type','password');\r\n }\r\n \r\n \r\n}", "cnfPass() {\n if (this.state.password !== this.state.confrmPassword) {\n this.setState({\n confrmPasswordError: \"password not matched.\"\n })\n return true\n } else {\n this.setState({\n confrmPasswordError: \"\"\n })\n return false\n }\n\n }" ]
[ "0.82025504", "0.8120857", "0.8120857", "0.8119566", "0.80819756", "0.80666107", "0.80627006", "0.8045172", "0.8017677", "0.799424", "0.7985309", "0.7985173", "0.7974092", "0.7972368", "0.79651445", "0.7958896", "0.7938092", "0.7901792", "0.7893774", "0.78741026", "0.786789", "0.78196764", "0.7692367", "0.7632032", "0.7598196", "0.7592362", "0.7514173", "0.7492508", "0.74750227", "0.7442227", "0.74420804", "0.7425599", "0.74001586", "0.73921037", "0.7361939", "0.73460585", "0.72962934", "0.72890323", "0.7196253", "0.71716595", "0.7149649", "0.71419346", "0.7133177", "0.71316993", "0.70728713", "0.70575386", "0.7053751", "0.7048581", "0.70293254", "0.7007572", "0.6971477", "0.6890484", "0.68722147", "0.68720466", "0.6870967", "0.68570346", "0.68486315", "0.68486315", "0.68153244", "0.68046963", "0.68031484", "0.68006754", "0.677851", "0.6775253", "0.67672646", "0.6717126", "0.67122424", "0.6669084", "0.66613215", "0.6658528", "0.6647131", "0.6639408", "0.6639294", "0.66385376", "0.6630976", "0.6624816", "0.66241205", "0.66064566", "0.65949595", "0.6593041", "0.6592932", "0.65869963", "0.65822655", "0.6574532", "0.6566665", "0.65601784", "0.6549474", "0.6547335", "0.6531511", "0.6525736", "0.6521493", "0.64937705", "0.6486983", "0.64859414", "0.6470456", "0.6467974", "0.6446191", "0.64418244", "0.6440955", "0.64219594" ]
0.7049971
47
Render function && User Interface for resetPassword
render() { return ( <MuiThemeProvider> <meta name="viewport" content="width=device-width, initial-scale=1.0" ></meta> <div className="containerReset"> <div className="loginstyleReset">{this.state.resetpassword}</div> <div className="borderReset"> <div className="loginFromReset"> <div className="inputFieldReset"> <TextField hintText="Password" floatingLabelText="Password" id="btnReset" variant="outlined" type="password" label="Password" helperText={this.state.helperTextpassword} onChange={this.onChangePassword.bind(this)} ></TextField> </div> <div className="inputFieldReset"> <TextField hintText="Confirm Password" floatingLabelText="Confirm Password" id="btnReset" variant="outlined" type="password" label="Confirm Password" helperText={this.state.helperText} onChange={this.onChangeConfirmPassword.bind(this)} ></TextField> </div> <div className="submitButtonReset"> <Button id="subbtnReset" onClick={(e) => this.resetPassword(e)}> SUBMIT </Button> </div> </div> <div className="loginstyle">{this.state.message}</div> </div> <Snackbar open={this.state.snackbaropen} autoHideDuration={6000} onClose={this.handleClose} message={<span>{this.state.snackbarmsg}</span>} action={[ <IconButton key="close" arial-label="close" coloe="inherit" onClick={this.handleClose} > x </IconButton>, ]} ></Snackbar> </div> </MuiThemeProvider> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async resetPassword({ view, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeResetPassword',\n header_msg: antl.formatMessage('main.change_password'),\n button_msg: antl.formatMessage('main.change_password'),\n })\n }", "function resetPassword(req, res) {\n res.render(\"resetPassword\");\n}", "function forgotPasswordPage(req, res) {\n res.render('forgotPassword')\n}", "renderSuccess () {\n this.response.render('auth/password-changed', {\n title: 'Password Changed', returnToUrl: this.returnToUrl\n })\n }", "function handlePasswordResetPage(req, res) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: false\n });\n}", "function forgetPassword(req, res) {\n res.render(\"forgetPassword\");\n}", "passwordReset() {\n Actions.passwordReset();\n }", "function managePasswordForgotten() {\n\t$('#passwordReset').click(function() { \n\t\t// We must reset the document and send a link to the registered email\n\t\t// to a form where the end user can update the password\n\t\tclearDocument();\n\t\tloadHTML(\"navbar.html\");\n\t\tnavbarHover();\n\t\t$(document.body).append(\"<center><h1>Please fill in the following form !</h1><center>\");\n\t\tloadHTML(\"passwordForgotten.html\");\n\t\tloadJS(\"js/forms.js\");\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\n loadHTML(\"footer.html\");\n\t});\n}", "function getForgotPage(req, res) {\n res.render('forgot.ejs', {\n title: 'Forgot Password?',\n user: req.user,\n message: ''\n });\n}", "function printResetPassword(token) {\n const main = document.getElementById(\"main\");\n main.innerHTML = `<div class=\"resetpage\">\n <div class=\"reset\">\n <h2>Reset password</h2>\n <form id=\"reset\">\n <label for=\"reset-password\">New password</label>\n <input type=\"password\" name=\"reset-password\" required>\n <br>\n <input type=\"submit\" value=\"Reset password\">\n </form>\n </div>\n </div>`;\n // when the user submits the form we call the function resetPassword()\n document.getElementById(\"reset\").addEventListener('submit', function(e) {\n e.preventDefault();\n resetPassword(token);\n })\n}", "function ResetCard({ email, onPasswordChange, submitForm, errorCode}) {\r\n return (\r\n <Card className=\"px-5 pt-4\">\r\n <Card.Header className=\"card-header-no-border\">\r\n <h2 className=\"font-weight-bold\">Resetting Password for:</h2 >\r\n <p className=\"mb-0\">{email}</p>\r\n </Card.Header >\r\n <Card.Body className=\"px-0\">\r\n {errorCode !== '' && <h6 className=\"text-danger\">{ }</h6>}\r\n <Form onSubmit={submitForm}>\r\n <Form.Group controlId=\"password\">\r\n <Form.Control\r\n className=\"py-4\"\r\n required\r\n type=\"password\"\r\n onChange={onPasswordChange}\r\n placeholder=\"New Password\" />\r\n </Form.Group>\r\n <Row className=\"mt-2 px-0\">\r\n <Col className=\"pr-3 py-1\">\r\n <CustomButton\r\n wide\r\n type=\"submit\"\r\n className=\"drop-shadow py-2\"\r\n > \r\n Save\r\n </CustomButton>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col className=\"mt-4\">\r\n <p className=\"main-text\">Don't have an account yet? <a href=\"/\">Sign up!</a></p>\r\n </Col>\r\n </Row>\r\n </Form>\r\n </Card.Body>\r\n </Card >\r\n );\r\n}", "function getForgotPasswordUI() {\n fetch('/api/forgotPassword', {\n method: 'GET'\n }).then(response => response.text())\n .then(res => {\n var mainBody = document.getElementById('main-body');\n mainBody.innerHTML = res;\n selectIcon('home');\n });\n}", "renderForget(){\n return (\n <div className=\"ForgetPassword\"> \n {this.state.submitForget === null\n ? this.renderForgetForm()\n : this.renderNewPassword()}\n </div>\n ); \n }", "_sendPasswordReset(user, password) {\n return this.mailer.reset({email: user.email, password: password})\n }", "function showPassword() {\n register((data, err)=>{\n if(data === -1) {\n showErr(err);\n }\n else {\n data = JSON.parse(data);\n userId = data.userId;\n attempt = 3;\n listenNextButton();\n $(\"#password1\").text(data.password_1);\n $(\"#password2\").text(data.password_2);\n $(\"#password3\").text(data.password_3);\n $(\"#ui_2\").fadeIn();\n }\n });\n}", "function postResetPassword() {\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\n if (validatePasswords !== true) {\n setSubmitResult(validatePasswords);\n setIsError(true);\n return;\n }\n setIsLoading(true);\n setIsError(false);\n axios.post(process.env.REACT_APP_API_LINK + \"/password/reset\", {\n \"email\": data.email,\n token,\n password\n }).then(result => {\n setIsLoading(false);\n if (result.status === 200) {\n setIsSuccess(true);\n data.onCloseModal();\n alert(\"Password Reset Successful!\")\n } else {\n setSubmitResult(\"An error has occurred, please contact an administrator.\")\n setIsError(true);\n }\n }).catch(e => {\n setIsLoading(false);\n setSubmitResult(e.response.data.error);\n setIsError(true);\n });\n }", "forgotPassword(data) {\n return this.post('forgot/password', data);\n }", "function postResetPassword(data, textStatus, jqXHR, param) {\n\tvar user = param.user;\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar p = $('<p>');\n\tuiDiv.append(p);\n\tp.html('The password for \"' + user + '\" has been reset.');\n\tvar ul = $('<ul>');\n\tuiDiv.append(ul);\n\tvar li = $('<li>');\n\tul.append(li);\n\tli.html('New password: \"' + data[user] + '\"');\n}", "function password_validation(){\n\n if(!checkResetPasswordEmail()) {\n return false;\n } else {\n document.getElementById('get_password').value = \"Sending...\";\n return true;\n }\n}", "resetPassword({ Meteor, Store, Bert }, data) {\n const { token, password } = data;\n const { dispatch } = Store;\n\n // Change state to password reset request\n dispatch(resetPasswordRequest());\n\n // Call reset password procedure\n Accounts.resetPassword(token, password, (error) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n // Change state to password reset error\n dispatch(resetPasswordError());\n } else {\n Bert.alert('Password reset!', 'success');\n // Change state to successful password reset\n dispatch(resetPasswordSuccess(Meteor.user()));\n\n // Redirect to home screen\n browserHistory.push('/');\n }\n });\n }", "function reset_password_form() {\n\t// Encode the String\n\tvar encoded_string = Base64.encode('login/reset_password/');\n\tvar encoded_val = encoded_string.strtr(encode_chars_obj);\n\t\n\tvar encoded_login_string = Base64.encode('login/index/');\n\tvar encoded_login_val = encoded_login_string.strtr(encode_chars_obj);\n\t\n\tvar success_msg = 'Successful';\n\tvar failure_msg = 'Failed';\n\t\n\tvar ajaxData = $(\"#resetForm\").serialize();\t\n\t\t$.ajax({\n\t\turl: base_url + encoded_val,\n\t\tdataType: \"json\",\n\t\ttype: \"post\",\n\t\tdata: ajaxData,\t\n\t\tbeforeSend: function() {\n $('.uni_wrapper').addClass('loadingDiv');\t\t\n },\t\t\n\t\tsuccess: function(response) {\n\t\t $('.uni_wrapper').removeClass('loadingDiv');\n\t\t\tif(true == response.status)\n\t\t\t{\t\t\t\t\n\t\t\t\t$(\".error-message .alert\").removeClass('alert-danger');\n\t\t\t\t$(\".error-message .alert\").addClass('alert-success');\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tsuccess_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(success_msg);\n\t\t\t\tsetTimeout(function(){\t\t\t\t\t\t \n\t\t\t\t window.location.href = base_url + encoded_login_val;\t\t\t\t\t\t \n\t\t\t\t}, 500);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tfailure_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(failure_msg);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\t\n}", "function forgotPassword(method,type) {\n hideError('email');\n addFunActionLabel=\"Forgot Pasword Submit\";\n if(pageType=='not_login'){\n var email = $.trim($(\"#TenTimes-Modal #userEmailCopy\").val()); \n }else{\n var email = $.trim($(\"#TenTimes-Modal #userEmail\").val());\n }\n if(!validateEmail12345(email)){\n $(\".alert_email\").show();\n return 0;\n }\n var otpType='password';\n if(type=='N' || type=='U'){\n otpType='otp';\n }\n\n if(method == \"connect\")\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\n else\n var postData = {'email':email, 'name' : email , 'type' : otpType }\n showloading();\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\n hideloading();\n response=$.parseJSON(response);\n var resText=response.resText;\n var resLink=response.resLink;\n if(type=='N' || type=='U'){\n resText=response.resText_typeN;\n resLink=response.resLink_typeN;\n \n }\n \n switch(response.response) {\n case 'true':\n $('#getpassword').parent().replaceWith(function() { return \"<a style='text-decoration:none'>\" + \"<p class='text-center' style='text-decoration:none;color:#909090;'>\" + resText + \"</p>\"+$('#getpassword').get(0).outerHTML+\"</a>\"; });\n\n $('#getpassword').text(resLink);\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\n $('#TenTimes-Modal .partial-log').hide();\n $('#getpassword').removeAttr(\"onclick\").click(function() {\n partialLog(method,type)\n }).text(resLink).css('color','#335aa1');\n }\n break;\n case 'false':\n $(\".alert_email\").html(\"Sorry, 10times doesn't recognize that email.\");\n $(\".alert_email\").show();\n break;\n }\n }); \n}", "function ChangePassword() {\n\t}", "forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }", "function resetPassword() {\r\n \tconsole.log(\"Inside reset password\");\r\n \t//self.user.userpassword = self.user.password;\r\n \tself.user.user_id = $(\"#id\").val();\r\n \tself.user.obsolete = $(\"#link\").val();\r\n \tdelete self.user.confpassword;\r\n \tUserService.changePassword(self.user)\r\n \t\t.then(\r\n \t\t\t\tfunction (response) {\r\n \t\t\t\t\tif(response.status == 200) {\r\n \t\t\t\t\t\tself.message = \"Password changed successfully..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.success');\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\twindow.setTimeout( function(){\r\n \t\t\t\t\t\t\twindow.location.replace('/Conti/login');\r\n \t\t\t\t \t}, 5000);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tself.message = \"Password is not changed..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.failure');\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t},\r\n \t\t\t\tfunction (errResponse) {\r\n \t\t\t\t\tconsole.log(errResponse);\r\n \t\t\t\t}\r\n \t\t\t);\r\n }", "function forgotPasswordEnterDetails(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.removeClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n\t\tformEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }", "passwordreset(email) {\r\n return this.auth\r\n .sendPasswordResetEmail(email)\r\n .then(function () {\r\n alert(\"Email Sent!\");\r\n })\r\n .catch(function (error) {\r\n alert(\"An error occured. Please try again\");\r\n });\r\n }", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "async forgotpasswordbtn () {\n await (await this.btnForgotPassword).click();\n }", "recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts.forgotPassword({\n email,\n }, (error) => {\n if (error) {\n Bert.alert(error.reason, 'warning');\n } else {\n Bert.alert('Check your inbox for a reset link!', 'success');\n }\n });\n }", "function resetpwRoute() {\n return \"/resetpw?username=\" + encodeURIComponent(user.username) + \"&schoolCode=\" + req.body.schoolCode + \"&school=\" + (user.school ? encodeURIComponent(user.school.name) : \"none\");\n }", "function onPasswordSet() {\n // Back to main form\n hide(pwSetForm);\n show(mainForm);\n\n // Password was just set, so generate right away if\n // site is filled in.\n if (mainForm.siteHost.value) {\n generatePassword();\n } else {\n // If the site has not been filled in, focus it.\n mainForm.siteHost.focus();\n }\n }", "render(){\n //material ui styling const\n const classes = makeStyles((theme) => ({\n root: {\n '& .MuiTextField-root': {\n margin: theme.spacing(1),\n width: '25ch',\n },\n },\n }));\n return (\n <div style={{textAlign:\"center\",display:\"inlineBlock\",marginTop:25,marginBottom:15}} align=\"center\" textAlign= \"center\">\n <form className={classes.root} noValidate autoComplete=\"off\">\n <Box m={2} pt={3}>\n <div style={{marginTop: 15, marginBottom: 10}}>\n <img src={Logo} alt=\"GameScore Logo\" width=\"100\" height=\"100\"></img>\n </div>\n <div style={{marginTop: 15, marginBottom: 10}}>\n <Typography>Reset Password</Typography>\n </div>\n <div style={{marginTop: 15, marginBottom: 10}}>\n <TextField required id=\"standard-required\" name = \"password\" label=\"Password\" type=\"password\" onChange={this.passwordHandler} error={this.state.passwordError} helperText={this.state.passwordHelper}/>\n </div>\n <div style={{marginTop: 15, marginBottom: 10}}>\n <TextField required id=\"standard-required\" name = \"confirmpassword\" label=\"Confirm Password\" type=\"password\" onChange={this.confirmPasswordHandler} error={this.state.confrimPasswordError} helperText={this.state.confirmPasswordHelper}/>\n </div>\n <div style={{marginTop: 15, marginBottom: 10}}>\n <Button variant = \"contained\" color = \"primary\" onClick={()=>{this.confirmSubmission()}}>Reset Password</Button>\n </div>\n </Box>\n <Snackbar open={this.state.displaySuccess} autoHideDuration={3000} onClose={()=>{\n this.setState({displaySuccess:false})\n this.props.history.push(\"/home/login\")\n }}>\n <Alert variant = \"filled\" severity=\"success\">\n Account password reset\n </Alert>\n </Snackbar>\n <Snackbar open={this.state.displayWarning} autoHideDuration={3000} onClose={()=>{this.setState({displayWarning:false})}}>\n <Alert variant = \"filled\" severity=\"warning\">\n Password error found\n </Alert>\n </Snackbar>\n <Snackbar open={this.state.displayError} autoHideDuration={3000} onClose={()=>{this.setState({displayError:false})}}>\n <Alert variant = \"filled\" severity=\"error\">\n Cannot use your previous password\n </Alert>\n </Snackbar>\n </form>\n </div>\n );\n }", "function forgotPassword() { \n\n\t\t\t$( \"#load\" ).show();\n\t\t\t\n\t\t\tvar form = new FormData(document.getElementById('reset_form'));\n\t\t\t\n\t\t\tvar validate_url = $('#reset_form').attr('action');\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: validate_url,\n\t\t\t\t//data: dataString,\n\t\t\t\tdata: form,\n\t\t\t\t//dataType: \"json\",\n\t\t\t\tcache : false,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tsuccess: function(data){\n\n\t\t\t\t\t\n\t\t\t\t\tif(data.success == true ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"input\").val('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".forgot-password-box\").html(data.notif);\n\t\n\t\t\t\t\t\tsetTimeout(function() { \n\t\t\t\t\t\t\t//$(\"#notif\").slideUp({ opacity: \"hide\" }, \"slow\");\n\t\t\t\t\t\t\t//window.location.reload(true);\n\t\t\t\t\t\t}, 2000); \n\n\t\t\t\t\t}else if(data.success == false){\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"#notif\").html(data.notif);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t},error: function(xhr, status, error) {\n\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn false;\n\t\t}", "onForgotPassword( values ) {\n const {dispatch} = this.props;\n dispatch( forgotPassword( values, ( ) => history.push( '/thanks-forgot-password' ) ) );\n }", "function forgotPassword(req, res, next) {\n const email = req.body.email;\n user_model_1.default.findByEmail(email, (err, result) => {\n // check errors from db\n if (err) {\n if (err.message === \"not_found\") {\n res.status(404).send({\n message: `Not found User with email ${email}.`,\n });\n }\n else {\n res.status(500).send({\n message: \"Error retrieving User with email \" + email,\n });\n }\n }\n else {\n //sending reset link\n (0, sendEmail_1.sendResetLink)(email)\n .then(() => {\n res.status(200).send(\"Send you a link on the email address\");\n })\n .catch(() => {\n next(new Error(\"Something went wrong when sending a link.\"));\n });\n }\n });\n}", "function showIncorrectPasswordPage() {\n\n // Retrieve all password elements.\n var passwordInputForm = document.getElementById(\"passwordInputForm\");\n var passwordInputLabel = document.getElementById(\"passwordInputLabel\");\n var scenarios = document.getElementById(\"scenarios\");\n\n passwordInputLabel.innerHTML = \"Enter password\";\n passwordInputForm.className = \"item shown\";\n passwordSubmitButton.className = \"item shown\";\n\n scenarios.className = \"options hide\";\n document.getElementById(\"scenariosLabel\").innerHTML = \"\";\n\n showStartupErrorMessage(\"Incorrect password\");\n }", "resetPassword(actionCode, newPassword) {\n var accountEmail;\n let thisComponent = this;\n // Verify the password reset code is valid.\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\n var accountEmail = email;\n \n // TODO: Show the reset screen with the user's email and ask the user for\n // the new password.\n \n // Save the new password.\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\n // Password reset has been confirmed and new password updated.\n \n // TODO: Display a link back to the app, or sign-in the user directly\n // if the page belongs to the same domain as the app:\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\n \n // TODO: If a continue URL is available, display a button which on\n // click redirects the user back to the app via continueUrl with\n // additional state determined from that URL's parameters.\n }).catch(function(error) {\n // Error occurred during confirmation. The code might have expired or the\n // password is too weak.\n });\n }).catch(function(error) {\n // Invalid or expired action code. Ask user to try to reset the password\n // again.\n }).then(function() {\n thisComponent.props.history.push('/signin'); // redirect to home page\n });\n }", "resetPasswordInit(email) {\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\n }", "function ksForgotPassword(){\n //check if the form is valid\n if(!$('#forgotpassword').valid()) return;\n \n //put the loading screen on\n loadingScreen();\n \n //create an object to send to varify auth\n var obj=new Object();\n obj.email = $('#forgotpassword input[name=\"email\"]').val();\n \n //send the reset information via ajax\n $.ajax({\n type: \"POST\",\n url: \"/login/resetpassword/\",\n dataType: \"json\",\n data: obj ,\n async: false,\n success: function(res) {\n if (res.items[0].status ==='success'){\n setSuccessToSuccess();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n \n \n $('#glassnoloading').fadeOut('normal');\n \n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/success.png\");\n $('.registerdialog * .message').text('Successfully identified your account. A mail was sent to the address you supplied. To proceed with password change follow the link in the mail sent.');\n $('.registerdialog > .front-card').remove();\n \n }\n else{\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n\n $('#glassnoloading').fadeOut('normal');\n \n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/failed.png\");\n $('.registerdialog * .message').text(res.items[0].msg);\n }\n },\n error: function(res){\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n \n //display success failure screen\n displaySuccessFailure();\n \n //$(\"#error\").text(\"Connection failure! Try again\");\n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/failed.png\");\n $('.registerdialog * .message').text('Error! Connection failure. Try again');\n }\n });\n}", "async function requestResetPassword(formData) {\n const headers = {};\n attach_headers([HEADERS.CSRF], headers);\n const body = { user: formData };\n\n cleanupAuthState();\n dispatch({ type: LOADING_STARTED });\n const resp = await supervise_rq(() =>\n axios.post(API_PATHS.AUTH_UPDATE_PASSWORD, body, { headers })\n );\n\n if (resp.status === STATUS.SUCCESS) {\n dispatch({\n type: AUTH_ACTIONS.AUTH_REQUEST_RESET_PASSWORD,\n payload:\n \"If an account for the provided email exists, an email with reset instructions will be sent to you. Please check your inbox.\",\n });\n } else {\n dispatch({\n type: AUTH_ACTIONS.AUTH_ERROR,\n payload: \"Oops, something went wrong. Pleas try again later.\",\n });\n }\n }", "renderSuccess(){\n return <SuccessRegister email={this.state.email} back={this.resetForm.bind(this)}/>\n }", "function retrieveForgotPassword() {\n var userData = {};\n angular.copy(vm.misc.forgotPassword, userData);\n cmnSvc.resetForm(scope.forgotPasswordForm, vm.misc.authData);\n fbaseSvc.resetForgetPassword(userData.emailAdd).then(function(rs){\n alert(rs);\n }, function(err){\n alert('Error! '+err);\n });\n }", "screenToShow(){ \n if(!this.props.forgotPasswordScreen){\n return <AuthScreen renderError={this.renderError.bind(this)}/>\n } else {\n return <ResetScreen renderError={this.renderError.bind(this)}/>\n }\n }", "postresetpassword(emailResetPassword) {\n return apiClientEmail.post('/password/reset', {\n email: emailResetPassword,\n })\n }", "function vpb_request_password_link()\n{\n\tvar ue_data = $(\"#ue_data\").val();\n\t\n\tif(ue_data == \"\")\n\t{\n\t\t$(\"#ue_data\").focus();\n\t\t$(\"#this_page_errors\").html('<div class=\"vwarning\">'+$(\"#empty_username_field\").val()+'</div>');\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $('#ue_data').offset().top-parseInt(200)+'px'\n\t\t}, 1600);\n\t\treturn false;\n\t} else {\n\t\tvar dataString = {'ue_data': ue_data, 'page':'reset-password-validation'};\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: vpb_site_url+'forget-password',\n\t\t\tdata: dataString,\n\t\t\tcache: false,\n\t\t\tbeforeSend: function() \n\t\t\t{\n\t\t\t\t$(\"#this_page_errors\").html('');\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('enable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('disable_this_box');\n\t\t\t\t\n\t\t\t\t$(\"#forgot_password_buttoned\").hide();\n\t\t\t\t$(\"#log_in_status\").html('<center><div align=\"center\"><img style=\"margin-top:-40px;\" src=\"'+vpb_site_url+'img/loadings.gif\" align=\"absmiddle\" alt=\"Loading\" /></div></center>');\n\t\t\t},\n\t\t\tsuccess: function(response)\n\t\t\t{\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('disable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('enable_this_box');\n\t\t\n\t\t\t\t$(\"#log_in_status\").html('');\n\t\t\t\t$(\"#forgot_password_buttoned\").show();\n\t\t\t\t\t\n\t\t\t\tvar response_brought = response.indexOf(\"processCompletedStatus\");\n\t\t\t\t$vlog=JSON.parse(response);\n\t\t\t\tif(response_brought != -1)\n\t\t\t\t{\n\t\t\t\t\tif($vlog.processCompletedStatus==true){\n $(\"#ue_data\").val('');\n $(\"#this_page_errors\").html($vlog.response);\n return false;\n\t\t\t\t\t}else{\n setTimeout(function() {\n \twindow.alert(\"To change the password you first need to verify the account by entering the verification code which was sent to your gmail account earlier while sign up in the 'Enter the verification code ... ' field to proceed.\");\n window.location.replace(vpb_site_url+'verification');\n },500);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\"#this_page_errors\").html($vlog.response);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function handlePasswordReset(req, res) {\n csrf.verify(req);\n\n if (!verifyReferrer(req, '/account/passwordreset')) {\n res.status(403).send('Mismatched referrer');\n return;\n }\n\n var name = req.body.name,\n email = req.body.email;\n\n if (typeof name !== \"string\" || typeof email !== \"string\") {\n res.send(400);\n return;\n }\n\n if (!$util.isValidUserName(name)) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Invalid username '\" + name + \"'\"\n });\n return;\n }\n\n db.users.getEmail(name, function (err, actualEmail) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n if (actualEmail === '') {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: `Username ${name} cannot be recovered because it ` +\n \"doesn't have an email address associated with it.\"\n });\n return;\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Provided email does not match the email address on record for \" + name\n });\n return;\n }\n\n crypto.randomBytes(20, (err, bytes) => {\n if (err) {\n LOGGER.error(\n 'Could not generate random bytes for password reset: %s',\n err.stack\n );\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Internal error when generating password reset\"\n });\n return;\n }\n\n var hash = bytes.toString('hex');\n // 24-hour expiration\n var expire = Date.now() + 86400000;\n var ip = req.realIP;\n\n db.addPasswordReset({\n ip: ip,\n name: name,\n email: actualEmail,\n hash: hash,\n expire: expire\n }, function (err, _dbres) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n Logger.eventlog.log(\"[account] \" + ip + \" requested password recovery for \" +\n name + \" <\" + email + \">\");\n\n if (!emailConfig.getPasswordReset().isEnabled()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"This server does not have mail support enabled. Please \" +\n \"contact an administrator for assistance.\"\n });\n return;\n }\n\n const baseUrl = `${req.realProtocol}://${req.header(\"host\")}`;\n\n emailController.sendPasswordReset({\n username: name,\n address: email,\n url: `${baseUrl}/account/passwordrecover/${hash}`\n }).then(_result => {\n sendPug(res, \"account-passwordreset\", {\n reset: true,\n resetEmail: email,\n resetErr: false\n });\n }).catch(error => {\n LOGGER.error(\"Sending password reset email failed: %s\", error);\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Sending reset email failed. Please contact an \" +\n \"administrator for assistance.\"\n });\n });\n });\n });\n });\n}", "function buildPasswordResetView(){\n\tpasswordResetWindow = Ti.UI.createWindow({\n\t\tbackgroundColor:UI_BACKGROUND_COLOR,\n\t\tmodal:true,\n\t\ttranslucent:false,\n\t\tbarImage:iOS7 ? IMAGE_PATH+'common/bar7.png' : IMAGE_PATH+'common/bar.png',\n\t\tbarColor:UI_COLOR,\n\t\ttitle:'Password Reset'\n\t});\n\t\n\t//check if version is ios 7 and higher and create new navigationWindow (3.1.3.GA)\n\t//if(iOS7){\n\t\tpasswordResetNavWin = Ti.UI.iOS.createNavigationWindow({\n\t\t modal: true,\n\t\t window: passwordResetWindow\n\t\t});\n\t//}\n\t\n\tvar passwordResetDoneButton = Titanium.UI.createButton({\n\t\tbackgroundImage:IMAGE_PATH+'common/Done_button.png',\n\t width:48,\n\t height:33\n\t});\n\tpasswordResetWindow.setRightNavButton(passwordResetDoneButton);\n\t\n\tpasswordResetDoneButton.addEventListener('click', function(e){\n\t\t//if(iOS7){\n\t\t\tpasswordResetNavWin.close();\n\t\t//}else{\n\t\t//\tpasswordResetWindow.close();\n\t\t//}\n\t});\n\t\n\tvar passwordResetDogsquareLogo = Ti.UI.createImageView({\n\t\timage:IMAGE_PATH+'signup/dogsquare_logo.png',\n\t\ttop:10\n\t});\n\tpasswordResetWindow.add(passwordResetDogsquareLogo);\n\t\n\tvar passwordResetFormBackground = Ti.UI.createView({\n\t\tbackgroundColor:'e7e6e6',\n\t\ttop:70,\n\t\twidth:262,\n\t\theight:42\n\t});\n\t\n\t//email textfield\n\tpasswordResetFieldEmail = Ti.UI.createTextField({\n\t\twidth:262,\n\t\theight:39,\n\t\tpaddingLeft:4, \n\t\tpaddingRight:4,\n\t\ttop:1,\n\t\tkeyboardType:Ti.UI.KEYBOARD_EMAIL\n\t});\n\tpasswordResetFormBackground.add(passwordResetFieldEmail);\n\tpasswordResetFieldEmail.addEventListener('change', handlePasswordResetTextFieldChange);\n\t\n\tpasswordResetFieldEmailHintTextLabel = Ti.UI.createLabel({\n\t\ttext:'Your Email',\n\t\tcolor:'999999',\n\t\ttextAlign:'left',\n\t\tleft:4,\n\t\topacity:0.7,\n\t\theight:30,\n\t\tfont:{fontSize:17, fontWeight:'regular', fontFamily:'Open Sans'}\n\t});\n\tpasswordResetFieldEmail.add(passwordResetFieldEmailHintTextLabel);\n\t\n\tvar passwordResetSepparator = Ti.UI.createView({\n\t\tbackgroundColor:'CCCCCC',\n\t\twidth:262,\n\t\theight:2,\n\t\ttop:40,\n\t\topacity:0.4\n\t});\n\tpasswordResetFormBackground.add(passwordResetSepparator);\n\t\t\n\tpasswordResetWindow.add(passwordResetFormBackground);\n\t\n\t//button to change password\n\tvar passwordResetButton = Ti.UI.createButton({\n\t\tbackgroundImage:IMAGE_PATH+'common/reset_btn.png',\n\t\twidth:270,\n\t\theight:55,\n\t\ttop:123,\n\t\tbottom:30\n\t});\n\tpasswordResetWindow.add(passwordResetButton);\n\tpasswordResetButton.addEventListener('click', handlePasswordResetButton);\n}", "function resetPassword(email){\n $.ajax({\n method: 'POST',\n url: \"inc/Auth/forget.php\",\n data: {email: email}\n }).done(function(msg){\n if(msg == 'user issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-exist').removeClass('novisible');\n displayError([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n if(msg == 'confirm issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-confirm').removeClass('novisible');\n displaySpecial([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n //ce msg est un retour de la fonction de mail et non de la fonction de reset\n if(msg == 'success')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.valid-forgot').removeClass('novisible');\n displaySuccess([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n });\n}", "async sendResetPassword({ request, antl, session, response }) {\n let data = request.only(['email'])\n\n try {\n await Recaptcha.validate(request.input('g-recaptcha-response'))\n } catch (errorCodes) {\n session\n .withErrors([{ field: 'recaptcha', message: antl.formatMessage('main.alert_recaptcha')}])\n .flashAll()\n return response.route('UserController.requireResetPassword')\n }\n\n let user = await User.findBy('email', sanitizor.normalizeEmail(data.email))\n if (!user || !user.activated) {\n session.flash({ error: antl.formatMessage('main.user_not_activated_not_registered') })\n return response.redirect('back')\n }\n\n if (user.password_reset_time) {\n let diff = (new Date()) - Date.parse(user.password_reset_time)\n if (diff < WAIT_TIME) {\n let min = Math.ceil((WAIT_TIME - diff)/60000.0)\n session.flash({ error: antl.formatMessage('main.email_rate_limit', { remaining: min }) })\n return response.redirect('back')\n }\n }\n\n let key = User.getToken()\n user.password_reset_time = new Date()\n user.password_reset_hash = await User.Hash(key)\n await user.save()\n\n Event.fire('mail:reset_password', {user, key})\n\n session.flash({ success: antl.formatMessage('main.email_sent') })\n return response.redirect('/')\n }", "resetUserPassword() {\n this.security.resetUserPassword(this.passwordDetails, '/api/auth/reset/' + this.$stateParams.token)\n .then((response) => {\n this.passwordDetails = null;\n this.toastr.success(\"Your password was reset successfully.\");\n // Attach user profile\n this.authentication.user = response;\n // And redirect to the index page\n this.$state.go('home');\n })\n .catch((response) => {\n this.toastr.error(response.message.message, 'Error');\n });\n }", "editPassword() {\n this.openChangePasswordModal();\n }", "render() {\r\n const { email, password } = this.state;\r\n return (\r\n <SafeAreaView style={styles.container}>\r\n <Block style={{ paddingHorizontal: theme.SIZES.BASE }}>\r\n <Input\r\n right\r\n color={theme.COLORS.BLACK}\r\n placeholderTextColor={materialTheme.COLORS.DEFAULT}\r\n style={{ borderRadius: 3, borderColor: materialTheme.COLORS.INPUT }}\r\n name=\"Name\"\r\n value={email}\r\n placeholder=\"Name\"\r\n onChangeText={text => this.handleEmailChange(text)}\r\n />\r\n </Block>\r\n <Block style={{ paddingHorizontal: theme.SIZES.BASE }}>\r\n <Input\r\n right\r\n color={theme.COLORS.BLACK}\r\n placeholderTextColor={materialTheme.COLORS.DEFAULT}\r\n style={{ borderRadius: 3, borderColor: materialTheme.COLORS.INPUT }}\r\n name=\"Last Name\"\r\n value={email}\r\n placeholder=\"Last Name\"\r\n onChangeText={text => this.handleEmailChange(text)}\r\n />\r\n </Block>\r\n <Block style={{ paddingHorizontal: theme.SIZES.BASE }}>\r\n <Input\r\n right\r\n color={theme.COLORS.BLACK}\r\n placeholderTextColor={materialTheme.COLORS.DEFAULT}\r\n style={{ borderRadius: 3, borderColor: materialTheme.COLORS.INPUT }}\r\n name=\"email\"\r\n value={email}\r\n placeholder=\"Enter email\"\r\n onChangeText={email => this.handleEmailChange(email)}\r\n />\r\n </Block>\r\n <Block style={{ paddingHorizontal: theme.SIZES.BASE }}>\r\n <Input\r\n right\r\n color={theme.COLORS.BLACK}\r\n //placeholder=\"icon right\"\r\n placeholderTextColor={materialTheme.COLORS.DEFAULT}\r\n style={{ borderRadius: 3, borderColor: materialTheme.COLORS.INPUT }}\r\n name=\"password\"\r\n value={password}\r\n placeholder=\"Password\"\r\n password\r\n viewPass\r\n onChangeText={password => this.handlePasswordChange(password)}\r\n />\r\n </Block>\r\n <Block center>\r\n <Button shadowless color=\"success\" style={[styles.button, styles.shadow]} onPress={() => this.onLogin()}>\r\n Sign Up\r\n </Button>\r\n </Block>\r\n </SafeAreaView>\r\n );\r\n }", "function showRegister() {\n clearErrorMsg();\n showLinks(['loginLink']);\n showView('registerForm');\n}", "function logkey() {\n if(password.length <= 0) {\n // Displays message about password length requirements\n ReactDOM.render(<div id=\"password-status-2\">Password length must be one character or more</div>, document.getElementById('password-status-1'));\n // Show password length message\n $(\"#password-status-2\").show()\n } else if (password.length > 0) {\n // Hide password length message\n $(\"#password-status-2\").hide()\n }\n }", "function resetPassword(e) {\n e.preventDefault();\n\n axios\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\n security: questions,\n newPW: password,\n })\n .then((res) => {\n localStorage.setItem(\"token\", res.data);\n alert(\"Your password has been changed! Logging you in...\");\n router.push(\"/\");\n })\n .catch(() => {\n alert(\n \"Could not reset password! You likely had the wrong answers to the security questions\"\n );\n });\n }", "function resetChangePass(massage = \"\") {\n $(\"#successMassage\").html(massage);\n $(\"#verifyMassage\").html(\"\");\n $(\"#confirmMassage\").html(\"\");\n $('#currentPassword').val(\"\");\n $('#newPassword').val(\"\");\n $('#confirmPassword').val(\"\");\n}", "function forgotPasswordEnterDetailsSignup(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.addClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n formEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }", "render() {\n return (\n <form method=\"POST\" onSubmit={this.submitChangePassword}>\n <label htmlFor=\"new_password1ChangePassword\">Password</label>\n <input\n name=\"new_password1\"\n className={checkInputError(this.props, \"new_password1\")}\n type=\"password\"\n id=\"new_password1ChangePassword\"\n placeholder=\"New password\"\n required\n />\n <input\n name=\"new_password2\"\n className={checkInputError(this.props, \"new_password2\")}\n type=\"password\"\n placeholder=\"Confirm new password\"\n required\n />\n <button type=\"submit\">Change</button>\n </form>\n )\n }", "async passwordreset({ commit, dispatch }, form) {\n form.busy = true;\n try {\n await App.post(route(\"api.auth.reset-password\"), form).then(() => {\n commit(\"isAuthenticated\", {\n isAuthenticated: vm.$auth.check()\n });\n form.busy = false;\n });\n await dispatch(\"fetchMe\");\n } catch ({ errors, message }) {\n form.errors.set(errors);\n form.busy = false;\n }\n }", "function displayPassword() {\n document.querySelector(\"#generate\").blur(); // remove button focus so it doesn't hang there after password is displayed.\n document.querySelector(\"#passwordBox\").value = generatePassword(); // call generate function and place returned value into HTML <input>\n}", "userUpdate(email) {\n this.render(email);\n }", "function addEventHandlerForgotPasswordButton() {\n\td3.select(\"#forgot-password-button\").on(\"click\", function() {\n\t\td3.event.preventDefault();\n\t\tvar emailElement = d3.select(\"input[name=email]\");\n\t\tvar email = emailElement.property(\"value\");\n\t\tif(tp.util.isEmpty(email) || !validEmail(email)) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-reset-email-invalid\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\temailElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\t\tvar confirmDispatcher = tp.dialogs.showDialog(\"confirmDialog\", tp.lang.getFormattedText(\"password-reset-confirm\", email))\n\t\t\t.on(\"ok\", function() {\n\t\t\t\ttp.session.sendPasswordReset(email, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.error(error, data);\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"errorDialog\", \"#password-reset-failed\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Handle successful send passwors reset\n\t\t\t\t\ttp.dialogs.closeDialogWithMessage(confirmDispatcher.target, \"messageDialog\", \"#password-reset-successful\");\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t})\n\t\t;\n\t});\n}", "function generate_password() {\n base.emit(\"generate-password\", {\n url: document.location.toString(),\n username: find_username(),\n });\n }", "function renderButton() {\n gapi.signin2.render('signin2', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n\n gapi.signin2.render('registrar-gmail', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n}", "function user_create_send_notification_button() {\n this.submit( null, null, function(data){\n data.resetpw = true;\n })\n}", "function sendPassword() {\n AuthService.forgotPassword(vm.user)\n .then(sendPasswordSuccess, sendPasswordError)\n .catch(sendPasswordError);\n // $state.go('app.changePassword');\n }", "async activate ({ view, request, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeActivate',\n header_msg: antl.formatMessage('main.signup'),\n button_msg: antl.formatMessage('main.signup'),\n })\n }", "function setPassword() {\n postPassword(\n success = function () {\n console.log('Password set');\n setPermissions();\n },\n error = null,\n email,\n password);\n }", "function forgotPassword(divid,url,mailid,type,fid){\n\t var emailvalue=document.getElementById(mailid).value;\n\t \n\t\t\t emailvalue=rm_trim(emailvalue);\n\t\t\t if(emailvalue==''){\n\t\t\t alert(\"Please Enter Email\");\n\t\t\t document.getElementById(mailid).focus();\n\t\t\t return false;\n\t\t\t }\n\t\t\t else if(!emailValidator(emailvalue)){\n\t\t\t\t\talert(\"Invalid Email \");\n\t\t\t\t\tdocument.getElementById(divid).innerHTML=\"\";\n\t\t\t\t\tdocument.getElementById(mailid).value=\"\";\n\t\t\t\t\tocument.getElementById(mailid).focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t }\n\t\t\t\t\t // alert(url);\n\t\t\turl=url+\"&email=\"+emailvalue;\n\t\t\tgetServerResponse(divid,url,\"\",true)\n}", "function changePasswordHandler(response) {\n messageData = JSON.parse(response);\n if (messageData.success) \n\tdocument.getElementById(\"changePasswordForm\").reset();\n}", "function render_login(username, password, error){\n return res.render('sign-in', {error1: '', error2: error, username: username, password: password})\n }", "function changePasswordFn(newPassword) {\n var obj = {\n id : vm.userId,\n newPassword: newPassword\n };\n\n UserService\n .resetPassword(obj)\n .then(function (res) {\n var res = res.data;\n if (res.data && res.code === \"OK\") {\n vm.passForm.newPassword = '';\n vm.passForm.confirm_password = '';\n $('#password-strength-label').text('');\n $(\"#password-strength-label\").removeClass(\"p15 btn-rounded\");\n $('.strength-meter-fill').removeAttr('data-strength');\n $scope.setFlash('s', res.message);\n }\n },\n function (err) {\n if (err.data && err.data.message) {\n $scope.setFlash('e', err.data.message);\n }\n })\n }", "renderNewPassword(){\n return (\n <form onSubmit={this.confirmNewPassword}>\n <FormGroup controlId=\"verifyCode\" bsSize=\"large\">\n <ControlLabel>Input your verify code</ControlLabel> \n <FormControl\n autoFocus\n type=\"tel\"\n placeholder=\"Enter verify code\"\n value={this.state.verifyCode}\n onChange={this.handleChange}\n />\n </FormGroup>\n <FormGroup controlId=\"newPassword\" bsSize=\"large\">\n <ControlLabel>Input your new password</ControlLabel> \n <FormControl\n placeholder=\"Enter your new password\"\n value={this.state.newPassword}\n onChange={this.handleChange}\n type=\"password\"\n />\n </FormGroup>\n <FormGroup controlId=\"confirmPassword\" bsSize=\"large\">\n <ControlLabel>Input your new password</ControlLabel> \n <FormControl\n placeholder=\"Enter new password again\"\n value={this.state.confirmPassword}\n onChange={this.handleChange}\n type=\"password\"\n />\n </FormGroup>\n <LoaderButton\n block\n bsSize=\"large\"\n disabled={!this.validateNewPasswordForm()}\n type=\"submit\"\n isLoading={this.state.isLoading}\n text=\"Enter\"\n loadingText=\"Logging in…\"\n />\n <LinkContainer to=\"/\" activeClassName=\"\">\n <LoaderButton\n block\n bsStyle=\"default\"\n bsSize=\"large\"\n onClick={this.routechange}\n text=\"Cancel\"\n loadingText=\"Returning…\"\n />\n </LinkContainer>\n </form>\n );\n }", "function showForgotPassword() {\n document.getElementById(\"newAccount\").style.display=\"none\";\n document.getElementById(\"login\").style.display=\"none\";\n document.getElementById(\"forgotPassword\").style.display=\"block\";\n document.getElementById(\"forgotUsername\").value=\"\";\n}", "function forgotPasswordSelected(){\n\t\tformLogin.removeClass('is-selected');\n\t\tformSignup.removeClass('is-selected');\n\t\tformEnterDetailsOTP.removeClass('is-selected');\n formForgotPasswordDetailsSignup.removeClass('is-selected');\n\t formEnterLoginDetailsToSignUp.removeClass('is-selected');\n\t\tformForgotPassword.addClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n\n\t}", "async function resetPassword() {\r\n try{\r\n const response = await axios.post(\"https://suraj-url-backend.herokuapp.com/new_password\", {\r\n token: props.match.params.id,\r\n newpassword: pass,\r\n });\r\n setResult(response.data);\r\n }catch(error){\r\n console.log(error)\r\n }\r\n \r\n }", "resetPassword(event) {\n event.preventDefault();\n let data = {\n password: this.state.password,\n confirmPassword: this.state.confirmPassword,\n };\n //Calling the API using axios method\n resetPassword(data, this.state.token).then((response) => {\n if (response.status === 200) {\n this.setState({\n message: \"Password reset Successfully\",\n });\n } else {\n this.setState({\n message: \"Password is Not changed\",\n snackbarmsg: \" Make Sure that password & confirmPassword is correct\",\n snackbaropen: true,\n });\n }\n });\n }", "render(){\n\n \n let errorMessage = null;\n if(this.state.error){\n errorMessage = <small id=\"emailHelp\" className=\"form-text text-danger\">{this.state.error}</small>;\n }\n let errorClass = 'form-group';\n if(this.state.error){\n errorClass = \"form-group has-danger\";\n }\n return(\n <div>\n <Header />\n <form onSubmit={this.handleSubmit}>\n <div className={ errorClass }>\n <label htmlFor=\"email\">Email address</label>\n <input \n type=\"email\"\n autoFocus\n className=\"form-control\"\n name=\"email\"\n id=\"email\"\n aria-describedby=\"emailHelp\"\n placeholder=\"Enter email\"\n onChange={this.handleEmail}\n value={this.state.email}\n />\n {\n }\n { errorMessage }\n </div>\n <div className={ errorClass }>\n <label htmlFor=\"password\">Password</label>\n <input \n type=\"password\"\n className=\"form-control is-invalid\"\n id=\"password\"\n name=\"password\"\n placeholder=\"Password\"\n onChange={this.handlePassword}\n value={this.state.password}\n />\n {\n }\n {errorMessage}\n </div>\n <button type=\"submit\" className=\"btn btn-primary\">Submit</button>\n </form>\n </div>\n );\n }", "function getFormRegister(request,response) {\n response.render('pages/login/signUp')\n}", "render () {\n return (\n <div className=\"auth-page login-page\">\n <AuthHeader/>\n <br/>\n <div className=\"auth-content login-content\">\n <form className=\"form\">\n <TextField label=\"Username\" variant=\"outlined\" margin=\"normal\" onChange={this.updateUsername}/>\n <br/>\n <TextField label=\"Password\" variant=\"outlined\" margin=\"normal\" onChange={this.updatePassword}/>\n </form>\n <br/>\n <Tooltip title=\"login\">\n <button className=\"login-button auth-button journey-button\" onClick={this.onClick}>\n login\n </button>\n </Tooltip>\n <div className=\"switch-auth-text\">\n Don't have an account yet?&nbsp;\n <a href=\"/createAccount\">Sign up</a>\n !\n </div>\n </div>\n </div>\n );\n }", "function resetPassword() {\n\t\t\tif (vm.newPassword != \"\" && vm.newPassword == vm.confirmPassword) {\n\t\t\t\tvm.waiting = true;\n\t\t\t\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\n\t\t\t\t\tvm.success = 1;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t}, function(res) {\n\t\t\t\t\tvm.success = 0;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgui.alertError(\"Passwords do not match.\");\n\t\t\t}\n\t\t}", "createPasswordResetLink(token, user_id) {\n\t\treturn `${SiteUrl}/auth/password-reset/${token}/${user_id}`;\n\t}", "function showChangePasswordDialog(passwordResetToken) {\n\tvar errorCallback = function(error, data) {\n\n\t\t// Special case when old password did not match\n\t\tif(!passwordResetToken && !error && data && data[\"resultCode\"] === \"NOT_FOUND\") {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#wrong-password\");\n\t\t} else {\n\t\t\tconsole.error(error, data);\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-change-failed\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tif(passwordResetToken) {\n\t\t\t\t\t\tdoNavigate(\"/home.html\");\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\t\t}\n\t};\n\tvar changeDispatcher = tp.dialogs.showDialog(\"changePasswordDialog\", tp.lang.getText(passwordResetToken ? \"password-change\" : \"change-password\"));\n\tif(!passwordResetToken) {\n\t\td3.select(\".password-old\").classed(\"hidden\", false);\n\t}\n\tchangeDispatcher\n\t\t.on(\"ok\", function() {\n\t\t\tvar oldPasswordElement = d3.select(\"input[name=password-old]\");\n\t\t\tvar oldPassword = oldPasswordElement.property(\"value\");\n\t\t\tvar newPasswordElement = d3.select(\"input[name=password-new]\");\n\t\t\tvar newPassword = newPasswordElement.property(\"value\");\n\t\t\tvar verifyPassword = d3.select(\"input[name=password-verify]\").property(\"value\");\n\t\t\tif(!passwordResetToken) {\n\t\t\t\tif(tp.util.isEmpty(oldPassword) || oldPassword.length < 6) {\n\t\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\toldPasswordElement.node().select();\n\t\t\t\t\t\t})\n\t\t\t\t\t;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tp.util.isEmpty(newPassword) || newPassword.length < 6) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(newPassword !== verifyPassword) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#passwords-different\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(passwordResetToken) {\n\t\t\t\ttp.session.resetPassword(passwordResetToken, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.showDialog(\"messageDialog\", \"#password-reset-change-successful\")\n\t\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\t\tdoNavigate(\"/home.html?signin=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} else {\n\t\t\t\ttp.session.changePassword(oldPassword, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-change-successful\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn false;\n\t\t})\n\t\t.on(\"cancel\", function() {\n\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-no-change\");\n\t\t\treturn false;\n\t\t})\n\t;\n}", "async show() {\n const ctx = this.ctx;\n await ctx.render('auth/verify');\n }", "function validateForgotPassword(e) {\n\n var regex = /^(\\d{3}\\d{3}\\d{4}|([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?))$/;\n e.preventDefault();\n if (regex.test(document.getElementById(\"capture_forgotPassword_resetPasswordUserID\").value)) {\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\n //document.getElementById('forgotFormButton').style.display = 'none';\n //document.getElementById(\"forgotFormSubmit\").click();\n } else if (document.getElementById(\"capture_forgotPassword_resetPasswordUserID\").value != '') {\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\n console.log('invalid.. fp GROUP ID');\n // document.getElementById('forgotPasswordGroupFailure').style.display = 'block';\n //document.getElementById('forgotPasswordForm').style.display = 'none';\n // document.getElementById('forgotFormButton').style.display = 'none';\n // document.getElementById(\"forgotFormSubmit\").click();\n } else {\n console.log('invalid blank fp');\n }\n}", "function sendForgetPassword(){\n //check validation\n if(!$('#forget_password_dialog form').valid()) return;\n \n //put loading screen\n loadingScreen();\n \n //prepare the object to send\n var obj=new Object();\n obj.email = $.trim($('#forget_password_dialog_textbox').val());\n \n //send the reset information via ajax\n $.ajax({\n type: \"POST\",\n url: \"/login/resetpassword/\",\n dataType: \"json\",\n data: obj ,\n async: false,\n success: function(res) {\n if (res.items[0].status ==='success'){\n $('#forget_password_dialog_error').css('display', 'none');\n $('#forget_password_dialog_body').fadeOut('normal', function(){\n $('#forget_password_dialog_success').fadeIn('normal');\n });\n }\n else{\n $('#forget_password_dialog_error * p').text(res.items[0].msg);\n $('#forget_password_dialog_error').fadeIn('normal');\n }\n removeLoadingScreen();\n },\n error: function(res){\n $('#forget_password_dialog_error * p').text('Connection failure: Try again');\n $('#forget_password_dialog_error').fadeIn('normal');\n removeLoadingScreen();\n }\n });\n}", "function submitNewPassword() {\n axios.post(`/users/reset`, {onyen: onyenAndToken[0], password: password}, {\n headers: {\n Authorization: `Token ${onyenAndToken[1]}`\n }\n }).then(res => {\n window.localStorage.setItem('onyen', res.data.onyen);\n window.localStorage.setItem('name', res.data.name);\n if (res.data.admin) {\n window.localStorage.setItem(\"adminUser\", \"true\");\n history.push(\"/dashboard\");\n } else {\n window.localStorage.setItem(\"teamId\", res.data.teamId);\n window.localStorage.setItem(\"studentUser\", \"true\");\n history.push(\"/studentDash\");\n }\n });\n }", "requirePassword() {\n this.navigateTo('walletResetRequirePassword');\n }", "function onResetClicked() {\n let event = new Event(\"resetClicked\", this.passwordField.value);\n this.notifyAll(event);\n}", "forgotPasswordOnclick() {\n this.setState({ page: \"forgot\" });\n }", "async action() {\n let result = await this.userServiceDI.checkMailInDb({\n email: this.model.email\n });\n if (result != null) {\n let model = {\n body: {\n email: this.model.email,\n uid: result.uid,\n href: (new URL(this.referer)).origin,//this.referer,//CONFIG.FRONT_END_URL,\n name: result.name\n }\n };\n this.mailSenderDI.mailSend({\n xslt_file: EMAIL_TEMPLATE.forgot_password_step_1,\n model,\n email_to: this.model.email,\n language: result.language,\n mail_title: new CodeDictionary().get_trans(\n \"FORGOT_PASSWORD_FIRST_MAIL\",\n \"EMAIL\",\n result.language\n )\n });\n }\n }", "render() {\n return (\n <div className=\"col-sm-5 col-xs-12 registration_main\">\n <div className=\"registration_head\">\n <span>Vous souhaitez tester notre plateforme ?</span>\n <Link to=\"/register\" className=\"btn-primary login\">Demander une démo</Link>\n </div>\n <div className=\"registration_con\">\n <span className=\"logo\"><img src={logoImg} className=\"img-responsive\" alt=\"visiretail\" /> </span>\n <h1>Simplifiez le déploiement de votre marketing digital</h1>\n <div className=\"form_main\">\n <form action=\"#/app/home\">\n <div className=\"form_raw\">\n <label>Username</label>\n <input type=\"text\" className=\"form-control\" required />\n </div>\n <div className=\"form_raw\">\n <label> Mot de passe</label>\n <input type=\"password\" className=\"form-control\" required />\n </div>\n <button className=\"btn-primary\">connexion</button>\n <a href=\"#\" className=\"fogot\">Mot de passe oublié ?</a>\n </form>\n </div>\n </div>\n </div>\n );\n }", "renderEmailInputView() {\n return (\n <View style={styles.inputContainer}>\n {this.renderEmailLabel()}\n {this.renderEmailInput()}\n {this.renderResetButton()}\n </View>\n );\n }", "render() {\n\t\treturn this.renderRegisterPage();\n\t}", "function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}", "function resetPasswordSuccess() {\n var $formState = $('.reset-password-success');\n\n // check if reset password form was successfully submited.\n if (!$formState.length) {\n return;\n }\n\n // show success message\n $('#ResetSuccess').removeClass('hide');\n }", "sendPasswordReset(email) {\n return axios\n .post(this.apiUrl() + `/users/forgot_password/`, {\n email: email,\n }, {\n headers: this.authHeader(),\n })\n }", "function showPasswordInput() {\n refreshAttemptCounter();\n\n // Change the service text accordingly\n // depending on passwordType(global)\n if(passwordType === 1) {\n $(\"#service\").text(\"Email\");\n listenLoginButton();\n listenLoginInput();\n }\n else if(passwordType === 2) {\n $(\"#service\").text(\"Shopping\");\n }\n else if(passwordType === 3) {\n $(\"#service\").text(\"Banking\");\n }\n\n // When UI is shown, record start time\n $(\"#ui_3\").fadeIn(null, ()=>{\n startTime = performance.now(); \n });\n}", "function postChangePassword(data, textStatus, jqXHR, param) {\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar div = $('<div>');\n\tuiDiv.append(div);\n\tdiv.addClass('transmissionnum');\n\tdiv.html('The password was successfully changed.');\n}" ]
[ "0.7532324", "0.7391816", "0.7268369", "0.69392043", "0.6881498", "0.68759274", "0.66833407", "0.6670186", "0.643608", "0.6398368", "0.6392016", "0.6330296", "0.6229249", "0.62137234", "0.6189236", "0.61827064", "0.6123889", "0.61110353", "0.6103", "0.60892946", "0.606166", "0.6056939", "0.6042231", "0.60187083", "0.60004777", "0.5993955", "0.5978661", "0.5978169", "0.59714305", "0.596772", "0.5960412", "0.5959909", "0.59429353", "0.59327024", "0.5927064", "0.59194314", "0.5896584", "0.58945197", "0.5884151", "0.58805895", "0.5877363", "0.58671904", "0.58640856", "0.58585924", "0.5857831", "0.58510244", "0.5847202", "0.58341634", "0.5828822", "0.5822317", "0.5813436", "0.5809691", "0.5795602", "0.57899696", "0.5787929", "0.5777513", "0.5769259", "0.5766719", "0.5764002", "0.57441306", "0.5739674", "0.5730626", "0.571695", "0.5700167", "0.5683511", "0.56830037", "0.56757957", "0.5666393", "0.56661767", "0.56645864", "0.56637025", "0.5663284", "0.5658824", "0.56453955", "0.56419486", "0.564121", "0.56348324", "0.5632161", "0.56315076", "0.5628966", "0.56266373", "0.5623031", "0.56222343", "0.5619523", "0.56174475", "0.5616566", "0.56143415", "0.561431", "0.5614121", "0.5614034", "0.5613998", "0.5609794", "0.5608716", "0.5587371", "0.5584988", "0.55820686", "0.5574741", "0.55738467", "0.55699396", "0.55644006" ]
0.5643229
74
function to retrieve list of users from database; (username, firstname, and lastname)
function getUsers(){ $.ajax({ type:'get', url: 'http://127.0.0.1/opinion/web/app_dev.php/ff/users', success: function (data) { var users = data.users, options_array = new Array(), //loop trought users getting username and name i = 0; users.forEach(function(user){ var username = user.username, key = i, pic = user.pic_path, name = user.firstname+' '+user.lastname, option = {'id':i, 'pic':pic, 'username':username, 'name':name}; options_array.push(option); i = i+1; }); var options = options_array; //stock users array in html element tag $('.fri-stk-data').attr('data-users', JSON.stringify(options_array)); var REGEX_EMAIL = '([a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@' + '(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)'; $('.nw-msg-recip').selectize({ persist: false, maxItems: null, valueField: 'username', labelField: 'name', searchField: ['name', 'username'], options: options, render: { item: function(item, escape) { return '<div class="selec-field">' + (item.name ? '<span class="selec-name">' + escape(item.name) + '</span><br/>' : '') + (item.pic ? '<span class="selec-pic" data-pic-url='+escape(item.pic)+'></span>':'') + '</div>'; }, option: function(item, escape) { var label = item.name || item.username; var caption = item.name ? item.username : null; return '<div class="selec-sugg">' + '<span class="label">' + escape(label) + '</span><br/>' + (caption ? '<span class="caption">' + escape(caption) + '</span>' : '') + '</div>'; } }, createFilter: function(input) { var match, regex; // [email protected] regex = new RegExp('^' + REGEX_EMAIL + '$', 'i'); match = input.match(regex); if (match) return !this.options.hasOwnProperty(match[0]); // name <[email protected]> regex = new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i'); match = input.match(regex); if (match) return !this.options.hasOwnProperty(match[2]); return false; }, create: function(input) { if ((new RegExp('^' + REGEX_EMAIL + '$', 'i')).test(input)) { return {username: input}; } var match = input.match(new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i')); if (match) { return { username : match[2], name : $.trim(match[1]) }; } alert('Invalid username address.'); return false; }, hideSelected: true, openOnFocus: false }); return true; }, failure: function(Error){ Error.bind(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "function getUsers() {\n return db('users')\n .select('id', 'username')\n}", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function getUsers(res, mysql, context, complete){\n mysql.pool.query(\"SELECT `first_name`, `username`, `user_id` FROM Users\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results;\n complete();\n });\n}", "function getallusers() {\n\n\t}", "function getUsers (db = connection) {\n return db('users').select()\n}", "function getUsers(request, response) {\n User.find({}, function(err, users) {\n if(err) {\n response.status(500).json({message: \"No users were found.\"});\n }\n if(!users) {\n response.status(404).json({message: \"No users were found.\"});\n }\n var userList = [];\n users.forEach(function(element) {\n userList.push({name: element.fullName, userId: element.userId});\n })\n\n response.status(200).send(userList);\n })\n}", "function getUsers() {\n let ourQuery = 'SELECT employeeID, name FROM QAA.user_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "function listUsers(callback) { \r\n this.users.find({}).toArray(function(err, arrayOfUsers) {\r\n var i;\r\n var nameArray = [];\r\n if (!err) {\r\n for (i = 0; i < arrayOfUsers.length; i++) {\r\n nameArray.push(arrayOfUsers[i].username);\r\n }\r\n }\r\n callback(err, nameArray);\r\n });\r\n}", "function listUsers() {\n gapi.client.directory.users.list({\n 'customer': 'my_customer',\n 'maxResults': 100,\n 'orderBy': 'email',\n 'viewType': \"domain_public\"\n }).then(function(response) {\n var users = response.result.users;\n var menu = document.getElementById('menu-main');\n menu.className += \" show-toggle\";\n //appendPre('Directory Loaded, you may now Show Directory <a href=\"link\"> test </a>');\n if (users && users.length > 0) {\n for (i = 0; i < users.length; i++) {\n //console.log(user);\n var user = users[i];\n userlist.push(user)\n /*appendPre('-' + user.primaryEmail + ' (' + user.name.fullName + ')');\n if (user.organizations){\n appendPre(user.organizations[0].title);\n };\n if (user.thumbnailPhotoUrl){\n appendPre(user.thumbnailPhotoUrl)\n }*/\n }\n } else {\n appendPre('No users found.');\n }\n });\n }", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function fetchAllUsers() {\n var users = [{\n firstName: \"Scott\",\n lastName: \"Jason\",\n email: \"[email protected]\",\n hair: \"blone\",\n hasTwoFirstNames: true\n }, {\n firstName: \"Austin\",\n lastName: \"Bourdier\",\n email: \"[email protected]\",\n hair: \"brown\",\n hasTwoFirstNames: false\n }, {\n firstName: \"Jessica\",\n lastName: \"Raynes\",\n email: \"[email protected]\",\n hair: \"blonde\",\n hasTwoFirstNames: false\n }];\n return function renderUsers() {\n return users;\n };\n}", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "function getUsers(db){\n return db('users')\n .select('*')\n}", "function databaseGetUserNames(){\r\n\tconnectsql.query(\"SELECT username FROM chatTable\", function(error, rows, fields){\r\n\t\tif(!!error){\r\n\t\t\tconsole.log('Error in the GetUserNames query');\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\tconsole.log('Sucessful GetUserNames query');\r\n\t\t\tvar s = [];\r\n\t\t\tfor (var i in rows) {\r\n\t\t\t\ts.push(rows[i].username);\r\n\t\t\t}\r\n\t\t\tbenutzer = s;\r\n\t\t}\r\n\t});\r\n}", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "function findAllUsers(callback) {\n \treturn fetch(this.url)\n .then(function(response) {\n return response.json();\n });\n }", "function readUsers() {\n\tvar userhead = [\n\t\t'username', null, 'beruf','gender', null, 'partei',\n\t 'location', 'description', 'url', null, null,\n\t\tnull, null, 'followers', null, 'following', 'listed', null ];\n\tvar userdefaults = [null, null, null, 0 , null, 0];\n\tvar userlist = readData('Users', 'UserList.txt', '\\t', userhead, userdefaults);\n\tvar a, aZ;\n\n\tfor(a = 0, aZ = userlist.length; a < aZ; a++) {\n\t\tvar ua = userlist[a];\n\t\tif (ua.beruf === '9') throw new Error('Beruf 9 :-(');\n\t\tuserlist[a] = initUser(\n\t\t\tua.username.toLowerCase(),\n\t\t\tua.username,\n\t\t\tua.beruf,\n\t\t\tua.gender,\n\t\t\tua.partei,\n\t\t\tua.followers,\n\t\t\tua.following\n\t\t);\n\t}\n\n\t// transforms list to a hashtable\n\tfor(a = 0; a < aZ; a++) {\n\t\tusers[userlist[a].username] = userlist[a];\n\t}\n\t//console.log(util.inspect(users));\n}", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "function listUsers() {\n const optionalArgs = {\n customer: 'my_customer',\n maxResults: 10,\n orderBy: 'email'\n };\n try {\n const response = AdminDirectory.Users.list(optionalArgs);\n const users = response.users;\n if (!users || users.length === 0) {\n console.log('No users found.');\n return;\n }\n // Print the list of user's full name and email\n console.log('Users:');\n for (const user of users) {\n console.log('%s (%s)', user.primaryEmail, user.name.fullName);\n }\n } catch (err) {\n // TODO (developer)- Handle exception from the Directory API\n console.log('Failed with error %s', err.message);\n }\n}", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "function getAllUsers(req, res, next) {\n db.any('select last_name from users')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved ALL users'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "static async getAll() {\n let result = await db.query(\n `SELECT username, first_name, last_name, email FROM users`\n );\n return result.rows;\n }", "function getUserList(){\r\n var ret = [];\r\n for(var i=0;i<clients.length;i++){\r\n ret.push(clients[i].username);\r\n }\r\n return ret;\r\n}", "function getUsers() {\n\tvar apiurl = ENTRYPOINT;\n\treturn $.ajax({\n\t\turl: apiurl,\n\t\tdataType:DEFAULT_DATATYPE\n\t}).always(function(){\n\t\t//Remove old list of users, clear the form data hide the content information(no selected)\n\t\t$(\"#user_list\").empty();\n\t\t$(\"#mainContent\").hide();\n\n\t}).done(function (data, textStatus, jqXHR){\n\t\tif (DEBUG) {\n\t\t\tconsole.log (\"RECEIVED RESPONSE: data:\",data,\"; textStatus:\",textStatus)\n\t\t}\n\t\t//Extract the users\n \tvar users = data.collection.items;\n\t\tfor (var i=0; i < users.length; i++){\n\t\t\tvar user = users[i];\n\t\t\t//Extract the nickname by getting the data values. Once obtained\n\t\t\t// the nickname use the method appendUserToList to show the user\n\t\t\t// information in the UI.\n\t\t\t//Data format example:\n\t\t\t// [ { \"name\" : \"nickname\", \"value\" : \"Mystery\" },\n\t\t\t// { \"name\" : \"registrationdate\", \"value\" : \"2014-10-12\" } ]\n\t\t\tvar user_data = user.data;\n\t\t\tfor (var j=0; j<user_data.length;j++){\n\t\t\t\tif (user_data[j].name==\"nickname\"){\n\t\t\t\t\tappendUserToList(user.href, user_data[j].value);\n\t\t\t\t}\t\t\t\n\t\t\t} \n\t\t}\n\t\t//Set the href of #addUser for creating a new user\n\t\tsetNewUserUrl(data.collection.href)\n\t}).fail(function (jqXHR, textStatus, errorThrown){\n\t\tif (DEBUG) {\n\t\t\tconsole.log (\"RECEIVED ERROR: textStatus:\",textStatus, \";error:\",errorThrown)\n\t\t}\n\t\t//Inform user about the error using an alert message.\n\t\talert (\"Could not fetch the list of users. Please, try again\");\n\t});\n}", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "function getUserNames() {\n $.get(\"/api/userNames\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createUserNameRow(data[i]));\n }\n renderUserNameList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "function getUsers(data){\n users = JSON.parse(data).results;\n renderUsers();\n}", "function getAllUsers() {\n return User.find({}).select({username: \"test\", email: \"[email protected]\", whitelisted: true});\n}", "getAllUsers(callback) {\r\n\r\n\t\tthis._connection.query('SELECT * FROM users', function (err, rows, fields) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n callback(null, rows);\r\n }\r\n );\r\n\r\n this._connection.end();\r\n }", "async function getUsers(page = 1){\n const offset = helper.getOffset(page, config.listPerPage);\n const rows = await db.query(\n `SELECT id, first_name, last_name, user_name, checkedout_books, overdue_books\n FROM Users LIMIT ?,?`,\n [offset, config.listPerPage]\n );\n const users = helper.emptyOrRows(rows)\n const meta = {page}\n \n return{\n users,\n meta\n }\n }", "function getUsers(users) {\n\tconst userList = JSON.parse(users);\n\tgetRepos(userList);\n\tdisplayUser(userList)\n}", "function getUserList() {\n \n return userList;\n }", "function getAllUsersInfos (callback: GenericCallback<Array<UserInformation>>) {\n db.getAllUsers(callback);\n}", "function findAllUsers(req, res, next){\r\n connection.query('SELECT * FROM Usuarios', function (error, results){\r\n if(error) throw error;\r\n res.send(200, results);\r\n return next();\r\n });\r\n}", "function getAllUsers(){\n $.get(\"/getAllUsers\", function(users){\n let output =\n \"<table class='table table-striped table-bordered'>\" +\n \"<tr>\" +\n \"<th>Username</th>\" +\n \"</tr>\";\n\n for (const user of users){\n output +=\n \"<tr>\" +\n \"<td>\" + user.username + \"</td>\" +\n \"</tr>\";\n }\n output += \"</table>\";\n $(\"#allUsers\").empty().html(output);\n });\n }", "function retrieve_all_users(){\n\tlet params = {\n\t\t\t\t method: \"GET\",\n\t\t\t\t url: \"/api/admin/all/\"\n \t\t\t\t}\n\t$.ajax(params).done(function(data) {\n\t\tvar allUsers = '<div style=\"border:1px solid black\"><h3>All users</h3><table><tr><th>Username</th>'+\n\t\t'<th>First Name</th><th>Last Name</th><th>e-mail</th><th>Account Type</th><th>Last Login</th></tr>';\n\t\tconsole.log(data[\"users\"].length);\n\t\tfor(i=0;i<data[\"users\"].length;i++){\n\t\t\tallUsers += \"<tr><th>\"+data[\"users\"][i].username+\"</th><th>\"+\n\t\t\tdata[\"users\"][i].firstName+\"</th><th>\"+data[\"users\"][i].lastName+\n\t\t\t\"</th><th>\"+data[\"users\"][i].email+\"</th><th>\"+data[\"users\"][i].userType+\n\t\t\t\"</th><th>\"+data[\"users\"][i].lastLogin+\"</th></tr>\";\n\t\t}\n\t\tallUsers+= \"</table>\";\n\t\t$(\"#allUsers\").html(allUsers);\n\t});\n}", "function getList(){\n\t\t// call ajax\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/get-user';\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tlet people = res['people'];\n\t\t\tdisplayList(people);\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// show error\n\t\t\tdisplayError(error + ' while getting list');\n\t\t});\n\t}", "function GetUserList() {\r\n\t\treturn $.ajax({\r\n\t\t\turl: '/api/usuarios/listar',\r\n\t\t\ttype: 'get',\r\n\t\t\tdataType: \"script\",\r\n\t\t\tdata: { authorization: localStorage.token },\r\n\t\t\tsuccess: function(response) {\r\n\t\t\t\tconst usuarios = JSON.parse(response);\r\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\r\n\t\t\t\tusuarios.forEach(user => {\r\n\t\t\t\t\ttablaUsuarios.row.add({\r\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\r\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\r\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\r\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\r\n\t\t\t\t\t}).draw();\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "function listUsers() {\n const Table = require('cli-table');\n const User = require('../models/user');\n const mongoose = require('../mongoose');\n\n User\n .find()\n .exec()\n .then((users) => {\n let table = new Table({\n head: [\n 'ID',\n 'Display Name',\n 'Profiles',\n 'Roles',\n 'State'\n ]\n });\n\n users.forEach((user) => {\n table.push([\n user.id,\n user.displayName,\n user.profiles.map((p) => p.provider).join(', '),\n user.roles.join(', '),\n user.disabled ? 'Disabled' : 'Enabled'\n ]);\n });\n\n console.log(table.toString());\n mongoose.disconnect();\n })\n .catch((err) => {\n console.error(err);\n mongoose.disconnect();\n });\n}", "function fetchUsers() {\n skygear.publicDB.query(\n new skygear.Query(skygear.UserRecord)\n .contains('_id', this.props.conversation.participant_ids)\n ).then(userList => {\n const {title} = this.props.conversation;\n let names = userList\n .filter(u => u._id !== skygear.currentUser.id)\n .map(u => u.displayName)\n .join(', ');\n if (names.length > 30) {\n names = names.substring(0,27) + '...';\n }\n const users = {};\n userList.forEach(u => users[u._id] = u);\n this.setState({\n users,\n title: title || names,\n });\n });\n}", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "async retrieveUsers(){cov_1m9telhrda.f[14]++;const _users=(cov_1m9telhrda.s[163]++,await User.find({}));const users=(cov_1m9telhrda.s[164]++,_users.map(user=>{cov_1m9telhrda.f[15]++;cov_1m9telhrda.s[165]++;return{name:user.name,id:user._id,email:user.email};}));cov_1m9telhrda.s[166]++;return users;}", "async getUsers(){\n let users = await db.query('SELECT id, name, email FROM users');\n\n return users;\n }", "function listUserName(req, res){\n // Get the username from query\n var username = req.params.username;\n const results = [];\n pg.connect(connectionString, (err, client, done) => {\n // Handle connection errors\n if (err) {\n done();\n console.log(err);\n return res.status(500).json({success: false, data: err});\n }\n\n const query = client.query(\"select * from sharegoods.user where username = $1;\",[username]);\n query.on('row', (row) => {\n results.push(row);\n });\n // After all data is returned, close connection and return results\n query.on('end', () => {\n done();\n return res.json(results);\n });\n });\n }", "function listUsers() { // user listing\n let numbers = [\":one:\", \":two:\", \":three:\", \":four:\", \":five:\"]; // normal discord emoji text\n let numbersUnicode = [\"\\u0031\\u20E3\", \"\\u0032\\u20E3\", \"\\u0033\\u20E3\", \"\\u0034\\u20E3\", \"\\u0035\\u20E3\"]; // unicode\n for (let i = 0; i <= 4; i++) { // we select first 5 users\n let u = users[i]; // we try to define the user\n if (u) { // if the user exists\n uarr.push(numbers[i] + ` ${u.name}`); // we push it into the array with the newline definitions\n binds[numbersUnicode[i]] = { // we also save it\n userId: u.id // and put there his user id\n };\n }\n }\n return uarr.join(\"\\n\"); // we return a string from the array with newlines\n }", "function getAllUsers (req, res, next) {\n db.any('SELECT * FROM \"user\";')\n .then((users) => {\n res.rows = users;\n next();\n })\n .catch(err => next(err));\n}", "function listUsers(req, res, next) {\n const privateData = ['password'];\n const offset = parseInt(req.query.offset, 10) || 0;\n const limit = parseInt(req.query.limit, 10) || defaultLimit;\n User.find()\n .skip(offset)\n .limit(limit)\n .omit(privateData)\n .then(users => {\n if (!users.length) {\n return res.status(HTTPStatus.NO_CONTENT).end();\n }\n return res.status(HTTPStatus.OK).send(users);\n })\n .catch(err => next(err));\n}", "getUsers(callback) {\n let getUsers = `select * from user`;\n\n this._db.all(getUsers, function(err,resolve) {\n callback(err,resolve);\n })\n }", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "async findAll() {\n const users = await fetch(\n \"https://run.mocky.io/v3/f7f2db83-197c-4941-be3e-fffd2ad31d26\"\n )\n .then((r) => r.json())\n .then((data) => {\n const list = [];\n data.map((row) => {\n let user = new User();\n user.id = row.id;\n user.fullName = row.name;\n user.email = row.email;\n user.avatar = row.avatar;\n list.push(user);\n });\n\n return list;\n });\n\n return users;\n }", "function listAllUsers() {\n var pageToken;\n var page;\n do {\n page = AdminDirectory.Users.list({\n domain: 'example.com',\n orderBy: 'givenName',\n maxResults: 100,\n pageToken: pageToken\n });\n var users = page.users;\n if (users) {\n for (var i = 0; i < users.length; i++) {\n var user = users[i];\n Logger.log('%s (%s)', user.name.fullName, user.primaryEmail);\n }\n } else {\n Logger.log('No users found.');\n }\n pageToken = page.nextPageToken;\n } while (pageToken);\n}", "function viewAllUsers() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n }\n };\n data[0] = [\"User ID\".cyan, \"Full Name\".cyan, \"Username\".cyan, \"User Type\".cyan];\n let queryStr = \"users\";\n let columns = \"user_id, full_name, username, user_type\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n Users\".magenta);\n for (let i = 0; i < res.length; i++) {\n data[i + 1] = [res[i].user_id.toString().yellow, res[i].full_name, res[i].username, res[i].user_type];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "getUsersByName(db, name) {\n return db('users').select('*').where('username', name).first();\n }", "async function list(req, res, next) {\n try {\n const users = await User.find({/*activated: true*/}, 'username email')\n .sort({'username': 'asc'}).limit(50).exec();\n res.render('users/list', { title: 'Users', users: users }); \n } catch (err) {\n next(err);\n }\n}", "function fetchUsers () {\n return knex('users')\n .select('id', 'firstName', 'lastName', 'email')\n .then(function (data) {\n return data\n })\n .catch(console.error)\n}", "function allusers(db) {\n\t//define and set a standard set of default responses as the returned object\n\tlet response = _sqlresponse(`all users`);\n\t\n\ttry { //wrap the instruction in a try/catch to protect the process\n\t\t//this set of instructions runs a single instruction multiple times, each time using the next 'bound' dataset \n\t\tconst statement = db.prepare(\n\t\t\t`SELECT \n\t\t\t\tuserid, \n\t\t\t\tfriendlyname, \n\t\t\t\temailaddress, \n\t\t\t\tpassword, \n\t\t\t\tadmin, \n\t\t\t\tdatetime(lastlogin,'unixepoch') as lastlogin\n\t\t\tFROM\n\t\t\t\tUsers\n\t\t\tORDER BY \n\t\t\t\tuserid\n\t\t\t;`\n\t\t);\n\n\t\t// const statement = db.prepare(\n\t\t// \t`SELECT userid, friendlyname, emailaddress, password, admin, \n\t\t// \t\tdatetime(lastlogin,'unixepoch') as lastlogin\n\t\t// \tFROM Users\n\t\t// \tWHERE userid > @userid\n\t\t// \tORDER BY userid\n\t\t// \t;`\n\t\t// );\n\n\t\tconst results = statement.all(); //execute the statement\n\t\t//const results = statement.all({userid: 2000}); //execute the statement\n\t\tresponse.results = results; //add any results to the response\n\n\t\tconsole.log(\"Records found: \" + results.length);\n\t\tconsole.log(results);\n\n\t} catch (error) {\n\t\t//error detected while attempting to process the request - update the initialised sql return response\n\t\tresponse.success = false;\n\t\tresponse.code = httpcode.CONFLICT;\n\t\tresponse.message = error.code + \":\" + error.message;\n\t}\n\n\t_showsqlresponse(response); //check out the current response before returning to the calling instruction\n\treturn response;\n}", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function listAdminUsers(arg) {\n\n\tif ('undefined' !== typeof arg && ('-h' === arg || '--help' === arg || 'help' === arg)) {\n\t\n\t\tactionHelp(\"adminUser list\", 'View a list of all admin users.', '');\n\t\treturn process.exit();\n\t\n\t}\n\telse if ('undefined' !== typeof arg) {\n\t\n\t\tconsole.log('\"adminUser list\" does not accept any arguments.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.listUsers(function(error, userList) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!userList || userList.length < 1) {\n\t\t\n\t\t\tconsole.log('No admin users. Use \"adminUser add\" to create an admin user.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\ttitleBlock('Available Admin Users:');\n\t\tconsole.log(' id username name sudoer');\n\t\tconsole.log(' --------------------------------------------------------------------------------------------');\n\n\t\tfor (let i = 0; i < userList.length; i++) {\n\t\t\n\t\t\tvar logLine = ' ' + userList[i]._id;\n\t\t\tfor (let sp = 23 - userList[i]._id.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].uName;\n\t\t\tfor (let sp = 21 - userList[i].uName.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tvar fullName;\n\t\t\tif (null === userList[i].fName && null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = \"*NONE*\";\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].fName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName + ', ' + userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += fullName;\n\t\t\tfor (let sp = 41 - fullName.length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].sudoer;\n\t\t\tconsole.log(logLine);\n\t\t\n\t\t}\n\t\treturn process.exit();\n\t\t\n\n\t});\n\n}", "async userNames() {\n let cursor;\n const userNames = {};\n do {\n const {\n members: users,\n response_metadata: { next_cursor: nextCursor },\n } = await this.usersList({\n cursor,\n });\n\n for (const user of users) {\n userNames[user.id] = user.name;\n }\n\n cursor = nextCursor;\n } while (cursor);\n return userNames;\n }", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "function outputUsers(users) {\r\n userList.innerHTML = '';\r\n users.forEach((user) => {\r\n const li = document.createElement('li');\r\n li.innerText = user.username;\r\n userList.appendChild(li);\r\n });\r\n}", "function getAllUsers() {\n let todoUsersDB = storage.getItem('P1_todoUsersDB');\n\n if (todoUsersDB) { return JSON.parse(todoUsersDB); }\n else { return []; }\n }", "list(req, res) {\n\n return User\n .findAll({})\n .then(users => res.status(200).send(users))\n .catch(error => res.status(400).send(error));\n }", "function userList() {\n let jsonFileRead = fs.readFileSync(path.join(__dirname, '../data/users.json'), 'utf-8')\n return JSON.parse(jsonFileRead)\n}", "function getUsers() {\n\n intakeTaskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "function getUserList(){\r\n var userListforGet = [];\r\n for(var i=0;i<chatAppUsers.length;i++){\r\n userListforGet.push(chatAppUsers[i].currentUser);\r\n }\r\n return userListforGet;\r\n}", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function listUsers(page, pgSize = 10) {\n}", "async function retrieveUserList() {\n return await User.find({},'name');\n}", "function getUsers(req, res) {\n User.find({}, function (err, users) {\n if (err) return res.status(500).send(\"There was a problem finding the users.\");\n res.status(200).send(users);\n });\n}", "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers);\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "function _get_manager_users_list(db){\n try{\n var rows = db.execute('SELECT * FROM my_manager_user WHERE status_code=1 and company_id=?',_selected_company_id);\n var b = 0;\n if(rows.getRowCount() > 0){\n while(rows.isValidRow()){\n var row = Ti.UI.createTableViewRow({\n filter_class:'manager_user',\n className:'manager_user_list_data_row_'+b,\n hasChild:true,\n source:_source,\n job_id:_selected_job_id,\n contact_id:rows.fieldByName('id'),\n title:rows.fieldByName('first_name')+' '+rows.fieldByName('last_name'),\n mobile:rows.fieldByName('phone_mobile'),\n email:rows.fieldByName('email')\n }); \n if(b === 0){\n row.header = 'Staff';\n }\n self.data.push(row);\n rows.next();\n b++;\n }\n }\n rows.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_manager_users_list');\n return;\n } \n }", "function listUsers() {\n $listUsers.empty();\n\n if (event) event.preventDefault();\n\n var token = localStorage.getItem('token');\n $.ajax({\n url: '/users',\n method: 'GET',\n beforeSend: function beforeSend(jqXHR) {\n if (token) return jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);\n }\n }).done(function (users) {\n showUsers(users, 0, 10);\n });\n }", "function getUsers() {\r\n var message = \"type=allUser\";\r\n sendFriendData(message, 'showUser');\r\n return 0;\r\n}", "function listUsers(req, res) {\n if (req == null || req.query == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n try {\n // Pagination\n const range = JSON.parse(req.query.range);\n const r0 = range[0], r1 = range[1] + 1;\n\n // Sort\n const sorting = JSON.parse(req.query.sort);\n const sortPara = sorting[0];\n const sortOrder = sorting[1];\n\n // Filter\n const filter = JSON.parse(req.query.filter);\n } catch (err) {\n return utils.res(res, 400, 'Please provide appropriate range, sort & filter arguments');\n }\n\n\n let qFilter = JSON.parse(req.query.filter);\n let filter = {};\n if (!(qFilter.user_id == null) && typeof (qFilter.user_id) === 'string') filter['user_id'] = { $regex: qFilter.user_id, $options: 'i' };\n\n // Fetch User lists\n models.User.find(filter, 'user_id name email age university total_coins cyber_IQ role')\n .lean()\n .exec(function (err, users) {\n if (err) {\n return utils.res(res, 500, 'Internal Server Error');\n }\n\n if (users == null) {\n return utils.res(res, 404, 'Users do not Exist');\n }\n users.map(u => {\n u['id'] = u['user_id'];\n delete u['user_id'];\n delete u['_id'];\n if (!u['university']) {\n u['university'] = 'NA';\n }\n return u;\n });\n\n // Pagination\n const range = JSON.parse(req.query.range);\n const len = users.length;\n const response = users.slice(range[0], range[1] + 1);\n const contentRange = 'users ' + range[0] + '-' + range[1] + '/' + len;\n\n // Sort\n const sorting = JSON.parse(req.query.sort);\n let sortPara = sorting[0] || 'name';\n let sortOrder = sorting[1] || 'ASC';\n if (sortOrder !== 'ASC' && sortOrder != 'DESC') sortOrder = 'ASC';\n\n res.set({\n 'Access-Control-Expose-Headers': 'Content-Range',\n 'Content-Range': contentRange\n });\n return utils.res(res, 200, 'Retrieval Successful', utils.sortObjects(response, sortPara, sortOrder));\n })\n}", "function getAllBD() {\r\n con.query(\"SELECT * FROM user\", function (err, result, fields) {\r\n if (err) throw err;\r\n console.log(\"Le retour JSON dans la function\", JSON.stringify(result))\r\n USER_LIST = result\r\n });\r\n\r\n}", "function getAllUsers() {\n var allUsers = User.find(function (err, users) {\n if (err) return handleError(err);\n return users\n })\n return allUsers\n}", "function getUsers(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT * FROM users\", (error, results, fields) => {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results;\n complete();\n });\n }", "function listOfUsers() {\n request.get('https://slack.com/api/users.list?token='+\n process.env.Apptoken+'&pretty=1',function (err,requ,response)\n {\n var data= JSON.parse(response);\n usersLists=data.members;\n });//end of get users.list function\n}", "function getUsers(request, response) {\n\n\tfunction respondOk(response, users) {\n\t\tresponse.json(users)\n\t}\n\n\tfunction respondError(response, error) {\n\t\tresponse.send(error)\n\t}\n\t// Consulta la base de datos, si no hay errores los devuelve los usuarios al cliente\n\tUser.find({})\n\t\t.then(users => respondOk(response, users))\n\t\t.catch(error => respondError(response, error))\n}", "function findAllUsers(req, res) {\n if(req.query.username) {\n findUserByUsername(req, res);\n } else {\n var users = userModel.findAllUsers().then(\n function (docs) {\n res.json(docs);\n },\n // send error if promise rejected\n function (err) {\n res.status(400).send(err);\n }\n )\n }\n }", "function displayUsers() {\n if (users && users.length) {\n var str = \"\";\n $(users).each(function () {\n str += this.name + \", \";\n });\n str = str.replace(/, $/, \"\");\n userList.text(str);\n userDisplay.show();\n }\n else {\n userDisplay.hide();\n }\n }", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "function getUsers(){\n return users;\n}", "function getAllUsers() {\n\t\t// url (required), options (optional)\n\t\t/*\n\t\tfetch('/snippets/all') // Call the fetch function passing the url of the API as a parameter\n\t\t.then(function(resp) {\n\t\t\treturn resp.json()\n\t\t}) // Transform the data into json\n\t\t.then(function(data) {\n\t\t\tconsole.log(JSON.parse(data));\n\t\t\t// Your code for handling the data you get from the API\n\t\t\t//_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t})\n\t\t.catch(function(errors) {\n\t\t\t// This is where you run code if the server returns any errors\n\t\t\tconsole.log(errors);\n\t\t});\n\t\t*/\n\n\t\t$.ajax({\n\t\t\ttype: 'GET', \t\t// define the type of HTTP verb we want to use (POST for our form)\n\t\t\turl: '/users/all', \t// the url where we want to POST\n\t\t\tdataType: 'json', \t// what type of data do we expect back from the server\n\t\t\tencode: true\n\t\t})\n\t\t// using the done promise callback\n\t\t.done(function(data) {\n\t\t\t_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t});\n\t}", "async getAllUsers() {\r\n\r\n const userCollection = await usersList();\r\n const listOfUsers = await userCollection.find().toArray();\r\n\r\n\r\n allusers = [];\r\n oneUser = {};\r\n\r\n //NM - Corrected spelling of orientation, added email and contact_info attributes\r\n for (var val of listOfUsers) {\r\n oneUser = {};\r\n oneUser._id = val._id;\r\n oneUser.user_id = val.user_id;\r\n oneUser.name = val.name;\r\n oneUser.hashedPassword = val.hashedPassword;\r\n oneUser.dob = val.dob;\r\n oneUser.gender = val.gender;\r\n oneUser.activity = val.activity;\r\n oneUser.location = val.location;\r\n oneUser.occupation = val.occupation;\r\n oneUser.email = val.email;\r\n oneUser.weight = val.weight;\r\n oneUser.activity = val.activity;\r\n allusers.push(oneUser);\r\n }\r\n\r\n return allusers;\r\n }", "function findUsers(req, res) {\n var username = req.query[\"username\"];\n var password = req.query[\"password\"];\n // findUserByCredentials\n if (username && password) {\n var promise = userModel\n .findUserByCredentials(username, password);\n promise.then(function(user) {\n res.json(user);\n });\n return;\n }\n // findUserByUserName\n else if (username) {\n var promise = userModel\n .findUserByUserName(username);\n promise.then(function (user) {\n res.json(user)\n });\n return;\n }\n var promise = userModel\n .findAllUsers();\n promise.then(function(users) {\n \"use strict\";\n res.json(users)\n });\n res.json(users);\n }", "allUsers() { return queryAllUsers() }" ]
[ "0.766131", "0.7485325", "0.7483956", "0.7322115", "0.72785", "0.72737813", "0.7252683", "0.7250729", "0.71935713", "0.71739554", "0.715861", "0.71408314", "0.7139639", "0.71351534", "0.71033436", "0.7088729", "0.7068352", "0.7064861", "0.70611763", "0.70529026", "0.7050367", "0.7031876", "0.7031644", "0.7031463", "0.6990983", "0.69881123", "0.6980494", "0.6972808", "0.6971299", "0.6957079", "0.6946527", "0.6946417", "0.69257945", "0.6911376", "0.68733555", "0.6868254", "0.6864462", "0.6856889", "0.6855421", "0.6852963", "0.6849226", "0.684776", "0.68335986", "0.68314284", "0.6823786", "0.681994", "0.6816734", "0.6803765", "0.67992216", "0.6796784", "0.67912114", "0.67797405", "0.67758685", "0.67742115", "0.6774126", "0.6772758", "0.67585045", "0.6735023", "0.67300564", "0.6720132", "0.6718159", "0.6705519", "0.6704542", "0.66928667", "0.668957", "0.6688183", "0.6677773", "0.66707385", "0.6662103", "0.66540325", "0.6645069", "0.6643705", "0.66291624", "0.6628232", "0.6627685", "0.6626683", "0.6624067", "0.6624067", "0.6624067", "0.6617995", "0.66127676", "0.6612062", "0.6610669", "0.66009736", "0.65997857", "0.65982395", "0.65809965", "0.65791625", "0.65733314", "0.6566751", "0.6564403", "0.656316", "0.65617245", "0.65496147", "0.6542702", "0.65398127", "0.6539317", "0.6521192", "0.6503559", "0.64997655", "0.6489522" ]
0.0
-1
Sets parameters that alter spatialization.
setAudioProperties(minDistance, maxDistance, rolloff, algorithm, transitionTime) { this.minDistance = minDistance; this.maxDistance = maxDistance; this.rolloff = rolloff; this.algorithm = algorithm; this.transitionTime = transitionTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "setParameters () {\n if (arguments.length > 1 || isString (arguments[0])) {\n // This branch is for backwards compatibility. In older versions, the\n // parameters were the supported scopes.\n\n this.options = {\n scope: flattenDeep (...arguments)\n }\n }\n else {\n this.options = arguments[0];\n }\n }", "setearParams(kv, ma, md, fltr, anod) {\n\n //console.log(\"seteo nuevos parametros\");\n this.kilovolt = kv;\n this.miliamperios = ma;\n this.modo = md;\n this.filtro = fltr;\n this.anodo = anod;\n }", "function setLangParams() {\n services.tts.then(function(tts) {\n if (game.german) {\n tts.setParameter('pitchShift', TTSPARAMS.pitchShift);\n tts.setParameter('speed', TTSPARAMS.speed);\n }\n });\n}", "function setParams() {\r\n \r\n for(Entry<String,Double> e : body.metabolicParameters.get(body.bodyState.state).get(BodyOrgan.BRAIN.value).entrySet()) {\r\n switch (e.getKey()) {\r\n case \"glucoseOxidized_\" : { glucoseOxidized_ = e.getValue(); break; }\r\n case \"glucoseToAlanine_\" : { glucoseToAlanine_ = e.getValue(); break; }\r\n case \"bAAToGlutamine_\" : { bAAToGlutamine_ = e.getValue(); break; }\r\n }\r\n }\r\n //System.out.println(\"glucoseOxidized: \" + glucoseOxidized_);\r\n }", "constructor() { \n \n OrgApacheSlingEngineParametersProperties.initialize(this);\n }", "setProgramParameters(vertexArray, uniformArray){\n this.setAttributes(vertexArray);\n this.setUniforms(uniformArray);\n }", "initCompartmentsByParams () {\n this.compartment.infectious = this.param.initPrevalence\n this.compartment.susceptible =\n this.param.initPopulation - this.param.initPrevalence\n }", "setSettings(parameter,type) {\n\n if(parameter.settings === undefined || parameter.settings == null){\n parameter.settings = {};\n }\n\n //necessary for all parameters added before changes\n for(var key in PARAMETERS.settings){\n if(parameter.settings[PARAMETERS.settings[key]] === undefined || parameter.settings[PARAMETERS.settings[key]] == null){\n if(PARAMETERS.settings[key] == \"required\"){\n //by default required must be set to true\n parameter.settings[PARAMETERS.settings[key]] = true;\n }\n else {\n parameter.settings[PARAMETERS.settings[key]] = null;\n }\n }\n }\n\n return parameter;\n\n }", "function reconfigureStreamParams(trackID) {\n var glyphTrack = gLyphTrack_array[trackID];\n if(glyphTrack == null) { return; }\n\n var paramDiv = document.getElementById(trackID + \"_spstreamParamsDiv\");\n if(!paramDiv) { return; }\n paramDiv.innerHTML = \"\"; //empty\n glyphTrack.spstream_config = new Object;\n\n var saveButton = document.getElementById(glyphTrack.trackID + \"_saveScriptButton\");\n if(saveButton) { saveButton.setAttribute(\"disabled\", \"disabled\"); }\n\n var spstream_mode = glyphTrack.spstream_mode;\n if(glyphTrack.newconfig.spstream_mode) { spstream_mode = glyphTrack.newconfig.spstream_mode; }\n\n var streamSelect = document.getElementById(trackID + \"_streamProcessSelect\");\n if(streamSelect) { streamSelect.value = spstream_mode; }\n\n if(spstream_mode == \"expression\") { createStreamParams_expression(glyphTrack, paramDiv); }\n if(spstream_mode == \"custom\") { createStreamParams_custom(glyphTrack, paramDiv); }\n if(spstream_mode == \"predefined\") { createStreamParams_predefined(glyphTrack, paramDiv); }\n}", "static setSecurityParams(hostname, params) {\n hostname = normalizeHostname(hostname);\n CoapClient.dtlsParams.set(hostname, params);\n }", "setParam(param) {\n if (IsObject(param, ['internal_name', 'name'])) {\n PopLog.info(this.name, `Params set for ${param.internal_name}`, param);\n this.asset.param.set(param.internal_name, param);\n }\n }", "function reconfigureStreamParams(glyphTrack) {\n if(glyphTrack == null) { return; }\n var trackID = glyphTrack.trackID;\n\n var paramDiv = document.getElementById(trackID + \"_spstreamParamsDiv\");\n if(!paramDiv) { return; }\n paramDiv.innerHTML = \"\"; //empty\n glyphTrack.spstream_config = new Object;\n\n var saveButton = document.getElementById(trackID + \"_saveScriptButton\");\n if(saveButton) { saveButton.setAttribute(\"disabled\", \"disabled\"); }\n\n var spstream_mode = glyphTrack.spstream_mode;\n if(glyphTrack.newconfig && glyphTrack.newconfig.spstream_mode) { spstream_mode = glyphTrack.newconfig.spstream_mode; }\n\n var streamSelect = document.getElementById(trackID + \"_streamProcessSelect\");\n if(streamSelect) { streamSelect.value = spstream_mode; }\n\n if(spstream_mode == \"expression\") { createStreamParams_expression(glyphTrack, paramDiv); }\n if(spstream_mode == \"custom\") { createStreamParams_custom(glyphTrack, paramDiv); }\n if(spstream_mode == \"predefined\") { createStreamParams_predefined(glyphTrack, paramDiv); }\n}", "setSceneParameters() {\n //If the scene parameters aren't already set, set them (prevents from not being able to fade out)\n if (!this.dialogParametersSet) {\n //if this scene doesn't have a fade-in animation, set the position to the landing position from the beginning\n if (!this.scene.fadeIn && !this.dialogBox.closing) {\n this.dialogBox.textBox.position.x = this.dialogBox.textBox.landingPosition.x;\n this.dialogBox.textBox.position.y = this.dialogBox.textBox.landingPosition.y;\n\n this.dialogBox.titleBox.position.x = this.dialogBox.titleBox.landingPosition.x;\n this.dialogBox.titleBox.position.y = this.dialogBox.titleBox.landingPosition.y;\n }\n }\n }", "function setParameters(gl, parameters) {\n (0, _setParameters.setParameters)(gl, parameters);\n\n for (var key in parameters) {\n var setter = LUMA_SETTERS[key];\n\n if (setter) {\n setter(gl, parameters[key], key);\n }\n }\n} // VERY LIMITED / BASIC GL STATE MANAGEMENT", "function refreshParams() {\n params = { X_max: X_max, X_min: X_min, max_: max_, min_: min_ };\n }", "function setParameter(name/*:String*/, value/*:**/)/*:**/{\n var old/*:**/ = this._parameters$aqE4[name];\n this._parameters$aqE4[name] = value;\n return old;\n }", "function setDatParameter(params){\n\n // console.log( Date(Date.now()) + \" [via OSC] \" + params[1] + \"->\" + params[2] + \": \" + params[3] + \" (for \" + params[4] +\")\");\n var data = { behaviour: params[1], name: params[2], value: params[3], target: params[4] };\n sendDatOSC(data);\n \n}", "function setParameters(e) {\n setModalTitle($(e.currentTarget));\n var articleId = ($(e.currentTarget).attr('data-article-id')) ? $(e.currentTarget).attr('data-article-id') : false;\n var articleScheduled = ($(e.currentTarget).attr('data-scheduled')) ? $(e.currentTarget).attr('data-scheduled') : false;\n schedule.articleId = articleId;\n schedule.articleScheduled = articleScheduled;\n schedule.scheduleActionType = $(e.currentTarget).attr('data-action-type');\n\n var data = {actionType: 'schedule', includeArticleId: false};\n if (schedule.scheduleActionType === 'schedule-cancel') {\n data.actionType = 'cancel';\n } else if (schedule.scheduleActionType === 'schedule-amend' || schedule.scheduleActionType === 'schedule' || schedule.scheduleActionType === 'future-schedule') {\n data.actionType = 'schedule';\n }\n\n if (schedule.scheduleActionType === 'future-schedule') {\n data.showArticleIdField = true;\n }\n\n $('#schedule-modal .modal-body').html(schedule.template.modalBody(data));\n $('#schedule-modal .modal-footer').html(schedule.template.modalFooter(data));\n\n }", "function setDeploymentParameters()\r\n{\r\n\ttry\r\n\t{\r\n\t\t\r\n\t\tif (nlapiGetContext().getSetting('SCRIPT', 'custscript_pricelist_debugtrace') == 'T')\r\n\t\t{ debugOn = true; } else { debugOn = false; }\r\n\t\t\r\n\t\tvar formidParam = nlapiGetContext().getSetting('SCRIPT', 'custscript_estimate_formid');\r\n\t\tif (formidParam != '' && formidParam != null)\r\n\t\t{ estimateFormID = formidParam; } else { estimateFormID = 111; }\t\r\n\t\t\r\n\t}\r\n\tcatch (e)\r\n\t{\r\n\t\terrorHandler(\"setDeploymentParameters\", e);\r\n\t}\r\n}", "function init_model_parameters()\n {\n //:primary params\n var a = toreg( 'a' )( 'value', sconf.a )( 'value' );\n toreg( 'alpha' )( 'value', sconf.alpha );\n toreg( 'beta' )( 'value', sconf.beta );\n toreg( 'gamma' )( 'value', sconf.gamma );\n toreg( 'O' )( 'pos', [0,0] );\n toreg( 'H' )( 'pos', [0,0] );\n\n //dependent parameters\n toreg( 'nB' )( 'value', [ 1, 0 ] );\n toreg( 'nA' )( 'value', [ -1, 0 ] );\n\n //variable parameter\n toreg( 'g' )( 'value', sconf.initial_g );\n\n //decorations:\n toreg( 'gN' )( 'value', sconf.initial_gN );\n\n setRgPoint( 'A', [ -rg.a.value, 0 ] )\n setRgPoint( 'B', [ 1-rg.a.value, 0 ] )\n\n toreg( 'b' );\n baseParams_2_extendedParams();\n //dev tool:\n //ellipsePar_create8paint( 1.50 )\n }", "function setParameters(){\n var params = {};\n src = $('[src*=\"contrast.js\"').attr('src');\n if (src.substring(0, 4) != 'http') src = protocol + '//' + hostname + src;\n src.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { params[key] = value; });\n css = params['css'];\n append = params['append'];\n if (append == null) append = 'body';\n }", "set(param, value) {\n return this.clone({\n param,\n value,\n op: 's'\n });\n }", "setParams() {\n this.from = this.params.from;\n this.to = this.params.to;\n this.start = this.params.start;\n this.end = this.params.end;\n\n this.airports = this.params.airports;\n\n // Get Airports if we don't have from the state params\n if (!this.airports) {\n this.airportsService.getAirports().then(res => {\n this.airports = {\n from: res.airports[this.from],\n to: res.airports[this.to]\n }\n });\n }\n }", "function fSetParameters(w,h,ctx){\r\n\tvar tctx = CargaContextoCanvas(ctx);\r\n\tif(tctx){\r\n\t\tthis.ctx = tctx;\r\n\t}\r\n\telse{\r\n\t\talert(\"contexto no cargado\");\r\n\t}\r\n\tthis.mainWidth = w;\r\n\tthis.mainHeight = h;\r\n}", "function changeparams()\n{\n if ( potts_timer !== null ) {\n startsimul();\n }\n}", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "function setContentInstanceParams(instance, params) {\n Object.assign(instance, params);\n}", "set_parameter(id, value) {\n if (id > 39 || id < 0) {\n throw \"Out of bounds!\";\n } else {\n _parameters[id] = value;\n }\n }", "function update_params () {\n\t\tvar config = Jupyter.notebook.config;\n\t\tfor (var key in params) {\n\t\t\tif (config.data.hasOwnProperty(key)) {\n\t\t\t\tparams[key] = config.data[key];\n\t\t\t}\n\t\t}\n\t}", "function setParamsOfChildNode() {\n if (inputFields) {\n // specific case for body type query/procedure variable with query params\n if (inputFields[param.name] && _.isObject(inputFields[param.name])) {\n paramValueInfo = inputFields[param.name];\n }\n else {\n paramValueInfo = inputFields;\n }\n params = _.get(operationInfo, ['definitions', param.type]);\n }\n else {\n // For Api Designer\n paramValueInfo = paramValue || {};\n params = param.children;\n }\n }", "set x(x){ this.spine.x = x; }", "function setRunTimeparam(params) {\n return new Promise((resolve, reject) => {\n var response;\n var parameter = params.param;\n var values = params.value;\n\n multichain.setRunTimeparam({\n \"param\": parameter,\n \"value\": values\n },\n (err, res) => {\n if (err == null) {\n return resolve({\n response: \"runtimeParameters has been changed\",\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n })\n}", "function resetParameters() {\n var key;\n for (key in parameters.whitelist) {\n parameters.whitelist[key] = false;\n }\n for (key in parameters.blacklist) {\n parameters.blacklist[key] = false;\n }\n parameters.structure.integrity = false;\n parameters.structure.components.some(function (component) {\n component.integrity = false;\n });\n }", "editSelectionParameters() {\n this.simcirWorkspace.editSelectionParameters();\n }", "set() {\n let {isSettingBreakTime, break: breakTime, time: roundTime, numOfRounds} = this.config;\n this.config.isSettingBreakTime = !isSettingBreakTime;\n let target = isSettingBreakTime ? roundTime : breakTime;\n target = target.map( el => this.getTwoDigitStr(el) );\n target[2] = numOfRounds;\n this.style.updateInputLabelTxt(!isSettingBreakTime);\n this.style.updateInputs.call(this, ...target);\n this.style.updateBtnTxt.call(this);\n }", "constructor(parameters = {}) {\n const presets = {\n name: 'ABC',\n level: -1,\n tooltip: \"you hovered\",\n view: {\n x: 200,\n y: 200,\n size: 50,\n normX: 0,\n normY: 0\n },\n siblings: [],\n children: [],\n parents: [],\n paths: 0\n }\n //presets go on this and parameters override presets\n Object.assign(this, presets, parameters)\n }", "function setParameters(gl, parameters) {\n Object(__WEBPACK_IMPORTED_MODULE_5__webgl_utils_set_parameters__[\"d\" /* setParameters */])(gl, parameters);\n for (var key in parameters) {\n var setter = LUMA_SETTERS[key];\n if (setter) {\n setter(gl, parameters[key], key);\n }\n }\n}", "set PSP2(value) {}", "function set_param(name, value) {\n remove_param(name);\n var params = get_params();\n set_cookie('params', params + '&' + name + '=' + value);\n}", "function Parameters() {\n Object.defineProperty(this, CACHE, {writable: true, value: {}});\n }", "function setParams(pageNumber) {\n\t\tvar params = {};\n\t\tparams.data = { \n\t\t\ttype : $scope.formData.type.map(function(a) {return a.value;}),\n\t\t\tregion : $scope.formData.region.map(function(a) {return a.value;}),\n\t\t\toxidation : $scope.formData.oxidation.map(function(a) {return a.value;}),\n\t\t\tleaf : $scope.formData.leaf.map(function(a) {return a.value;}),\n\t\t\tlabel : $scope.formData.label.map(function(a) {return a.value;}),\n\t\t\tprice: $scope.formData.price\n\t\t};\n\t\tparams.pageNumber = pageNumber;\n\t\tparams.pageItemsCount = $scope.itemsPerPage;\n\t\treturn params;\n\t}", "_setSourceTextureParameters() {\n const index = this.currentIndex;\n const {sourceTextures} = this.bindings[index];\n for (const name in sourceTextures) {\n sourceTextures[name].setParameters(SRC_TEX_PARAMETER_OVERRIDES);\n }\n }", "setDSPValue() {\n for (var i = 0; i < this.moduleControles.length; i++) {\n this.moduleFaust.fDSP.setParamValue(this.moduleControles[i].itemParam.address, this.moduleControles[i].value);\n }\n }", "set() {\n\n let kv = this.getKeyValue();\n let config = this.readSteamerConfig({ isGlobal: this.isGlobal });\n\n config[kv.key] = kv.value;\n\n this.createSteamerConfig(config, {\n isGlobal: this.isGlobal,\n overwrite: true,\n });\n\n }", "function Parameters() {\n Object.defineProperty(this, CACHE, {writable:true, value: {}});\n}", "function Parameters() {\n Object.defineProperty(this, CACHE, {writable:true, value: {}});\n}", "function Parameters() {\n Object.defineProperty(this, CACHE, {writable:true, value: {}});\n}", "function setParams()\n {\n //get advanced links width\n var width = $('#oc-link-advanced-player').outerWidth();\n Opencast.embedControlHide.setWidth(width);\n \n //get controll bars height\n var height = 0;\n \n for (var id in _elements) {\n if ($(_elements[id]).css('display') !== 'none') {\n height += $(_elements[id]).outerHeight();\n }\n }\n Opencast.embedControlHide.setHeight(height);\n }", "update(x0, y0, height, horizon, theta){\n this.worker.postMessage({\n cmd: 'set_params',\n\n x0,\n y0,\n height,\n horizon,\n theta\n });\n }", "function setViewportSize(value) {\n __params['vp'] = value;\n}", "function setParameters(gl, values) {\n var compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (var key in values) {\n var setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n // only call setter if value has changed\n // TODO - deep equal on values?\n } else {\n // Note - the setter will automatically update this.state\n setter(gl, values[key], Number(key));\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n var cache = gl.state && gl.state.cache;\n if (cache) {\n var mergedValues = Object.assign({}, cache, values);\n\n for (var _key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n var compositeSetter = GL_PARAMETER_COMPOSITE_SETTERS[_key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, mergedValues);\n }\n }\n // Add a log for the else case?\n}", "onModifySpA() {}", "function flushParams() {\n\n s.events = \"\";\n s.campaign = \"\";\n s.linkTrackVars = \"\";\n s.linkTrackEvents = \"\";\n s.Media.trackVars = \"\";\n s.Media.trackEvents = \"\";\n\n s.eVar1 = \"\";\n s.eVar2 = \"\";\n s.eVar3 = \"\";\n s.eVar4 = \"\";\n s.eVar5 = \"\";\n s.eVar6 = \"\";\n s.eVar7 = \"\";\n s.eVar8 = \"\";\n s.eVar9 = \"\";\n s.eVar10 = \"\";\n s.eVar11 = \"\";\n s.eVar12 = \"\";\n s.eVar13 = \"\";\n s.eVar14 = \"\";\n s.eVar15 = \"\";\n s.eVar16 = \"\";\n s.eVar17 = \"\";\n s.eVar18 = \"\";\n s.eVar19 = \"\";\n s.eVar20 = \"\";\n s.eVar21 = \"\";\n s.eVar22 = \"\";\n s.eVar23 = \"\";\n\n s.hier1 = \"\";\n s.hier3 = \"\";\n\n s.prop1 = \"\";\n s.prop2 = \"\";\n s.prop3 = \"\";\n s.prop4 = \"\";\n s.prop5 = \"\";\n s.prop6 = \"\";\n s.prop7 = \"\";\n s.prop8 = \"\";\n s.prop9 = \"\";\n s.prop10 = \"\";\n s.prop11 = \"\";\n s.prop12 = \"\";\n s.prop13 = \"\";\n s.prop14 = \"\";\n s.prop15 = \"\";\n s.prop16 = \"\";\n s.prop17 = \"\";\n s.prop18 = \"\";\n s.prop19 = \"\";\n s.prop20 = \"\";\n }", "doConfigure (configParams) {\n\t\tif (typeof configParams.isShuffle == \"boolean\") {\n\t\t\tthis.state.isShuffle = configParams.isShuffle;\n\t\t}\n\t\tif (typeof configParams.minItemDisplayDuration == \"number\") {\n\t\t\tif (configParams.minItemDisplayDuration >= 0) {\n\t\t\t\tthis.state.minItemDisplayDuration = configParams.minItemDisplayDuration;\n\t\t\t}\n\t\t}\n\t\tif (typeof configParams.maxItemDisplayDuration == \"number\") {\n\t\t\tif (configParams.maxItemDisplayDuration >= 0) {\n\t\t\t\tthis.state.maxItemDisplayDuration = configParams.maxItemDisplayDuration;\n\t\t\t}\n\t\t}\n\t\tif (typeof configParams.minStartPositionDelta == \"number\") {\n\t\t\tthis.state.minStartPositionDelta = configParams.minStartPositionDelta;\n\t\t}\n\t\tif (typeof configParams.maxStartPositionDelta == \"number\") {\n\t\t\tthis.state.maxStartPositionDelta = configParams.maxStartPositionDelta;\n\t\t}\n\t}", "function setChartParameters() {\n\n // use the domain to specify the lowest and highest value possible\n // use the range to confine this range to certain dimensions. \n xScale = d3.scale.linear()\n .domain([-10, 10])\n .range([0, (rawSvg.attr(\"width\") -leftPad - textPad)]);\n\n yScale = d3.scale.linear()\n .domain([0, 50])\n .range([ (rawSvg.attr(\"height\") - topPad - textPad - yPad), 0]);\n\n xAxisGen = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\")\n .ticks(4);\n\n yAxisGen = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\")\n .ticks(5);\n }", "enterSettingsParameters(ctx) {\n\t}", "resetSettings() {\n document.getElementById('marot-scoring-unit').value = 'segments';\n this.mqmWeights = JSON.parse(JSON.stringify(mqmDefaultWeights));\n this.mqmSlices = JSON.parse(JSON.stringify(mqmDefaultSlices));\n this.setUpScoreSettings();\n this.updateSettings();\n }", "function set_settings () {\n if (typeof s === 'number')\n self.width = s;\n else if (typeof s === 'object'){\n self.width = typeof s.width === 'number' ? s.width : typeof s.width === 'string' ? s.width :self.width;\n self.transition = typeof s.transition === 'number' ? s.transition : self.transition;\n self.font_size = typeof s.font_size === 'number' ? s.font_size : self.font_size;\n self.z_index = typeof s.z_index === 'number' ? s.z_index : self.z_index;\n self.color = typeof s.color === 'string' ? s.color : self.color;\n self.font_weight = typeof s.font_weight === 'string' ? s.font_weight : self.font_weight;\n self.type = typeof s.type === 'string' ? s.type : self.type;\n self.elements = typeof s.elements === 'number' ? s.elements : self.elements;\n self.placeholder = typeof s.placeholder === 'string' ? s.placeholder : self.placeholder;\n self.collapsable = typeof s.collapsable === 'boolean' ? s.collapsable : self.collapsable;\n self.display = typeof s.display === 'string' ? s.display : self.display;\n self.display = typeof s.verticalAlign === 'string' ? s.verticalAlign : self.verticalAlign;\n }\n if (self.width < min_width)\n self.width = min_width;\n if (self.transition < min_transition)\n self.transition = min_transition;\n if (self.elements == undefined)\n self.elements = self.type == 'single' ? self.options.length-1 : self.options.length;\n if (self.elements < min_elements)\n self.elements = min_elements;\n else if (self.elements > max_elements)\n self.elements = max_elements;\n if (['single','multiple'].indexOf(self.type) == -1)\n self.type = 'single';\n }", "function setArticleParams() {\n var articleId;\n var versionNumber;\n var runId;\n var url = window.location.pathname;\n if (config.ISPP) {\n // for use in the PP\n url = window.location.search;\n url = url.replace('?', '/');\n }\n\n url = url.split('/');\n url = _.compact(url);\n articleId = (!_.isEmpty(url[1])) ? url[1] : null;\n versionNumber = (!_.isEmpty(url[2])) ? url[2] : null;\n runId = (!_.isEmpty(url[3])) ? url[3] : null;\n\n /* If you have come through the PP nav we need to force some id's */\n if (config.ISPP && url[0] !== 'article') {\n articleId = '00353';\n versionNumber = '1';\n runId = 'c03211f7-6e1e-492d-9312-e0a80857873c';\n }\n\n detail.queryParams = {\n articleId: articleId,\n versionNumber: versionNumber,\n runId: runId,\n };\n }", "static setQp(caller, qp) {\n if (caller && caller._queryParams) {\n // eslint-disable-next-line no-param-reassign\n caller._queryParams = qp || {};\n\n /**\n * @event qp-set\n * Fired when query params are replaced\n * detail payload: qp\n */\n const customEvent = new Event('qp-changed', { composed: true, bubbles: true });\n customEvent.detail = caller._queryParams;\n caller.dispatchEvent(customEvent);\n }\n }", "function resetParameters() {\n schedule.scheduleData = {};\n schedule.scheduleDate = null;\n schedule.scheduleTime = null;\n schedule.scheduleDateTime = null;\n }", "param(){\n var param = this.config.param;\n param.forEach(function(p) {\n this.addData(p.name, p.value);\n }, this);\n }", "function changeSettings() {\n originalWidth = width;\n originalHeight = height;\n xCentreCoord = 0;\n yCentreCoord = 0;\n }", "async setRtpEncodingParameters(params) {\n if (this._closed)\n throw new InvalidStateError('closed');\n else if (typeof params !== 'object')\n throw new TypeError('invalid params');\n await this.safeEmitAsPromise('@setrtpencodingparameters', params);\n }", "setPlaySettings(...args) {\n this.$movieClip.setPlaySettings.apply(this.$movieClip, args);\n }", "updateParams(){\n\n\t\tconsole.log('params');\n\n\t\tvar self = this;\n\n\t\t\tfor (var key in this.attributes.filters) {\n\n\t\t\t\tif(self.attributes.filters[key]['active']==true){\n\t\t\t\t\tself.attributes.params[key] = self.attributes.filters[key]['value'];\n\t\t\t\t}\n\t\t\t}\n\n\t\tthis.sendParams();\n\n\t}", "set() {\n if (arguments.length === 0) {\n this._constructorDefault();\n }\n else if (arguments.length === 2) {\n this._constructorValues(arguments[0], arguments[1]);\n }\n else if (arguments.length === 1) {\n this._constructorPoint(arguments[0]);\n }\n else {\n throw new Error('HPoint#set error: Invalid number of arguments.');\n }\n return this;\n }", "function setExampleParameters() {\r\n\t\r\n\t// set query sequence\r\n\tif(! setValue('inputSeq', 'AGCTTTTGGGGACACAGTAGTTGACTGGTATATCTCCTGTAAAAACTAGCTTGTATATACT') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set junction position\r\n\tif(! setValue('junctionPos', '27') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set enhancers list\r\n\tsetValue('enhancerList', 'AGCT,GACA,taaaaac,atgtcctcta');\r\n\t\r\n\t// set silencers list\r\n\tsetValue('silencerList', 'CTTTTG,GACA,TATATACT');\r\n\t\t\r\n\t// set enhancers score \r\n\tif(! setValue('enhancerScore', '5') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\t\t\r\n\t// set silencers score \r\n\tif(! setValue('silencerScore', '-7') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\t\r\n\t// set enhancers color to be red\r\n\tif(! setListValue('enhancersColor', 'red')) { // valid options are: green, blue, red\r\n\t\treturn false;\r\n\t}\t\r\n\t\r\n\t// set silencers color to be yellow\r\n\tif(! setListValue('silencersColor', 'yellow')) { // valid options are: violet, yellow, brown\r\n\t\treturn false;\r\n\t}\t\r\n\r\n\t// set \"Sequences to highlight\" option to be \"both\"\r\n\tif(! setRadioValue('mark', 'both')){ // valid options (value field) are: enhancers, silencers, both\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set check box to be checked\r\n\tvar element = document.getElementById('reverse');\r\n\t\r\n\tif (element == null) {\r\n\t\treturn false;\r\n\t} else{ \r\n\t\telement.checked = true;\r\n\t}\r\n\t\r\n\t// set message\r\n\tif(! setValue('errors', 'Input assignment was performed successfully!') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "initParameters(defaultParameters, optionalParameters = {}) {\n Object.keys(defaultParameters).forEach(paramName => {\n if (this.materialParameters.indexOf(paramName) === -1) {\n this.materialParameters.push(paramName)\n }\n //some parameters have different uniform names\n const uniformName = this.uniforms[\n SPECIAL_UNIFORM_MAPPING[paramName]\n ]\n ? SPECIAL_UNIFORM_MAPPING[paramName]\n : paramName\n\n //if there is a uniform\n if (this.uniforms[uniformName]) {\n Object.defineProperty(this, paramName, {\n get: () => this.uniforms[uniformName].value,\n set: value => (this.uniforms[uniformName].value = value)\n })\n console.log('uniform', paramName)\n } else {\n console.log('no uniform', paramName)\n //TODO: figure out what to do with these, probably shouldnt be on material\n // or lookup some mapping and modify the uniform (param)\n }\n\n //wire input parameters, consider types and map appropriately\n //\n this[paramName] = defaultParameters[paramName]\n\n const currentValue = this[paramName]\n const optionalParam = optionalParameters[paramName]\n\n if (currentValue && currentValue.isColor && optionalParam) {\n currentValue.set(optionalParam)\n } else if (\n currentValue &&\n currentValue.isVector3 &&\n (optionalParam && optionalParam.isVector3)\n ) {\n currentValue.copy(optionalParam)\n } else if (optionalParam !== undefined) {\n this[paramName] = optionalParam\n }\n })\n }", "setPorts(port, multiviewPort) {\n this.data.port = port\n this.data.multiviewPort = multiviewPort\n this.save_session_data()\n }", "function setSphere() {\r\n tetrahedron(va, vb, vc, vd, numTimesToSubdivide);\r\n}", "function setOrModifyParameter(template) {\n // Set header_text parameter.\n template.parameters['header_text'] = {\n defaultValue: {\n value: 'A Gryffindor must be brave, talented and helpful.'\n },\n conditionalValues: {\n android_en: {\n value: 'A Droid must be brave, talented and helpful.'\n },\n },\n };\n}", "async setPresets (settings) {\n const { device, ...params } = settings\n for (const p of Object.keys(params)) {\n const [cc, pp] = p.split('_').map(n => parseInt(n))\n const vv = params[p]\n await this.set(pp, cc, vv)\n }\n }", "function setPara(model, parameters){\n var obj = {};\n model.forEach(function(prop) {obj[prop] = parameters[prop];});\n return obj;\n}", "function loadParamsFromServer() {\n\t\t\t\tvar paramArea = this;\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvar componentId = $this.attr('componentId');\n\t\t\t\tvar entryId = $(this).attr('entryId');\n\n\t\t\t\tCREEDO.core.requestData(componentId, entryId, function(result) {\n\t\t\t\t\tPARAMETERS.renderParameters($this, result);\n\t\t\t\t});\n\t\t\t}", "function run(context) {\n\n \"use strict\";\n\n if (adsk.debug === true) {\n /*jslint debug: true*/\n debugger;\n /*jslint debug: false*/\n }\n\n var PARAM_OPERATION = {\n LOOP_ONLY: 0,\n //CLONE_SELECTION: 1,\n EXPORT_FUSION: 1,\n EXPORT_IGES: 2,\n EXPORT_SAT: 3,\n EXPORT_SMT: 4,\n EXPORT_STEP: 5,\n EXPORT_STL: 6,\n LAST: 6\n };\n\n var appTitle = 'ParaParam';\n\n var app = adsk.core.Application.get(), ui;\n if (app) {\n ui = app.userInterface;\n if (!ui) {\n adsk.terminate();\n return;\n }\n }\n\n var design = adsk.fusion.Design(app.activeProduct);\n if (!design) {\n ui.messageBox('No active design', appTitle);\n adsk.terminate();\n return;\n }\n\n // Get the current user parameters\n var paramsList = design.userParameters;\n\n // Create the command definition.\n var createCommandDefinition = function() {\n var commandDefinitions = ui.commandDefinitions;\n\n // Be fault tolerant in case the command is already added...\n var cmDef = commandDefinitions.itemById('ParaParam');\n if (!cmDef) {\n cmDef = commandDefinitions.addButtonDefinition('ParaParam',\n 'ParaParam',\n 'Parametrically drives a user parameter.',\n './resources'); // relative resource file path is specified\n }\n return cmDef;\n };\n\n // CommandCreated event handler.\n var onCommandCreated = function(args) {\n try {\n // Connect to the CommandExecuted event.\n var command = args.command;\n command.execute.add(onCommandExecuted);\n\n // Terminate the script when the command is destroyed\n command.destroy.add(function () { adsk.terminate(); });\n\n // Define the inputs.\n var inputs = command.commandInputs;\n\n var paramInput = inputs.addDropDownCommandInput('param', 'Which Parameter', adsk.core.DropDownStyles.TextListDropDownStyle );\n\n // Get the parameter names\n for (var iParam = 0; iParam < paramsList.count; ++iParam) {\n paramInput.listItems.add(paramsList.item(iParam).name,(iParam === 0));\n }\n\n var valueStart = adsk.core.ValueInput.createByReal(1.0);\n inputs.addValueInput('valueStart', 'Start Value', 'cm' , valueStart);\n\n var valueEnd = adsk.core.ValueInput.createByReal(10.0);\n inputs.addValueInput('valueEnd', 'End Value', 'cm' , valueEnd);\n\n var valueInc = adsk.core.ValueInput.createByReal(1.0);\n inputs.addValueInput('valueInc', 'Increment Value', 'cm' , valueInc);\n\n var operInput = inputs.addDropDownCommandInput('operation', 'Operation', adsk.core.DropDownStyles.TextListDropDownStyle );\n operInput.listItems.add('Value Only',true);\n //operInput.listItems.add('Clone Selected Bodies',false);\n operInput.listItems.add('Export to Fusion',false);\n operInput.listItems.add('Export to IGES',false);\n operInput.listItems.add('Export to SAT',false);\n operInput.listItems.add('Export to SMT',false);\n operInput.listItems.add('Export to STEP',false);\n operInput.listItems.add('Export to STL',false);\n\n //SelectionCommandInput\n //var selInput = inputs.addSelectionInput('selection','Selection','Select bodies for operation or none');\n //selInput.addSelectionFilter( 'Bodies' ); // and Faces and/or sketch elements?\n\n //BoolValueCommandInput\n inputs.addBoolValueInput('pause', 'Pause each iteration', true);\n }\n catch (e) {\n ui.messageBox('Failed to create command : ' + (e.description ? e.description : e));\n }\n };\n\n // CommandExecuted event handler.\n var onCommandExecuted = function(args) {\n try {\n\n // Extract input values\n var unitsMgr = app.activeProduct.unitsManager;\n var command = adsk.core.Command(args.firingEvent.sender);\n var inputs = command.commandInputs;\n\n var paramInput, valueStartInput, valueEndInput, valueIncInput, operationInput, selInput, pauseInput;\n\n // REVIEW: Problem with a problem - the inputs are empty at this point. We\n // need access to the inputs within a command during the execute.\n for (var n = 0; n < inputs.count; n++) {\n var input = inputs.item(n);\n if (input.id === 'param') {\n paramInput = adsk.core.DropDownCommandInput(input);\n }\n else if (input.id === 'valueStart') {\n valueStartInput = adsk.core.ValueCommandInput(input);\n }\n else if (input.id === 'valueEnd') {\n valueEndInput = adsk.core.ValueCommandInput(input);\n }\n else if (input.id === 'valueInc') {\n valueIncInput = adsk.core.ValueCommandInput(input);\n }\n else if (input.id === 'operation') {\n operationInput = adsk.core.DropDownCommandInput(input);\n }\n else if (input.id === 'selection') {\n selInput = adsk.core.SelectionCommandInput(input);\n }\n else if (input.id === 'pause') {\n pauseInput = adsk.core.BoolValueCommandInput(input);\n }\n }\n\n if (!paramInput || !valueStartInput || !valueEndInput || !valueIncInput || !operationInput || !pauseInput) { // || !selInput) {\n ui.messageBox(\"One of the inputs does not exist.\");\n return;\n }\n\n // holds the parameters that drive the parameter. How meta!\n var params = {\n paramName: \"\",\n valueStart: 0.0,\n valueEnd: 1.0,\n valueInc: 0.1,\n operation: PARAM_OPERATION.LOOP_ONLY,\n pause: false,\n exportFilename: \"\"\n };\n\n var iParam = paramInput.selectedItem.index;\n if (iParam < 0) {\n ui.messageBox(\"No parameter name selected\");\n return false;\n }\n\n params.paramName = paramsList.item(iParam).name;\n\n params.valueStart = unitsMgr.evaluateExpression(valueStartInput.expression);\n params.valueEnd = unitsMgr.evaluateExpression(valueEndInput.expression);\n params.valueInc = unitsMgr.evaluateExpression(valueIncInput.expression);\n\n params.operation = operationInput.selectedItem.index;\n if (params.operation < 0 || params.operation > PARAM_OPERATION.LAST) {\n ui.messageBox(\"Invalid operation\");\n return false;\n }\n\n var isExporting = (params.operation >= PARAM_OPERATION.EXPORT_FUSION && params.operation <= PARAM_OPERATION.EXPORT_STL);\n\n params.pause = pauseInput.value;\n\n // If operation is an export then prompt for folder location.\n if (isExporting) {\n\n // Prompt for the base filename to use for the exports. This will\n // be appended with a counter or step value.\n var dlg = ui.createFileDialog();\n dlg.title = 'Select Export Filename';\n dlg.filter = 'All Files (*.*)';\n if (dlg.showSave() !== adsk.core.DialogResults.DialogOK) {\n return false;\n }\n\n // Strip extension\n var filename = dlg.filename;\n var extIdx = filename.lastIndexOf('.');\n if (extIdx >= 0) {\n filename = filename.substring(0, extIdx);\n }\n\n if (filename === '') {\n ui.messageBox('Invalid export filename');\n return false;\n }\n\n params.exportFilename = filename;\n }\n\n // Validate loop params\n if (params.valueInc <= 0) {\n ui.messageBox(\"Value increment must be positive and none zero\");\n return false;\n }\n\n if (params.valueStart > params.valueEnd) {\n params.valueInc = -params.valueInc;\n }\n else if (params.valueStart == params.valueEnd) {\n ui.messageBox(\"Start value must not equal end value\");\n return false;\n }\n\n // Get the actual parameter to modify\n var param = paramsList.itemByName(params.paramName);\n if (!param) {\n return false;\n }\n\n var exportMgr = design.exportManager; // used if exporting\n var resExport = 0;\n\n // Loop from valueStart to valueEnd incrementing by valueInc\n for (var iStep = params.valueStart;\n (params.valueInc > 0) ? iStep <= params.valueEnd : iStep >= params.valueEnd;\n iStep += params.valueInc) {\n\n // note - setting the 'value' property does not change the value. Must set expression\n param.expression = '' + iStep; // + ' cm';\n\n // If exporting then we need to build the name for this iteration\n var exportFilenamePrefix = params.exportFilename;\n if (isExporting) {\n exportFilenamePrefix += '_'+params.paramName+'_'+iStep;\n }\n\n // Now do the post increment operation\n switch (params.operation)\n {\n case PARAM_OPERATION.LOOP_ONLY:\n // Nothing\n break;\n\n case PARAM_OPERATION.CLONE_SELECTION:\n // Need to clone selected bodies\n var selCount = selInput.selectionCount;\n if (selCount > 0) {\n for (var iSel = 0; iSel < selCount; ++iSel) {\n var selItem = selInput.selection(iSel);\n //if (selItem.objectType === 'BRepBody')\n if (selItem.copy()) {\n // ARGH - No support for paste in the API\n }\n }\n }\n\n break;\n\n case PARAM_OPERATION.EXPORT_FUSION:\n var fusionArchiveOptions = exportMgr.createFusionArchiveExportOptions(exportFilenamePrefix+'.f3d');\n resExport = exportMgr.execute(fusionArchiveOptions);\n break;\n\n case PARAM_OPERATION.EXPORT_IGES:\n var igesOptions = exportMgr.createIGESExportOptions(exportFilenamePrefix+'.igs');\n resExport = exportMgr.execute(igesOptions);\n break;\n\n case PARAM_OPERATION.EXPORT_SAT:\n var satOptions = exportMgr.createSATExportOptions(exportFilenamePrefix+'.sat');\n resExport = exportMgr.execute(satOptions);\n break;\n\n case PARAM_OPERATION.EXPORT_SMT:\n var smtOptions = exportMgr.createSMTExportOptions(exportFilenamePrefix+'.smt');\n resExport = exportMgr.execute(smtOptions);\n break;\n\n case PARAM_OPERATION.EXPORT_STEP:\n var stepOptions = exportMgr.createSTEPExportOptions(exportFilenamePrefix+'.step');\n resExport = exportMgr.execute(stepOptions);\n break;\n\n case PARAM_OPERATION.EXPORT_STL:\n var stlOptions = exportMgr.createSTLExportOptions(design.rootComponent, exportFilenamePrefix+'.stl');\n stlOptions.isBinaryFormat = true;\n stlOptions.meshRefinement = adsk.fusion.MeshRefinementSettings.MeshRefinementHigh;\n resExport = exportMgr.execute(stlOptions);\n break;\n }\n\n // Pause each iteration?\n if (params.pause) {\n //DialogResults\n var dlgres = ui.messageBox('Pausing iteration at ' + iStep, 'Iteration Paused', adsk.core.MessageBoxButtonTypes.OKCancelButtonType);\n if (dlgres !== 0) {\n break; // Cancel iteration.\n }\n }\n }\n }\n catch (e) {\n ui.messageBox('Failed to execute command : ' + (e.description ? e.description : e));\n }\n };\n\n // Create and run command\n\ttry {\n var command = createCommandDefinition();\n var commandCreatedEvent = command.commandCreated;\n commandCreatedEvent.add(onCommandCreated);\n\n command.execute();\n }\n catch (e) {\n ui.messageBox('Script Failed : ' + (e.description ? e.description : e));\n adsk.terminate();\n }\n}", "function setMixSplit(newSp) {\n mixSplits = newSp;\n splitPointer = -1;\n nexter();\n}", "function randomizeParameters() {\n CS.strokeS=randomRGBA();\n CS.fillS=randomRGBA();\n CS.lineW=Math.floor(Math.random()*9)+1;\n CS.brushSize=Math.floor(Math.random()*99)+1;\n updateControls();\n // canvas.dispatchEvent(new Event('mousemove')); // trigger updating in place of the brush on the preview layer\n //TODO trigger redraw \"in-place\" on new random event\n }", "enterSettingsParameter(ctx) {\n\t}", "set props(p) {\n props = p;\n }", "function PanelParameter() { this.initialize(...arguments); }", "function setParams(element, airport) {\n\t// Adds param...\n\tparams[element.name] = {\n\t\tcode: airport.code,\n\t\tname: airport.code + ' - ' + airport.name,\n\t\tlat: airport.lat,\n\t\tlng: airport.lng\n\t};\n\t// Sets value in parameter\n\tsetInput(element, params[element.name]);\n\t// Add marker to map...\n\t(0, _trackMap.addMarker)(params[element.name]);\n\t// Checks if form is valid\n\t(0, _submitButton.validateButton)();\n}", "function settings(timeout,server,paip,paport,accuracy,polygon) {\n\tthis.timeout=timeout;\n\tthis.server=server;\n\tthis.paip=paip;\n\tthis.paport=paport;\n\tthis.accuracy=accuracy;\n\tthis.polygon=polygon;\n}", "function setRouteParameters(params, saveHistory = false) {\r\n let url = UU5.Common.Url.parse(window.location.href.replace(/#.*/, \"\"))\r\n .set({ parameters: params })\r\n .toString();\r\n if (saveHistory) {\r\n history.pushState({}, document.title, url);\r\n } else {\r\n history.replaceState({}, document.title, url);\r\n }\r\n}", "setResolution(width, height) {\n\t\tthis.gl.canvas.width = width;\n\t\tthis.gl.canvas.height = height;\n\t}", "setParams(params){\n var state_manager = this,\n url, house, params;\n if (state_manager.update_in_progress) return false;\n state_manager.update_in_progress = true;\n\n params = Object.assign({}, state_manager.state, params);\n if (params.house_id){\n house = state_manager.houses.find((h)=>{ return h.data.id == params.house_id; });\n } else {\n house = state_manager.state.house || state_manager.houses[0];\n params.house_id = house.data.id;\n }\n\n house.verifyMonthState(params);\n if (params.dataset === 'irradiance'){\n params.date_interval = house.verifyPowerRange(params.date_interval || [], params);\n url = `/irradiance/${params.month}/${params.year}/${params.view}?${query_string.stringify({dates: params.date_interval})}`;\n } else if (params.dataset === 'energy'){\n url = `/houses/${params.house_id}/energy/${params.year}/${params.graph_attr}/${params.view}`;\n } else {\n params.date_interval = house.verifyPowerRange(params.date_interval || [], params);\n url = `/houses/${params.house_id}/power/${params.month}/${params.year}/${params.view}?${query_string.stringify({dates: params.date_interval})}`;\n }\n\n state_manager.history.push(url);\n }", "function ShapeParameter(obj) {\n scope.AbstractParameter.call(this, obj);\n if (obj) {\n if (obj.rejectDetectionSensitivity) {\n this.rejectDetectionSensitivity = obj.rejectDetectionSensitivity;\n }\n if (obj.doBeautification) {\n this.doBeautification = obj.doBeautification;\n }\n if (obj.userResources) {\n this.userResources = obj.userResources;\n }\n }\n }", "function updateParams() {\n let params = [];\n params.push(getPlayerParams());\n params.push(getPilesParams());\n document.getElementById('new_parameters').value = JSON.stringify(params);\n all_params = params;\n}", "function set_upload_param(up) {\n var ret = get_signature();\n if (ret == true) {\n var filename = '${filename}';\n if (uploader.seq < up.files.length) {\n filename = up.files[uploader.seq].name;\n filename = generateFilename(filename);\n // change the filename in the files, used in diplaying photo display.\n up.files[uploader.seq].name = filename;\n }\n new_multipart_params = {\n 'key' : key + filename,\n 'policy': policyBase64,\n 'OSSAccessKeyId': accessid,\n 'success_action_status' : '200', //让服务端返回200,不然,默认会返回204\n 'signature': signature,\n };\n\n up.setOption({\n 'url': host,\n 'multipart_params': new_multipart_params\n });\n\n console.log('reset uploader');\n }\n }", "setVertices(hasBeenInitialized=false) {\n for (let i=0; i<this.presetVertices.length; i++)\n this.vertices.splice(this.verticesOffset + i, // index\n hasBeenInitialized ? 1 : 0, // number of elements to remove before pushing\n this.presetVertices[i]\n );\n let defaultModelCenter = {x: 0.0, y: 0.0, z: 0.0};\n let newCenter = this.center;\n this.center = defaultModelCenter;\n this.move(newCenter);\n this.scale(this.ratioSize);\n }", "function SetSavedParameters(params) {\n $('#txtScheduledReportName').val(params.ReportNameOverride);\n $('input[name=ReportTypeNoExcel][value=\"' + getParamValue(params.ReportParameters, \"ReportType\") + '\"]').prop('checked', true);\n $('input[name=TracerComplianceGroupBy][value=\"' + getParamValue(params.ReportParameters, \"ReportGroupByType\") + '\"]').prop('checked', true);\n\n $(\"#TracersCategory\").data(\"kendoMultiSelect\").value(getParamValue(params.ReportParameters, \"TracersCategory\").split(\",\"));\n $(\"#TracersListForCompliance\").data(\"kendoMultiSelect\").value(getParamValue(params.ReportParameters, \"TracersList\").split(\",\"));\n\n SetOrgHierarchy(params.ReportParameters);\n SetSavedObservationDate(params.ReportParameters);\n\n CheckboxChecked(getParamValue(params.ReportParameters, \"IncludeFSAcheckbox\"), 'IncludeFSAcheckbox');\n\n SetRecurrenceParameters(params);\n\n TriggerActionByReportMode(params.ReportMode);\n}", "function setVals(param) {\n let modParam = $(param).siblings('select');\n let valOptions = $(param).val();\n\n switch (valOptions) {\n case 'Warehouse':\n modParam.empty();\n modParam.append(warehouseOptions.cloneNode(true));\n break;\n case 'Project':\n modParam.empty();\n modParam.append(classOptions.cloneNode(true));\n break;\n case 'Item':\n modParam.empty();\n modParam.append(itemOptions.cloneNode(true));\n break;\n case 'Manager':\n modParam.empty();\n modParam.append(managerOptions.cloneNode(true));\n break;\n case 'Supervisor':\n modParam.empty();\n modParam.append(supervisorOptions.cloneNode(true));\n break;\n case 'Type':\n modParam.empty();\n modParam.append(typeOptions.cloneNode(true));\n break;\n case 'Status':\n modParam.empty();\n modParam.append(statusOptions.cloneNode(true));\n break;\n case 'Stage':\n modParam.empty();\n modParam.append(stageOptions.cloneNode(true));\n break;\n //For future \"All Projects\" option\n /*\tcase 'All Projects':\n\t\tmodParam.empty();\n\t\tmodParam.append(allProjectsOptions.cloneNode(true));\n\t\tbreak; */\n }\n}", "configure(settings) {\n this.settings = { ...this.settings, ...settings }\n }", "enterParameters(ctx) {\n\t}", "set(options) {\n\n if (\"point1\" in options) {\n var copyPoint = options[\"point1\"];\n this.point1.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"point2\" in options) {\n var copyPoint = options[\"point2\"];\n this.point2.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"line\" in options) {\n var copyLine = options[\"line\"];\n this.point1.set({x: copyLine.getPoint1().getX(), y: copyLine.getPoint1().getY()});\n this.point1.set({x: copyLine.getPoint2().getX(), y: copyLine.getPoint2().getY()});\n }\n }", "setPath (callback) {\n\t\t// provide random parameter \"thisparam\", which will be rejected\n\t\tthis.path = `/posts?teamId=${this.team.id}&streamId=${this.teamStream.id}&thisparam=1`;\n\t\tcallback();\n\t}" ]
[ "0.6579918", "0.6186937", "0.61332995", "0.59890825", "0.5856807", "0.5719159", "0.57059836", "0.570415", "0.5674817", "0.56528974", "0.56449145", "0.5638581", "0.5625705", "0.5624296", "0.5599042", "0.5576267", "0.55709195", "0.55701673", "0.55601704", "0.55513895", "0.55262554", "0.5524761", "0.55197036", "0.551576", "0.5513602", "0.55060446", "0.54920405", "0.54920405", "0.54920405", "0.54920405", "0.54920405", "0.54917806", "0.5486072", "0.545926", "0.54286593", "0.5427917", "0.540977", "0.5396436", "0.53111774", "0.53060955", "0.53054225", "0.5301912", "0.52929235", "0.52874696", "0.5275698", "0.52721184", "0.5267426", "0.5266488", "0.5256601", "0.5230686", "0.5230686", "0.5230686", "0.52105", "0.5207821", "0.5206682", "0.52004653", "0.519278", "0.51925504", "0.51866776", "0.51739424", "0.51632607", "0.5141277", "0.5139287", "0.5139125", "0.51319826", "0.5123581", "0.5119702", "0.5101736", "0.5089247", "0.5088808", "0.50880283", "0.5085108", "0.5070581", "0.506995", "0.5064273", "0.50640714", "0.5062785", "0.5058429", "0.50519013", "0.50353485", "0.5026884", "0.50204587", "0.5018482", "0.5017526", "0.5015832", "0.50139326", "0.49966773", "0.4994569", "0.4987681", "0.4974388", "0.4962517", "0.4961136", "0.4960773", "0.49452698", "0.4945027", "0.4940513", "0.49399775", "0.49249563", "0.49242634", "0.4919147", "0.491181" ]
0.0
-1
input two strings output number rules: return a number that represents how many times the first string appears in the second string algorithm: use match on the second string and return the length of the resulting array
function searchWord(word, text) { word = new RegExp(word, "gi"); return text.match(word).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matching_strings(stra1,stra2){\n var count = 0;\n for(var i = 0; i < stra1.length; i++){\n if(stra2.includes(stra1[i])){\n count++;\n }\n }\n return count;\n}", "function hamming(string_1, string_2) {\n if (string_1.length !== string_2.length) {\n return 0;\n } else {\n let num_common = 0;\n for (let i = 0; i < string_1.length; i++) {\n if (string_1.charAt(i) === string_2.charAt(i)) {\n num_common++;\n }\n } //end of for loop\n return num_common;\n } //end of else\n } //end of hamming", "function strRepeatCount(str1, str2) {\n const str1Hash = {};\n let fragment = \"\";\n let lastIndex = -Infinity;\n let count = 0;\n\n //O(str1.length)\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n if (str1Hash[letter]) {\n str1Hash[letter].push(i);\n } else {\n str1Hash[letter] = [i];\n }\n\n }\n\n //O(str2.length) * O(indices.length)\n\n for (let j = 0; j < str2.length; j++) {\n let letter = str2[j];\n \n if (str1Hash[letter]) {\n if (fragment.length === 0) {\n fragment = letter;\n lastIndex = str1Hash[letter][0];\n count++;\n } else {\n let letterIndices = str1Hash[letter];\n let foundIdx = false;\n\n for (let idx of letterIndices) {\n if (idx > lastIndex) {\n fragment += letter;\n lastIndex = idx;\n foundIdx = true;\n }\n }\n\n console.log(fragment, count);\n if (!foundIdx) {\n count++;\n fragment = letter;\n lastIndex = str1Hash[letter][0];\n } else if (foundIdx === str2.length - 1) {\n count ++;\n }\n \n }\n } else {\n return -1;\n }\n\n\n }\n\n return count;\n\n\n}", "function commonCharacterCount(s1, s2) {\n \n // find lesser of two lengths\n let len = Math.min(s1.length, s2.length)\n \n // set count to zero\n let count = 0\n \n let s1Dict = {}\n \n // create dictionary of letter counts in s1\n for (let i = 0; i < s1.length; i++){\n // if character is not in dictionary, add it\n let char = s1.charAt(i)\n if (!(char in s1Dict)){\n s1Dict[char] = 1\n } else {\n // add 1 to key since character is in dict already\n s1Dict[char] ++\n }\n }\n //console.log(s1Dict)\n \n // loop through s2\n for (let j = 0; j < s2.length; j++){\n let char2 = s2.charAt(j)\n // char2 in s1Dict?\n if (char2 in s1Dict){\n // are there remaining characters in s1Dict to pull from?\n if (s1Dict[char2] > 0){\n count ++\n s1Dict[char2] --\n }\n }\n }\n //console.log(s1Dict)\n \n return count\n}", "function stringSearch(str1, str2) {\n\tlet count = 0;\n\tfor (let i = 0; i < str1.length; i++) {\n\t\tfor (let j = 0; j < str2.length; j++) {\n\t\t\tif(str2[j] !== str1[i+j]) {\n break;\n }\n if(j === str2.length -1){\n count++;\n }\n }\n\t}\n\treturn count;\n}", "function hammingDistance(string1, string2) {\n var total = 0;\n for (var i=0; i<string1.length; i++) {\n if (string1[i] != string2[i]) {\n total = total + 1;\n }\n }\n return total;\n}", "function sumOfStrings(a, b) {\n\tlet strA = a.toString().split(\"\").reverse().join(\"\");\n\tlet strB = b.toString().split(\"\").reverse().join(\"\");\n\tvar sumCount = [];\n\n\tvar countArr = {};\n\tvar isCarry = 0;\n\n\tlet isFirstLong = strA.length < strB.length ? false : true;\n\tlet numberDigits = isFirstLong ? strB.length : strA.length;\n\n\tfor (let index = 0; index < numberDigits; index++) {\n\t\tconst elementA = strA[index];\n\t\tconst elementB = strB[index];\n\t\tvar result = parseInt(elementA) + parseInt(elementB) + isCarry;\n\t\t/*\n\t\tif (result > 9) {\n\t\t\tisCarry = 1;\n\t\t}\n\t\tif (index == strA.length - 1) {\n\t\t\tresult++;\n\t\t}\n\t\t*/\n\t\tcountArr[index] = result;\n\t}\n\n\tfor (const key in countArr) {\n\t\tif (countArr.hasOwnProperty(key)) {\n\t\t\tsumCount.push(countArr[key]);\n\t\t}\n\t}\n\n\t// Handle the difference in two numbers.\n\tlet diffDigits = Math.abs(strA.length - strB.length);\n\tlet startingIndex = isFirstLong ? strA.length : strB.length;\n\tlet remainingStr = isFirstLong ? strA : strB;\n\n\tfor (let index = startingIndex - diffDigits; index <= diffDigits; index++) {\n\t\tconst element = remainingStr[index];\n\t\tsumCount.push(parseInt(element));\n\t}\n\tconsole.log(sumCount.reverse().join(\"\"));\n\treturn sumCount.join(\"\");\n}", "function makingAnagrams(s1, s2) {\n let charMatched = 0;\n let s1Arr = s1.split('');\n let s2Arr = s2.split('');\n let deletionCount = s1Arr.length+s2Arr.length;\n for(let i=0;i<s1Arr.length;i++){\n for(let j=0;j<s2Arr.length;j++){\n if(s1Arr[i]===s2Arr[j]){\n charMatched+=2;\n s2Arr[j] = 0;\n break;\n }\n }\n }\n return deletionCount-charMatched;\n}", "function solve(a,b){\r\n var dict = {}\r\n for (i = 0; i < a.length; i++) {\r\n var word = a[i]\r\n if (word in dict) {\r\n dict[word] = dict[word] + 1\r\n } else {\r\n dict[word] = 1\r\n }\r\n }\r\n var result = [];\r\n for (j = 0; j < b.length; j++) {\r\n var key = b[j]\r\n if (key in dict) {\r\n result.push(dict[key])\r\n } else {\r\n result.push(0)\r\n }\r\n }\r\n return result\r\n }", "function twoStrings(s1, s2) {\n let letterCounter = {};\n for (let i = 0; i < s1.length; i++) {\n let letter_1 = s1[i];\n letterCounter[letter_1] = (letterCounter[letter_1] || 0) + 1;\n console.log(letterCounter);\n }\n for (let i = 0; i < s2.length; i++) {\n let letter2 = s2[i];\n if (letterCounter[letter2]) {\n return \"YES\";\n }\n }\n return \"NO\";\n}", "function naiveString(A, B) {\n let count = 0;\n for (let i=0; i<A.length; i++) {\n for (let j=0; j<B.length; j++) {\n if (B[j] !== A[i+j]) break\n if (j === B.length-1) count++\n }\n }\n return count || -1\n}", "function twoStrings(s1, s2) {\n let dict = {};\n for(let i=0;i<s1.length;i++){\n if(dict[s1[i]]){\n dict[s1[i]] = dict[s1[i]] + 1;\n }\n else{\n dict[s1[i]] = 1;\n }\n }\n for(let i=0;i<s2.length;i++){\n if(dict[s2[i]]){\n return \"YES\";\n }\n }\n return \"NO\";\n \n}", "function commonCharacterCount(s1, s2) {\n let letterObj = {};\n let commonCount = 0;\n\n for (let i = 0; i < s1.length; i++) {\n let currentLetter = s1[i]\n if (!(currentLetter in letterObj)) {\n letterObj[currentLetter] = 1\n } else {\n letterObj[currentLetter]++\n }\n }\n\n for (let i = 0; i < s2.length; i++) {\n let currentLetter = s2[i]\n if (currentLetter in letterObj) {\n if (letterObj[currentLetter] > 0) {\n commonCount++\n letterObj[currentLetter]--\n }\n }\n }\n\n return commonCount\n}", "function solution_1 (s1, s2) {\r\n if (s2.length < s1.length) return false;\r\n const freq = {};\r\n for (const char of s1) {\r\n freq[char] = freq[char] ? freq[char] - 1 : -1;\r\n }\r\n for (let i = 0; i < s2.length; i++) {\r\n const newChar = s2[i];\r\n freq[newChar] = freq[newChar] ? freq[newChar] + 1 : 1;\r\n if (!freq[newChar]) delete freq[newChar];\r\n if (i >= s1.length) {\r\n const oldChar = s2[i - s1.length]\r\n freq[oldChar] = freq[oldChar] ? freq[oldChar] - 1 : -1;\r\n if (!freq[oldChar]) delete freq[oldChar];\r\n }\r\n if (!Object.keys(freq).length) return true;\r\n }\r\n return false;\r\n}", "function getHammingDistance(str1, str2){ \n\tvar cnt=0, i=0;\n\t\n\tif(str1.length != str2.length) console.log(\"Error! Strings are not equal!\"); //prints error msg if length of both string is NOT equal\n\tif(str1.length <= 0 || str2.length <= 0) console.log(\"Invalid string length!\"); //prints error msg if length is invalid (negative or zero)\n\telse{\n\t\twhile(i<str1.length){\n\t\t\tif(str1[i]!=str2[i]) //if characters in ith position is NOT equal\n\t\t\t\tcnt++;\t//updates counter\t\t\t\t\n\t\t\ti++; //updates i\n\t\t}\n\t\treturn(cnt);\n\t}\t\n}", "function matchingStrings(strings, queries) {\nstrings=strings.sort();\nlet x=0,n=0;\nlet arr=[];\nfor(let i of queries){\nif(strings.includes(i)){\n arr.push(1+strings.lastIndexOf(i)-strings.indexOf(i));\n}else{\n arr.push(0);\n}\n\n}\n return arr;\n}", "function stringsConstruction(a, b) {\n a = a.split('');\n b = b.split('');\n\n let index = 0;\n let count = 0;\n let numStrings = 0;\n \n while(b.length > 0){\n if(b.indexOf(a[index]) >= 0){\n count++;\n b.splice(b.indexOf(a[index]), 1);\n } else break;\n\n if(index === a.length - 1)\n index = -1;\n \n if(count === a.length){\n numStrings++;\n count = 0;\n }\n index++;\n }\n return numStrings;\n}", "function isAnagram (a, b) {\n\t// turn each string into arrays to check for equality\n\tlet stringAArray = a.split('');\n let stringBArray = b.split('');\n\n // have a counter variable to keep track of how many characters match\n let numberOfMatches = 0;\n\n // check which string is smaller to loop through that string in the first loop\n // so we can reduce the number of equality checks\n if (stringAArray.length > stringBArray.length) {\n \tstringAArray = b.split('');\n stringBArray = a.split('');\n }\n\n // loop through both array of strings to check if stringAArray[i] === stringBArray[j]\n // push 2 counters to numberOfMatches for each match\n // set stringBArray[j] to null so that when we do an equality check it would not check that same value again and add counters to numberOfMatches\n for (let i = 0; i < stringAArray.length; i++) {\n for (let j = 0; j < stringBArray.length; j++) {\n if (stringAArray[i] === stringBArray[j]) {\n \t// console.log('match');\n numberOfMatches += 2;\n stringBArray[j] = null;\n break;\n }\n }\n }\n\n // console.log('number of matches: ' + numberOfMatches);\n // console.log('string a array: ' + stringAArray);\n // console.log('string b array: ' + stringBArray);\n // console.log('number of cuts: ' + (stringAArray.length + stringBArray.length) - numberOfMatches);\n\n // return total amount of cuts to both strings\n return (stringAArray.length + stringBArray.length) - numberOfMatches;\n}", "function search(w1, w2)\n{\n let l1 = w1.length;\n let l2 = w2.length;\n console.log(w1, w2);\n let ch,c,maxc=0;\n let i,j;\n\n for(i=0;i<l1;i++)\n {\n ch = w1.charAt(i);\n\n for(j=0;j<l2;j++)\n {\n if(ch === w2.charAt(j))\n {\n c=1;\n tempi = i;\n tempj = j;\n\n\n while (w1.charAt(++tempi) === w2.charAt(++tempj))\n {\n c++;\n if(tempi+1>l1 || tempj+1>l2)\n {\n c--;\n break;\n }\n\n }\n\n\n }\n\n\n if(c>maxc)\n {\n maxc = c;\n }\n\n }\n }\n let perc_match = maxc/l1*100;\n console.log(perc_match)\n return perc_match;\n}", "function makingAnagrams(s1, s2){\n const str1 = s1.split('');\n const str2 = s2.split('');\n let str1Only = 0;\n \n str1.forEach((el, i) => {\n let j = str2.findIndex((el2) => el2 === el);\n if (j >= 0) {\n str2.splice(j,1);\n } else {\n str1Only++;\n }\n });\n \n return str1Only + str2.length;\n}", "function matchingStrings(strings, queries) {\n // Write your code here\n // O(n^2) | O(n);\n let results = [];\n for (let i = 0; i < queries.length; i++) {\n let count = 0;\n for (let j = 0; j < strings.length; j++) {\n if (strings[j] === queries[i]) {\n count++;\n }\n }\n results.push(count);\n }\n return results;\n}", "function main() {\n\tvar a = readLine();\n\tvar b = readLine();\n\tvar read = [];\n\tvar c = 0; \n\tfor (var i = 0; i < a.length; i++) {\n\t\tif(read.indexOf(a.charAt(i))!==-1){\n\t\t\tread.push(a.charAt(i));\n\t\t\tvar nA = searchNumberOfChar(a, a.charAt(i));\n\t\t\tvar nB = searchNumberOfChar(b, a.charAt(i)); \n\t\t\tvar c = c+ Math.abs(nA-nB);\n\t\t}\n\t}\n\n\tfor (var i = 0; i < b.length; i++) {\n\t\tif(read.indexOf(b.charAt(i))!==-1){\n\t\t\tread.push(b.charAt(i));\n\t\t\tvar nA = searchNumberOfChar(a, b.charAt(i));\n\t\t\tvar nB = searchNumberOfChar(b, b.charAt(i)); \n\t\t\tvar c = c+ Math.abs(nA-nB);\n\t\t}\n\t}\n\tconsole.log(c);\n}", "function stringLength(x,y){\n let dic = {}\n let dic1 = {}\n for(var i = 0; i<x.length;i++){\n if(dic.hasOwnProperty(x[i])){\n dic[x[i]]++\n }else{\n dic[x[i]]=1\n }\n }\n for(var i = 0; i<y.length;i++){\n if(dic1.hasOwnProperty(y[i])){\n dic1[y[i]]++\n }else{\n dic1[y[i]]=1\n }\n }\n if(Object.keys(dic)===Object.keys(dic1)){\n\n }\n\n console.log(dic, dic1)\n}", "function hammingDistance(str1, str2) {\n if (str1.length !== str2.length)\n return \"Input strings must have the same length.\";\n let diff = 0;\n for (let i = 0; i < str1.length; i++) {\n if (str1[i].toLowerCase() !== str2[i].toLowerCase()) diff++;\n }\n return diff;\n}", "function count(x, y){\n return (x.match(new RegExp(y, \"g\")) || []).length;\n }", "function matchingStrings(strings, queries) {\n \n var n = strings.length;\n var q= queries.length;\n \n var s = \"\";\n for(var i=0;i<n;i++){\n s+=strings[i];\n }\n \n var temp = [];\n \n for(let i=0;i<q;i++){\n if(s.search(q[i]!=-1)){\n var count=0;\n for(let j=0;j<n;j++){\n if(strings[j]==queries[i]){\n count++;\n }\n temp[i]=count;\n } \n }\n \n }\n \n return temp;\n\n}", "function matchingStrings(strings, queries) {\n return queries.map(q => strings.filter(s => s === q).length);\n}", "function typeaheadSimilarity(a: string, b: string): number {\n const aLength = a.length;\n const bLength = b.length;\n const table = [];\n\n if (!aLength || !bLength) {\n return 0;\n }\n\n // Early exit if `a` startsWith `b`; these will be scored higher than any\n // other options with the same `b` (filter string), with a preference for\n // shorter `a` strings (option labels).\n if (a.indexOf(b) === 0) {\n return bLength + 1 / aLength;\n }\n\n // Initialize the table axes:\n //\n // 0 0 0 0 ... bLength\n // 0\n // 0\n //\n // ...\n //\n // aLength\n //\n for (let x = 0; x <= aLength; ++x) {\n table[x] = [0];\n }\n for (let y = 0; y <= bLength; ++y) {\n table[0][y] = 0;\n }\n\n // Populate the rest of the table with a dynamic programming algorithm.\n for (let x = 1; x <= aLength; ++x) {\n for (let y = 1; y <= bLength; ++y) {\n table[x][y] = a[x - 1] === b[y - 1] ?\n 1 + table[x - 1][y - 1] :\n Math.max(table[x][y - 1], table[x - 1][y]);\n }\n }\n\n return table[aLength][bLength];\n}", "function comparisionking(str1, str2) {\r\n rankk = 0;\r\n str1 = str1.split(' ');\r\n str2 = str2.split(' ');\r\n for (i1 = 0; i1 < str1.length; i1++) {\r\n for (j1 = 0; j1 < str2.length; j1++) {\r\n\r\n if (str1[i1] == str2[j1]) {\r\n rankk++;\r\n }\r\n }\r\n }\r\n return rankk;\r\n}", "function levenshtein (s1, s2) {\n // http://kevin.vanzonneveld.net\n // + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)\n // + bugfixed by: Onno Marsman\n // + revised by: Andrea Giammarchi (http://webreflection.blogspot.com)\n // + reimplemented by: Brett Zamir (http://brett-zamir.me)\n // + reimplemented by: Alexander M Beedie\n // * example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld');\n // * returns 1: 3\n if (s1 == s2) {\n return 0;\n }\n\n var s1_len = s1.length;\n var s2_len = s2.length;\n if (s1_len === 0) {\n return s2_len;\n }\n if (s2_len === 0) {\n return s1_len;\n }\n\n // BEGIN STATIC\n var split = false;\n try {\n split = !('0')[0];\n } catch (e) {\n split = true; // Earlier IE may not support access by string index\n }\n // END STATIC\n if (split) {\n s1 = s1.split('');\n s2 = s2.split('');\n }\n\n var v0 = new Array(s1_len + 1);\n var v1 = new Array(s1_len + 1);\n\n var s1_idx = 0,\n s2_idx = 0,\n cost = 0;\n for (s1_idx = 0; s1_idx < s1_len + 1; s1_idx++) {\n v0[s1_idx] = s1_idx;\n }\n var char_s1 = '',\n char_s2 = '';\n for (s2_idx = 1; s2_idx <= s2_len; s2_idx++) {\n v1[0] = s2_idx;\n char_s2 = s2[s2_idx - 1];\n\n for (s1_idx = 0; s1_idx < s1_len; s1_idx++) {\n char_s1 = s1[s1_idx];\n cost = (char_s1 == char_s2) ? 0 : 1;\n var m_min = v0[s1_idx + 1] + 1;\n var b = v1[s1_idx] + 1;\n var c = v0[s1_idx] + cost;\n if (b < m_min) {\n m_min = b;\n }\n if (c < m_min) {\n m_min = c;\n }\n v1[s1_idx + 1] = m_min;\n }\n var v_tmp = v0;\n v0 = v1;\n v1 = v_tmp;\n }\n return v0[s1_len];\n}", "function findOccurance(a, b) {\n let str = b;\n //new RegExp(stringToMatch , flags)\n let testStr = new RegExp(a, \"g\")\n let count = (str.match(testStr) || []).length;\n return console.log(count);\n}", "function matchUp(a, b) {\n let count = 0;\n for (let i = 0; i < a.length; i++) {\n if (a[i][0] !== undefined && b[i][0] !== undefined) {\n a[i][0] === b[i][0] ? count++ : null ;\n }\n }\n return count;\n}", "function makeAnagram(str1, str2) {\n let counter1 = str1.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n let counter2 = str2.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n for (let ltr in counter2) {\n counter1[ltr] = (counter1[ltr] || 0) - counter2[ltr];\n }\n return Object.values(counter1).reduce((acc, val) => acc + Math.abs(val), 0);\n}", "function solve(a,b){\n let arr = [];\n for(let i = 0; i < b.length; i++){\n let count = 0;\n for(let j = 0; j < a.length; j++){\n if(b[i] === a[j])\n count++; \n }\n arr.push(count)\n }\n return arr\n }", "function getTwoLengths(str1,str2){\n\tlet strLengths = [];\n\tstrLengths.push(str1.length, str2.length);\n\treturn strLengths;\n}", "function stringChecker(a,b, myFunc){\n // we initialize our results\n let results;\n // if the length of b !== the length of a\n if (String(b).length !== String(a).length){\n // we know the answer is false\n return false;\n } else{\n // we convert our strings/integers to arrays.\n // stringConverter- returns 2 arrays within an array.\n results = stringConverter(a,b);\n // we then compare the frequency of our two arrays\n return myFunc(results[0],results[1]);\n };\n \n}", "function alg(str1, str2) {\n\tlet out = \"\";\n\tlet arr = [];\n\n\tfor (let l of str1) {\n\t\tlet index = str1.indexOf(l);\n\t\t// If the chars are the same\n\t\tif (l === str2[index]) {\n\t\t\tout += l;\n\t\t} else {\n\t\t\t// if there is a substring add to arr\n\t\t\tif (out.length > 0) {\n\t\t\t\tarr.push(out);\n\t\t\t}\n\t\t\tout = \"\";\n\t\t}\n\t}\n\tconsole.log(arr);\n\t// Compare and return If there is sub strings\n\tlet output = arr[0];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (output.length > arr[i].length) output = arr[i];\n\t}\n\tif (output !== undefined) return output;\n\n\treturn undefined;\n}", "function distance(s1, s2) {\r\n if (typeof(s1) != \"string\" || typeof(s2) != \"string\") return 0;\r\n if (s1.length == 0 || s2.length == 0) \r\n return 0;\r\n s1 = s1.toLowerCase(), s2 = s2.toLowerCase();\r\n var matchWindow = (Math.floor(Math.max(s1.length, s2.length) / 2.0)) - 1;\r\n var matches1 = new Array(s1.length);\r\n var matches2 = new Array(s2.length);\r\n var m = 0; // number of matches\r\n var t = 0; // number of transpositions\r\n\r\n //debug helpers\r\n //console.log(\"s1: \" + s1 + \"; s2: \" + s2);\r\n //console.log(\" - matchWindow: \" + matchWindow);\r\n\r\n // find matches\r\n for (var i = 0; i < s1.length; i++) {\r\n\tvar matched = false;\r\n\r\n\t// check for an exact match\r\n\tif (s1[i] == s2[i]) {\r\n\t\tmatches1[i] = matches2[i] = matched = true;\r\n\t\tm++\r\n\t}\r\n\r\n\t// check the \"match window\"\r\n\telse {\r\n \t// this for loop is a little brutal\r\n \tfor (k = (i <= matchWindow) ? 0 : i - matchWindow;\r\n \t\t(k <= i + matchWindow) && k < s2.length && !matched;\r\n\t\t\tk++) {\r\n \t\tif (s1[i] == s2[k]) {\r\n \t\tif(!matches1[i] && !matches2[k]) {\r\n \t \t\tm++;\r\n \t\t}\r\n\r\n \t matches1[i] = matches2[k] = matched = true;\r\n \t }\r\n \t}\r\n\t}\r\n }\r\n\r\n if(m == 0)\r\n return 0.0;\r\n\r\n // count transpositions\r\n var k = 0;\r\n\r\n for(var i = 0; i < s1.length; i++) {\r\n \tif(matches1[k]) {\r\n \t while(!matches2[k] && k < matches2.length)\r\n k++;\r\n\t if(s1[i] != s2[k] && k < matches2.length) {\r\n t++;\r\n }\r\n\r\n \t k++;\r\n \t}\r\n }\r\n \r\n //debug helpers:\r\n //console.log(\" - matches: \" + m);\r\n //console.log(\" - transpositions: \" + t);\r\n t = t / 2.0;\r\n return (m / s1.length + m / s2.length + (m - t) / m) / 3;\r\n}", "function anagrams(str1, str2) {\n let resultsHash = {};\n\n str1.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] += 1;\n })\n\n str2.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] -= 1;\n })\n\n // console.log(resultsHash)\n return Object.values(resultsHash).every( value => value == 0);\n}", "function makeAnagram(a, b) {\n // if(a === b) return a.length;\n \n // if(a.length > b.length){\n // for(let char of a){\n // if(b.includes(char)){\n // b.split(' ').splice(b.indexOf(char)).join('')\n // }\n // }\n // }\n // return b.length;\n\n //1 test case. \n\n// <-------------------------------------------------------------------->\n\n // if(a === b) return a.length;\n // let arrA = a.split('').sort();\n // let arrB = b.split('').sort();\n \n // if(a.length > b.length){\n // for(let char of b){\n // if(arrA.includes(char)){\n // arrA.splice(arrA.indexOf(char), 1);\n // arrB.splice(arrB.indexOf(char), 1);\n // }\n // }\n // }\n \n // if(b.length > a.length){\n // for(let char of a){\n // if(arrB.includes(char)){\n // arrA.splice(arrA.indexOf(char), 1);\n // arrB.splice(arrB.indexOf(char), 1);\n // }\n // }\n // }\n \n // return arrA.length + arrB.length;\n\n //2 test cases passed\n\n// <----------------------------------------------------------------------->\n if(a === b) return a.length;\n let arrA = a.split('').sort();\n let arrB = b.split('').sort();\n\n if(a.length > b.length || a.length === b.length){\n for(let char of b){\n if(arrA.includes(char)){\n arrA.splice(arrA.indexOf(char), 1);\n arrB.splice(arrB.indexOf(char), 1);\n }\n }\n }\n\n if(b.length > a.length){\n for(let char of a){\n if(arrB.includes(char)){\n arrA.splice(arrA.indexOf(char), 1);\n arrB.splice(arrB.indexOf(char), 1);\n }\n }\n }\n\n return arrA.length + arrB.length;\n\n // a bit slow but passed all tests. forgot to check for equal array input lengths\n}", "function jwdistance(s1, s2) {\n if (typeof(s1) != \"string\" || typeof(s2) != \"string\") return 0;\n if (s1.length == 0 || s2.length == 0) return 0;\n s1 = s1.toLowerCase(), s2 = s2.toLowerCase();\n var matchWindow = (Math.floor(Math.max(s1.length, s2.length) / 2.0)) - 1;\n var matches1 = new Array(s1.length);\n var matches2 = new Array(s2.length);\n var m = 0; // number of matches\n var t = 0; // number of transpositions\n //debug helpers\n //console.log(\"s1: \" + s1 + \"; s2: \" + s2);\n //console.log(\" - matchWindow: \" + matchWindow);\n // find matches\n for (var i = 0; i < s1.length; i++) {\n var matched = false;\n // check for an exact match\n if (s1[i] == s2[i]) {\n matches1[i] = matches2[i] = matched = true;\n m++\n }\n // check the \"match window\"\n else {\n // this for loop is a little brutal\n for (k = (i <= matchWindow) ? 0 : i - matchWindow;\n (k <= i + matchWindow) && k < s2.length && !matched;\n k++) {\n if (s1[i] == s2[k]) {\n if (!matches1[i] && !matches2[k]) {\n m++;\n }\n matches1[i] = matches2[k] = matched = true;\n }\n }\n }\n }\n if (m == 0) return 0.0;\n // count transpositions\n var k = 0;\n for (var i = 0; i < s1.length; i++) {\n if (matches1[k]) {\n while (!matches2[k] && k < matches2.length)\n k++;\n if (s1[i] != s2[k] && k < matches2.length) {\n t++;\n }\n k++;\n }\n }\n //debug helpers:\n //console.log(\" - matches: \" + m);\n //console.log(\" - transpositions: \" + t);\n t = t / 2.0;\n return (m / s1.length + m / s2.length + (m - t) / m) / 3;\n}", "function Levenshtein (str1, str2) {\n var m = str1.length,\n n = str2.length,\n d = [],\n i, j;\n \n if (!m) return n;\n if (!n) return m;\n for (i = 0; i <= m; i++) d[i] = [i];\n for (j = 0; j <= n; j++) d[0][j] = j;\n for (j = 1; j <= n; j++) {\n for (i = 1; i <= m; i++) {\n if (str1[i-1] === str2[j-1]) d[i][j] = d[i - 1][j - 1];\n else d[i][j] = Math.min(d[i-1][j], d[i][j-1], d[i-1][j-1]) + 1;\n }\n }\n return d[m][n];\n }", "function commonCharacterCount(s1, s2) {\n\tvar count = 0;\n\tfor (var i = 0; i <s1.length; i++) {\n\t\tfor (var j =0 ; j<s2.length; j++) {\n\t\t\tif(s1[i] === s2[j]){\n\t\t\t\tcount++;\n\t\t\t\ts2 = s2.split('');\n\t\t\t\ts2.splice(j,1);\n\t\t\t\ts2= s2.join('')\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn count;\n}", "function checkAnagram(str1, str2){\n\n // Check if the length of the two array is the samey\n if(str1.length !== str2.length){\n return false;\n }\n\n// create two object frequencies\n let strFrequency1 = {};\n let strFrequency2 = {};\n\n // loop through each of the two string respectively and add their count to their objects\n for(let char of str1){\n strFrequency1[char] = ++strFrequency1[char] || 1;\n }\n for(let char of str2){\n strFrequency2[char] = ++strFrequency2[char] || 1;\n }\n console.log(strFrequency1);\n console.log(strFrequency2);\n // compare the two objects with occupiance of the frequencies\n for(let key in strFrequency1){\n if(strFrequency2[key] !== strFrequency1[key]){\n return false;\n }\n }\n // return either true or false\n return true;\n}", "function solve(a,b){\r\n let finalArray = [];\r\n let currentCount = 0;\r\n //go through b and compare each element in b to each element in a\r\n for(let i = 0; i < b.length; i++){\r\n currentCount = 0;\r\n for(let x = 0; x <= a.length; x++){\r\n if(b[i] === a[x]){\r\n currentCount++\r\n }\r\n if(x === a.length){\r\n finalArray.push(currentCount);\r\n currentCount = 0;\r\n }\r\n }\r\n }\r\n return finalArray;\r\n}", "function twoStrings(s1, s2) {\n if (!s1.length || !s2.length) {\n return 'NO';\n }\n\n const hashMap = {};\n for (let i = 0; i < s1.length; i++) {\n let char = s1[i];\n hashMap[char] = hashMap[char] || 0;\n hashMap[char]++;\n } //creating a hash map of the biggest string\n\n for (let i = 0; i < s2.length; i++) {\n let char = s2[i];\n if (hashMap[char]) {\n return 'YES';\n }\n }\n return 'NO';\n}", "function stringDifference(s1, s2) {\n s1 = s1.toLowerCase().trim();\n s2 = s2.toLowerCase().trim();\n\n var costs = [];\n for (var i = 0; i <= s1.length; i++) {\n var lastValue = i;\n for (var j = 0; j <= s2.length; j++) {\n if (i === 0)\n costs[j] = j;\n else {\n if (j > 0) {\n var newValue = costs[j - 1];\n if (s1.charAt(i - 1) !== s2.charAt(j - 1))\n newValue = Math.min(Math.min(newValue, lastValue),\n costs[j]) + 1;\n costs[j - 1] = lastValue;\n lastValue = newValue;\n }\n }\n }\n if (i > 0)\n costs[s2.length] = lastValue;\n }\n return costs[s2.length];\n}", "function solve(args) {\r\n\r\n var substr = args[0].toLowerCase(),\r\n str = args[1].toLowerCase(),\r\n regex = new RegExp(substr, 'g'),\r\n count = (str.match(regex) || []).length;\r\n\r\n console.log(count);\r\n}", "function fullStringDistance(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength) {\n return bLength;\n }\n if (!bLength) {\n return aLength;\n }\n\n // Initialize the table axes:\n //\n // 0 1 2 3 4 ... bLength\n // 1\n // 2\n //\n // ...\n //\n // aLength\n //\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [x];\n }\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = y;\n }\n\n // Populate the rest of the table with a dynamic programming algorithm.\n for (var _x2 = 1; _x2 <= aLength; ++_x2) {\n for (var _y2 = 1; _y2 <= bLength; ++_y2) {\n table[_x2][_y2] = a[_x2 - 1] === b[_y2 - 1] ? table[_x2 - 1][_y2 - 1] : 1 + Math.min(table[_x2 - 1][_y2], // Substitution,\n table[_x2][_y2 - 1], // insertion,\n table[_x2 - 1][_y2 - 1]); // and deletion.\n }\n }\n\n return table[aLength][bLength];\n}", "function validAnagram(first,second){\n if(first.length!== second.length){\n return false;\n }\n \n //Create an object \n const lookup = {};\n\n //Loop through first string\n for(let i =0;i<first.length;i++){\n let letter = first[i];\n //If letter exists increment otherwise set to 1\n lookup[letter]?lookup[letter]+=1:lookup[letter]=1;\n }\n console.log(lookup)\n\n //Loop through the second string \n for (let i = 0;i<second.length;i++){\n let letter =second[i];\n //If we can't find a letter or letter is zero , then its not an anagram\n if(!lookup[letter]){\n return false;\n }\n else{\n lookup[letter]-=1;\n }\n }\n\n return true;\n\n}", "function sameFrequency(num1,num2){\n const num1Str = num1.toString();\n const num2Str = num2.toString();\n\n let splitNum1Arr = num1Str.split(\"\");\n let splitNum2Arr = num2Str.split(\"\");\n\n if(splitNum1Arr.length !== splitNum2Arr.length){\n return false;\n }\n \n let counterOne = {};\n let counterTwo = {};\n\n for(let i = 0; i < splitNum1Arr.length; i++){\n let number = splitNum1Arr[i];\n counterOne[number] = (counterOne[number] || 0) + 1;\n }\n\n for(let i = 0; i < splitNum2Arr.length; i++){\n let number = splitNum2Arr[i];\n counterTwo[number] = (counterTwo[number] || 0) + 1;\n }\n\n for(let key in counterOne){\n if(counterOne[key] !== counterTwo[key]){\n return false\n }\n }\n return true\n}", "function HDistance(strArr) {\n let count = 0;\n for (let i = 0; i < strArr[0].length; i++) {\n if (strArr[0][i] !== strArr[1][i]) count++;\n }\n\n // code goes here\n return count;\n}", "function matchingStrings(strings, queries) {\n var sindex;\n var qindex;\n var count;\n var slen = strings.length;\n var qlen = queries.length;\n var a = [];\n var i = 0;\n\n for (qindex = 0; qindex < qlen; qindex++) {\n count = 0;\n for (sindex = 0; sindex < slen; sindex++) {\n if (queries[qindex].localeCompare(strings[sindex]) == 0) {\n\n count++;\n }\n }\n a[i] = count;\n i++;\n }\n return a;\n}", "function distance(str1, str2) {\n\tvar maxOffset = 5\n\n\tif (str1 == \"\")\n\t\treturn (str2 ==\"\")?0:str2.length\n\tif (str2 == \"\")\n\t\treturn str1.length\n\n\tvar c = 0\n\tvar offset1 = 0\n\tvar offset2 = 0\n\tvar lcs = 0\n\n\twhile ((c + offset1 < str1.length)\n\t\t&& (c + offset2 < str2.length)) {\n\t\tif (str1[c + offset1] == str2[c + offset2])\n\t\t\tlcs++\n\t\telse {\n\t\t\toffset1 = 0\n\t\t\toffset2 = 0\n\n\t\t\tfor (var i = 0; i < maxOffset; ++i) {\n\t\t\t\tif ((c + i < str1.length) && str1[c + i] == str2[c]) {\n\t\t\t\t\toffset1 = i\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((c + i < str2.length) && str1[c] == str2[c+i]) {\n\t\t\t\t\toffset2 = i\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t++c\n\t}\n\n\treturn (str1.length + str2.length)/2 - lcs\n}", "function compare(s1, s2) {\n let sum1 = 0;\n let sum2 = 0;\n\n if (!s1 || s1.search(/[^a-zA-Z]+/) !== -1) s1 = '';\n if (!s2 || s2.search(/[^a-zA-Z]+/) !== -1) s2 = '';\n\n s1.toUpperCase().split('').map((item) => sum1 += item.charCodeAt(0));\n s2.toUpperCase().split('').map((item) => sum2 += item.charCodeAt(0));\n\n return sum1 === sum2;\n }", "function sameFrequency(num1, num2) {\n // convert num1 and num2 into strings\n let str1 = num1.toString();\n let str2 = num2.toString();\n // if str1 and str2 lengths are not the same\n if (str1.length !== str2.length) {\n // return false\n return false;\n }\n // create obj to hold numbers\n let container = {};\n // iterate over the str1 array\n for (let num of str1) {\n // set obj at str1 current index to be 1 or +1\n container[num] = (container[num] || 0) + 1;\n }\n // iterate over str2\n for (let num of str2) {\n // if obj at str2 doesnt exist\n if (container[num] === undefined) {\n // return false\n return false;\n }\n // decrement the obj at str2\n container[num]--;\n }\n // return true\n return true;\n }", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n\n for (let i = 0; i < str2.length; i++) {\n let letter = str2[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n //we subtract one to make sure both str have same frequency of letter\n lookup[letter] -= 1;\n }\n }\n\n return true;\n}", "function mix(s1, s2) {\n \n if(arguments.length !== 2) {\n return '';\n }\n \n let counts = [new Map(), new Map()];\n \n // keep track of any letters used, this is handy to return result of just those > 1\n let lettersUsed = new Set();\n \n for (let i = 0; i < counts.length; i++) {\n\n // iterate from sentence i, finding frequency of letters\n for (let chr of arguments[i]) {\n\n // Only need 97 --> 122: i.e. lowercase letters a-z\n if ((chr.charCodeAt(0) >= 97) && (chr.charCodeAt(0) <= 122)) {\n\n counts[i].set(chr, 1 + counts[i].get(chr) || 1);\n \n // we only want to return any of 2 or more, so we keep a note of these\n if(counts[i].get(chr) === 2) {\n lettersUsed.add(chr);\n }\n }\n\n }\n \n }\n \n // console.log('letters used', lettersUsed);\n \n // initialise our result array to correct size\n let result = [];\n\n for (let letter of lettersUsed) {\n \n // - funnel answers into array of arrays, where index of\n let answer = '';\n const s1count = counts[0].get(letter) || 0;\n const s2count = counts[1].get(letter) || 0;\n \n // the outer array is the no. letters of that solution\n if (s1count === s2count) {\n answer = '=:' + letter.repeat(s1count);\n \n } else if (s1count > s2count) {\n answer = '1:' + letter.repeat(s1count);\n } else {\n answer = '2:' + letter.repeat(s2count);\n }\n // console.log('answer',answer);\n \n // initialise to array if necessary:\n result[answer.length] = result[answer.length] || [];\n result[answer.length].push(answer);\n \n \n }\n \n // this is the final result we will return:\n let final = [];\n \n // then we sort inners ascendingly, lexically.\n // (...and in final return outer array descendingly)\n for (let i = 0; i < result.length; i++) {\n \n // we do not want the undefined elements\n if(result[i] !== undefined) {\n final.push(result[i].sort().join('/'));\n }\n \n }\n \n // finally return and join:\n if (!final.length) {\n return '';\n } else {\n //\n return final.reverse().join('/');\n }\n \n}", "function howManyDifferent(a){\n\n // if the string length % 2 == 0\n if (a.length % 2 !== 0){\n\n // -1 representing that solution is not possible.\n return -1;\n }\n\n // create a new string of the first half of the given string\n let astring = a.substring(0, a.length / 2);\n\n // and a new string for the second half of the given string\n let bstring = a.substring((a.length / 2), a.length);\n\n // return the result of calling 2 helper functions\n // with our 2 new strings as helper arguements\n return stringChecker(astring, bstring, difFreqChecker);\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n // check if str1 has the same length as str2 & same characters\n if(str1.length !== str2.length){\n return false\n }\n // create an object call lookup\n let lookup = {}\n// construct the object first\n for (let i = 0; i < str1.length; i++){\n letter = str1[i]\n //if letter exits, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n for (let i = 0; i < str2.length; i++){\n let letter = second[i];\n // can't find letter of letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n return true;\n }\n}", "function workOnStrings(a,b){\n let cc=x=>x==x.toLowerCase()?x.toUpperCase():x.toLowerCase(), arra=a.split(''), arrb=b.split(''), r, res;\n res = arra.map(x=>{r=new RegExp(x,'gi'); return (b.match(r)||[]).length%2?cc(x):x}).join('');\n res += arrb.map(x=>{r=new RegExp(x,'gi'); return (a.match(r)||[]).length%2?cc(x):x}).join('');\n return res;\n}", "function same(str1, str2) {\n // If str1 and str2 have different length, return false.\n if (str1.length !== str2.length) {\n return false;\n }\n\n let frequencyCounter1 = {};\n let frequencyCounter2 = {};\n\n // Go through each letters in str.\n // If letter is in frequencyCounter, increment value by 1 and if not, set it to 1.\n for (let letter of str1) {\n if (frequencyCounter1[letter]) {\n frequencyCounter1[letter] += 1;\n } else {\n frequencyCounter1[letter] = 1;\n }\n }\n\n for (let letter of str2) {\n if (frequencyCounter2[letter]) {\n frequencyCounter2[letter] += 1;\n } else {\n frequencyCounter2[letter] = 1;\n }\n }\n\n console.log(frequencyCounter1);\n console.log(frequencyCounter2);\n\n // If each keys in frequencyCounter1 is not in frequencyCounter2, return false.\n for (let key in frequencyCounter1) {\n if (!(key in frequencyCounter2)) {\n return false;\n }\n // If values of each keys in counter1 and counter2 are different, return false.\n if (frequencyCounter1[key] !== frequencyCounter2[key]) {\n return false;\n }\n }\n return true;\n}", "function sameFrequency(num1, num2){\n let strNum1 = num1.toString();\n let strNum2 = num2.toString();\n if(strNum1.length !== strNum2.length) return false;\n \n let countNum1 = {};\n let countNum2 = {};\n \n for(let i = 0; i < strNum1.length; i++){\n countNum1[strNum1[i]] = (countNum1[strNum1[i]] || 0) + 1\n }\n \n for(let j = 0; j < strNum1.length; j++){\n countNum2[strNum2[j]] = (countNum2[strNum2[j]] || 0) + 1\n }\n \n for(let key in countNum1){\n if(countNum1[key] !== countNum2[key]) return false;\n }\n \n return true;\n\n}", "function isAnagram1(str1, str2) {\n // check if the length is the same, if not return false\n if (str1.length !== str2.length) { return false }\n \n // create empty object to store the frequency counter for both strings\n let freqCount1 = {};\n let freqCount2 = {};\n\n // loop both strings and store the frequency to the corresponding objects\n for (let char of str1) {\n freqCount1[char] = (freqCount1[char] || 0) + 1;\n }\n for (let char of str2) {\n freqCount2[char] = (freqCount2[char] || 0) + 1;\n }\n\n // console.log(freqCount1);\n // console.log(freqCount2);\n \n // loop the first object to check the key and value with the second object\n for (let key in freqCount1) {\n // check if the current key of the first object is not in the second object, if so return false\n if (!(key in freqCount2)) { return false }\n\n // check if the value of the current key of the first object is not same with the second one, if so return false\n if (freqCount1[key] !== freqCount2[key]) { return false }\n }\n \n // return true, means anagram\n return true;\n}", "function sameFrequency(num1, num2) {\n const num1String = num1.toString();\n const num2String = num2.toString();\n if (num1String.length !== num2String.length) return false;\n\n let countObj1 = {};\n let countObj2 = {};\n // iterate array or string with for...of\n for (let char of num1String) {\n countObj1[char] = (countObj1[char] || 0) + 1;\n }\n\n for (let char of num2String) {\n countObj2[char] = (countObj2[char] || 0) + 1;\n }\n // iterate object with for...in\n for (let key in countObj1) {\n if (!(key in countObj2)) {\n return false;\n }\n\n if (countObj1[key] !== countObj2[key]) {\n return false;\n }\n }\n return true;\n}", "function anagrams1(stringA, stringB) {\n let countA = {};\n let countB = {};\n\n const countLetters = (string, count) => {\n string.split(\"\").forEach((char, i) => {\n char = char.toLowerCase();\n if (!count[char]) {\n count[char] = 1;\n } else {\n count[char]++;\n }\n });\n return count;\n };\n const cleanUp = count => {\n for (key in count) {\n if (key === \" \" || key === \"!\") {\n delete count[key];\n }\n }\n return count;\n };\n countA = cleanUp(countLetters(stringA, countA));\n countB = cleanUp(countLetters(stringB, countB));\n const compareObjects = (count1, count2) => {\n const compared = {};\n\n for (letter in count1) {\n if (count1[letter] === count2[letter]) {\n compared[letter] = count1[letter];\n }\n }\n return Object.keys(compared).length === Object.keys(count2).length || false;\n };\n return compareObjects(countA, countB);\n}", "function matchingString(strings, queries) {\n var result = [];\n queries.map(function (query) {\n var noOfresults = 0;\n strings.map(function (string) {\n if (string === query)\n noOfresults++;\n });\n result.push(noOfresults);\n });\n return result;\n}", "function singleLetterCount(str1, str2) {\r\n let count = 0\r\n\r\n for (i = 0; i < str1.length; i++) {\r\n // console.log(str1[i].toUpperCase());\r\n if (str1[i].toUpperCase().indexOf(str2.toUpperCase()) != -1) {\r\n count++\r\n }\r\n // console.log(count)\r\n }\r\n console.log(count)\r\n\r\n}", "function mix(s1, s2) {\n\n console.log(s1, \"string2: \" + s2)\n\n var finalStr = \"\";\n // remove all unnecessary characters in the string..\n s1 = s1.replace(/[^a-z]/gi, '');\n s2 = s2.replace(/[^a-z]/gi, '');\n\n var letterOccurrenceInSentences = {};\n\n // moves all the occurrence of every letter into a object with two properties\n\n\n countLetterOccurrence(s1, letterOccurrenceInSentences, 'first');\n countLetterOccurrence(s2, letterOccurrenceInSentences, 'second');\n\n // now need to check each value length if greater than 1, if it isn't remove it from the object\n\n // i dont think we need to actually check if it is bigger than one...\n\n // when doing the final check i can just only count it if is bigger than one...\n\n // console.log(\"first string \" + s1, \"second string \" + s2)\n // for (var key in letterOccurrenceInSentences) {\n // if (letterOccurrenceInSentences.hasOwnProperty(key)) {\n // console.log(letterOccurrenceInSentences)\n // }\n // }\n\n // starting to insert the maxium of letters into a string..\n\n console.log(letterOccurrenceInSentences);\n\n for (var key in letterOccurrenceInSentences) {\n if (\n letterOccurrenceInSentences[key].first > letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].second == undefined) {\n if (trueString(letterOccurrenceInSentences[key].first)) {\n finalStr += \"1:\"\n for (var i = 0; i < letterOccurrenceInSentences[key].first; i++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first < letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].first == undefined) {\n if (trueString(letterOccurrenceInSentences[key].second)) {\n finalStr += \"2:\"\n for (var j = 0; j < letterOccurrenceInSentences[key].second; j++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first == letterOccurrenceInSentences[key].second) {\n if (letterOccurrenceInSentences[key].first !== 1 && letterOccurrenceInSentences[key].second !== 1) {\n finalStr += \"=:\"\n for (var k = 0; k < letterOccurrenceInSentences[key].first; k++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } \n }\n\n finalStr = finalStr.split(\"/\").sort(function (a, b) {\n if (b.length === a.length) {\n return (a > b ? 1 : -1);\n } else {\n return b.length - a.length;\n }\n }).join(\"/\");\n\n // remove the last slash...\n finalStr = finalStr.slice(0, -1);\n console.log(finalStr);\n\n return console.log(finalStr);\n\n }", "function similarLength() {\n return sampleStrings.reduce((acc, curr) => {\n return {\n ...acc,\n [`${curr.length}`]: acc[`${curr.length}`] ?\n acc[`${curr.length}`] + 1 : 1\n };\n }, {})\n}", "function StringScramble(str1,str2) { \n var objOne = {}; \n\n for(var i = 0; i < str1.length; i++){\n objOne[str1[i]] = objOne[str1[i]] ? objOne[str1[i]] + 1 : 1;\n }\n //place in object with number of occurences \n \n for(var j = 0; j < str2.length; j++){\n if(!objOne[str2[j]]){ \n //loop thru each letter of str2\n //if it doesn't exist, we know that \n //the word cannot be created therefore return false\n\n \treturn false\n }\n }\n \n return true;\n\n \n}", "function main() {\n var a = readLine();\n var b = readLine();\n\n function make_anagrams (first_str, second_str) {\n var first_arr = first_str.split('')\n var second_arr = second_str.split('')\n\n var all_hash = {};\n var first_hash = {};\n // store the characters of first string as the key in a hash object\n // with count of occurences as the value\n // also store the characters in a hash that will contain all possible chars from the first and second strings\n for (var i = 0; i < first_arr.length; i++) {\n if (first_hash[first_arr[i]]) {\n first_hash[first_arr[i]]++;\n all_hash[first_arr[i]]++;\n } else { // if the key doesn't exist, initiate count to 1 for key\n first_hash[first_arr[i]] = 1;\n all_hash[first_arr[i]] = 1;\n }\n }\n\n var second_hash = {};\n // store the characters of second string as the key in hash object \n // with count of occurences as the value\n for (var i = 0; i < second_arr.length; i++) {\n if (!(second_arr[i] in second_hash)) { // initiate count to 1 if key does not exist\n second_hash[second_arr[i]] = 1;\n\n // set the count for all_hash appropriately depending if key already exists from looking at first_hash\n all_hash[second_arr[i]] = (second_arr[i] in all_hash) ? all_hash[second_arr[i]]+1 : 1; \n } else {\n second_hash[second_arr[i]]++;\n all_hash[second_arr[i]]++;\n }\n\n \n }\n\n // go through all the characters\n var deletions = 0; // number of deletion operations to make strings anagrams\n for (var letter in all_hash) {\n if (letter in first_hash && letter in second_hash) { \n // character in both strings, subtract to get extra count\n deletions += Math.abs(first_hash[letter] - second_hash[letter]);\n } else if (letter in first_hash) {\n // character only in the first string\n deletions += first_hash[letter]\n } else if (letter in second_hash) {\n // character only in the second string\n deletions += second_hash[letter];\n }\n }\n\n console.log(\"deletions\", deletions);\n }\n\n make_anagrams(a, b);\n}", "function diffCount (input1, input2) {\n let count = 0;\n for (let i = 0; i < input1.length; i++) {\n if (input1[i] !== input2[i]) count++;\n if (count > 1) break;\n };\n //console.log(count);\n return count;\n}", "function makeAnagram(a, b) {\n let counter = {};\n let total = 0;\n Array.from(a).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] += 1;\n });\n Array.from(b).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] -= 1;\n });\n Object.keys(counter).forEach((k) => {\n if (counter[k] !== 0) total += Math.abs(counter[k]);\n });\n return total;\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n // console.log(lookup)\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n }\n console.log(lookup)\n return true;\n}", "function HamingDistance(strArr) {\n\t// strArr[0].length;\n\tlet count = 0;\n\tfor (let i = 0; i < strArr[0].length; i++) {\n\t\tif (strArr[0][i] != strArr[1][i]) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\n\treturn count;\n}", "function sameFreq(num1, num2) {\n const strNum1 = num1.toString()\n const strNum2 = num2.toString()\n if (strNum1.length !== strNum2.length) return false\n\n const countNum1 = {}\n const countNum2 = {}\n\n for (let i = 0; i < strNum1.length; i++) {\n const num = strNum1[i]\n countNum1[num] = (countNum1[num] || 0) + 1\n }\n for (let i = 0; i < strNum2.length; i++) {\n const num = strNum2[i]\n countNum2[num] = (countNum2[num] || 0) + 1\n }\n\n for (let key in countNum1) {\n if (countNum1[key] !== countNum2[key]) return false\n }\n\n return true\n}", "function validAnagram(first, second){\n\tif(first.length !== second.length){\n\t\treturn false;\n\t}\n\t\n\tconst lookup = {}; //obj as freq.counter\n\n\t//Break down the first string.\n\tfor(let i=0; i < first.length ; i++){\n\t\tlet letter = first[i];\n\t\t//if letter exists, increment, otherwise set to 1\n\t\tlookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n\t}\n\n\t//Break down the second string\n\t//then check to first string.\n\tfor(let i=0; i < second.length; i++){\n\t\tlet letter = second[i];\n\t\t//can't find letter or letter is zero then not anagram.\n\t\tif(!lookup[letter]){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tlookup[letter] -= 1;\n\t\t}\t\n\t}\n\treturn true;\n}", "function match(a, b) {\n score = 0;\n // console.log(a.length, b.length);\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 30; j++) {\n if (a[i][j] === b[i][j]) {\n score = score + 1;\n }\n }\n }\n return score;\n}", "function sameFrequency(num1, num2){\n let strNum1 = num1.toString();\n let strNum2 = num2.toString();\n if(strNum1.length !== strNum2.length) return false;\n \n let countNum1 = {};\n let countNum2 = {};\n \n for(let i = 0; i < strNum1.length; i++){\n countNum1[strNum1[i]] = (countNum1[strNum1[i]] || 0) + 1\n }\n \n for(let j = 0; j < strNum1.length; j++){\n countNum2[strNum2[j]] = (countNum2[strNum2[j]] || 0) + 1\n }\n \n for(let key in countNum1){\n if(countNum1[key] !== countNum2[key]) return false;\n }\n \n return true;\n}", "function solve(args) {\r\n\r\n var len = +args[0], \r\n num = +args[2],\r\n arr = args[1].split(' '),\r\n counter = 0;\r\n\r\n console.log(count(num));\r\n\r\n function count(n) {\r\n counter = 0;\r\n for (var i = 0; i < len; i++) {\r\n if (+arr[i] === num ) {\r\n counter++;\r\n }\r\n }\r\n return counter;\r\n }\r\n}", "function anagrams(string1, string2){\n let obj = {};\n\n string1.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] += 1;\n }\n });\n\n string2.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] -= 1;\n }\n });\n\n return Object.values(obj).every(char => char === 0);\n}", "function lcs(word1, word2) {\r\n\tvar max = 0;\r\n\tvar index = 0;\r\n\tvar lcsarr = new Array(word1.length+1);\r\n\tfor (var i = 0; i <= word1.length+1; ++i) {\r\n\t\tlcsarr[i] = new Array(word2.length+1);\r\n\t\tfor (var j = 0; j <= word2.length+1; ++j) {\r\n\t\tlcsarr[i][j] = 0;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i <= word1.length; ++i) {\r\n\t\tfor (var j = 0; j <= word2.length; ++j) {\r\n\t\t\tif (i == 0 || j == 0) {\r\n\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (word1[i-1] == word2[j-1]) {\r\n\t\t\t\t\tlcsarr[i][j] = lcsarr[i-1][j-1] + 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (max < lcsarr[i][j]) {\r\n\t\t\t\tmax = lcsarr[i][j];\r\n\t\t\t\tindex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar str = \"\";\r\n\tif (max == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\telse {\r\n\t\tfor (var i = index-max; i <= max; ++i) {\r\n\t\t\tstr += word2[i];\r\n\t}\r\n\treturn str;\r\n\t}\r\n}", "function fourthAnagram(str1, str2) {\n let letterSums = {};\n\n // If we do the exact same subractions for each letter in\n // str2 as we do additions for str1, letter_sums will all be 0.\n str1.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) + 1));\n str2.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) - 1));\n\n // It's a zero-sum game!\n return Object.values(letterSums).every((sum) => sum === 0);\n}", "function checkAnagramWithTimeComplexity(str1, str2) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1.length !== str2.length) return false\n let counting = {}\n for (let c of str1) {\n counting[c] = (counting[c] + 1) || 1;\n }\n for (let c of str2) {\n if (counting[c]) {\n --counting[c];\n }\n else {\n return false;\n }\n }\n return true;\n}", "static countSubString(input, strToCount) {\n if (!input || !strToCount) {\n return 0;\n }\n return (input.match(new RegExp(strToCount, 'g')) || []).length;\n }", "function checkCount(s){\n let count =1;\n for (let x=1; x<s.length; x++){\n if (s[0]==s[x]){\n count++;\n }\n }\n return count;\n\n}", "function thirdAnagram(str1, str2) {\n let letterCounts1 = {},\n letterCounts2 = {};\n\n str1\n .split(\"\")\n .forEach((e) => (letterCounts1[e] = (letterCounts1[e] || 0) + 1));\n str2\n .split(\"\")\n .forEach((e) => (letterCounts2[e] = (letterCounts2[e] || 0) + 1));\n\n const haveSameCount = function (obj1, obj2) {\n const obj1Length = Object.keys(obj1).length;\n const obj2Length = Object.keys(obj2).length;\n\n if (obj1Length === obj2Length) {\n return Object.keys(obj1).every(\n (key) => obj2.hasOwnProperty(key) && obj2[key] === obj1[key]\n );\n }\n return false;\n };\n return haveSameCount(letterCounts1, letterCounts2);\n}", "function validAnagram(str1, str2) {\n if(str1.length !== str2.length) {\n return false;\n }\n \n let lookup = {};\n \n for(i = 0; i < str1.length; i++){\n let letter = str1[i]\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n \n for(let j = 0; j < str2.length; j++) {\n let letter = str2[j]\n if(!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1\n }\n }\n return true;;\n}", "function scramble(str1, str2) {\n let obj = {};\n\n str1.split('').map(function(v) {\n if (v in obj) {\n obj[v]++;\n } else {\n obj[v] = 1;\n }\n });\n\n for (let i = 0; i < str2.length; i++) {\n if (obj[str2[i]] > 0) {\n obj[str2[i]]--;\n } else {\n return false;\n }\n }\n\n return true;\n}", "function ___R$project$rome$$internal$string$utils$orderBySimilarity_ts$compareTwoStrings(\n\t\taStr,\n\t\tbStr,\n\t) {\n\t\tconst a = aStr.replace(/\\s+/g, \"\");\n\t\tconst b = bStr.replace(/\\s+/g, \"\");\n\n\t\t// If both are empty strings\n\t\tif (!(a.length || b.length)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// If only one is empty string\n\t\tif (!(a.length && b.length)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Identical\n\t\tif (a === b) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Both are 1-letter strings\n\t\tif (a.length === 1 && b.length === 1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// If either is a 1-letter string\n\t\tif (a.length < 2 || b.length < 2) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet firstBigrams = new Map();\n\t\tfor (let i = 0; i < a.length - 1; i++) {\n\t\t\tconst bigram = a.substring(i, i + 2);\n\n\t\t\tconst count = firstBigrams.has(bigram)\n\t\t\t\t? ___R$$priv$project$rome$$internal$string$utils$orderBySimilarity_ts$getMap(\n\t\t\t\t\t\tfirstBigrams,\n\t\t\t\t\t\tbigram,\n\t\t\t\t\t) + 1\n\t\t\t\t: 1;\n\t\t\tif (count === undefined) {\n\t\t\t\tthrow new Error(\"Already used has() above\");\n\t\t\t}\n\n\t\t\tfirstBigrams.set(bigram, count);\n\t\t}\n\n\t\tlet intersectionSize = 0;\n\t\tfor (let i = 0; i < b.length - 1; i++) {\n\t\t\tconst bigram = b.substring(i, i + 2);\n\n\t\t\tconst count = ___R$$priv$project$rome$$internal$string$utils$orderBySimilarity_ts$getMap(\n\t\t\t\tfirstBigrams,\n\t\t\t\tbigram,\n\t\t\t\t0,\n\t\t\t);\n\t\t\tif (count === undefined) {\n\t\t\t\tthrow new Error(\"Already used has() above\");\n\t\t\t}\n\n\t\t\tif (count > 0) {\n\t\t\t\tfirstBigrams.set(bigram, count - 1);\n\t\t\t\tintersectionSize++;\n\t\t\t}\n\t\t}\n\n\t\treturn 2 * intersectionSize / (a.length + b.length - 2);\n\t}", "function solve(s) {\n let subStrings = [];\n for (let index = 0; index < s.length; index++) {\n for (let index2 = index; index2 < s.length; index2++) {\n let subString = s.slice(index, index2 + 1);\n subStrings.push(subString);\n }\n }\n return subStrings.reduce((count, subStr) => {\n if (Number(subStr) % 2 === 1) {\n count += 1;\n }\n return count;\n }, 0);\n}", "function anagram(str1,str2){\n\n //2. Check to see if input1 & input2 are strings, if not return error/false\n if (typeof(str1, str2) !== 'string'){\n return false;\n }\n\n //3. Check to see if input1 & input2 are the same length, if not return error/false\n if (str1.length !== str2.length){\n return false;\n }\n\n //4. Create objects for both inputs\n let stringBox1 = {};\n let stringBox2 = {};\n\n //5. For each value in string1, if does not exist, create key and set value to 1 in Object1.\n //6. If value exists in Object1, increment value by 1.\n for(let val of str1){\n stringBox1[val] = stringBox1[val] + 1 || 1;\n\n }\n console.log(stringBox1);\n //7. For each value in string2, if does not exist, create key and set value to 1 in Object2.\n //8. If value exists in Object2, increment value by 1.\n for(let val of str2){\n stringBox2[val] = stringBox2[val] + 1 || 1;\n\n }\n console.log(stringBox2)\n\n //9. For each key in Object1, compare to each key in Object2.\n for(let key in stringBox1){\n // If does not exist, return false.\n if(!(key in stringBox2)){\n console.log('step 9')\n return false;\n }\n //10. Compare value of that key to each value of every key in Object2.\n if(stringBox1[key] !== stringBox2[key]){\n console.log('step 10')\n return false;\n }\n //11. Return true.\n console.log('Step 11')\n return true;\n\n }\n\n\n}", "function sherlockAndAnagrams(s) {\n \n var map = new Map();\n var totalCount = 0;\n\n for(var i = 0 ; i < s.length; i++) {\n for(var j=i+1 ; j <= s.length; j++) {\n var SubString = s.substring(i,j);\n\n var chars = [...SubString];\n chars.sort();\n \n SubString = String(chars);\n\n if(map.has(SubString)) {\n var value = map.get(SubString);\n totalCount = totalCount + value;\n\n map.set(SubString, value+1);\n } \n else {\n map.set(SubString, 1);\n }\n }\n }\n return totalCount;\n\n\n}", "function findLCSUsingDP(firstInput, secondInput, lookup) {\n let fLength = firstInput.length + 1;\n let sLength = secondInput.length + 1;\n\n lookup = new Array(fLength +1);\n\n for (let i = 0; i <= fLength; i++) {\n lookup[i] = new Array(sLength+1);\n for (let j = 0; j <= sLength; j++) {\n lookup[i][j] = 0;\n }\n }\n\n for (let i = 1; i <= fLength; i++) {\n for (let j = 1; j < sLength; j++) {\n if (firstInput[i - 1] == secondInput[j - 1]) {\n lookup[i][j] = lookup[i - 1][j - 1] + 1;\n } else {\n lookup[i][j] = Math.max(lookup[i - 1][j], lookup[i][j - 1]);\n }\n }\n }\n return lookup;\n}", "function checkPerms(s1, s2) { //case-sensitive; assume whitespace is significant; only ASCII inputs\n\tvar l1 = s1.length;\n\tvar l2 = s2.length;\n\tif (l1 !== l2) return false;\n\n\tvar chars = {};\n\tfor (var i = 0, l = l1; i < l; i++) {\n\t\tif (chars[s1[i]]) chars[s1[i]] += 1;\n\t\telse chars[s1[i]] = 1;\n\t}\n\tfor (var i = 0, l = l2; i < l; i++) {\n\t\tif (chars[s2[i]]) chars[s2[i]] -= 1;\n\t\telse return false;\n\n\t\tif (chars[s2[i]] < 0) return false;\n\t}\n\treturn true;\n}", "function runLength(string) {\n var output = [];\n var counter = 1;\n if (string === '' || string === null) {\n return string;\n }\n for (var i = 0; i < string.length; i++){\n if(string[i] === string[i+1]){\n counter++;\n }\n output.push(counter + string[i]);\n }\n counter = 1;\n }", "function validAnaram2(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n //Initalize object\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n //if letter exists, incremnt, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n //Cant find letter or letter is zero then its not an anagram\n //Because zero is falsey\n if (!lookup[letter]) {\n return false;\n } else {\n //If letter exists, subtract one, one is truthy\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function hammingDistance(textA, textB) {\n if (textA.length !== textB.length) {\n throw new Error('String lengths are not equal');\n }\n\n let distance = 0;\n\n for (let i = 0; i < textA.length; i++) {\n if (textA[i].toLowerCase() !== textB[i].toLowerCase()) {\n distance++;\n }\n }\n\n return distance;\n}", "function checkGenerator(string,arr){\n let count=0;\n for (let i=0; i<string.length;i++){\n for (let j=0;j<arr.length;j++){\n if (string[i]===arr[j]){\n count++;\n }\n }\n }\n return count;\n}", "function getDeleteCountUsingIndexOf() {\n var aChars = a.split(\"\");\n var bChars = b.split(\"\");\n \n if (aChars.length > bChars.length) {\n var outer = aChars;\n var inner = bChars;\n } else {\n var outer = bChars;\n var inner = aChars;\n }\n \n var outerIndex = outer.length-1;\n while (inner.length > 0 && outer.length > 0 && outerIndex >= 0) {\n let innerIndex = inner.indexOf(outer[outerIndex]);\n if (innerIndex !== -1) {\n outer.splice(outerIndex, 1);\n inner.splice(innerIndex, 1);\n }\n --outerIndex;\n }\n \n return outer.length + inner.length;\n }" ]
[ "0.7708254", "0.74665195", "0.7178124", "0.7174277", "0.71487314", "0.70757943", "0.7068777", "0.70508534", "0.70226973", "0.7019197", "0.6988411", "0.697685", "0.6965461", "0.69650936", "0.69394314", "0.68370605", "0.68209517", "0.682034", "0.6814287", "0.68081325", "0.6777165", "0.677383", "0.6748657", "0.6736223", "0.6736196", "0.6735831", "0.6733828", "0.6714822", "0.67112213", "0.6679627", "0.66683024", "0.6656826", "0.6648815", "0.6611403", "0.6608906", "0.65983236", "0.65941244", "0.6590763", "0.6584234", "0.6577778", "0.65671927", "0.65667605", "0.65634984", "0.655469", "0.6542068", "0.652594", "0.6525235", "0.650094", "0.65004605", "0.64995664", "0.6495407", "0.6476641", "0.64747006", "0.6474601", "0.64639187", "0.6456052", "0.64478385", "0.6441057", "0.64409375", "0.6431158", "0.64264405", "0.6426381", "0.64073473", "0.63998216", "0.63778466", "0.63721824", "0.6365243", "0.63648325", "0.6359972", "0.63586944", "0.635177", "0.63324326", "0.63266695", "0.6325303", "0.6318482", "0.6315168", "0.6313659", "0.6312696", "0.6300183", "0.6293485", "0.6279127", "0.6268653", "0.6266855", "0.626558", "0.62650514", "0.6264274", "0.62537444", "0.6243331", "0.624111", "0.6232914", "0.62319267", "0.62131804", "0.62114894", "0.6210746", "0.62107295", "0.61999726", "0.61970335", "0.619299", "0.6184927", "0.6178747", "0.6177716" ]
0.0
-1
enable Calendar cells to be clickable
function hoverableCells() { document.querySelectorAll('.hover').forEach(item => { item.addEventListener('click', () => { document.getElementById("timeButtons").innerHTML=""; // kill previous buttons document.getElementById("displayTableBody").innerHTML=""; // kill table rows //remove any bg-primary cells document.querySelectorAll('.hover').forEach(hoverable => { hoverable.classList.remove('bg-primary'); }); //set clicked cell to bg-primary item.classList.add('bg-primary'); //run function to show reports displayReports(item.innerHTML); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleEventTableClick() {\n\t \tvar center = $(this).attr('data-datetime');\n\t \tvar visible = app.chart.extentRange();\n\t \tvar start = app.chart.constrainToDomainMin(center-visible/2);\n\t\t\tvar stop = app.chart.constrainToDomainMax(start+visible);\n\t\t\tapp.chart.scrollTo(start,stop);\n\t\t\treturn false;\n\t }", "function setGridToClickable(grid){\n grid.style.pointerEvents=\"visiblePainted\";\n}", "onClick(event) {\n let args = event.detail;\n this._allDay = $(args.target.currentTarget).hasClass('e-alldaycells');\n }", "_setVisibleCalendar(val) {\n\n }", "function displayEvent() {\n $('tbody.event-calendar td').on('click', function(e) {\n \n $('.day-event').slideUp('fast');\n var monthEvent = $(this).attr('date-month');\n var yearEvent = $(this).attr('date-year');\n var dayEvent = $(this).text();\n if($('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').css('display') == 'none')\n $('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').slideDown('fast');\n });\n }", "function addEvents(ccs) {\r\n var dragging = false,\r\n start_el, selected, docs;\r\n var root_el = ccs.templated.root.parentNode;\r\n root_el.addEventListener('click', function(e) {\r\n src_el = e.target || e.srcElement;\r\n /*\r\n handle the column calendar elements\r\n such as the days, years, and months\r\n */\r\n if (hasClass(src_el, \"ccs_col\")) {\r\n if (hasClass(src_el, \"ccs_col_months\")) {\r\n var month = moment(src_el.id).startOf('month');\r\n ccs.next(month);\r\n } else if (hasClass(src_el, \"ccs_col_years\")) {\r\n var year = moment(src_el.id).startOf('year');\r\n ccs.next(year);\r\n }\r\n }\r\n /*\r\n handle some of the controls\r\n */\r\n else if (hasClass(src_el, 'ccs_control')) {\r\n if (hasClass(src_el, 'ccs_back')) {\r\n ccs.prev();\r\n } else if (hasClass(src_el, 'ccs_up')) {\r\n ccs.scroll(-1);\r\n } else if (hasClass(src_el, 'ccs_down')) {\r\n ccs.scroll(1);\r\n }\r\n } else if (hasClass(src_el, 'ccs_today')) {\r\n //console.log('Wow');\r\n ccs.goto(moment(), 'days', true);\r\n }\r\n e.stopPropagation();\r\n });\r\n //drag over dates and such\r\n root_el.addEventListener(\"mousedown\",function(e){\r\n selected = [];\r\n src_el = e.target || e.srcElement;\r\n if(hasClass(src_el, \"ccs_col_days\")){\r\n docs = root_el.querySelectorAll(\".ccs_col_days\");\r\n src_el.classList.toggle(\"ccs_col_selected\");\r\n start_el = src_el;\r\n dragging = true;\r\n }\r\n });\r\n root_el.addEventListener(\"mouseup\",function(e){\r\n if(!dragging) return false;\r\n if (hasClass(src_el, \"ccs_col_days\")) {\r\n var day = moment(e.srcElement.id);\r\n if (hasClass(src_el, 'ccs_col_selected')) {\r\n runEvents('select', {\r\n //selection: day\r\n });\r\n ccs.addSelection(day);\r\n } else {\r\n runEvents('deselect', {\r\n //selection: day\r\n });\r\n ccs.removeSelection(day);\r\n }\r\n ccs.next(day);\r\n dragging = false;\r\n }\r\n });\r\n\r\n root_el.addEventListener(\"mousemove\",function(e){\r\n src_el = e.target || e.srcElement;\r\n if(src_el == start_el || !dragging) return false;\r\n if(hasClass(src_el, \"ccs_col_days\")){\r\n //get all td between this one and start_el\r\n var populating = false, \r\n doc;\r\n for(var i=0;i<docs.length;i++){\r\n doc = docs[i];\r\n if(doc == src_el || doc == start_el){\r\n populating = !populating;\r\n }\r\n if(populating){\r\n if(start_el.classList.contains(\"ccs_col_selected\")){\r\n doc.classList.add(\"ccs_col_selected\");\r\n }else{\r\n doc.classList.remove(\"ccs_col_selected\");\r\n }//doc.classList.toggle(\"ccs_col_selected\");\r\n }else{\r\n doc.classList.remove(\"ccs_col_selected\");\r\n }\r\n }\r\n\r\n }\r\n });\r\n }", "function show_day(day){\n if(day.getAttribute(\"aria-disabled\") == \"false\"){\n document.getElementById(\"rightbar_checkbox\").checked = true;\n let s = `${day.children[0].innerText} ${document.getElementById(\"calendar_month_display\").innerText}`;\n document.getElementById(\"rightbar_date\").innerText = s;\n\n let day_appointments = document.getElementById(\"rightbar_day_appointments\");\n day_appointments.innerHTML = \"\";\n\n let appointments = day.children[1].children;\n\n for(let i=0;i<appointments.length;i++){\n appointment = appointments[i].cloneNode(true);\n\n //appointment.onclick = show_popup;\n \n appointment.style.gridRowStart = parseInt(appointment.getAttribute(\"aria-start\")) - 7;\n appointment.style.gridRowEnd = parseInt(appointment.getAttribute(\"aria-end\")) - 7;\n\n day_appointments.appendChild(appointment);\n }\n }\n}", "function placeCalendar() {\n\n\tvar calendar = new JsDatePick({\n\t\t\tuseMode:1,\n\t\t\tisStripped:true,\n\t\t\ttarget: \"calendar_div\",\n\t\t\tcellColorScheme:\"beige\"\n\t\t});\n\t\t\n\tcalendar.setOnSelectedDelegate(function(){\n\t\t\tvar obj = calendar.getSelectedDay(); \n\t\t\tcurrentDate(new Date(obj.year, obj.month - 1, obj.day)); \n\t\t\tif ($(\"#filter_entries\").get(0).checked) {\n\t\t\t\tshowReservationsList(document.getElementById(\"reservations_list_div\"), currentDate());\n\t\t\t}\n\t\t});\n}", "function fillCalendar(month,year){\n var start = new Date(year,month,1);\n //update global values\n gMonth = start.getMonth();\n gYear = start.getFullYear();\n var firstday = start.getDay();\n //Update the month text\n $('#month h1').html(months[ start.getMonth() ]);\n $('#month h1').append(' '+ start.getFullYear() );\n //clear calendar's values\n //$('.calendar td div, .calendar td span').empty();\n //$('.calendar').remove('.event');\n //fill cells with dates and events\n var date = 1;\n for (var i = 0; i< 42 ; i++){\n $('.calendar td:eq('+i+') span').text(\"\");\n var day = new Date(year,month,date);\n var d = day.getDate();\n var m = day.getMonth();\n var y = day.getFullYear();\n var dayIndex = firstday+date-1;\n if ( i < firstday || m >month) {\n $('.calendar td:eq('+i+') div').text(\"\");\n }\n else {\n $('.calendar td:eq('+dayIndex+') div').text(date);\n //check for events\n events.forEach(function(ele) {\n if ( d == ele.day && m == ele.month && y == ele.year){\n //print text\n $('.calendar td:eq('+dayIndex+')').append('<span class=\"event\">'+ele.text+'</span>');\n //create handler for text\n $('.calendar td:eq('+dayIndex+') span:last()').click(function(){\n $(this).hide();\n var tmpText = $(this).text();\n $(this).after('<input type=\"text\" value=\"'+tmpText+'\" day=\"'+ele.day+'\" month=\"'+ele.month+'\" year=\"'+ele.year+'\" prevtext=\"'+ele.text+'\">');\n $(\"input\").focus();\n });\n }\n });\n date++;\n }\n }\n}", "function openCalendar(e) {\n vm.calendarOpen = true;\n }", "function clickToday() {\n if (!$(\"tr.fc-week\").is(':visible')) {\n $('.fc-today-button').click();\n }\n}", "function dayClick(date, jsEvent, view)\n {\n\n alert('Clicked on: ' + date.format());\n\n // alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);\n\n // alert('Current view: ' + view.name);\n\n // change the day's background color just for fun\n // $(this).css('background-color', 'red');\n }", "function highlight() {\n var table = document.getElementById('appointment-list');\n // go through all appointments\n for (var i=0;i < table.rows.length;i++){\n table.rows[i].onclick = toggleHighlight;\n }\n}", "_handleCalendarCellHover(event, cell) {\n const that = this;\n\n if (that._animationStarted) {\n return;\n }\n\n if (that.displayMode === 'month') {\n if (event.type === 'mouseover' && that.selectionMode === 'many' && that.selectedDates.length > 0) {\n const months = that.$.monthsContainer.children;\n\n for (let m = 0; m < months.length; m++) {\n that._getMonthCells(months[m]).map(cell => {\n that._setCellState(cell, 'hover', false);\n });\n }\n\n let firstSelectedDate = new Date(that.selectedDates[0]),\n targetDate = new Date(cell.value),\n targetCell = cell;\n const nextCoeff = firstSelectedDate.getTime() > targetDate.getTime() ? -1 : 1,\n hoverCell = function () {\n targetCell = that._getCellByDate(firstSelectedDate, that.$.monthsContainer);\n\n if (targetCell && !targetCell.selected && !targetCell.restricted) {\n that._setCellState(targetCell, 'hover', true);\n }\n };\n\n if (firstSelectedDate.getTime() !== targetDate.getTime()) {\n firstSelectedDate.setDate(firstSelectedDate.getDate() + nextCoeff);\n while (firstSelectedDate.getTime() !== targetDate.getTime()) {\n hoverCell();\n firstSelectedDate.setDate(firstSelectedDate.getDate() + nextCoeff);\n }\n\n hoverCell();\n }\n }\n else {\n that._setCellState(cell, 'hover', false);\n }\n }\n\n if (event.type === 'mouseover' && !cell.otherMonth) {\n that._setCellState(cell, 'hover', true);\n }\n else {\n that._setCellState(cell, 'hover', false);\n }\n }", "renderCells() {\n const { currentMonth, today, booked } = this.state;\n const monthStart = dateFns.startOfMonth(currentMonth);\n const monthEnd = dateFns.endOfMonth(monthStart);\n const startDate = dateFns.startOfWeek(monthStart);\n const endDate = dateFns.endOfWeek(monthEnd);\n\n const dateFormat = \"D\";\n const rows = [];\n\n let days = [];\n let day = startDate;\n let formattedDate = \"\";\n\n // loop from startDate to endDate to show all the dates\n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n formattedDate = dateFns.format(day, dateFormat);\n const cloneDay = day;\n // determine if day is disabled, today or has event and assign the style\n days.push(\n <div\n className={`col cell ${\n !dateFns.isSameMonth(day, monthStart)\n ? \"disabled\"\n : dateFns.isSameDay(day, today) ? \"selected\" : \"\"\n }${booked.map((book) => dateFns.isSameDay(day, book) ? \"booked\" : \"\").join('')}\n ` }\n \n key={day}\n onClick={() => this.onDateClick(dateFns.parse(cloneDay))}\n >\n <span className=\"number\">{formattedDate}</span>\n <span className=\"bg\">{formattedDate}</span>\n \n </div>\n );\n day = dateFns.addDays(day, 1);\n }\n rows.push(\n <div className=\"row\" key={day}>\n {days}\n </div>\n );\n days = [];\n }\n return <div className=\"body\">{rows}</div>;\n }", "function addCellEvents() {\n cells.forEach(function (cell) {\n cell.addEventListener(\"click\", cellEventListener);\n });\n}", "function toggleGridClickable() {\n grid.style.pointerEvents = \"auto\";\n}", "function DateClicking(component){var _this=_super.call(this,component)||this;_this.dragListener=_this.buildDragListener();return _this;}", "function za(){function b(b){var c=j(\"unselectCancel\");c&&a(b.target).parents(c).length||d(b)}function c(a,b){d(),a=i.moment(a),b=b?i.moment(b):l(a),m(a,b),e(a,b)}\n// TODO: better date normalization. see notes in automated test\nfunction d(a){o&&(o=!1,n(),k(\"unselect\",null,a))}function e(a,b,c){o=!0,k(\"select\",null,a,b,c)}function f(b){// not really a generic manager method, oh well\nvar c=h.cellToDate,f=h.getIsCellAllDay,g=h.getHoverListener(),i=h.reportDayClick;// this is hacky and sort of weird\nif(1==b.which&&j(\"selectable\")){// which==1 means left mouse button\nd(b);var k;g.start(function(a,b){// TODO: maybe put cellToDate/getIsCellAllDay info in cell\nn(),a&&f(a)?(k=[c(b),c(a)].sort(C),m(k[0],k[1].clone().add(1,\"days\"))):k=null},b),a(document).one(\"mouseup\",function(a){g.stop(),k&&(+k[0]==+k[1]&&i(k[0],a),e(k[0],k[1].clone().add(1,\"days\"),// make exclusive\na))})}}function g(){a(document).off(\"mousedown\",b)}var h=this;\n// exports\nh.select=c,h.unselect=d,h.reportSelection=e,h.daySelectionMousedown=f,h.selectionManagerDestroy=g;\n// imports\nvar i=h.calendar,j=h.opt,k=h.trigger,l=h.defaultSelectionEnd,m=h.renderSelection,n=h.clearSelection,o=!1;\n// unselectAuto\nj(\"selectable\")&&j(\"unselectAuto\")&&a(document).on(\"mousedown\",b)}", "function ac_showCalendarPanel() {\n\tac_switchTool(\"cal\");\n}", "function addClickEventToCells() {\n var cells = document.getElementsByClassName('cell');\n for (var i = 0; i < cells.length; i++) {\n cells[i].addEventListener(\"click\", function(event) {\n var chosenCell = event.target;\n chosenCell.style.backgroundColor = chosenColor;\n });\n }\n}", "function create_mark_event() { \n\t\tvar ids_arr = [];\n\t\t\n\t\tfor (var i=1;i<day_cells_counter;i++) {\n\t\t\tvar local_i=i;\n\t\t\tids_arr[i-1] = \"day\"+i; // creating cell ids array\n\t }\t\t\n\t\tfor (var k=0;k<ids_arr.length;k++) {\n\t\t\tif (ids_arr[k]!=\"day\"+today_day) {\n\t\t\t\t//====Creating onclick event for each cell====//\n\t\t\t\tdocument.getElementById(ids_arr[k]).onclick = function(arg) {\n\t\t\t\t\treturn function() {\t\n\t\t\t\t\t\tget_marked_day =document.getElementsByClassName(\"active_day\");\n\t\t\t\t\t\tfor (var j=0;j<get_marked_day.length;j++) {\n\t\t\t\t\t\t\t//====Cleaning up other marked cells====//\n\t\t\t\t\t\t\tget_marked_day[j].className=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//====Marking an active cell====//\n\t\t\t\t\t\tdocument.getElementById(ids_arr[arg]).className = \"active_day\";\n\t\t\t\t\t}\n\t\t\t\t}(k);\n\t\t\t};\t\n\t\t};\n }", "function paintIfClicking(event, day, time) {\n\t\tif (painting) {\n\t\t\tbabysitterScheduleTable.paint(day, time, currentColor);\n\t\t}\n\t}", "_mouseEventsHandler(event) {\n const that = this;\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (event.type === 'mouseenter') {\n that.$.setAttributeValue('hover', true);\n return;\n }\n else if (event.type === 'mouseleave') {\n that.$.setAttributeValue('hover', false);\n\n if (that.tooltip) {\n that.$.tooltip.close();\n }\n\n return;\n }\n\n const target = that.enableShadowDOM ? event.composedPath()[0] : event.target;\n\n if (!target.closest('.jqx-calendar-week')) {\n if (that.tooltip) {\n that.$.tooltip.close();\n }\n\n return;\n }\n\n let cell = target, isItemChild;\n\n while (cell && !(cell.value instanceof Date)) {\n cell = cell.parentElement;\n isItemChild = true;\n }\n\n if (!cell) {\n return;\n }\n\n if (!JQX.Utilities.Core.isMobile) {\n that._handleCalendarCellHover(event, cell);\n }\n\n if (that.tooltip) {\n if (cell.hasAttribute('important')) {\n if (event.type === 'mouseover') {\n that.$.tooltip.open();\n that.tooltipTemplate ? that.$.tooltip.value = cell.value + '' :\n that.$.tooltip.innerHTML = that.$.tooltip.innerHTML.trim().length === 0 ? 'Important day!' : that.$.tooltip.innerHTML;\n that.$.tooltip.selector = cell;\n\n if (that.$.tooltip.selector !== cell) {\n that.$.tooltip.close();\n }\n\n return;\n }\n }\n\n if (isItemChild || that.$.tooltip.selector === cell) {\n return;\n }\n\n that.$.tooltip.close();\n }\n }", "_calendarButtonClickHandler(event) {\n const that = this;\n\n that._highlightedTimePart = undefined;\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (that.hasRippleAnimation) {\n JQX.Utilities.Animation.Ripple.animate(that.$.calendarButton, event.pageX, event.pageY);\n }\n\n if (that.opened) {\n that._close();\n }\n else {\n that._open();\n }\n }", "function addClickEventToCells() {\n var box = document.getElementsByClassName('cell');\n for (x = 0; x < box.length; x++) {\n box[x].addEventListener(\"click\", function(event) {\n var selectedBox = event.target;\n selectedBox.style.backgroundColor = selectedColor;\n });\n }\n}", "function clickable(){\n var table = document.getElementById(\"table\"); // select the table\n var columns = table.getElementsByTagName('td'); // select al the `td` children of `table`\n for (i = 0; i < columns.length; i++) { // for each column\n if(columns[i].className == \"W\"){ // for each row, if the class is W (white)\n columns[i].addEventListener('click', mark); // set the event `addEventListener`\n // if the are others class inside the cell\n // (if the cell is already filled)\n // the click is denied\n }\n }\n}", "function yahoo_showCalendar(cal, dateLink) {\n \n var pos = YAHOO.util.Dom.getXY(dateLink);\n cal.outerContainer.style.display='block';\n YAHOO.util.Dom.addClass(cal.outerContainer, \"annotation-front\");\n YAHOO.util.Dom.setXY(cal.outerContainer, [pos[0],pos[1]+dateLink.offsetHeight+1]);\n RSF.getDOMModifyFirer().fireEvent();\n }", "function drawDayEvent() {\r\n if (eventSource != null) {\r\n $.each(eventSource, function (i, result) {\r\n $(\"#evxDay\" + formatJsonSimple(result.StartDate)).append('<tr><td width=\"100%\" valign=\"top\"><img id=\"imgApproved' + result.Id + '\" style=\"display:none\" border=\"0\" align=\"absmiddle\" title=\"Đã chấp nhận\" src=\"' + urlRoot + 'images/img_Calendar/icon_approved.gif\"><img id=\"imgRejected' + result.Id + '\" style=\"display:none\" border=\"0\" align=\"absmiddle\" title=\"Đã từ chối\" src=\"' + urlRoot + 'images/img_Calendar/icon_rejected.gif\"><a id=\"lnkViewId' + result.Id + '\" href=\"javascript:;\" onclick=\"viewEventDetail(' + result.Id + ')\">' + formatDateTime(result.StartDate) + ' ' + result.Title + '</a></td></tr>');\r\n /* cai dat hien thi cac icon trang thai */\r\n if (result.Status == 2) {\r\n $(\"#imgApproved\" + result.Id).attr(\"style\", \"\");\r\n }\r\n else if (result.Status == 3) {\r\n $(\"#imgRejected\" + result.Id).attr(\"style\", \"\");\r\n }\r\n else if (result.Status == 4) {\r\n $(\"#lnkViewId\" + result.Id).html('<strike>' + $(\"#lnkViewId\" + result.Id).text() + '</strike>');\r\n $(\"#lnkViewId\" + result.Id).attr(\"style\", \"color: red\");\r\n $(\"#lnkViewId\" + result.Id).attr(\"title\", \"Đã hủy\");\r\n $(\"#lnkViewId\" + result.Id).attr(\"alt\", \"Đã hủy\");\r\n }\r\n });\r\n }\r\n}", "function activateCalendar() {\n vm.today = function () {\n vm.dt = new Date();\n };\n vm.today();\n\n vm.clear = function () {\n vm.dt = null;\n };\n\n // Disable weekend selection\n vm.disabled = function (date, mode) {\n return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 6 ) );\n };\n\n vm.toggleMin = function () {\n vm.minDate = vm.minDate ? null : new Date();\n };\n vm.toggleMin();\n\n vm.open = function ($event) {\n $event.preventDefault();\n $event.stopPropagation();\n\n vm.opened = true;\n };\n\n vm.dateOptions = {\n formatYear: 'yy',\n startingDay: 1\n };\n\n vm.initDate = new Date('2019-10-20');\n vm.format = 'dd-MM-yyyy';\n }", "function Calendar({ selected, changeDate, rowId }) {\n const [datePickerIsOpen, setDatePickerIsOpen] = useState(false);\n const openDatePicker = () => {\n setDatePickerIsOpen(!datePickerIsOpen);\n };\n return (\n <div className=\"action-cell-inner\">\n <button onClick={() => openDatePicker()} className=\"calendar\">\n <img alt=\"calendar\" src={CalendarIcon} className=\"icon-size\" />\n <span className=\"calendar-span sub-color\">Schedule Again</span>\n </button>\n <DatePicker\n className=\"calendar-picker\"\n selected={selected}\n onChange={(date) => {\n openDatePicker();\n changeDate(date, rowId);\n }}\n peekNextMonth\n showMonthDropdown\n showYearDropdown\n dropdownMode=\"select\"\n onClickOutside={openDatePicker}\n open={datePickerIsOpen}\n />\n </div>\n );\n}", "function openCalender($event) {\n $event.preventDefault();\n $event.stopPropagation();\n }", "function openCalender($event) {\n $event.preventDefault();\n $event.stopPropagation();\n }", "_focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }", "_focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }", "_focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }", "_focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }", "function onClick(event) {\n for(let i=0; i<(rows*cols); ++i) {\n //Add start cell \n if(cells[i] == event.target && cells[i].contains(event.target) && currentKey == 83 && start == null) {\n cells[i].style.backgroundColor = \"blue\"\n start = cells[i];\n }\n //Add end cell \n else if(cells[i] == event.target && cells[i].contains(event.target) && currentKey == 69 && end == null) {\n cells[i].style.backgroundColor = \"red\"\n end = cells[i];\n }\n \n }\n}", "function activateCalendar() {\n vm.today = function () {\n vm.dt = new Date();\n };\n vm.today();\n\n vm.clear = function () {\n vm.dt = null;\n };\n\n // Disable weekend selection\n vm.disabled = function (date, mode) {\n return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 6 ) );\n };\n\n vm.toggleMin = function () {\n vm.minDate = vm.minDate ? null : new Date();\n };\n vm.toggleMin();\n\n vm.open = function ($event) {\n $event.preventDefault();\n $event.stopPropagation();\n vm.opened = true;\n };\n\n vm.dateOptions = {\n formatYear: 'yy',\n startingDay: 1\n };\n\n vm.initDate = new Date('2019-10-20');\n vm.format = 'dd-MM-yyyy';\n }", "function addClickEventToCells() {\n const cells = document.getElementsByClassName(\"cell\");\n for (let i = 0; i < cells.length; i++) {\n cells[i].addEventListener('click', function (event) {\n let clickedCell = event.target;\n clickedCell.style.backgroundColor = inputColor.value;\n });\n };\n}", "function createCalender() {\n $('#calendar').fullCalendar({\n header: {\n left: 'prev,next today',\n center: 'title',\n right: 'month,basicWeek,basicDay'\n },\n defaultDate: '2018-03-12',\n navLinks: true, // can click day/week names to navigate views\n editable: true,\n eventLimit: true, // allow \"more\" link when too many events\n events: eventList\n });\n }", "_handleDateSelection(cell) {\n const that = this;\n\n if (typeof (cell) === 'undefined' || cell.disabled || cell.restricted) {\n return;\n }\n\n\n function selectMultipleDates(firstSelectedDate, date) {\n that._clearSelection(true);\n if (firstSelectedDate.getTime() < date.value.getTime()) {\n while (firstSelectedDate.getTime() <= date.value.getTime()) {\n that._selectDate(firstSelectedDate, true);\n firstSelectedDate.setDate(firstSelectedDate.getDate() + 1);\n }\n }\n else if (firstSelectedDate.getTime() > date.value.getTime()) {\n while (firstSelectedDate.getTime() >= date.value.getTime()) {\n that._selectDate(firstSelectedDate, true);\n firstSelectedDate.setDate(firstSelectedDate.getDate() - 1);\n }\n }\n else {\n that._selectDate(date, true);\n }\n\n //Update the hidden input\n that.$.hiddenInput.value = that.selectedDates.toString();\n\n that._refreshFooter();\n that.$.fireEvent('change', { 'value': that.selectedDates });\n that._refreshTitle();\n }\n\n switch (that.selectionMode) {\n case 'none':\n that._focusCell(cell);\n break;\n case 'one':\n case 'default':\n if (that._keysPressed['Control']) {\n if (that.selectedDates.length > 1 || (that.selectedDates.length === 1 && !cell.selected)) {\n that._selectDate(cell.value);\n return;\n }\n\n that._focusCell(cell);\n return;\n }\n\n if (that._keysPressed['Shift']) {\n selectMultipleDates(new Date(that.selectedDates[0]), cell);\n return;\n }\n\n that._clearSelection(true);\n\n that._selectDate(cell.value, that._selectedCells.indexOf(cell.value) > -1 ? true : false);\n break;\n case 'many': {\n if (that.selectedDates.length === 0) {\n that._selectDate(cell.value);\n return;\n }\n\n const lastSelectedDate = that.selectedDates[that.selectedDates.length - 1];\n let firstSelectedDate = new Date(that.selectedDates[0]);\n\n if (cell.value.getTime() === firstSelectedDate.getTime() || cell.value.getTime() === lastSelectedDate.getTime()) {\n that._clearSelection();\n that._focusCell(cell);\n return;\n }\n\n if (that.selectedDates.length > 0) {\n selectMultipleDates(firstSelectedDate, cell);\n }\n\n break;\n }\n case 'zeroOrMany':\n that._selectDate(cell.value);\n break;\n case 'oneOrMany':\n if (that.selectedDates.length === 1 && cell.selected) {\n that._focusCell(cell);\n return;\n }\n\n that._selectDate(cell.value);\n break;\n case 'zeroOrOne':\n if (that.selectedDates.length === 1 && cell.selected) {\n that._selectDate(cell.value);\n return;\n }\n\n that._clearSelection(true);\n that._selectDate(cell.value);\n break;\n case 'week': {\n if (cell.selected && (cell.value.getTime() === that.selectedDates[0].getTime() ||\n cell.value.getTime() === that.selectedDates[that.selectedDates.length - 1].getTime())) {\n that._clearSelection();\n that._focusCell(cell);\n return;\n }\n\n that._clearSelection(true);\n\n let date = new Date(cell.value);\n\n that._selectDate(date);\n\n for (let i = 1; i < 8; i++) {\n date.setDate(date.getDate() + 1, i < 7);\n that._selectDate(date);\n }\n\n if (!that._isDateInView(date)) {\n that.navigate(1)\n }\n\n break;\n }\n }\n }", "function setGridToNonClickable(grid){\n grid.style.pointerEvents=\"none\";\n}", "creanOnClick() {\n\n var currentAssignmentType = AssignmentReactiveVars.CurrentAssignmentType.get();\n\n switch (currentAssignmentType) {\n case AssignmentType.USERTOTASK:\n console.error(\"Template.assignmentCalendar.events.click .creneau\", \"User can't normally click on this kind of element when in userToTask\");\n return;\n break;\n case AssignmentType.TASKTOUSER: //only display users that have at least one availability matching the selected time slot\n break;\n }\n }", "function createRowsCalendar(){\r\n var numDias=arrayDias[document.getElementById(\"month\").selectedIndex-1];\r\n var html; \r\n var numDiaAdd=1;\r\n $( \".fc-row \" ).remove(); \r\n for (var i = 1; i <= 6; i++) { \r\n html=\"\"; \r\n html+=\" <div class='fc-row fc-week fc-widget-content' style='height: 80px;'>\";\r\n //se crean los encabezados para los calendarios\r\n html+=\" <div class='fc-bg'>\";\r\n html+=\" <table> <tbody> <tr>\";\r\n for (var j = 0; j < 6; j++) { \r\n html+=\" <td class='fc-day fc-widget-content fc-sun fc-other-month fc-past' ></td>\";\r\n }\r\n html+=\" </tr> </tbody> </table> </div> \";\r\n //termino de encabezados para el calendario\r\n\r\n //inicia la creacion de valores para el calendario\r\n html+=\" <div class='fc-content-skeleton'> \";\r\n html+=\" <table> \";\r\n html+=\" <tbody> <tr> \";\r\n for (var j = 0; j < 6; j++) { \r\n if(numDiaAdd<=numDias){\r\n html+=\" <td id='td_\"+numDiaAdd+\"' class='fc-day-number fc-sun fc-today fc-state-highlight'>\"+numDiaAdd;\r\n html+=\"<a id='btnadd_\"+numDiaAdd+\"' class='fc-day-grid-event fc-event fc-start fc-end fc-draggable' style='background-color:#fff;border-color:#fff'>\";\r\n html+=\"<div class='fc-content'>\"; \r\n html+=\"<button class='btn btn-primary' data-toggle='tooltip' data-placement='top' title='Crear visita' onclick='showModalCreate(\\\"\"+numDiaAdd+\"\\\",\\\"\"+$(\"#month\").val()+\"\\\",\\\"\"+$(\"#year\").val()+\"\\\");'> <i class='fa fa-plus-square'></i> </button>\" \r\n html+=\"</div></a>\";\r\n\r\n html+=\"<a id='btnadd2_\"+numDiaAdd+\"' class='fc-day-grid-event fc-event fc-start fc-end fc-draggable' style='background-color:#00a65a;border-color:#fff'>\";\r\n html+=\"<div class='fc-content'>\"; \r\n html+=getNameDay(numDiaAdd,$(\"#month\").val(),$(\"#year\").val()); \r\n html+=\"</div></a>\";\r\n\r\n html+=\"</td>\";\r\n }else {\r\n html+=\" <td class='fc-day-number fc-sun fc-today fc-state-highlight'></td>\";\r\n }\r\n \r\n numDiaAdd++;\r\n }\r\n html+=\" </tr> </tbody> </table> </div> \"; \r\n $( \"#containerCalendar\" ).append(html); \r\n } \r\n }", "showNoExercisesForTodayText()\n {\n var row = document.createElement(\"tr\");\n\n var col = document.createElement(\"td\");\n col.innerHTML = \"There are no exercises left to do today. <a href='#'>Check schedule</a>.\";\n col.className = \"mdl-data-table__cell--non-numeric table-message\";\n col.setAttribute('colspan', 3);\n col.addEventListener('click', event => {\n if (event.target.nodeName === \"A\") {\n this.application.switchToSchedule();\n }\n });\n\n row.appendChild(col);\n this.listEl.appendChild(row);\n }", "function addRow() \n{\n\t//현재 달의 처음날짜계산 마지막 날짜 전체계산\n\tvar lastDate = new Date(today.getFullYear(), today.getMonth()+1, 0);\n\tvar startDate = new Date(today.getFullYear(), today.getMonth(), 1);\n\t\n\t//현재 달의 처음일, 마지막일\n\tvar startDay = startDate.getDate();\n\tvar lastDay = lastDate.getDate(); \n\t//요일\n\tvar weekStartDay = startDate.getDay();\n\tvar weekLastDay = lastDate.getDay(); \n\t\n\tvar tbl = document.getElementById(\"calendar\");\n\t\n\t//1개의 행을 추가\n\tvar newRow = tbl.insertRow();\n\t\n\tvar cnt = 0;\n\tvar newCell = null;\n\tfor(n=0; n<weekStartDay; n++) {\n\t\tnewCell = newRow.insertCell();\n\t\tcnt++;\n\t}\n\t\n\tfor(d=1; d<=lastDay+3; d++) {\n\t\t \n\t\tnewCell = newRow.insertCell();\n\t\tif (d>lastDay) {\n\t\t\tnewCell.innerHTML = \"\";\n\t\t}\n\t\telse if(d<=lastDay) {\n\t\t\tnewCell.innerHTML = d;\n\t\t}\n\t\tcnt++;\n\t\t\n\t\tif(cnt%7==0) {\n\t\t\tif (d>lastDay) {\n\t\t\t\tnewCell.innerHTML = \"\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// 7개 열 추가 후 다음 행 추가\n\t\t\t\tnewRow = tbl.insertRow();\n\t\t\t\tnewCell.innerHTML = \"<span class='sat'>\"+d+\"<span>\";\n\t\t\t}\n\t\t}\n\t\tif(cnt%7==1) {\n\t\t\tif (d>lastDay) {\n\t\t\t\tnewCell.innerHTML = \"\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewCell.innerHTML = \"<span class='sun'>\"+d+\"<span>\";\n\t\t\t}\n\t\t}\n\t}\n}", "function rightClickOnRightClickFieldRow(formTable,calendarObject) {\n document.getElementById('rightclickfieldrow').style.display = 'none';\n return;\n}", "onElementClick(event) {\n const me = this,\n cellData = me.getEventData(event);\n\n // There is a cell\n if (cellData) {\n me.triggerCellMouseEvent('click', event);\n\n // Clear hover styling when clicking in a row to avoid having it stick around if you keyboard navigate\n // away from it\n // https://app.assembla.com/spaces/bryntum/tickets/5848\n DomDataStore.get(cellData.cellElement).row.removeCls('b-hover');\n }\n }", "canEditCell(event) {\n if (event.value == undefined) {\n this.setState({ openNoScheduleWarning: true });\n return;\n }\n }", "_handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"LEFT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"RIGHT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"UP_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"DOWN_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"HOME\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"END\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, (this._dateAdapter.getNumDaysInMonth(this._activeDate) -\n this._dateAdapter.getDate(this._activeDate)));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_UP\"]:\n this.activeDate = event.altKey ?\n this._dateAdapter.addCalendarYears(this._activeDate, -1) :\n this._dateAdapter.addCalendarMonths(this._activeDate, -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_DOWN\"]:\n this.activeDate = event.altKey ?\n this._dateAdapter.addCalendarYears(this._activeDate, 1) :\n this._dateAdapter.addCalendarMonths(this._activeDate, 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]:\n if (!this.dateFilter || this.dateFilter(this._activeDate)) {\n this._dateSelected({ value: this._dateAdapter.getDate(this._activeDate), event });\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }\n return;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ESCAPE\"]:\n // Abort the current range selection if the user presses escape mid-selection.\n if (this._previewEnd != null) {\n this._previewStart = this._previewEnd = null;\n this.selectedChange.emit(null);\n this._userSelection.emit({ value: null, event });\n event.preventDefault();\n event.stopPropagation(); // Prevents the overlay from closing.\n }\n return;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n this._focusActiveCell();\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }", "_handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"LEFT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"RIGHT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"UP_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"DOWN_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"HOME\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"END\"]:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, (this._dateAdapter.getNumDaysInMonth(this._activeDate) -\n this._dateAdapter.getDate(this._activeDate)));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_UP\"]:\n this.activeDate = event.altKey ?\n this._dateAdapter.addCalendarYears(this._activeDate, -1) :\n this._dateAdapter.addCalendarMonths(this._activeDate, -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_DOWN\"]:\n this.activeDate = event.altKey ?\n this._dateAdapter.addCalendarYears(this._activeDate, 1) :\n this._dateAdapter.addCalendarMonths(this._activeDate, 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]:\n if (!this.dateFilter || this.dateFilter(this._activeDate)) {\n this._dateSelected({ value: this._dateAdapter.getDate(this._activeDate), event });\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }\n return;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ESCAPE\"]:\n // Abort the current range selection if the user presses escape mid-selection.\n if (this._previewEnd != null && !Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"hasModifierKey\"])(event)) {\n this._previewStart = this._previewEnd = null;\n this.selectedChange.emit(null);\n this._userSelection.emit({ value: null, event });\n event.preventDefault();\n event.stopPropagation(); // Prevents the overlay from closing.\n }\n return;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n this._focusActiveCell();\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }", "function setEventsToTable() {\n\n\n //Event for click at button\n $(\"button.add-col-button\").click(function () {\n \n ShowCreateMarkFieldWind();\n });\n\n //Event for click at cell with presence\n $(\".presence-cell.editable\").click(function () {\n var studentId = $(this).parent().children().first().next().attr(\"data-id\");\n var classId = $(this).attr(\"data-id\");\n\n if ($(this).css(\"background-color\") == \"rgb(194, 255, 10)\") { //if student is absent\n $(this).css(\"background\", \"rgb(255, 218, 6)\");\n $(this).html(\"н\");\n $.ajax({\n url: \"NoteStudentAbsence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n } else { //if - precent\n $(this).css(\"background\", \"rgb(194, 255, 10)\");\n $(this).html(\"\");\n $.ajax({\n url: \"NoteStudentPresence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n }\n });\n\n //event for edit conent of cell with marks\n $(\".mark-cell.editable\").click(function (e) {\n //alert(this.className);\n\n e = e || window.event;\n var t = e.target || e.srcElement;\n var elm_name = t.tagName.toLowerCase();\n if (elm_name == 'input') {\n return false;\n }\n // alert(elm_name);\n\n var val = $(this).html();\n var code = '<input type=\"text\" class=\"edit\" value=\"' + val + '\"/>';\n $(this).html(code);\n $(\".edit\").focus();\n\n $(\".edit\").blur(function () {\n var val = $(\".edit\").val();\n var parent = $(\".edit\").parent();\n var data_id = parent.attr(\"data-id\");\n var data_type = parent.attr(\"data-type\");\n //////Нужна другая проверка в!!!!!\n if (isNaN(val))\n val=\"\";\n parent.html(val);\n $.ajax({\n url: \"SaveMarkServlet?id=\" + data_id +\n \"&type=\" + data_type +\n \"&value=\" + val\n });\n });\n });\n ////event function for click at cell whith student name\n $(\"td.cell-ui.stud-name.data-cell\").click(function () {\n clickAtCellWithStudName(event);\n });\n $(\"#stud-inf-wind\").mouseleave(function () {\n HideStudentInformationWind();\n });\n\n ////////////Редактируй. Нерабочий кусок кода. Для склика поя чейке таблице редактирования\n $(\".cell-ui.info-cell-editable\").click(function (event) {\n showPopupFormEditStudent(event);\n });\n}", "function init_calendar(date) {\n $(\".tbody\").empty();\n $(\".events-container\").empty();\n var calendar_days = $(\".tbody\");\n var month = date.getMonth();\n var year = date.getFullYear();\n var day_count = days_in_month(month, year);\n var row = $(\"<tr class='table-row'></tr>\");\n var today = date.getDate();\n // Set date to 1 to find the first day of the month\n date.setDate(1);\n var first_day = date.getDay();\n var notfirstweek = false;\n // 35+firstDay is the number of date elements to be added to the dates table\n // 35 is from (7 days in a week) * (up to 5 rows of dates in a month)\n for(var i=0; i<42+first_day; i++) {\n // Since some of the elements will be blank, \n // need to calculate actual date from index\n var day = i-first_day+1;\n // If it is a sunday, make a new row\n if(i%7===0) {\n if (notfirstweek && (day > day_count)) {\n break;\n }\n calendar_days.append(row);\n row = $(\"<tr class='table-row'></tr>\");\n notfirstweek = true;\n }\n // if current index isn't a day in this month, make it blank\n if(i < first_day || day > day_count) {\n var curr_date = $(\"<td class='table-date nil'>\"+\"</td>\");\n row.append(curr_date);\n } \n else {\n var curr_date = $(\"<td class='table-date'>\"+day+\"</td>\");\n var events = check_events(day, month+1, year);\n if(today===day && $(\".active-date\").length===0) {\n curr_date.addClass(\"active-date\");\n }\n // If this date has any events, style it with .event-date\n if(events.length!==0) {\n if(events[0].state===1) {\n curr_date.addClass(\"event-date-green\");\n }\n if(events[0].state===2) {\n curr_date.addClass(\"event-date-yellow\");\n }\n if(events[0].state===3) {\n curr_date.addClass(\"event-date-red\");\n }\n }\n else {\n curr_date.addClass(\"event-date-yellow\");\n }\n // Set onClick handler for clicking a date\n curr_date.click({events: events, month: months[month], day:day}, date_click);\n row.append(curr_date);\n }\n }\n // Append the last row and set the current year\n calendar_days.append(row);\n $(\".year\").text(year);\n}", "function openCalendar(ev) {\n // opens and closes the calendar\n var sec = document.getElementById(\"calendar-pannel\");\n if(sec.classList.contains(\"open-section\")){\n sec.classList.add(\"closed-section\");\n sec.classList.remove(\"open-section\");\n } else {\n var sec = document.getElementById(\"calendar-pannel\");\n var event_sec = document.getElementById(\"calendar-event\");\n sec.classList.add(\"open-section\");\n sec.classList.remove(\"closed-section\");\n event_sec.classList.add(\"closed-section\");\n event_sec.classList.remove(\"open-section\");\n var params = {};\n params.method = \"GET\";\n params.url = \"/section/calendar/displayMonth\";\n params.data = null;\n params.setHeader = false;\n ajaxRequest(params, calendarResponse);\n }\n }", "function calDisplay()\n{\nweek=7;\nselDate= new Date(opener.user_sel_val_holder);\ntoday = new Date(arguments[0]);\ncurrentVal = new Date(opener.cal_val_holder);\n// as of Danube, PT needs all the dates, including weekend dates, to be\n// hyperlinked in the Calendar for its Date type attributes, whereas PD\n// doesn't want weekend dates to be hyperlinked.\nhyperLinkWeekEndDates = arguments[1] == null ? false : arguments[1];\ncurr_day= today.getDate();\nsel_day= selDate.getDate();\nend_date= getEndDate(currentVal);\ncurrentVal.setDate(end_date);\nend_day=currentVal.getDay();\ncurrentVal.setDate(1);\nstart_day=currentVal.getDay();\nrow=0;\nend_week=week-end_day;\ndocument.writeln(\"<tr>\");\nfor (var odday=0;odday<start_day;odday++,row++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\n\nfor (var day=1;day<=end_date;day++,row++)\n{\nif(row == week)\n{\ndocument.writeln(\"</tr> <tr> \");\nrow=0;\n}\ndocument.writeln(\"<td class=\\\"calendarday\\\"\");\nif(curr_day == day && currentVal.getMonth() == today.getMonth() && currentVal.getFullYear() == today.getFullYear())\ndocument.writeln(\" id=\\\"today\\\" > \");\nelse if(sel_day == day && currentVal.getMonth() == selDate.getMonth() && currentVal.getFullYear() == selDate.getFullYear())\ndocument.writeln(\" id=\\\"selectedDate\\\" > \");\nelse\ndocument.writeln(\" > \");\n\nif(isWeekend(day,currentVal) && !hyperLinkWeekEndDates)\ndocument.writeln(day+\"</td>\");\nelse\n if(sel_day == day)\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\"; title=\\\"\"+ arguments[2]+\" \\\" >\"+day+\"</a></td>\");\n else\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\" >\"+day+\"</a></td>\");\n}\n\nfor (var end=0;end<(end_week-1);end++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\ndocument.writeln(\"</tr>\");\n\n\n}", "_cellClicked(cell, event) {\n if (cell.enabled) {\n this.selectedValueChange.emit({ value: cell.value, event });\n }\n }", "_cellClicked(cell, event) {\n if (cell.enabled) {\n this.selectedValueChange.emit({ value: cell.value, event });\n }\n }", "function DateClicking(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateClicking(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateClicking(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateClicking(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "function onOpen() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n var entries = [\n {\n name: \"Check all rows\",\n functionName: \"checkEventsForAllRows\"\n },\n {\n name: \"Configure active row\",\n functionName: \"configureActiveRow\"\n },\n {\n name: \"Check event for active row\",\n functionName: \"checkEventForActiveRow\"\n },\n {\n name: \"Sync event for active row\",\n functionName: \"syncEventForActiveRow\"\n },\n {\n name: \"Delete event for active row\",\n functionName: \"deleteEventForActiveRow\"\n }\n ];\n if (Settings.getOffice365CalendarEnabled()) {\n entries.push({\n name: \"Authorize access to Office 365\",\n functionName: \"authorizeIfRequired\"\n });\n entries.push({\n name: \"Logout from Office 365\",\n functionName: \"logout\"\n });\n }\n sheet.addMenu(\"Calendar\", entries);\n}", "function Calander (div, minYear ,minMonth,minDate,maxYear,maxMonth,maxDate,target = \"\",acceptNull=false) {\n this.minYear = minYear;\n\tthis.minMonth = minMonth; //(0-11)\n\tthis.minDate = minDate;\n\tthis.maxYear = maxYear;\n\tthis.maxMonth = maxMonth;\n\tthis.maxDate = maxDate;\n\tthis.target = document.getElementById(target);\n\tthis.div = div;\n\tthis.acceptNull = acceptNull;\n\tthis.dx = new Date();\n\tthis.dxNow = new Date();\n\tthis.cells = document.getElementById(div).getElementsByClassName(\"dateCell\");\n\tcontrol = document.getElementById(div);\n\tvar tableCells=\"\";\n\t\tfor (i = 0; i< 5;i++){\n\t\t\ttableCells = tableCells + '<tr>';\n\t\t\tfor(j = 0; j <7;j++){\n\t\t\t\ttableCells = tableCells + '<td class=\"dateCell\" onClick=\"'+div+'.monthCellClick(this);\"></td>'\n\t\t\t}\n\t\t\ttableCells = tableCells + '</tr>';\n\t\t}\n\t\tcontrol.innerHTML='<table width=\"100%\">'+\n\t\t\t'<tr><td align=\"left\" width=\"25px\"><input type=\"button\" class=\"prevYear monthViewControl\" value=\"<\" onClick=\"'+div+'.lowerYear();\"></td><td align=\"center\" width=\"150px\"><label class=\"yearLabel\">2016</label></td><td align=\"right\" width=\"25px\"><input type=\"button\" class=\"nextYear monthViewControl\" value=\">\" onClick=\"'+div+'.higherYear();\"></td></tr>'+\n\t\t\t'<tr><td align=\"left\" width=\"25px\"><input type=\"button\" class=\"prevMonth monthViewControl\" value=\"<\" onClick=\"'+div+'.lowerMonth();\"></td><td align=\"center\" width=\"150px\"><label class=\"monthLabel\">August</label></td><td align=\"right\" width=\"25px\"><input type=\"button\" class=\"nextMonth monthViewControl\" value=\">\" onClick=\"'+div+'.higherMonth();\"></td></tr>'+\n\t\t\t'<tr><td colspan=\"3\"><table class=\"dates\" width=\"100%\">'+\n\t\t\t'<tr><th>S</th> <th>M</th> <th>T</th> <th>W</th> <th>T</th> <th>F</th> <th>S</th></tr>'+\n\t\t\ttableCells + '</table></td></tr>'+\n\t\t'</table>';\n\tcontrol.setAttribute(\"class\",\"monthView\");\n\tcontrol.setAttribute(\"style\",\"display:none;\");\n\tcontrol.setAttribute(\"tabindex\",\"0\");\n\tthis.target.setAttribute(\"class\",\"monthViewTarget\");\n\tthis.target.setAttribute(\"readonly\",\"readonly\");\n\t//control.setAttribute(\"onblur\",div+\".showCalander(false);\");\n\tthis.checkLeap = function(){\n\t\tif(this.dx.getFullYear()%4 ==0){\n\t\t\tif(this.dx.getFullYear()%400 ==0)\n\t\t\t\treturn 29;\n\t\t\telse if(this.dx.getFullYear()%100 == 0)\n\t\t\t\treturn 28;\n\t\t\telse\n\t\t\t\treturn 29;\n\t\t}\n\t\telse return 28;\n\t};\n\tthis.me = document.getElementById(this.div);\n\tthis.showCalander = function(vis){\n\t\tif(vis){\n\t\t\tthis.me.style.display=\"block\";\n\t\t\tif (acceptNull) this.target.value=\"\";\n\t\t}\n\t\telse{\n\t\t\tthis.me.style.display=\"none\";\n\t\t}\n\t}\n\t\n\tthis.toggle = function(){\n\t\tif(this.me.style.display==\"none\")this.showCalander(true);\n\t\telse is.showCalander(false);\n\t}\n\t\n\tthis.drawDates = function(){\n\t\tnod[1] = this.checkLeap();\n\t\tvar startX = this.dx.getDay()\n\t\tvar markToday = (this.dx.getMonth() == this.dxNow.getMonth()) && (this.dx.getFullYear() == this.dxNow.getFullYear());\n\t\tvar markMin = (this.dx.getMonth() == minMonth) && (this.dx.getFullYear() == minYear);\n\t\tvar markMax = (this.dx.getMonth() == maxMonth) && (this.dx.getFullYear() == maxYear);\n\t\tfor(i = 0 ; i< this.cells.length; i++){\n\t\t\tthis.cells[i].innerHTML= \"&nbsp;\";\n\t\t\tthis.cells[i].setAttribute(\"class\",\"disabledCell dateCell\");\n\t\t}\n\t\tif(nod[this.dx.getMonth()] + startX+1 > 35){\n\t\t\tfor(i = startX ; i< 35; i++){\n\t\t\t\tthis.cells[i].innerHTML= i-startX+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML < this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t\tfor(i = 0 ; i< nod[this.dx.getMonth()] + startX - 35; i++){\n\t\t\t\tthis.cells[i].innerHTML=nod[this.dx.getMonth()]-((nod[this.dx.getMonth()] + startX - 35)-i)+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML <this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(i = startX ; i< nod[this.dx.getMonth()] + startX; i++){\n\t\t\t\tthis.cells[i].innerHTML= i-startX+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML < this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t}\t\n\t\tdocument.getElementById(this.div).getElementsByClassName(\"monthLabel\")[0].innerHTML=months[this.dx.getMonth()];\n\t\tdocument.getElementById(this.div).getElementsByClassName(\"yearLabel\")[0].innerHTML=this.dx.getFullYear();\n\t};\n\t\n\tthis.lowerMonth = function(){\n\t\tif(this.dx.getFullYear() == this.minYear){\n\t\t\tif(this.minMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\tthis.drawDates();\n\t};\n\t\n\tthis.lowerMonth = function (){\n\t\tif(this.dx.getFullYear() == this.minYear){\n\t\t\tif(this.minMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\tthis.drawDates();\n\t};\n\t\n\tthis.higherMonth = function (){\n\t\tif(this.dx.getFullYear() == this.maxYear){\n\t\t\tif(this.maxMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\tthis.drawDates();\n\t};\n\t\n\n\tthis.lowerYear = function (){\n\t\tif(this.minYear == this.dx.getFullYear()-1){ //next click will be the min year\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()-1);\n\t\t\twhile(this.dx.getMonth() < this.minMonth){\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\t\t}\n\t\t}\n\t\telse if(this.minYear < this.dx.getFullYear()){\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()-1);\n\t\t}\n\t\tthis.drawDates();\n\t}\n\tthis.higherYear = function (){\n\t\tif(this.maxYear == this.dx.getFullYear()+1){ //next click will be the max year\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()+1);\n\t\t\twhile(this.dx.getMonth() > this.maxMonth)\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t}\n\t\telse if(this.maxYear > this.dx.getFullYear()){\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()+1);\n\t\t}\n\t\tthis.drawDates();\n\t}\n\n\tthis.monthCellClick = function (elem){\n\t\tif (!elem.classList.contains(\"disabledCell\")){\n\t\t\tif (this.target == \"\")\n\t\t\t\talert(this.dx.getFullYear() + \"-\" + this.dx.getMonth() + \"-\" + elem.innerHTML);\n\t\t\telse {\n\t\t\t\tthis.target\n\t\t\t\tthis.target.value = this.dx.getFullYear() + \"-\" + (this.dx.getMonth() +1< 10 ? \"0\"\n\t\t\t\t+(this.dx.getMonth()+1) : (this.dx.getMonth()+1)) + \"-\" + (elem.innerHTML < 10 ? \"0\" + elem.innerHTML : elem.innerHTML);\n\t\t\t}\n\t\t\tthis.showCalander(false);\n\t\t}\t\n\t}\n\tthis.drawDates();\n}", "function toggleEndDate(section, evt) {\n\n $(evt).closest('.gcconnex-' + section + '-entry').find('.gcconnex-' + section + '-end-year').attr('disabled', evt.checked);\n $(evt).closest('.gcconnex-' + section + '-entry').find('.gcconnex-' + section + '-enddate').attr('disabled', evt.checked);\n}", "function calDays(calDate) {\r\n //Determine the starting days of the month\r\n let day = new Date(calDate.getFullYear(), calDate.getMonth(), 1);\r\n let weekDay = day.getDay();\r\n\r\n //Write blank cells preceding the starting day\r\n let htmlCode = \"<tr >\";\r\n for (let i = 0; i < weekDay; i++) {\r\n htmlCode += \"<td class='day'></td>\";\r\n }\r\n\r\n //Write the cells for each day of the month\r\n let totalDays = daysInMonth(calDate);\r\n\r\n let highlightDay = calDate.getDate();\r\n for (let i = 1; i <= totalDays; i++) {\r\n day.setDate(i);\r\n weekDay = day.getDay();\r\n\r\n if (weekDay === 0) htmlCode += \"<tr>\";\r\n \r\n // Checks if highlightDay is today and if there are more than one event listed in eventList\r\n if (i === highlightDay && dayEvent[i] !== \"\" && dayEvent2[i] !== \"\") {\r\n \r\n // Concats the table data for today with up to 2 events\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \" <br />\" + dayEvent2[i] + \"</div></td>\";\r\n\r\n // Checks if highlightDay is today and there is an event on dayEvent[i]\r\n } else if (i === highlightDay && dayEvent[i] !== \"\") {\r\n\r\n // Concats the table data for today with event tags and event info\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</td>\";\r\n\r\n // Checks if there event on dayEvent[i] is an empty string\r\n } else if (i === highlightDay) {\r\n\r\n // Concats the table data for today with up to 2 events\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div></td>\";\r\n\r\n } else if (dayEvent[i] === \"\") {\r\n\r\n // Concats ONLY the table data and the date\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div></td>\";\r\n\r\n // Checks for a second event\r\n } else if (dayEvent2[i] !== \"\") {\r\n\r\n // Concats the table data for 2 events on any day but the today.\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</div> <div class='event'>\" + dayEvent2[i] + \"</div></td>\";\r\n\r\n } else {\r\n // Concats table data for every day except today with a single event for the day\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</div></td>\";\r\n\r\n }\r\n\r\n if (weekDay === 6) htmlCode += \"</tr>\";\r\n }\r\n return htmlCode;\r\n}", "_handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"LEFT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? 1 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"RIGHT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? -1 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"UP_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -4);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"DOWN_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 4);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"HOME\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -this._dateAdapter.getMonth(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"END\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 11 - this._dateAdapter.getMonth(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_UP\"]:\n this.activeDate =\n this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_DOWN\"]:\n this.activeDate =\n this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]:\n this._monthSelected({ value: this._dateAdapter.getMonth(this._activeDate), event });\n break;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n this._focusActiveCell();\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }", "_handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"LEFT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? 1 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"RIGHT_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? -1 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"UP_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -4);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"DOWN_ARROW\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 4);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"HOME\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -this._dateAdapter.getMonth(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"END\"]:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 11 - this._dateAdapter.getMonth(this._activeDate));\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_UP\"]:\n this.activeDate =\n this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"PAGE_DOWN\"]:\n this.activeDate =\n this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]:\n this._monthSelected({ value: this._dateAdapter.getMonth(this._activeDate), event });\n break;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n this._focusActiveCell();\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }", "function setEventBehaviour(){\n\t\t\tbutton.style(\"pointer-events\",\"all\");\n\t\t}", "function addCellHighlight(event)\n{\n event.currentTarget.style.backgroundColor = TH_HOVER_COLOR;\n}", "function eventClick(calEvent, jsEvent, view) {\n var item = getItem(calEvent.itId);\n map.SetCenter(new VELatLong(item.data.location.lat, item.data.location.long));\n map.SetCenter(new VELatLong(item.data.location.lat, item.data.location.long));\n var index = itinerary.indexOf(calEvent.itId) + 1;\n var pins = $(\".pinpos\");\n for (var i = 0; i < pins.length; i++) {\n \tif ($(pins[i]).text() == index) {\n \t\t$(pins[i]).mouseover();\n \t}\n }\n}", "function printCalendar(calendarMatrix){\n while(calendarBody.children[0]){\n calendarBody.removeChild(calendarBody.children[0]);\n }\n deleteAppointments();\n title = document.getElementById(\"calendarTitle\").getElementsByTagName(\"h2\")[0];\n title.innerText = mesi[month]+\" \"+year //Cambio il titolo\n\n //Ogni riga della matrice è un tr nella tabella in html\n for(i=0; i<calendarMatrix.length; i++){\n tr = document.createElement(\"tr\");\n for(j=0; j<7; j++){\n td = document.createElement(\"td\");\n\n //calendarMatrix[i][j]==0 vuol dire che l'elemento è vuoto, ossia che è uno di quelli che,\n //nella stessa settimana, appartengono ad un mese diverso\n if(calendarMatrix[i][j]!=0){\n td.innerText = calendarMatrix[i][j];\n\n //Verifico se il giorno è passato\n if (today.getFullYear()>year ||\n (today.getFullYear()==year && today.getMonth()>month) ||\n (today.getFullYear()==year && today.getMonth()==month && today.getDate()>calendarMatrix[i][j]))td.setAttribute(\"class\",\"past\");\n \n //Se il giorno non è passato, gli assegno la funzione che da una parte mi stampa gli eventuali appuntamenti,\n //dall'altra mi permette di aggiungere il giorno di ambulatorio / modificarne lo stato\n else{\n (function(d,m,y){\n td.onclick = function(){getAppointments(d,m,y)}\n })(calendarMatrix[i][j],month,year);\n }\n\n //Verifico se è già un giorno tra quelli di ambulatorio\n for(k=0; k<usedDays.length; k++){\n usedDay= new Date(usedDays[k]['data']);\n if(usedDay.getDate()==calendarMatrix[i][j]){\n if(usedDays[k]['stato']==1){\n td.setAttribute(\"class\",\"accessibleDay\");\n }\n else td.setAttribute(\"class\",\"removedDay\");\n break;\n }\n }\n }\n else{\n td.setAttribute(\"class\",\"empty\");\n }\n tr.appendChild(td);\n }\n calendarBody.appendChild(tr);\n }\n}", "function setEventBackground(date, url) {\n (month = Number(date[0]) + Number(date[1]) - 1),\n (day = Number(date[3] + date[4])),\n (year = Number(date.slice(6)));\n\n let d = new Date(year, month, 1),\n firstDay = d.getDay(),\n calendarElements = firstDay + day;\n let item = document.querySelector(\n `tbody>tr:nth-child(${Math.ceil(calendarElements / 7)}) >td:nth-child(${\n calendarElements % 7 || 7\n })`\n );\n item.style = `background:url(${url}) no-repeat center center/cover`;\n // Add class for background behind date to make it visible with image background if applicable\n let eventDate = item.innerHTML;\n item.innerHTML = `<span class='eventDate'>${eventDate}</span>`;\n item.prepend(createDeleteBtn());\n}", "onContainerElementClick(event) {\n const target = DomHelper.up(event.target, '.b-sch-header-timeaxis-cell');\n\n if (target) {\n const\n index = target.dataset.tickIndex,\n position = target.parentElement.dataset.headerPosition,\n columnConfig = this.timeAxisViewModel.columnConfig[position][index];\n\n // Skip same events with Grid context menu triggerEvent\n const contextMenu = this.grid.features.contextMenu;\n if (!contextMenu || event.type !== contextMenu.triggerEvent) {\n this.trigger('timeAxisHeader' + StringHelper.capitalize(event.type), {\n startDate : columnConfig.start,\n endDate : columnConfig.end,\n event\n });\n }\n }\n }", "function highlightDateWithEvent(month){\n\t$(\"#calendar>tr>td.dateWithEvent\").removeClass(\"dateWithEvent\");\n\tvar events = [];\n\tevents = eventRecord.getMonthEvents(month);\n\tfor (var i=0; i<31; i++) {\n\t\tif (events[i].isNotEmpty()) {\n\t\t\tvar d = i+1;\n\t\t\t$(\"#\"+d+\"-\"+month+\"-\"+yearIndex).addClass(\"dateWithEvent\");\n\t\t}\n\t}\n}", "function fillCalendar(appointments){\n let calendar = document.getElementsByClassName(\"calendar_day\");\n\n let year = selectedDate.getFullYear();\n let month = selectedDate.getMonth();\n\n let monthName = CALENDAR_MONTH_NAMES[month];\n document.getElementById(\"calendar_month_display\").innerText = `${monthName} ${year}`;\n\n let endDate = new Date(Date.UTC(year, month+1));\n let date = new Date(Date.UTC(year, month));\n let index = (date.getDay() + 6) % 7;\n \n // clear days outside range\n for(let i=0;i<index;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n\n // fill in days + apointments\n while (date < endDate) {\n calendar[index].children[0].innerText = date.getDate() + \".\";\n calendar[index].children[1].innerHTML = \"\";\n\n for(let i=0;i<appointments.length;i++){\n if(date.getUTCDate() == appointments[i].day){\n let appointment = document.createElement(\"div\");\n appointment.innerText = `${appointments[i].lecturer}: ${appointments[i].name}`;\n appointment.setAttribute(\"aria-id\", appointments[i].id);\n appointment.setAttribute(\"aria-name\", appointments[i].name);\n appointment.setAttribute(\"aria-location\", appointments[i].location);\n appointment.setAttribute(\"aria-start\", appointments[i].start);\n appointment.setAttribute(\"aria-end\", appointments[i].end);\n appointment.setAttribute(\"aria-status\", appointments[i].status);\n appointment.setAttribute(\"aria-lecturer\", appointments[i].lecturer);\n appointment.setAttribute(\"aria-type\", appointments[i].type);\n appointment.setAttribute(\"onclick\", \"show_popup(this)\");\n\n calendar[index].children[1].appendChild(appointment);\n }\n }\n calendar[index].setAttribute(\"aria-disabled\", \"false\");\n\n index += 1;\n date.setUTCDate(date.getUTCDate() + 1);\n }\n \n // clear days outside range\n for(let i=index;i<calendar.length;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n}", "function createCalendar() {\n addCalendar();\n displayDates();\n}", "onElementClick(event) {\n const me = this,\n cellData = me.getCellDataFromEvent(event); // There is a cell\n\n if (cellData) {\n me.triggerCellMouseEvent('click', event); // Clear hover styling when clicking in a row to avoid having it stick around if you keyboard navigate\n // away from it\n // https://app.assembla.com/spaces/bryntum/tickets/5848\n\n DomDataStore.get(cellData.cellElement).row.removeCls('b-hover');\n }\n }", "_onClick(e){if(e.defaultPrevented){// Something has handled this click already, e. g., <vaadin-grid-sorter>\nreturn}const path=e.composedPath(),cell=path[path.indexOf(this.$.table)-3];if(!cell||-1<cell.getAttribute(\"part\").indexOf(\"details-cell\")){return}const cellContent=cell._content,activeElement=this.getRootNode().activeElement,cellContentHasFocus=cellContent.contains(activeElement)&&(// MSIE bug: flex children receive focus. Make type & attributes check.\n!this._ie||this._isFocusable(activeElement));if(!cellContentHasFocus&&!this._isFocusable(e.target)){this.dispatchEvent(new CustomEvent(\"cell-activate\",{detail:{model:this.__getRowModel(cell.parentElement)}}))}}", "function cell_click(evt) {\n let cell_id = evt.srcElement.id;\n let id = cell_id.split(\"_\");\n let x = parseInt(id[0]);\n let y = parseInt(id[1]);\n\n switch (evt.which) {\n case LEFT:\n cell_on(x, y);\n break;\n case MIDDLE:\n cell_toggle(x, y);\n break;\n case RIGHT:\n cell_off(x, y);\n break;\n }\n return false;\n}", "function initializeYearCalendar(year){\n\t$(\"#year-calendar\").calendar({\n\t\tstartYear: year == null ? currentYear : year,\n enableRangeSelection: true,\n // click function\n clickDay: function(e) {\n \tremoveHighlightedDates();\n \tsetDate(e);\n },\n style:'background', \t\n\t});\n\t}", "function setDaysInCalendar() {\n for (let i = 1; i <= CurrentDaysInMonth; i++) {\n number[i].innerText = i\n }\n for (let i = 0; i < number.length; i++) {\n // remove attr from non-days\n if ($(number[i]).text() == \"-\") {\n $(number[i]).siblings().remove();\n $(number[i]).parent().attr({\"data-bs-toggle\" : \"\", \"data-bs-dismiss\" : \"\", \"data-bs-target\" : \"\"});\n }\n // add class today to the current day \n if (number[i].innerText == today.getDate()) {\n $(number[i]).parent().addClass(\"today\");\n }\n }\n }", "function Calendar_OnDateSelected(sender, eventArgs) {\r\n // limpa o span das datas\t \r\n var dtSelecionada = document.getElementById(\"dtSelecionada\");\r\n dtSelecionada.innerHTML = \"\";\r\n // obtém a referencia para o calendario\r\n var calendario = $find(IdCalendario);\r\n // obtém as datas selecionadas\r\n var dates = calendario.get_selectedDates();\r\n\r\n // para cada data..\r\n for (var i = 0; i < dates.length; i++) {\r\n var date = dates[i];\r\n var data = date[2] + \"/\" + date[1] + \"/\" + date[0];\r\n data += \" \"; // adiciona um espaco ao final para dar espaco entre as datas\r\n dtSelecionada.innerHTML += data;\r\n }\r\n}", "function createCalendar (schedule) {\n\n\t$('#calendar').fullCalendar('removeEvents')\n\n\t$('#calendar').fullCalendar({\n\t\theader: false,\n\t\tdefaultView: 'agendaWeek',\n\t\tweekends: false,\n\t\tdefaultDate: '2015-02-09',\n\t\teditable: false,\n\t\teventLimit: true, // allow \"more\" link when too many events\n\t\tminTime: \"07:00:00\",\n\t\tallDayText: \"Online\",\n\t\tcolumnFormat: \"ddd\"\n\t});\n\n\t\t\t\t\n\tfor (var i = 0; i < schedule.length; i++) {\n\t\tvar days = splitDays(schedule[i]);\n\t\tvar color = getColor(i)\n\n\t\tif(days == \"\") // The class has no meeting days (online)\n\t\t{\n\t\t\t\tvar newEvent = new Object();\n\t\t\t\tnewEvent.title = schedule[i][\"CourseName\"] + \" \" + schedule[i][\"Title\"] + \" \" + schedule[i][\"Instructor\"]\n\t\t\t\tnewEvent.color = color\n\t\t\t\tnewEvent.start = \"2015-02-09\"\n\t\t\t\tnewEvent.end = \"2015-02-14\"\n\t\t\t\tnewEvent.allDay = true;\n\t\t\t\t$('#calendar').fullCalendar( 'renderEvent', newEvent );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (var j = 0; j < days.length; j++) {\n\t\t\t\tvar newEvent = new Object();\n\t\t\t\tnewEvent.title = schedule[i][\"CourseName\"] + \" \" + schedule[i][\"Title\"] + \" \" + schedule[i][\"Instructor\"]\n\t\t\t\tnewEvent.color = color\n\t\t\t\tvar day;\n\t\t\t\t//lazy way to do it\n\t\t\t\tif (days[j] == \"M\") {\n\t\t\t\t\tday = \"2015-02-09\"\n\t\t\t\t} else if (days[j] == \"T\") {\n\t\t\t\t\tday = \"2015-02-10\"\n\t\t\t\t} else if (days[j] == \"W\") {\n\t\t\t\t\tday = \"2015-02-11\"\n\t\t\t\t} else if (days[j] == \"R\") {\n\t\t\t\t\tday = \"2015-02-12\"\n\t\t\t\t} else if (days[j] == \"F\") {\n\t\t\t\t\tday = \"2015-02-13\"\n\t\t\t\t}\n\t\t\t\tnewEvent.start = day + \"T\" + convertMilitaryTimeToFullCalendarFormat(schedule[i][\"Start\"])\n\t\t\t\tnewEvent.end = day + \"T\" + convertMilitaryTimeToFullCalendarFormat(schedule[i][\"End\"])\n\t\t\t\tnewEvent.allDay = false;\n\n\t\t\t\t$('#calendar').fullCalendar( 'renderEvent', newEvent );\n\t\t\t}\n\t\t}\n\t}\n}", "function initCells(){\n\t\tvar days = ['Monday', 'Tuesday', 'Wednesday', \n\t\t\t'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\t\tvar tableRows = document.getElementById('schedTable').children[0].children;\n\t\tvar numericClass = 0000;\n\t\tvar toggle = true;\n\t\tvar first = true;\n\t\tfor(row in tableRows){\n\t\t\tif(!isNaN(row)){\n\t\t\t\tvar tableDatas = tableRows[row].children;\n\t\t\t\tif(!first){\n\t\t\t\t\tvar counter = 0;\n\t\t\t\t\tfor(dat in tableDatas){\n\t\t\t\t\t\tif(!isNaN(dat)){\n\t\t\t\t\t\t\tif(!tableDatas[dat].classList.contains('timeLabel')){\n\t\t\t\t\t\t\t\tvar html = days[counter].toLowerCase();\n\t\t\t\t\t\t\t\tcounter++\n\t\t\t\t\t\t\t\ttableDatas[dat].classList.add(html);\n\t\t\t\t\t\t\t\ttableDatas[dat].classList.add(numericClass);\n\t\t\t\t\t\t\t\ttableDatas[dat].classList.add('cell');\n\t\t\t\t\t\t\t\ttableDatas[dat].setAttribute('data-type','');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(toggle){\n\t\t\t\t\t\tnumericClass += 30;\n\t\t\t\t\t\ttoggle = false;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tnumericClass += 70;\n\t\t\t\t\t\ttoggle = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tfirst = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function onCanvasMouseDown(event) {\n window.mouseDown = true;\n clickCell(event.pageX, event.pageY);\n}", "function doCreateCalendar() {\n let cal_name = document.getElementById(\"calendar-name\").value;\n let cal_color = document.getElementById('calendar-color').color;\n\n gCalendar.name = cal_name;\n gCalendar.setProperty('color', cal_color);\n\n if (!document.getElementById(\"fire-alarms\").checked) {\n gCalendar.setProperty('suppressAlarms', true);\n }\n\n cal.getCalendarManager().registerCalendar(gCalendar);\n return true;\n}", "function openCalendarInGrid(sFieldName) {\r\n\r\n var parentTrRow = findParentTrRow(window.event.srcElement);\r\n var myrow = parentTrRow.rowIndex - 1;\r\n\r\n var myobj = document.getElementsByName(sFieldName)[myrow];\r\n\r\n if (typeof myobj == \"undefined\") {\r\n calendar(sFieldName);\r\n }\r\n else\r\n {\r\n calendar(sFieldName + \"[\" + myrow + \"]\");\r\n }\r\n}", "onContainerElementClick(event) {\n const target = DomHelper.up(event.target, '.b-sch-header-timeaxis-cell');\n\n if (target) {\n const index = target.dataset.tickIndex,\n position = target.parentElement.dataset.headerPosition,\n columnConfig = this.timeAxisViewModel.columnConfig[position][index]; // Skip same events with Grid context menu triggerEvent\n\n const contextMenu = this.grid.features.contextMenu;\n\n if (!contextMenu || event.type !== contextMenu.triggerEvent) {\n this.trigger('timeAxisHeader' + StringHelper.capitalize(event.type), {\n startDate: columnConfig.start,\n endDate: columnConfig.end,\n event\n });\n }\n }\n }", "function attachCellClickListeners() {\n $.each(grid[0].rows, function(i, row) {\n $.each(row.cells, function(j, cell) {\n $(cell).click(function changeColor() {\n var color = color_input();\n $(this).css({backgroundColor: color});\n });\n });\n });\n}", "function calendar() {\n var monthNames = [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"];\n\n var dayNames = [\"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\", \"Вс\"];\n\n var events = [\n {\n date: \"8/3/2013\",\n title: 'Двойной заказ',\n link: '',\n linkTarget: '_blank',\n color: '',\n //content: 'Два заказа, один на выезде, другой в городе ',\n class: 'tripleOutdore',\n displayMonthController: true,\n displayYearController: true,\n nMonths: 6\n }\n ];\n\n $('#calendari_lateral1').bic_calendar({\n //list of events in array\n events: events,\n //enable select\n enableSelect: true,\n //enable multi-select\n multiSelect: false, //set day names\n dayNames: dayNames,\n //set month names\n monthNames: monthNames,\n //show dayNames\n showDays: true,\n //show month controller\n displayMonthController: true,\n //show year controller\n displayYearController: false,\n //set ajax call\n reqAjax: {\n type: 'get',\n url: 'http://fierydream.com/js/someJSON/events.json'\n }\n });\n }", "function initCalendar() {\n var firstDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth(), 1);\n var lastDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth() + 1, 0);\n\n // Set headline content\n headline.innerHTML = formatDate(currentDateTime, 'headline');\n\n // Create elements for calendar\n var table = document.createElement('table')\n var thead = document.createElement('thead');\n var headRow = document.createElement('tr');\n\n // Fill header row with weekdays\n weekdays.forEach(function (weekDay) {\n var cell = document.createElement('th');\n cell.innerHTML = weekDay;\n headRow.appendChild(cell);\n });\n\n var tbody = document.createElement('tbody');\n\n // Calculate the first rendered day of the current view.\n // We always begin with a sunday, which can be before first day of month\n var firstDayOfCalendar = new Date(firstDayOfMonth);\n while (firstDayOfCalendar.getDay() != 0) {\n firstDayOfCalendar.setDate(firstDayOfCalendar.getDate() - 1);\n }\n\n // Fill the calendar month with elements\n var currentRenderDate = new Date(firstDayOfCalendar);\n var i = 0;\n var row = document.createElement('tr');\n var current = formatDate(currentDateTime, 'date');\n var cell;\n\n while (currentRenderDate <= lastDayOfMonth) {\n if (i == 7) {\n i = 0;\n tbody.appendChild(row);\n row = document.createElement('tr');\n }\n var currentString = formatDate(currentRenderDate, 'date');\n\n cell = document.createElement('td');\n cell.innerHTML = currentRenderDate.getDate().toString();\n // This is the selected date. Mark it\n if (currentString == current) {\n addClass(cell, 'selected');\n }\n // The day is not in the current month. Mark it\n if (currentRenderDate.getMonth() != lastDayOfMonth.getMonth()) {\n addClass(cell, 'outerMonth');\n }\n cell.setAttribute('data-date' , currentString);\n cell.addEventListener('click', onDateSelect);\n\n row.appendChild(cell);\n\n // Prepare next step\n currentRenderDate.setDate(currentRenderDate.getDate() + 1);\n i++;\n }\n\n // Each row should have the same amount of cells.\n // Create empty cells if needed.\n for (i; i < 7; i++) {\n cell = document.createElement('td');\n cell.innerHTML = '&nbsp;';\n row.appendChild(cell);\n }\n tbody.appendChild(row);\n\n thead.appendChild(headRow);\n table.appendChild(thead);\n table.appendChild(tbody);\n\n // Clear calendar and add new table\n calendar.innerHTML = '';\n calendar.appendChild(table);\n }", "accessibleFocusCell(cellSelector, options) {\n const me = this;\n cellSelector = me.normalizeCellContext(cellSelector);\n\n if (cellSelector.columnId === me.timeAxisColumn.id) ; else {\n return super.focusCell(cellSelector, options);\n }\n }", "function addClickListener(\n col,\n row,\n rows,\n employee\n) {\n const overlay = col.querySelector('.overlay');\n col.addEventListener('click', () => {\n if(overlay.style.display === '') {\n rows.forEach(column => column.querySelector('.overlay').style.display = '');\n resetTestimonials();\n overlay.style.display = 'none';\n row.querySelector('.testimonial-container').firstChild.style.backgroundColor = employee.color.bColor\n row.querySelector('.testimonial-container').firstChild.style.display = 'flex'\n setTestimonialContainerHTML(row, employee);\n col.firstChild.style.backgroundColor = pSBC(0.1, employee.color.bColor);\n col.firstChild.setAttribute('selected', true)\n }\n else{\n overlay.style.display = '';\n resetTestimonials();\n col.firstChild.removeAttribute('selected')\n }\n });\n}", "function cellDblClicked() {\n changeColor()\n}", "function DPC_onContainerClick(event){DatePickerControl.onContainerClick(event);}", "function initIndexCal() {\n initCal({\n height: \"75%\",\n initialView: 'dayGridMonth',\n dayMaxEventRows: true,\n moreLinkClick: \"popover\",\n customButtons: {\n customPrevButton: {\n text: '<',\n click: movePrev\n },\n customNextButton: {\n text: '>',\n click: moveNext\n },\n customTodayButton: {\n text: 'Today',\n click: moveToday\n }\n },\n headerToolbar: {\n left: 'customPrevButton,customNextButton customTodayButton',\n center: 'title',\n right: ''\n },\n eventSources: [\n {\n url: '/schedule/api/getSchedule',\n failure: function () {\n alert('there was an error while fetching Regular Duties!');\n },\n extraParams: function () {\n return {\n monthNum: appConfig.calDate.getMonth() + 1,\n year: appConfig.calDate.getFullYear(),\n allColors: 0\n };\n },\n eventDataTransform: displayFlaggedDuties\n },\n {\n url: '/breaks/api/getBreakDuties',\n failure: function () {\n alert('there was an error while fetching Break Duties!');\n },\n extraParams: function () {\n return {\n monthNum: appConfig.calDate.getMonth() + 1,\n year: appConfig.calDate.getFullYear(),\n allColors: 0\n };\n },\n }\n ],\n lazyFetching: true,\n fixedWeekCount: false,\n eventOrder: \"flagged, title\"\n });\n}", "function showCalendar(month, year) {\r\n\r\n\tlet firstDay = (new Date(year, month)).getDay();\r\n\tlet daysInMonth = 32 - new Date(year, month, 32).getDate();\r\n\r\n\tlet tbl = document.getElementById(\"calendar-body\"); // body of the calendar\r\n\r\n\t// clearing all previous cells\r\n\ttbl.innerHTML = \"\";\r\n\r\n\t// filing data about month and in the page via DOM.\r\n\tmonthAndYear.innerHTML = months[month] + \" \" + year;\r\n\tcurrentYear.value = year;\r\n\tcurrentMonth.value = month;\r\n\r\n\t// creating all cells\r\n\tlet date = 1;\r\n\tfor (let i = 0; i < 6; i++) {\r\n\t\t// creates a table row\r\n\t\tlet row = document.createElement(\"tr\");\r\n\r\n\t\t//creating individual cells, filing them up with data.\r\n\t\tfor (let j = 0; j < 7; j++) {\r\n\t\t\tif (i === 0 && j < firstDay) {\r\n\t\t\t\tlet cell = document.createElement(\"td\");\r\n\t\t\t\tlet cellText = document.createTextNode(\"\");\r\n\t\t\t\tcell.appendChild(cellText);\r\n\t\t\t\trow.appendChild(cell);\r\n\t\t\t}\r\n\t\t\telse if (date > daysInMonth) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tlet trueMonth = month + 1;//Because months start at 0, i need to +1 to compare.\r\n\t\t\t\tlet dateString = year + \"-\" + trueMonth.toString().padStart(2, 0) + \"-\" + date.toString().padStart(2, 0);\r\n\t\t\t\tlet cell = document.createElement(\"td\");\r\n\t\t\t\tlet cellText = document.createTextNode(date);\r\n\r\n\t\t\t\tif (date === today.getDate() && year === today.getFullYear() && month === today.getMonth()) {\r\n\t\t\t\t\tcell.classList.add('addBold');//Add bold to the current date\r\n\t\t\t\t\tselectedTd = cell;\r\n\t\t\t\t\tshowDisplay(dateString, date);\r\n\t\t\t\t} // color today's date\r\n\r\n\t\t\t\t//Check for dueDates matching with calendar dates and color them.\r\n\t\t\t\tfor (let i = 0; i < projects.length; i++) {\r\n\t\t\t\t\tif (dateString == projects[i].dueDate)\r\n\t\t\t\t\t\tcell.classList.add(\"bg-danger\");\r\n\t\t\t\t}\r\n\t\t\t\tfor (let j = 0; j < tasks.length; j++) {\r\n\t\t\t\t\tif (dateString == tasks[j].dueDate && !cell.classList.contains('bg-danger'))\r\n\t\t\t\t\t\tcell.classList.add(\"bg-warning\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.appendChild(cellText);\r\n\t\t\t\trow.appendChild(cell);\r\n\t\t\t\tdate++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttbl.appendChild(row); // appending each row into calendar body.\r\n\t}\r\n\tcreateMouseEvent();//Allows me to be able to click on a cell\r\n}", "function init_calendar() {\r\n\tcalendarSizeAjust();\r\n}", "function addDateToCalendar(row, day, dateValueOf){\n\t\n\tvar dataCol = $('<td>');\n\trow.append(dataCol);\n\n\tvar innerElem = $('<div>');\n\tdataCol.append(innerElem);\n\t\n\tinnerElem.append('<span class=\"celldate-number\">' + (day) +'</span>');\n\tinnerElem.data('itemdata', dateValueOf);\n\tinnerElem.addClass('celldate-container');\n}" ]
[ "0.6556007", "0.6360352", "0.6203196", "0.6168091", "0.60323596", "0.6012475", "0.5998993", "0.5949617", "0.59220207", "0.59154946", "0.59028995", "0.5900782", "0.58812726", "0.58762604", "0.58457005", "0.5833754", "0.58298236", "0.5810187", "0.58082515", "0.58016896", "0.58004785", "0.57829654", "0.57726", "0.5756982", "0.5742861", "0.573934", "0.5737934", "0.5706832", "0.56677556", "0.5626275", "0.5624253", "0.56204456", "0.56204456", "0.5609782", "0.5609782", "0.5609782", "0.5609782", "0.5606405", "0.56046337", "0.556659", "0.5559055", "0.5553013", "0.5498633", "0.54982823", "0.54911286", "0.5479618", "0.54752433", "0.5469954", "0.54692096", "0.54431945", "0.5434687", "0.5434687", "0.54278255", "0.54214185", "0.542019", "0.5413985", "0.54103065", "0.54103065", "0.54094535", "0.54094535", "0.54094535", "0.54094535", "0.54059625", "0.5405482", "0.54013306", "0.53994095", "0.53905606", "0.53864056", "0.53864056", "0.5385761", "0.5380763", "0.53753585", "0.53744566", "0.53706086", "0.5362072", "0.5349962", "0.53491396", "0.53421956", "0.53413486", "0.5336425", "0.53272784", "0.53259", "0.53249705", "0.53174585", "0.5316327", "0.53113794", "0.5308687", "0.5298109", "0.5294677", "0.5293706", "0.52874935", "0.5281786", "0.5279365", "0.5279342", "0.52793086", "0.5278064", "0.52733904", "0.5273376", "0.5264155", "0.5262239", "0.52614105" ]
0.0
-1
Display report based on clicked date
function displayReports(displayDay) { let displayYear = selectYear.value; let displayMonth = parseInt(selectMonth.value) + 1; if(displayMonth < 10){ displayMonth = ("0" + displayMonth); } if(displayDay < 10){ displayDay = ("0" + displayDay); } let displayDate = (displayYear + "-" + displayMonth + "-" + displayDay); let URL = "http://localhost:3004/weather/"+displayYear+"/"+displayMonth+"/"+displayDay; let buttonDiv = document.getElementById("timeButtons"); $.get(URL, function(data){ let table = document.getElementById("reportWholeTable"); if(data.length==0){ // hide table table.style.display = 'none'; buttonDiv.innerHTML = "No hay informes meteorológicos disponibles hoy"; document.getElementById("displayTableAnnouncement").innerHTML = ''; } else{ table.style.display = ''; data.forEach(element => { let button = document.createElement("button"); let textnode = document.createTextNode(element.time); button.id=element.id; button.classList.add("btn"); button.classList.add("btn-outline-primary"); button.addEventListener("click", displayByTime); button.appendChild(textnode); buttonDiv.appendChild(button); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateReport(event) {\n \n cleanReport();\n \n // If the arrows where clicked, than update the arrows' timestamp\n updateTimeSpan(event);\n \n // extract report query from the DOM\n var reportQ = getReportQueryFromControlPanel();\n \n // write time span in human readable way\n var titleFrom = moment.unix(reportQ.start).format('YY MM DD HH:mm');\n var titleTo = moment.unix(reportQ.end).format('YY MM DD HH:mm');\n var verbalTimeSpanFormat = $(\"[name='radio-span']:checked\").data('verbal-format');\n var humanReadableTimespan = moment.unix(reportQ.end).format(verbalTimeSpanFormat);\n $('#report-title').html( /*titleFrom + '</br>' +*/ humanReadableTimespan /*+ '</br>' + titleTo*/ );\n\n // query data and update report\n getDataAndPopulateReport(reportQ);\n}", "function dateDisplay()\n{\nduration= opener.repDuration;\nrep_Period= opener.currRepEnd;\nweek=7;\ndate= new Date(curr_date);\nsel_day=date.getDate();\nend_date= getEndDate(date);\ndate.setDate(end_date);\nend_day=date.getDay();\ndate.setDate(1);\nstart_day=date.getDay();\nrow=0;\nend_week=week-end_day;\ndocument.writeln(\"<tr>\"); \nfor (var odday=0;odday<start_day;odday++,row++)\n{\ndocument.writeln(\"<td class='\"+css[3]+\"'>&nbsp;</td>\");\n}\n\nfor (var day=1;day<=end_date;day++,row++)\n{\nif(row == week)\n{\ndocument.writeln(\"</tr> <tr align='right'> \");\nrow=0;\n}\ndocument.writeln(\"<td class='\"+getCssClass(day,duration,date,rep_Period)+\"'>\");\n\nif(isWeekend(day,date))\n{\ndocument.writeln(day+\"</td>\");\n}\nelse{\ndocument.writeln(\"<a href='javascript:clickDatePeriod(\"+day+\",\"+date.getMonth()+\",\"+date.getFullYear()+\");' >\"+day+\"</a></td>\");\n}\n\n}\n\nfor (var end=0;end<(end_week-1);end++)\n{\ndocument.writeln(\"<td class='\"+css[3]+\"'>&nbsp;</td>\");\n}\ndocument.writeln(\"</tr>\"); \n}", "function daily_office() {\n _daily_report_(WORK_LIST,OFFICE);\n}", "function onDateSelection(date) {\n currentDate = date;\n $('.date-selection').val(dateSlashString(date));\n // Update daily data\n getDailyData().done(updateDataByTime);\n // Update display data\n updateVisualData();\n document.dispatchEvent(new CustomEvent('datechanged'));\n}", "function ReportDate(obj) {\n this.obj = obj;\n if ( 'datepicker' in this.obj )\n this.obj.datepicker({maxDate:new Date()}); // enable datepicker\n else\n console.log('failed to load datepicker()');\n}", "function calDisplay()\n{\nweek=7;\nselDate= new Date(opener.user_sel_val_holder);\ntoday = new Date(arguments[0]);\ncurrentVal = new Date(opener.cal_val_holder);\n// as of Danube, PT needs all the dates, including weekend dates, to be\n// hyperlinked in the Calendar for its Date type attributes, whereas PD\n// doesn't want weekend dates to be hyperlinked.\nhyperLinkWeekEndDates = arguments[1] == null ? false : arguments[1];\ncurr_day= today.getDate();\nsel_day= selDate.getDate();\nend_date= getEndDate(currentVal);\ncurrentVal.setDate(end_date);\nend_day=currentVal.getDay();\ncurrentVal.setDate(1);\nstart_day=currentVal.getDay();\nrow=0;\nend_week=week-end_day;\ndocument.writeln(\"<tr>\");\nfor (var odday=0;odday<start_day;odday++,row++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\n\nfor (var day=1;day<=end_date;day++,row++)\n{\nif(row == week)\n{\ndocument.writeln(\"</tr> <tr> \");\nrow=0;\n}\ndocument.writeln(\"<td class=\\\"calendarday\\\"\");\nif(curr_day == day && currentVal.getMonth() == today.getMonth() && currentVal.getFullYear() == today.getFullYear())\ndocument.writeln(\" id=\\\"today\\\" > \");\nelse if(sel_day == day && currentVal.getMonth() == selDate.getMonth() && currentVal.getFullYear() == selDate.getFullYear())\ndocument.writeln(\" id=\\\"selectedDate\\\" > \");\nelse\ndocument.writeln(\" > \");\n\nif(isWeekend(day,currentVal) && !hyperLinkWeekEndDates)\ndocument.writeln(day+\"</td>\");\nelse\n if(sel_day == day)\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\"; title=\\\"\"+ arguments[2]+\" \\\" >\"+day+\"</a></td>\");\n else\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\" >\"+day+\"</a></td>\");\n}\n\nfor (var end=0;end<(end_week-1);end++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\ndocument.writeln(\"</tr>\");\n\n\n}", "function actionDateSelectedForAgendaManage(){\n\n\t}", "function show_today(){\n period=1;\n draw_building_chart(period,variable);\n}", "function dateRendered() {\r\n \"use strict\";\r\n //define all variables\r\n var todaysDate;\r\n\r\n //get date and make pretty\r\n todaysDate = new Date();\r\n todaysDate = todaysDate.toDateString();\r\n\r\n //display date\r\n document.write(\"Rendered: \" + todaysDate);\r\n}", "function dayClick(date, jsEvent, view)\n {\n\n alert('Clicked on: ' + date.format());\n\n // alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);\n\n // alert('Current view: ' + view.name);\n\n // change the day's background color just for fun\n // $(this).css('background-color', 'red');\n }", "function handleClick(){\n // create a variable to hold date data\n let date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n\n // Checking to see if date was entered\n if (date) {\n // filter the data to show data that matches date that was used\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n // Rebuild the table using the filtered data\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n }", "function myDatePicker_dateSelected(page){\n page.children.flexLayout1.children.textFlex.children.dateLabel.text = definedDate;\n}", "function showDate()\r\n{\r\n\tvar today=new Date();\r\n\tvar displayDate = checkTime(today.getDate()) + '/' + checkTime(today.getMonth()+1) + '/' + today.getFullYear();\r\n\t$(\"#menu-date\").html(displayDate);\r\n}", "function singleClickWeeklyFinalReportRender(graphImage){\n\t\trunReportAnimation(100); //of Step 11 which completed the data processing\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\tif(graphImage && graphImage != ''){\n\t\t\twindow.localStorage.graphImageDataWeekly = graphImage;\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t}\n\n\n\t\tvar graphRenderSectionContent = '';\n\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\tif(fromDate != toDate){\n\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t}\n\t else{ //Render graph only if report is for a day\n\n\t if(graphImage){\n\n\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t graphRenderSectionContent = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t '</div>'+\n\t '<div class=\"weeklyGraph\">'+\n\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\t }\n\n\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\n\t //Quick Summary Content\n\t var quickSummaryRendererContent = '';\n\n\t var a = 0;\n\t while(reportInfoExtras[a]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t a++;\n\t }\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\n\t var b = 1; //first one contains total paid\n\t while(completeReportInfo[b]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t b++;\n\t }\n\n\n\t //Sales by Billing Modes Content\n\t var salesByBillingModeRenderContent = '';\n\t var c = 0;\n\t var billSharePercentage = 0;\n\t while(detailedListByBillingMode[c]){\n\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t c++;\n\t }\n\n\t var salesByBillingModeRenderContentFinal = '';\n\t if(salesByBillingModeRenderContent != ''){\n\t salesByBillingModeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByBillingModeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\t //Sales by Payment Types Content\n\t var salesByPaymentTypeRenderContent = '';\n\t var d = 0;\n\t var paymentSharePercentage = 0;\n\t while(detailedListByPaymentMode[d]){\n\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t d++;\n\t }\n\n\t var salesByPaymentTypeRenderContentFinal = '';\n\t if(salesByPaymentTypeRenderContent != ''){\n\t salesByPaymentTypeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByPaymentTypeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\n\n\n\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px 25px;text-align:center}.factsBox{margin-right: 5px; width:20%;display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:30%;display:inline-block;text-align:center;float:right;margin-top:30px}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:65%;display:inline-block}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t \n\n\t var finalReport_emailContent = '<html>'+cssData+\n\t\t '<body>'+\n\t\t '<div class=\"mainHeader\">'+\n\t\t '<div class=\"headerLeftBox\">'+\n\t\t '<div id=\"logo\">'+\n\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t '</div>'+\n\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t '</div>'+\n\t\t '<div class=\"headerRightBox\">'+\n\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '<div class=\"introFacts\">'+\n\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t '<div class=\"factsArea\">'+\n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t '</div>'+\n\t\t '</div>'+graphRenderSectionContent+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"tableQuick\">'+\n\t\t '<table style=\"width: 100%\">'+\n\t\t '<col style=\"width: 70%\">'+\n\t\t '<col style=\"width: 30%\">'+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t quickSummaryRendererContent+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t '</table>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t salesByBillingModeRenderContentFinal+\n\t\t salesByPaymentTypeRenderContentFinal+\n\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t '<p class=\"footerNote\">www.accelerate.net.in | [email protected]</p>'+\n\t\t '</div>'+\n\t\t '</body>'+\n\t\t '<html>';\n\t}", "function Calendar_OnDateSelected(sender, eventArgs) {\r\n // limpa o span das datas\t \r\n var dtSelecionada = document.getElementById(\"dtSelecionada\");\r\n dtSelecionada.innerHTML = \"\";\r\n // obtém a referencia para o calendario\r\n var calendario = $find(IdCalendario);\r\n // obtém as datas selecionadas\r\n var dates = calendario.get_selectedDates();\r\n\r\n // para cada data..\r\n for (var i = 0; i < dates.length; i++) {\r\n var date = dates[i];\r\n var data = date[2] + \"/\" + date[1] + \"/\" + date[0];\r\n data += \" \"; // adiciona um espaco ao final para dar espaco entre as datas\r\n dtSelecionada.innerHTML += data;\r\n }\r\n}", "function _daily_report_(ListName,Destination)\n{\n var listId = _list_by_name_(ListName);\n if (!listId) {\n Logger.log(\"No such list\");\n return;\n }\n var now = new Date();\n var lookBack2 = (now.getDay() == 1) ? -4 : -2;\n var later = _days_away_(1);\n var before = _days_away_(-1);\n var before2 = _days_away_(lookBack2);\n var i, n, c, t, tasks, items;\n var message = {\n to: Destination,\n subject: \"Daily Task Status: \"+ListName,\n name: \"Happy Tasks Robot\",\n htmlBody: \"<div STYLE=\\\"background-color:rgba(1,.9,.4,.9);\\\"><table>\\n\",\n body: \"Task report for \"+now+\":\\n\"\n };\n //Logger.log(before.toISOString());\n // past week\n tasks = Tasks.Tasks.list(listId, {'showCompleted':true, 'dueMin':before.toISOString(), 'dueMax': now.toISOString()});\n items = tasks.getItems();\n message = _add_to_message_(message,items,\"Today's Scheduled Tasks\");\n tasks = Tasks.Tasks.list(listId, {'showCompleted':true, 'dueMin':before2.toISOString(), 'dueMax': before.toISOString()});\n items = tasks.getItems();\n message = _add_to_message_(message,items,\"Yesterday's Schedule\");\n message['htmlBody'] += _footer_text_();\n message['htmlBody'] += \"</table>\\n\";\n message['htmlBody'] += \"</div>\";\n //\n MailApp.sendEmail(message);\n Logger.log('Sent email:\\n'+message['body']);\n Logger.log('Sent email:\\n'+message['htmlBody']);\n}", "function pickedDate(date) {\n if (date) {\n if ($('[id$=TB_Print_Date2]').val() == '' || $('[id$=TB_Print_Date2]').val() == 'To Date') { $('[id$=TB_Print_Date2]').val(date) }\n if ($('[id$=TB_Print_Date2]').val() < date) { $('[id$=TB_Print_Date2]').val(date) }\n if ($('[id$=TB_Print_Date1]').val() != 'From Date') { $('[id$=TB_Print_Date1]').css('color', 'black'); }\n if ($('[id$=TB_Print_Date2]').val() != 'To Date') { $('[id$=TB_Print_Date2]').css('color', 'black'); }\n }\n }", "function displayDate() {\n var currentDay = new Date();\n var month;\n var date = currentDay.getDate();\n var year = currentDay.getFullYear();\n \n switch (currentDay.getMonth()) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n }\n var dateDiv = document.getElementById('date');\n dateDiv.innerText = month + \" \" + date + \", \" + year;\n }", "function onReportClick() {\n\tcommonFunctions.sendScreenshot();\n}", "function getDailyView() { return 'daily'; }", "function showEvents() {\n for (var i=0;i<Events.length;i++) {\n //if no date of event was given, show a message instead of date\n if(Events[i].dateOfEvent==undefined) Events[i].dateOfEvent=\" -n/a- \";\n prettyVisualization(i);\n } console.log(\"\\n\");\n}", "backlogRecords(date){\n \n }", "function showDate(choose){\n var chooseTimeZone = choose;\n chooseTimeZone.setMinutes(chooseTimeZone.getMinutes() - timeZoneToday);\n var local = $('#local').data('local')\n var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\n $('#date-choose').html(chooseTimeZone.toLocaleDateString(local, options));\n if (dateOpen.length){\n $.each(dateOpen, function(i, d) {\n var day = new Date(d.day.date.slice(0, 10));\n if (choose.getDate() == day.getDate() && choose.getMonth() == day.getMonth() && choose.getFullYear() == day.getFullYear()){\n $('#nb-places').html(1000 - d.nbVisitor);\n return false;\n }\n $('#nb-places').html('1000');\n });\n } else {\n $('#nb-places').html('1000');\n }\n $('#choose').css('display', 'block');\n // \n if ((choose.getDate() == today.getDate() && choose.getMonth() == today.getMonth() && choose.getFullYear() == today.getFullYear() && today.getHours() > 13)){\n $('#button-day').css('display', 'none');\n } else {\n $('#button-day').css('display', 'inline-block');\n }\n $('#button-half-day').css('display', 'inline-block');\n }", "function handleSearchButtonClickDate() {\n // Format the user's search by removing leading and trailing whitespace\n var filterDate = $dateInput.value.trim().toLowerCase();\n\n // Set ufoSightings to an array of all dataSet whose \"date\" matches the filter\n ufoSightings = dataSet.filter(function(sightings) {\n var sightingDate = sightings.date.toLowerCase();\n\n // If true, add the sighting to the filterState, otherwise don't add it to filterState\n return sightingDate === filterDate;\n });\n renderTable();\n}", "function handleClick() {\n //using d3 js library, Data-Driven Documents (D3 for short),\n // we're going to use D3 to handle an action from a user, such as a button click\n //The selector string is the item we're telling D3.js to look for.\n // once we get what we're looking for, .property(\"value\") tells js to actually grab that information and hold it in the \"date\" variable.\n let date = d3.select(\"#datetime\").property(\"value\");\n\n let filteredData = tableData;\n \n if (date) {\n // We want JavaScript to check for a date. If one is present, we want it to return only the data with that date\n //triple equal signs means, date in the table has to match our filter exactly\n filteredData = filteredData.filter(row => row.datetime === date);\n //It's basically saying, \"Show only the rows where the date is equal to the date filter we created above.\n };\n // Rebuild the table using the filtered data\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n}", "function fillHistoryReport(visits) {\n\t$('#history-pane tbody').empty();\n\t$('#table-history').trigger('destroy.pager');\n\t$(\"#table-history\").trigger(\"update\"); //trigger an update after emptying\n\t//pad(number) function adds zeros in front of number, used to get consistent date / time display. \n\tfunction pad (number) {\n\t\treturn (\"00\" + number).slice(-2);\n\t}\n\n\tif(visits.length === 0) {\n\t\t$('#history-pane #visits').hide();\n\t\t$('#history-pane #no-visit').show();\n\t} else {\n\t\t$('#history-pane #no-visit').hide();\n\t\t$('#history-pane #visits').show();\n\t\t//for each visit found in the log add a row to the table\n\t\tvisits.forEach(function (visitElement) {\n\t\t\tif(visitElement) {\n\t\t\t\t//prepare the data for display\n\t\t\t\tvar visit = {};\n\t\t\t\t\n\t\t\t\tvar visitDate = new Date(+visitElement.timestamp);\n\t\t\t\tvisit.date = visitDate.getFullYear() + \"-\"+ \n\t\t\t\t\t\t\tpad((visitDate.getMonth()+1))+ \"-\" +\n\t\t\t\t\t\t\tpad(visitDate.getDate())+\" \"+\n\t\t\t\t\t\t\tpad(visitDate.getHours())+\":\"+\n\t\t\t\t\t\t\tpad(visitDate.getMinutes());\n\n\t\t\t\tvisit.title = decodeURI(visitElement.title);\n\t\t\t\t//visit.url = $('<a>', {'href': visitElement.url, 'text': removeUrlPrefix(visitElement.url)});\n\t\t\t\t//visit.url.attr(\"target\",\"_blank\");\n\n\t\t\t\t//create a row that will hold the data\n\t\t\t\tvar line = $('<tr>'); \n\t\t\t\t\n\t\t\t\t//for each attribute of the visit, create a table data element and put it in the row\n\t\t\t\tfor (var name in visit) {\n\t\t\t\t\tif (visit.hasOwnProperty(name)) {\n\t\t\t\t\t\tline.append($('<td>', {'text': visit[name]}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar url_cell=$('<td>').append($('<a>', {'href': decodeURI(visitElement.url), 'text': decodeURI(removeUrlPrefix(visitElement.url)), 'target':\"_blank\"}));\n\t\t\t\tline.append(url_cell);\n\t\t\t\t\n\t\t\t\t//append the line to the table\n\t\t\t\t$('#table-history')\n\t\t\t\t\t.find('tbody').append(line)\n\t\t\t\t\t.trigger('addRows',[$(line)]);\n\t\t\t}\n\t\t});\n\t\t$('#table-history').tablesorterPager(pagerOptions);\n\t\t$(\"#table-history\").trigger(\"update\"); //trigger update so that tablesorter reloads the table\n\t\t$(\".tablesorter-filter\").addClass(\"form-control input-md\");\n\t}\n}", "function renderDate() {\n dateDiv.text(todaysDate)\n}", "function launchReport(script) {\n Launch(script, 'Report', 800, 550);\n}", "function displayReport(report){\n var data = [];\n for(var key in report){\n data.push([Number(key), report[key]]);\n }\n data.sort(function(d){return d[0]});\n var report = d3.select(\"#report\");\n report.selectAll('*').remove();\n var title = report.append(\"h3\");\n var total = 0;\n report.selectAll('p')\n .data(data)\n .enter()\n .append('p')\n .text(function(d){\n // console.log(d[1])\n var weekSum = 0;\n for(var item of d[1]){\n weekSum += item.Amount;\n }\n total += weekSum;\n return `Week Starting ${weekToDate(d[0])}: $${weekSum}`;\n })\n var titleTxt\n if(!currentReport.all){\n titleTxt = `${window.myName}'s Total (${currentReport.start} to ${currentReport.end}): $${total}`;\n }\n else{\n titleTxt = `${window.myName}'s Total Expenses: $${total}`;\n }\n title.text(titleTxt);\n}", "function showEvent(day,month,year){\n dia_ult = day;\n mes_ult = month;\n ano_ult = year;\n showListCalen(4,day,month,year);\n}", "function displayDateSearch() {\n var template = HtmlService.createTemplateFromFile('displayDateSearch');\n var rawDate = SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(8, 2).getValue().toString();\n var date = rawDate.substring(0, 15);\n var headerString = '🔎 Search results for ' + date;\n template.automationInfo = searchDate();\n var html = template.evaluate().setTitle('🔎 Search by Date Results')\n .setWidth(800)\n .setHeight(800);\n SpreadsheetApp.getUi() \n .showModalDialog(html, headerString);\n}", "function handleClick(){\n d3.event.preventDefault()\n var date = d3.select(\"#datetime\").property(\"value\");\n var filterData = tableData;\n if (date){\n filterData = filterData.filter((row) => row.datetime == date);\n }\n buildTable(filterData);\n}", "function dateHandler() {\n\n d3.event.preventDefault();\n\n console.log(dateInput.property(\"value\"));\n\n // Create table showing filtered data\n var filterTable = tableData.filter(alienSighting => alienSighting.datetime === dateInput.property(\"value\"));\n\n // Display the filtered table\n alienData(filterTable);\n}", "function showTypeAndDate(){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar $reportHeaderMailingSelectorCount = $e.find(\".reportHeader-mailingSelector .count\");\n\t\tvar $reportHeaderMailingSelectorNeedS = $e.find(\".reportHeader-mailingSelector .needS\");\n\t\tvar $reportHeaderMailingSelectorType = $e.find(\".reportHeader-mailingSelector .type\");\n\t\tvar $reportHeaderMailingSelectorDate = $e.find(\".reportHeader-mailingSelector .date\");\n\t\tvar $reportHeaderPeriod = $e.find(\".reportHeader-period\");\n\t\tvar $reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\tvar setType = smr.getSetAndType(reportType);\n\t\tvar count = setType.set.list().length;\n\t\t//show mailings\t\t\n\t\tif(reportType == smr.REPORT_TYPE.DELIVERABILITY){\n\t\t\tvar title = setType.type;\n\t\t\tif(setType.type==\"VSG\") title = \"Mailing Server Group\";\n\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<span class='type'>\"+title+\"</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t (count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t}else if(reportType == smr.REPORT_TYPE.DELIVERABILITYDOMAINS){\n\t\t\tif(count==0){\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"All Mailing Server Groups\");\n\t\t\t}else{\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\"<span class='type'>Mailing Server Group</span>\" +\n\t\t\t\t\t\t(count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.AUDIENCE){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((selectorList[0].name && selectorList[0].name.length>30) ?selectorList[0].name.substring(0,27)+\"...\" : selectorList[0].name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.USERINSIGHT){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tvar curNum = setType.set.attr(\"UserInsightShowIndex\") || 1;\n\t\t\tvar item = selectorList[curNum-1];\n\t\t\tif(item){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((item.name && item.name.length>30) ?item.name.substring(0,27)+\"...\" : item.name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",item.name)\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(item.email);\n\t\t\t\t//hide the dateAdded 2013-09-16\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(item.dateAdded);\n\t\t\t\tvar renderObj = {\"currentNum\":curNum, \"total\": selectorList.length , \"hasControl\":(selectorList.length>1), \"haveNext\":(curNum<selectorList.length),\"havePrev\":(curNum>1)};\n\t\t\t\tvar html = smr.render(\"tmpl-reportHeader-userPage\",renderObj);\n\t\t\t\t$e.find(\".reportHeader-findUser .user-page\").html(html);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(\"no email\");\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(\"-\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.ABTEST){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else{\n\t\t\tvar selectorType = setType.type;\n\t\t\tvar list = setType.set.list();\n\t\t\tif(selectorType==\"Campaign\"){\n\t\t\t\tvar includeSubOrg = setType.set.attr(\"includeSubOrg\");\n\t\t\t\tif(includeSubOrg){\n\t\t\t\t\tvar tempList = [];\n\t\t\t\t\tvar tempName = {};\n\t\t\t\t\tfor(var i=0;i<list.length;i++){\n\t\t\t\t\t\tif(tempName[list[i].name]) continue;\n\t\t\t\t\t\ttempList.push(list[i]);\n\t\t\t\t\t\ttempName[list[i].name] = true;\n\t\t\t\t\t}\n\t\t\t\t\tcount = tempList.length;\n\t\t\t\t}\n\t\t\t}else if(selectorType==\"Tag\"){\n\t\t\t\tvar tempList = [];\n\t\t\t\tvar tempName = {};\n\t\t\t\t$.each(list,function(i,temp){\n\t\t\t\t\tif(tempName[temp.pid]) return;\n\t\t\t\t\ttempList.push(temp);\n\t\t\t\t\ttempName[temp.pid] = true;\n\t\t\t\t});\n\t\t\t\tcount = tempList.length;\n\t\t\t}\n\t\t\t\n\t\t\t$reportHeaderMailingSelectorCount.html(count);\n\t\t\tif(count != 1){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.show();\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.hide();\n\t\t\t}\n\t\t\tif(reportType==smr.REPORT_TYPE.DOMAINDRILLDOWN){\n\t\t\t\tselectorType = setType.set.attr(\"domainType\");\n\t\t\t\tif(selectorType == \"VSG\") selectorType=\"Mailing Server Group\" ;\n\t\t\t}\n\t\t\t$reportHeaderMailingSelectorType.html(selectorType);\n\t\t}\n\t\t\n\t\tif(setType.set.attr(\"limit\")){\n\t\t\t$reportHeaderPeriod.show();\n\t\t\tvar dateRange = setType.set.period().getDateRange(); \n\t\t\t\n\t\t\tif(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\t\tif(smr.allDateRangeShow){\n\t\t\t\t\t$reportHeaderDate.html(\"All\");\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t\tvar list = setType.set.list();\n\t\t\t\tvar mailingType = list[0]? list[0].mailingType: \"Batch\";\n\t\t\t\tif(mailingType != \"Transactional\" && mailingType != \"transactional\" && mailingType != \"Program\" && mailingType != \"program\"){\n\t\t\t\t\t$reportHeaderDate.parent().hide();\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.parent().show();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(reportType == \"userInsight\"){\n\t\t\t\t\tvar $reportSelectDate = $(\".reportHeader-selectdate\");\n\t\t\t\t\t$reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\t\t\t\tvar period = setType.set.period();\n\t\t\t\t\tif(period.dateType==\"inCustomDateRange\"){\n\t\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$reportHeaderDate.html($reportSelectDate.find(\"select.dateTypeSelect option[value='\"+period.dateType+\"']\").html());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$reportHeaderPeriod.hide();\n\t\t}\n\t}", "function handleClick() {\n var date = d3.select(\"#datetime\").property(\"value\");\n var filterData = tableData\n if (date) {\n filterData = filterData.filter(row => row.datetime === date);\n }\n buildTable(filterData);\n}", "function getSelectedDate()\n{\nreturn curr_date;\n}", "function displayEvent() {\n $('tbody.event-calendar td').on('click', function(e) {\n \n $('.day-event').slideUp('fast');\n var monthEvent = $(this).attr('date-month');\n var yearEvent = $(this).attr('date-year');\n var dayEvent = $(this).text();\n if($('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').css('display') == 'none')\n $('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').slideDown('fast');\n });\n }", "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}", "function display() {\n var thisDay = today.getDay();// lấy thứ theo số thứ tự của mảng 0-6, lưu giá trị hiển thị\n var thisMonth = today.getMonth();// lấy tháng theo index 0-11, lưu giá trị hiển thị\n var thisYear = today.getFullYear();// lấy năm đủ 4 chữ số, lưu giá trị hiển thị\n var thisDate = today.getDate();// lấy ra ngày 1-31, lưu giá trị hiển thị\n var nowDate = now.getDate();// lay ngay\n console.log(nowDate);\n var nowMonth = now.getMonth();// lay thang\n var nowYear = now.getFullYear();// lay nam\n var text = \"\";\n\n if (nowYear % 4 == 0) month_day[1]=29;\n console.log(nowYear);\n var first_date = new Date(thisYear, thisMonth, 1);// trả về kết quả đầy đủ h, ngày 1 tháng năm ở thời điểm được trỏ tới\n var first_day = first_date.getDay();// trả về thứ của ngày mùng 1 = so\n console.log(first_day);\n title = month_name[thisMonth] + ' ' + thisYear;\n document.getElementById('title').innerHTML = title;\n text += '<table border = 2 style=\"height: 300px;width: 440px;\">';\n text += '<tr><td style=\"color: orangered;\">' + \"Sunday\" + '</td><td style=\"color: orangered;\">' + \"Monday\" + '</td><td style=\"color: orangered;\">' + \"Tuesday\" + '</td><td style=\"color: orangered;\">' + \"Wednesday\" + '</td><td style=\"color: orangered;\">' + \"Thursday\" + '</td><td style=\"color: orangered;\">' + \"Friday\" + '</td><td style=\"color: orangered;\">' + \"Saturday\" + '</td></tr>';\n text+='<tr>';\n for (i = 0; i < first_day; i++) {\n console.log(i);\n console.log(first_day);\n text += \"<td> </td>\";\n }\n date = 1;\n while (date <= month_day[nowMonth]){\n for (j = first_day; j < 7; j++) {\n if ( date <= month_day[thisMonth]){\n if (nowDate == date && nowMonth == thisMonth && nowYear == thisYear){\n text +='<td id = \"nowDate\"><b style=\"color: orangered;\">' + date + '</b></td>';\n }else {\n text +='<td class = \"date\">' + date + '</td>';\n }\n } else {\n text += \"&nbsp\";\n }\n date++;\n }\n text += '</tr>';\n first_day = 0;\n }\n text += '</table>';\n document.getElementById(\"display\").innerHTML = text;\n}", "function myDayClickHandler(eventObj) {\n // Get the Date of the day that was clicked from the event object\n var date = eventObj.data.calDayDate;\n // store date in our global js variable for access later\n clickDate = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate();\n // open our add event dialog\n $('#add-event-form').dialog('open');\n }", "function selectDate(e){\r\n\t\t\tmainEvt.target.value = addLeadingZero(e.target.textContent)+\".\"+addLeadingZero(jcalendar_month.value)+\".\"+jcalendar_year.value;\r\n\t\t\tJC.style.display = \"none\";\r\n\t\t}", "function View() {\n var self = this;\n this.currentDate = new Date();\n this.currentReport = {\n needToPickupList: [],\n absenceList: [],\n pickedUpList: []\n };\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "function showdate() {\r\n \tdocument.getElementById(\"eventFunctions\").innerHTML = Date()\r\n }", "function clickedButton (){\n \n let currentDay= document.getElementById('date');\n if(currentDay.style.display==='none'){\n currentDay.style.display= 'block';\n }else {\n currentDay.style.display='none';\n }\n /*For testing purposes\n console.log('click test2'); */\n }", "function populateMe(date, days) {\n\t\n\ttodayVisible = false;\n\tvar startingSunday = new Date();\n\tif (firstofmonth==0) {\n\t\tstartingSunday=firstofmonth;\n\t\t//filldates(startingSunday);\n\t}\n\telse {\n\t\tstartingSundayTemp = date_minus_days(date, days);\n\t\tstartingSunday = new Date(startingSundayTemp);\n\t}\n\tdateDate = new Date(date);\n\tdateDateInt = new Date(date).getDate();\n\tdateYear = new Date(date).getFullYear();\n\tdateMonthInt = new Date(date).getMonth();\n\tdateMonthName = monthNames[dateMonthInt];\n\tdateDayInt = new Date(date).getDay();\n\tdateDayName = dayNames[dateDayInt];\n\t//console.log(\"date Year: \"+dateYear);\n\t//console.log(\"dateMonthInt: \"+dateMonthInt);\n\t//console.log(\"dateMonthName: \"+dateMonthName);\n\t\n\t\n\t//populate the calendar view given info\n\tdocument.getElementById(\"monthDisplay\").innerHTML = dateMonthName+\", \"+dateYear;\n\t\n\tvar sc1 = \"square-\";\n\tvar sc2 = \"-date\";\n\tvar num = new Date(startingSunday);\n\tvar numInt;\n\t//console.log(\"Num: \"+num);\n\tfor (var i=0;i<42;i++) {\n\t\tvar str = sc1+i+sc2;\n\t\tvar numTemp = new Date(num);\n\t\tnumInt = new Date(numTemp).getDate();\n\t\tdocument.getElementById(str).innerHTML = numInt;\n\t\tvar numX = String(num);\n\t\tvar numXX = numX.substring(0, numX.length - 24);\n\t\tvar todayX = String(today);\n\t\tvar todayXX = todayX.substring(0, todayX.length - 24);\n\t\t/*if ( (numInt==currentDate) && ((numXX)==(todayXX)) ){\n\t\t\t//console.log('changing color for today');\n\t\t\tcolorSelectedDate(i);\n\t\t\ttodayVisible = true;\n\t\t\t\n\t\t}*/\n\t\tnum = date_plus_days(numTemp, 1);\n\t}\n\tvar data = [currentDay, currentMonth, currentDate, currentYear];\n\tpopulateEventMe(data);\n}", "function onDatePick() {\n calRadioGroupSelectItem(\"view-field\", \"custom-range\");\n refreshHtml();\n}", "function showDate() {\n\n let tempCalendarDate = new Date(theYear, theMonth, 1);\n let tempYear = tempCalendarDate.getFullYear();\n let tempDate = tempCalendarDate.getDate();\n let tempDay = tempCalendarDate.getDay();\n let tempMonth = tempCalendarDate.getMonth();\n\n dayDiv.innerHTML = \"<!--innerHTML-->\"\n\n\n loopWeekDady: for (let i = 0; i < 6; i++) {\n\n\n // make there is enough rows for showing weeks.\n // porvide an extra row when the month span 6 weeks\n if (i == 5) {\n document.getElementById(\"id-dates\").style.height = \"270px\";\n document.getElementById(\"calendar\").style.height = \"405px\";\n\n\n\n\n } else {\n document.getElementById(\"id-dates\").style.height = \"225px\";\n document.getElementById(\"calendar\").style.height = \"360px\";\n }\n\n\n\n loopDate: for (let j = 0; j < 7; j++) {\n\n\n let tempId = \"\" + tempYear + \"y\" + tempMonth + \"m\" + tempDate + \"d\";\n\n\n if (tempDay == j) {\n dayDiv.innerHTML = dayDiv.innerHTML + \"<div \" + \"id=\" + tempId + \" class= \\\"small-box\\\" \" + \" onclick=\\\"chooseDate('\" + tempId + \"')\\\"\" + \" data-value=\" + \"\\\"\" + tempDate + \"\\\" \" + \">\" + \"<p>\" + tempDate + \"</p\" +\n \" class= \\\"date\\\" \" + \">\" + \"</div>\";\n\n tempCalendarDate.setDate(tempDate + 1);\n tempDay = tempCalendarDate.getDay();\n tempDate = tempCalendarDate.getDate();\n\n } else {\n dayDiv.innerHTML = dayDiv.innerHTML + \"<div class= \\\"small-box\\\" >\" + \"<p>\" + \" \" + \"</p>\" + \"</div>\";\n }\n if (tempMonth != tempCalendarDate.getMonth()) {\n tempMonth = tempCalendarDate.getMonth();\n break loopWeekDady;\n }\n\n }\n\n }\n\n document.getElementById(theDateId).style.fontWeight = 700;\n}", "function loadDailyQARpt(data, xpage) {\n var html = \"\";\n $.each(data, function (i, item) {\n html += \"<tr>\";\n html += \"<td>\" + item.DateProduced + \"</td>\";\n html += \"<td><button class='btn btn-success report' id='report-\" + item.DateProduced + \"' data-toggle='modal' data-target='#ViewDailyRpt' ReportDate='\" + item.DateProduced + \"'>View Details</button></td>\";\n html += \"</tr>\";\n\n });\n\n // $(\"#tblqto\").html(html);\n if (xpage == 1) {\n $(\"#tbldaily\").html(html);\n }\n else {\n $(\"#tbldaily\").append(html);\n }\n}", "function DisplaySchedule()\n{\nHTMLCode = \"<table cellspacing=0 cellpadding=3 border=3 bgcolor=purple bordercolor=#000033>\";\nQueryDay = DefDateDay(QueryYear,QueryMonth,QueryDate);\nWeekRef = DefWeekNum(QueryDate);\nWeekOne = DefWeekNum(1);\nHTMLCode += \"<tr align=center><td colspan=8 class=Titre><b>\" + MonthsList[QueryMonth] + \" \" + QueryYear + \"</b></td></tr><tr align=center>\";\n\nfor (s=1; s<8; s++)\n{\nif (QueryDay == s) { HTMLCode += \"<td><b><font color=#ff0000>\" + DaysList[s] + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><b>\" + DaysList[s] + \"</b></td>\"; }\n}\n\nHTMLCode += \"<td><b><font color=#888888>Sem</font></b></td></tr>\";\na = 0;\n\nfor (i=(1-DefDateDay(QueryYear,QueryMonth,1)); i<MonthLength[QueryMonth]; i++)\n{\nHTMLCode += \"<tr align=center>\";\nfor (j=1; j<8; j++)\n{\nif ((i+j) <= 0) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse if ((i+j) == QueryDate) { HTMLCode += \"<td><b><font color=#ff0000>\" + (i+j) + \"</font></b></td>\"; }\nelse if ((i+j) > MonthLength[QueryMonth]) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse { HTMLCode += \"<td>\" + (i+j) + \"</td>\"; }\n}\n\nif ((WeekOne+a) == WeekRef) { HTMLCode += \"<td><b><font color=#00aa00>\" + WeekRef + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><font color=#888888>\" + (WeekOne+a) + \"</font></td>\"; }\nHTMLCode += \"</tr>\";\na++;\ni = i + 6;\n}\n\nCalendrier.innerHTML = HTMLCode + \"</table>\";\n}", "function handleClick() {\n d3.event.preventDefault();\n\n let date = d3.select('datetime').property('value');\n let filterData = tableData;\n\n // Conditional filter for search\n if(date) {\n filterData = filterData.filter((row) => row.datetime === date);\n }\n\n buildTable(filterData);\n\n}", "function showDate(date) {\n for (var i = 0; i < eventDates.length; i++) {\n if (new Date(eventDates[i]).toString() == date.toString()) {\n return [true, 'eventBooked ui-datepicker-unselectable', 'JOUR RÉSERVÉ -- ' + eventLibelle[i] + ' : ' + eventTitre[i] + ' => Salle : ' + eventSalle[i]];\n }\n }\n return [true, null, 'Ce jour est disponible. Vous pouvez créer un evenement ce jour là.'];\n }", "function calendarSelected(dateStr)\n {\n var project = document.getElementById(\"projectname\");\n window.location = \"index.php?project=\" + project.value + \"&date=\" + dateStr.substr(6, 4) + dateStr.substr(0, 2) + dateStr.substr(3, 2);\n $('#calendar').hide();\n }", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._previewStart = this._previewEnd = null;\n this._changeDetectorRef.markForCheck();\n }", "function viewEvents(huc12, mode) {\n function pprint(val, mode) {\n if (val == null) return \"0\";\n return val.toFixed(2);\n }\n function pprint2(val, mode) {\n if (mode == 'daily') return \"\";\n return \" (\" + val + \")\";\n }\n var colLabel = (mode == 'daily') ? \"Date\": \"Year\";\n var lbl = ((mode == 'daily') ? 'Daily events' : 'Yearly summary (# daily events)');\n $('#eventsModalLabel').html(lbl + \" for \" + huc12);\n $('#eventsres').html('<p><img src=\"images/wait24trans.gif\" /> Loading...</p>');\n $.ajax({\n method: 'GET',\n url: BACKEND + '/geojson/huc12_events.py',\n data: { huc12: huc12, mode: mode }\n }).done(function (res) {\n var myfunc = ((mode == 'yearly') ? 'setYearInterval(' : 'setDateFromString(');\n var tbl = '<button class=\"btn btn-primary\" ' +\n 'onclick=\"javascript: window.open(\\''+ BACKEND +'/geojson/huc12_events.py?huc12='+huc12+'&amp;mode='+mode+'&amp;format=xlsx\\');\">' +\n '<i class=\"fa fa-download\"></i> Excel Download</button><br />' +\n '<table class=\"table table-striped header-fixed\" id=\"depdt\">' +\n \"<thead><tr><th>\" + colLabel +\"</th><th>Precip [\" + varunits['qc_precip'][appstate.metric] +\n \"]</th><th>Runoff [\" + varunits['qc_precip'][appstate.metric] +\n \"]</th><th>Detach [\" + varunits['avg_loss'][appstate.metric] +\n \"]</th><th>Hillslope Soil Loss [\" + varunits['avg_loss'][appstate.metric] +\n \"]</th></tr></thead>\";\n $.each(res.results, function (idx, result) {\n var dt = ((mode == 'daily') ? result.date : result.date.substring(0, 4));\n tbl += \"<tr><td><a href=\\\"javascript: \" + myfunc + \"'\" + dt + \"');\\\">\" + dt + \"</a></td><td>\" +\n pprint(result.qc_precip * multipliers['qc_precip'][appstate.metric]) + pprint2(result.qc_precip_events, mode) + \"</td><td>\" +\n pprint(result.avg_runoff * multipliers['avg_runoff'][appstate.metric]) + pprint2(result.avg_runoff_events, mode) + \"</td><td>\" +\n pprint(result.avg_loss * multipliers['avg_loss'][appstate.metric]) + pprint2(result.avg_loss_events, mode) + \"</td><td>\" +\n pprint(result.avg_delivery * multipliers['avg_delivery'][appstate.metric]) + pprint2(result.avg_delivery_events, mode) + \"</td></tr>\";\n });\n tbl += \"</table>\";\n if (mode == 'yearly') {\n tbl += \"<h4>Monthly Averages</h4>\";\n tbl += '<p><img src=\"' + BACKEND + '/auto/huc12_bymonth.py?huc12=' + huc12 + '\" class=\"img img-responsive\"></p>';\n }\n\n $('#eventsres').html(tbl);\n $(\"#depdt\").DataTable();\n }).fail(function (res) {\n $('#eventsres').html(\"<p>Something failed, sorry</p>\");\n });\n\n}", "function handleClick() {\n // Create variable to hold date data (.select() selects first element that matches the string '#datetime', and .property('value') grabs and stores that data in the the date variable)\n let date = d3.select(\"#datetime\").property(\"value\");\n // Set default filter and save it to original table data so user can refine search from complete table\n let filteredData = tableData;\n // Apply a filter on the date variable based on a date value\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n // Rebuild the table using filtered data. If no date was entered then filteredData will just be the original tableData\n buildTable(filteredData);\n}", "function clickDatePeriod () {\ndate= opener.setDate(arguments[0],arguments[1],arguments[2]);\nwindow.close();\nreturn (date);\n}", "function visData(){\r\n\tvar days=new Array(\"Domenica\",\"Luned&igrave;\",\"Marted&igrave;\",\"Mercoled&igrave;\",\"Gioved&igrave;\",\"Venerd&igrave;\",\"Sabato\");\r\n\tvar months=new Array(\"Gennaio\",\"Febbraio\",\"Marzo\",\"Aprile\",\"Maggio\",\"Giugno\",\"Luglio\",\"Agosto\",\"Settembre\",\"Ottobre\",\"Novembre\",\"Dicembre\");\r\n\tvar dateObj=new Date();\r\n\tvar lmonth=months[dateObj.getMonth()];\r\n\tvar anno=dateObj.getFullYear();\r\n\tvar date=dateObj.getDate();\r\n\tvar wday=days[dateObj.getDay()];\r\n\tdocument.write(\" \" + wday + \" \" + date + \" \" + lmonth + \" \" + anno);\r\n}", "function openDatePicker () {\n if (dateDis.classList.contains(\"hidden\")) {\n var dayOfWeek = days[dueDate.getDay()];\n var dayOfMonth = dueDate.getDate();\n var curYear = dueDate.getFullYear();\n var curMonth = dueDate.getMonth() + 1;\n document.getElementById(\"curDateDisplay\").innerHTML = dayOfWeek+\", \"+curMonth+\"/\"+dayOfMonth+\"/\"+curYear;\n dateDis.classList.remove(\"hidden\");\n }\n todoStage.classList.remove(\"hidden\");\n todoCal.addEventListener(\"datetap\", function(e){\n dueDate = e.detail.date;\n dayOfWeek = days[dueDate.getDay()];\n dayOfMonth = dueDate.getDate();\n curYear = dueDate.getFullYear();\n curMonth = dueDate.getMonth() + 1;\n document.getElementById(\"curDateDisplay\").innerHTML = dayOfWeek+\", \"+curMonth+\"/\"+dayOfMonth+\"/\"+curYear;\n });\n}", "function action() {\n var lblResultat = $(\"#\" + that.data.idLibelle);\n var now = new Date();\n // on affiche juste la date pour cet exemples\n lblResultat.append(\"<br/>\" + now);\n }", "date(e){\n this.appDate = e.detail.value; \n \n }", "function displayDate() {\r\n currentDate.innerHTML = daysInWeek[currentDayInWeek] + ', ' + currentDay + 'th';\r\n}", "function clickme(){\n d3.event.preventDefault();\n var userdate= d3.select(\"#datetime\").property(\"value\");\n let filterrecord= tableData;\n if (userdate){\n filterrecord= filterrecord.filter(element=>element.datetime === userdate);\n }\n displaytable(filterrecord);\n}", "function create_change_report() {\n //\n var item_table_args = {};\n var data_sql_args = {};\n var meta_sql_args = {};\n var ts_obj = to_and_from_timestamps();\n //\n // creating new get data button to prevent stacking of event handlers\n var old_btn = document.getElementById('create-report');\n var new_btn = document.createElement(\"BUTTON\");\n new_btn.appendChild(document.createTextNode(\"Create Report\"));\n new_btn.id = \"create-report\"\n new_btn.className = \"hidden-elm\"\n new_btn.addEventListener(\"click\",function(){\n create_change_report();\n });\n old_btn.parentNode.replaceChild(new_btn,old_btn);\n //\n // setting up the data and meta SQL args\n meta_sql_args.cmd = 'SELECT';\n meta_sql_args.table = 'table_meta_data';\n meta_sql_args.where = [['in_tables','REGEXP','(^|%)meat_shop_stock_changes(%|$)'],['use_on_pages','REGEXP','(^|%)meat_shop(%|$)']];\n meta_sql_args.order_by = [['order_index','ASC']];\n data_sql_args.cmd = 'SELECT';\n data_sql_args.table = 'meat_shop_stock_changes';\n data_sql_args.where = [['date','BETWEEN',ts_obj.from_ts+' 00:00:00\\' AND \\''+ts_obj.to_ts+' 23:59:59']];\n data_sql_args.order_by = [['date','DESC'],['item_number','ASC']];\n if (!(document.getElementById('show-deleted').checked)) {data_sql_args.where.push(['entry_status','LIKE','submitted']);}\n if (trim(document.getElementById('search-item-number').value) != '') {data_sql_args.where.push(['item_number','REGEXP',trim(document.getElementById('search-item-number').value)]);} //\n item_table_args.meta_sql_args = meta_sql_args;\n item_table_args.data_sql_args = data_sql_args;\n //\n // setting up the item table arguments\n item_table_args.table_output_id = 'content-div';\n item_table_args.table_id = 'stock-change-report-table';\n item_table_args.table_class = 'default-table';\n item_table_args.row_id_prefix = 'record-row';\n item_table_args.table_data_cell_class = 'default-table-td';\n item_table_args.no_page_nav = true;\n item_table_args.row_onclick = '';\n item_table_args.row_onmouseenter = \"add_class('default-table-row-highlight','%row_id%')\";\n item_table_args.row_onmouseleave = \"remove_class('default-table-row-highlight','%row_id%')\";\n item_table_args.head_row_args = {\n sortable : false,\n 'tables_referenced' : ['meat_shop_stock_changes']\n }\n item_table_args.page_nav_args = {};\n item_table_args.add_callback = function() {\n add_class('hidden-elm','report-page-nav');\n };\n //\n create_standard_table(item_table_args);\n}", "function PaintDailyWindow()\n{\n\tGetTimeCardView(TimeCard.View);\n\tPaintHeaders(\"Daily\");\n\t\n\tif (TimeCard.Records[1].CommentsExist == 1)\n\t{\n\t\tself.TABLE.document.comment.src = ExistingCommentsIcon;\n\t}\n\telse\n\t{\t\n\t\tself.TABLE.document.comment.src = NoCommentsIcon;\n\t}\n\t\n\tPaintDailyTime();\t\n\t\n\tremoveWaitAlert();\n}", "_homeClicked(){\n const initialDate = this._setInitialDate(this.initialDate);\n this.date = initialDate;\n this.diaryService.get(this.journalID, this.date);\n }", "function date_click() {\n $(\".events-container\").show(250);\n $(\"#dialog\").hide(250);\n $(\".active-date\").removeClass(\"active-date\");\n $(this).addClass(\"active-date\");\n}", "function weeklystatusreport (request, response) {\n var contextData = {};\n response.render('weekly-status-report.html', contextData);\n}", "function selectDate(){\n var choose = $(this).datepicker('getDate');\n $('.error-card').css('display', 'none');\n $('#date-select').val(choose.toDateString());\n showDate(choose);\n }", "function displayByDay(day){\n // document.getElementById(\"filterCheckBox\").checked = false;\n\n if(day===\"26 April\"){\n document.getElementById(\"day1btn\").className=\"selectedDay\";\n document.getElementById(\"day2btn\").className=\"notSelectedDay\";\n }\n else{\n document.getElementById(\"day2btn\").className=\"selectedDay\";\n document.getElementById(\"day1btn\").className=\"notSelectedDay\";\n }\n\n if(document.getElementById(\"filterCheckBox\").checked){\n displayByStatus(document.getElementById(\"filterCheckBox\"));\n }\n\n else{\n //Get all events\n firebase.database().ref('event/').on('value', function(snapshot) {\n let result={};\n result = snapshot.val();\n //Filter events by a particular day\n result.events = snapshot.val().events.filter(filterByDay,day);\n let template = document.getElementById(\"mustacheTemplate\").innerHTML;\n // render all data to template DOM element\n let resultMustache = Mustache.render(template,result);\n document.getElementById(\"output\").innerHTML=resultMustache;\n })\n }\n }", "function myDateFunction(id) {\n $(\"#date-popover\").hide();\n var date = $(\"#\" + id).data(\"date\");\n var hasEvent = $(\"#\" + id).data(\"hasEvent\");\n $(\"#dateArea\").html('<strong>Date :</strong> '+ date);\n parser(\"SCADA/\"+date)\n return true;\n}", "function renderReport(doc) {\n\n // ----------------------------------------------\n let br = document.createElement('br');\n let hr = document.createElement('hr');\n let page = document.createElement('span');\n\n let caption = document.createElement('h4'); //append caption\n let innerCaption = document.createElement('small');\n var t1 = document.createTextNode(\"PREVIOUS POSTS\");\n innerCaption.appendChild(t1);\n caption.appendChild(innerCaption)\n\n // append hr\n\n let title = document.createElement('h3'); //append title\n title.textContent = doc.data().studentUserName;\n\n let date = document.createElement('h5')//append date\n let icons = document.createElement('span')\n icons.classList.add('glyphicon');\n icons.classList.add('glyphicon-time');\n let time = document.createElement('span');\n time.textContent = doc.data().time;\n var t2 = document.createTextNode(' Posted on ');\n date.appendChild(icons);\n date.appendChild(t2);\n date.appendChild(time);\n\n\n let mainIcons = document.createElement('h5')//mainIcons\n let glyph1 = document.createElement('span');\n glyph1.classList.add('label');\n glyph1.classList.add('label-success');\n var t3 = document.createTextNode('created');\n var t5 = document.createTextNode(' ');\n glyph1.appendChild(t3);\n let glyph2 = document.createElement('span');\n glyph2.classList.add('label');\n glyph2.classList.add('label-primary');\n var t4 = document.createTextNode('read');\n glyph2.appendChild(t4);\n mainIcons.appendChild(glyph1);\n mainIcons.appendChild(t5);\n mainIcons.appendChild(glyph2);\n\n // append break (br)\n // append break (br)\n\n let comment = document.createElement('p')//append comment\n comment.textContent = doc.data().report;\n\n page.appendChild\n\n page.appendChild(caption);\n page.appendChild(hr);\n page.appendChild(title);\n page.appendChild(date);\n page.appendChild(mainIcons);\n page.appendChild(comment);\n page.appendChild(br);\n page.appendChild(br);\n page.appendChild(br);\n\n reportList.appendChild(page);\n\n}", "function fnGetLastSubmittedReportRPT() {\n\n ShowModalPopup(\"dvloading\");\n $('#lnkExcel').hide();\n $(\"#dvTree\").hide();\n $('#divInput').show();\n $(\"#spnTreeToggle\").html('Show Tree');\n $('#divToggle').show();\n $(\"#divMain\").css('width', '100%');\n\n $(\"#divCompReport\").html(\"\");\n $(\"#divCompPrint\").html(\"\");\n\n if ($(\"#txtFromDate\").val() == \"\") {\n fnMsgAlert('info', 'Last Submitted Report', 'Select start date.');\n HideModalPopup(\"dvloading\");\n return false;\n }\n if ($(\"#txtToDate\").val() == \"\") {\n fnMsgAlert('info', 'Last Submitted Report', 'Select end date.');\n HideModalPopup(\"dvloading\");\n return false;\n }\n\n var unlistedDoctor = $('input:radio[name=Unlisted]:checked').val();\n var DCRDate = \"ACTUAL\";\n\n var FromDateArr = $(\"#txtFromDate\").val().split('/');\n var ToDateArr = $(\"#txtToDate\").val().split('/');\n var dt1 = new Date(FromDateArr[2] + \"-\" + FromDateArr[1] + \"-\" + FromDateArr[0]);\n var dt2 = new Date(ToDateArr[2] + \"-\" + ToDateArr[1] + \"-\" + ToDateArr[0]);\n\n if (dt1 > dt2) {\n fnMsgAlert('info', 'Last Submitted Report', 'Start date should be less than End date.');\n HideModalPopup(\"dvloading\");\n return false;\n }\n\n var noOfDays = dt2 - dt1;\n noOfDays = Math.round(noOfDays / 1000 / 60 / 60 / 24);\n\n if (noOfDays > 92) {\n\n fnMsgAlert('info', 'Last Submitted Report', 'Start date and end date should not be greater than 92 days.');\n HideModalPopup(\"dvloading\");\n return false;\n }\n var doctorMissed = \"\";\n if ($(\":checkbox[name=missed]:checked\").length > 0) {\n doctorMissed = \"MISSED\";\n }\n\n var userCode = selKeys;\n var reportViewType = $(\"input:radio[name=rdReportView]:checked\").val();\n\n if (userCode == \"\") {\n fnMsgAlert('info', 'Last Submitted Report', 'Please select atleast one user.');\n HideModalPopup(\"dvloading\");\n return false;\n }\n $('#hdnDownload').val('');\n $('#hdnDownload').val(userCode);\n\n $(\"#divInput\").slideUp();\n $(\"#spnInputToggle\").html(\"Show Input\");\n $.ajax({\n type: 'POST',\n url: '../HiDoctor_Reports/ReportsLevelTwo/GetLastSubmittedReportRPT',\n data: 'userCode=' + userCode + '&sd=' + FromDateArr[2] + \"-\" + FromDateArr[1] + \"-\" + FromDateArr[0] + '&ed=' + ToDateArr[2] + \"-\" + ToDateArr[1] + \"-\" + ToDateArr[0] + '&type=' + unlistedDoctor + '&selectionType=' + DCRDate + '&title=' + $(\"#divPageHeader\").html() + '&missed=' + doctorMissed + '&reportViewType=' + reportViewType,\n success: function (response) {\n $(\"#divReport\").html('');\n if (response != \"\") {\n // $(\"#lnkExcel\").attr(\"href\", response.split('$')[1]);\n $(\"#divReport\").html(response);\n // $(\"#divPrint\").html(response.split('$')[0]);\n if (response != \"\") {\n $(\"#divInput\").slideUp();\n $(\"#spnInputToggle\").html(\"Show Input\");\n $('#dvTablePrint').hide();\n }\n $('#tblLastSubmittedReport').tablePagination({});\n HideModalPopup(\"dvloading\");\n }\n else {\n fnMsgAlert('info', 'Last Submitted Report', 'No data found.');\n $(\"#spnTreeToggle\").show();\n $('#dvTablePrint').hide();\n HideModalPopup(\"dvloading\");\n\n }\n },\n error: function () {\n fnMsgAlert('info', 'Report', 'Error.');\n HideModalPopup(\"dvloading\");\n }\n });\n}", "function projectPendInvReport() {\n window.open(\n 'Report?' +\n 'id=' +\n projectID +\n '&type=Project PendInv Report ' +\n '~' +\n $('#pendingInvoiceSelector2').val()\n );\n}", "function handleClick() {\r\n // Prevent the form from refreshing the page\r\n d3.event.preventDefault();\r\n // Select the datetime value\r\n var date = d3.select(\"#datetime\").property(\"value\");\r\n // Set tableData as the value for filteredData, the basis of our replacement table\r\n let filteredData = tableData;\r\n // Check to see if a date was entered\r\n if (date) {\r\n // Filter the table data to the match date\r\n filteredData = filteredData.filter(row => row.datetime === date);\r\n }\r\n // Populate the new table based on the filtered data\r\n buildTable(filteredData);\r\n }", "function HeaderCalendar_Daily()\n{\n\tif (boolSaveChanges || bSelectChanged)\n\t{\n\t\tSaveChanges(\"MoveToHeaderCalendar_Daily()\", \"Daily\");\n\t}\n\telse\n\t{\n\t\tMoveToHeaderCalendar_Daily();\n\t}\n}", "function displayPractice() {\n\tvar d = new Date();\n\tvar day = d.getDay();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n // in case of pool closing set day = 8 practice canceled for repairs; day=9 practice canceled for meet -------------------------------------------------\n //if (month == 6 && date == lastPractice) {day = 7};\n if (RVCCclosed === true) {day = 8};\n\n\tif (month === 4 && date < firstPractice) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n\t} else if((month === lastmonthPractice && date > lastPractice) || (month > lastmonthPractice) ) {\n\t\t\t\t$(\"#todayschedule\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n\t}else if ((month === 4 && date >= firstPractice) || (month === 5 && date < changeDate)) {\n\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n $(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"The RVCC Pool is CLOSED<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"The RVCC Pool is CLOSED<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n break;\n\n\t\t}\n } else if (month === lastmonthPractice && date == lastPractice) {\n switch (day) {\n default:\n $(\"#todayschedule\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n break;\n }\n\t} else if ( month === 5 && date >= changeDate || month === 6 || month === 7 && date <= lastPractice) {\n\t\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n break;\n case 7:\n $(\"#todayschedule\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n $(\"#todayschedule2\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"RVCC Closed for Repairs<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"RVCC Closed for Repairs<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n\n\t\t}\n\t} else if (month >= 0 && month < 4) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n\t} else {\n $(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n }\n}", "function showDate(date) {\n let weekDays = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n let weekDay = weekDays[currentDate.getDay()];\n let day = currentDate.getDate();\n let months = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n let month = months[currentDate.getMonth()];\n\n return `${weekDay} ${day} ${month}`;\n}", "function dateClick(){\r\n\t\tclearInterval(timerDates); //stops interval for user input\r\n\t\tdocument.getElementById(\"success\").style.display = \"none\";\r\n\t\tif (this.validDate){\r\n\t\t\tdocument.getElementById(\"appname\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"first\").onclick = clearBox;\r\n\t\t\tdocument.getElementById(\"last\").onclick = clearBox;\r\n\t\t\tdatePointer = this.innerHTML;\r\n\t\t\tdocument.getElementById(\"send\").onclick = submitApp;\r\n\r\n\t\t}else{\r\n\t\t\tdocument.getElementById(\"appname\").style.visibility = \"hidden\";\r\n\t\t}\r\n\t}", "function createDetailsReport(banDoc, startDate, endDate, cardToPrint) {\r\n\r\n\tvar report = Banana.Report.newReport(\"Details\");\r\n\tvar headerLeft = Banana.document.info(\"Base\",\"HeaderLeft\");\r\n var headerRight = Banana.document.info(\"Base\",\"HeaderRight\");\r\n\r\n\tvar printAssetsLiabilities = false;\r\n\tvar printIncomeExpenses = false;\r\n\tvar printAll = false; \r\n\r\n\tif (cardToPrint === \"Assets / Liabilities\") {\r\n\t\tprintAssetsLiabilities = true;\r\n\t}\r\n\telse if (cardToPrint === \"Income / Expenses\") {\r\n\t\tprintIncomeExpenses = true;\r\n\t}\r\n\telse if (cardToPrint === \"All\") {\r\n\t\tprintAll = true;\r\n\t}\r\n\r\n\r\n\tif (printAssetsLiabilities || printAll) {\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// ASSETS \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Assets with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar assetsTable = report.addTable(\"assetsTable\");\r\n\r\n\t\t//Accounts assets data\r\n\t\tvar assetsAccountForm = [];\r\n\t\tassetsAccountForm = getAccountsAssets(banDoc, assetsAccountForm);\r\n\r\n\t\t//Transactions assets data\r\n\t\tvar assetsTransactionForm = [];\r\n\t\tfor (var i = 0; i < assetsAccountForm.length; i++) {\r\n\t\t\tif (assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, assetsAccountForm[i][\"Account\"], startDate, endDate, assetsTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS ASSETS DETAILS\r\n\t\tfor (var i = 0; i < assetsAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (assetsAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = assetsTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(assetsAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(assetsAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (assetsAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = assetsTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(assetsAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(assetsAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS ASSETS DETAILS\r\n\t\t\t\tfor (var j = 0; j < assetsTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (assetsAccountForm[i][\"Account\"] && assetsTransactionForm[j][\"JAccount\"] === assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = assetsTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(assetsTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(assetsTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (assetsTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (assetsTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treport.addPageBreak();\r\n\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// LIABILITIES \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Liabilities with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar liabilitiesTable = report.addTable(\"liabilitiesTable\");\r\n\r\n\t\t//Liabilities assets data\r\n\t\tvar liabilitiesAccountForm = [];\r\n\t\tliabilitiesAccountForm = getAccountsLiabilites(banDoc, liabilitiesAccountForm);\r\n\r\n\t\t//Transactions liabilities data\r\n\t\tvar liabilitiesTransactionForm = [];\r\n\t\tfor (var i = 0; i < liabilitiesAccountForm.length; i++) {\r\n\t\t\tif (liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, liabilitiesAccountForm[i][\"Account\"], startDate, endDate, liabilitiesTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS LIABILITIES DETAILS\r\n\t\tfor (var i = 0; i < liabilitiesAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (liabilitiesAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = liabilitiesTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(liabilitiesAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(liabilitiesAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (liabilitiesAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = liabilitiesTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(liabilitiesAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(liabilitiesAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS LIABILITIES DETAILS\r\n\t\t\t\tfor (var j = 0; j < liabilitiesTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (liabilitiesAccountForm[i][\"Account\"] && liabilitiesTransactionForm[j][\"JAccount\"] === liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = liabilitiesTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(liabilitiesTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(liabilitiesTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (liabilitiesTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (liabilitiesTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tif (printIncomeExpenses || printAll) {\r\n\r\n\t\tif (printAll) {\r\n\t\t\treport.addPageBreak();\r\n\t\t}\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// INCOME \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Income with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar incomeTable = report.addTable(\"incomeTable\");\r\n\r\n\t\t//Accounts Income data\r\n\t\tvar incomeAccountForm = [];\r\n\t\tincomeAccountForm = getAccountsIncome(banDoc, incomeAccountForm);\r\n\r\n\t\t//Transactions Income data\r\n\t\tvar incomeTransactionForm = [];\r\n\t\tfor (var i = 0; i < incomeAccountForm.length; i++) {\r\n\t\t\tif (incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, incomeAccountForm[i][\"Account\"], startDate, endDate, incomeTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS INCOME DETAILS\r\n\t\tfor (var i = 0; i < incomeAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (incomeAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = incomeTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(incomeAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(incomeAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (incomeAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = incomeTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(incomeAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(incomeAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS INCOME DETAILS\r\n\t\t\t\tfor (var j = 0; j < incomeTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (incomeAccountForm[i][\"Account\"] && incomeTransactionForm[j][\"JAccount\"] === incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = incomeTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(incomeTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(incomeTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (incomeTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (incomeTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treport.addPageBreak();\r\n\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// EXPENSES \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Expenses with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create table\r\n\t\tvar expensesTable = report.addTable(\"expensesTable\");\r\n\r\n\t\t//Accounts Expenses data\r\n\t\tvar expensesAccountForm = [];\r\n\t\texpensesAccountForm = getAccountsExpenses(banDoc, expensesAccountForm);\r\n\r\n\t\t//Transactions Expenses data\r\n\t\tvar expensesTransactionForm = [];\r\n\t\tfor (var i = 0; i < expensesAccountForm.length; i++) {\r\n\t\t\tif (expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, expensesAccountForm[i][\"Account\"], startDate, endDate, expensesTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS EXPENSES DETAILS\r\n\t\tfor (var i = 0; i < expensesAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (expensesAccountForm[i][\"Balance\"]) {\r\n\r\n\t\t\t\t//Account\r\n\t\t\t\tif (expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = expensesTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(expensesAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(expensesAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (expensesAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = expensesTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(expensesAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(expensesAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\" \", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS EXPENSES DETAILS\r\n\t\t\t\tfor (var j = 0; j < expensesTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (expensesAccountForm[i][\"Account\"] && expensesTransactionForm[j][\"JAccount\"] === expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\ttableRow = expensesTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(expensesTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(expensesTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (expensesTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic right\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (expensesTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic right\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//Add a footer to the report\r\n\taddFooter(banDoc, report);\r\n\r\n\treturn report;\r\n}", "function printReport(startDate, endDate) {\n\n\t//Add a name to the report\n\tvar report = Banana.Report.newReport(\"Trial Balance\");\n\n\t//Add a title\n\treport.addParagraph(\"Trial Balance\", \"heading1\");\n\treport.addParagraph(\" \", \"\");\n\n\t//Create a table for the report\n\tvar table = report.addTable(\"table\");\n\t\n\t//Add column titles to the table\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \"\", 1);\n\ttableRow.addCell(\"Trial Balance at \" + Banana.Converter.toLocaleDateFormat(endDate), \"alignRight bold\", 3);\n\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"Debit\", \"alignCenter bold borderBottom\");\n\ttableRow.addCell(\"Credit\", \"alignCenter bold borderBottom\");\n\n\t/* 1. Print the balance sheet */\n\tprintBalanceSheet(startDate, endDate, report, table);\n\n\t/* 2. Print the profit & loss statement */\n\tprintProfitLossStatement(startDate, endDate, report, table);\n\n\t/* 3. Print totals */\n\tprintTotals(report, table);\n\n\t//Add a footer to the report\n\taddFooter(report);\n\n\t//Print the report\n\tvar stylesheet = createStyleSheet();\n\tBanana.Report.preview(report, stylesheet);\n}", "function dateAdvanced() {\n $(\"#mnth-list\").toggleClass(\"hidden\");\n $(\"#date-inp\").toggleClass(\"hidden\");\n $(\"#mnth-wraper\").toggleClass(\"text select\");\n date_src = !date_src;\n if (date_src) {\n $(\"#dsrc\").html(\"Date:\");\n } else {\n $(\"#dsrc\").html(\"Month:\");\n }\n // console.log(date_src);\n}", "onReportButtonClicked(eventObject) {\n new RoKA.Reddit.Report(this.commentObject.name, this.commentThread, false);\n }", "function createReports() {\r\n var RawDataReport = AdWordsApp.report(\"SELECT Domain, Clicks \" + \"FROM AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT \" + \"WHERE Clicks > 0 \" + \"AND Conversions < 1 \" + \"DURING LAST_7_DAYS\");\r\n RawDataReport.exportToSheet(RawDataReportSheet);\r\n}", "function processGenerateReportButton() \n{ \n\t//console.log(\"Entereed generateReport\");\n\t//console.log(currentPage);\n\t\n\tif (currentPage == \"Campus\")\n\t{\n\t\tinitCampusReportGeneration();\n\t}\n\telse\n\t{ \n\t\tinitBuildingReportGeneration(currentPage);\n\t}\n\t\n}", "function formatresults(){\r\n if (this.timesup==false){//if target date/time not yet met\r\n var displaystring=arguments[0]+\" days \"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds left until Scott & Javaneh's Wedding\"\r\n }\r\n else{ //else if target date/time met\r\n var displaystring=\"Future date is here!\"\r\n }\r\n return displaystring\r\n}", "function showReportDialog() {\n return;\n}", "showSelectedData() {\n const findRanking = (dateString) => {\n return this.data.rankings.find((ranking) => {\n return Form.getDropDownDate(ranking.date) === dateString;\n });\n };\n this.updateGraph(findRanking(this.dateFromElement.value), findRanking(this.dateToElement.value), parseInt(this.topNRanksElement.value, 10));\n }", "function printDate()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_date.innerHTML = time.day + '.' + time.monthNameShort + ' ' + time.year;\n\t}", "async onClickDay(dateValue){\n \n var date = {day : dateValue.getDate(), month : dateValue.getMonth()+1, year : dateValue.getFullYear()}\n await this.setState({dateSelect:date})\n let today = this.state.date;\n let dd = today.getDate();\n let MM = today.getMonth()+1;\n (dd<10)? dd='0'+ dd:dd;\n (MM<10)? MM='0'+ MM:MM; \n let yyyy = today.getFullYear(); \n //console.log(dd+' '+MM+' '+yyyy)\n\n let dt = dd+'/'+MM+'/'+yyyy\n const payload = await fetch('/resourceScheduleHistory?date='+dt);\n const body= await payload.json();\n await this.setState({resourceScheduleHistory : body})\n \n //console.log(this.state.resourceScheduleHistory)\n let date_ob = new Date();\n // current date\n // adjust 0 before single digit date\n let date1 = (\"0\" + date_ob.getDate()).slice(-2);\n \n // current month\n let month1 = (\"0\" + (date_ob.getMonth() + 1)).slice(-2);\n \n // current year\n let year1 = date_ob.getFullYear();\n // prints date in YYYY-MM-DD format\n //console.log(year + \"-\" + month + \"-\" + date);\n let cur_date = date1+'/'+month1+'/'+year1\n\n if(dt === cur_date){\n await this.setState({data : this.props.data})\n }else{\n await this.setState({data : body})\n }\n \n }", "onReportButtonClicked(eventObject) {\n new RoKA.Reddit.Report(this.threadInformation.name, this, true);\n }", "function _callLineBoardReport()\r\n{\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n var changeFields = objHTMLData.getChangeFields();\r\n var objAjax = htmlAreaObj.getHTMLAjax();\r\n bShowMsg = true;\r\n //when user doesn't enter anything and clicks on the report button for the\r\n //first time this check is done\r\n if(objHTMLData.hasUserModifiedData()==false)\r\n {\r\n var htmlErrors = objAjax.error();\r\n objAjax.error().addError(\"errorInfo\", 'Must enter values for: Season', true);\r\n messagingDiv(htmlErrors);\r\n return;\r\n }\r\n\tvar url = 'lineboardreport';// report action method name\r\n\t\r\n\tobjAjax.setActionMethod(url);\r\n\tobjAjax.setActionURL('lineboardreport.do');\r\n\tobjAjax.setProcessHandler(_loadLineBoardReport);\r\n\tobjHTMLData.performSaveChanges(_loadLineBoardReport, objAjax);\r\n}", "function displayDate() {\n // variable for date formatted day, month, day, year\n var date = now.format(\"dddd, MMMM Do YYYY\");\n // update text to show date\n currentDayEl.text(date);\n}", "function reportEventChange(event) {// event is change from eventID\t\n\t\trerenderEvents(event.id);\t\t\n\t\tvar currentObj = event;\n\t\tdate = currentObj.start;\n\t\tif (options.isDBUpdateonDrag && currentObj.isCurrent == false && options.defaultView=='month') {\n\t\t\tvar $scrollable = $(currentView.element).find(\"#scroll-slots\");\n\t\t\tvar parentContainerID = $scrollable.find(\"#dragable-\" + currentObj.id)\n\t\t\t\t\t.attr(\"id\");\n\t\t\tvar message = currentObj.msg;\n\t\t\tvar messageAndUIBinder = new MessageAndUIBinder(parentContainerID,\n\t\t\t\t\tmessage, AppConstants.XPaths.Appointment.MESSAGE_TYPE);\n\t\t\tif (messageAndUIBinder) {\n\t\t\t\tvar lookupHandler = appController.getComponent(\"DataLayer\").lookupHandler;\n\t\t\t\tmessageAndUIBinder.loadDataOntoForm(lookupHandler);\n\t\t\t\tmessageAndUIBinder.bindFieldEvents();\n\n\t\t\t\tvar fields = \"\";\n\t\t\t\tvar type = \"IVL_TS\";\n\t\t\t\tvar tagName = \"effectiveTime\";\n\t\t\t\tvar pathFields = fields.split(',');\n\t\t\t\tcurrentObj.start = CommonUtil.dateFormat(parseDate(currentObj.start),\n\t\t\t\t\t\t\"fullDateTime\");\n\t\t\t\tcurrentObj.end = CommonUtil.dateFormat(parseDate(currentObj.end),\n\t\t\t\t\t\t\"fullDateTime\");\n\t\t\t\tinstanceObject = [ currentObj.start, currentObj.end ];\n\t\t\t\tmessageAndUIBinder.writeValueToMessage(tagName, pathFields,\n\t\t\t\t\t\ttype, instanceObject);\n\t\t\t\tmessageAndUIBinder.bindFieldEvents();\n\t\t\t\t$(messageAndUIBinder.parentContainerID).trigger(\"change\");\n\t\t\t}\n\t\t\tcurrentObj.start = parseDate(currentObj.start);\n\t\t\tcurrentObj.end = parseDate(currentObj.end);\t\t\t\n\t\t\tonChangeSchedule(currentObj);\t\n\t\t}\n\t}", "function showSelectedDays() {\r\n var selectedDates = data.selectedDates;\r\n for (var index in selectedDates) {\r\n var day = selectedDates[index][\"day\"];\r\n var month = selectedDates[index][\"month\"];\r\n var year = selectedDates[index][\"year\"];\r\n showAsSelected(day, month, year);\r\n }\r\n }", "function myDate() \n\t\t{\n\t\t\tvar d = new Date();\n\t\t\t//The current date is saved to the date string\n\t\t\tdocument.getElementById(\"date\").innerHTML = d.toDateString();\n\t\t}", "showReport() {\n this.props.showReport();\n }", "function paintGridDate(){\r\n $('.futureDate').text(gridSimulatorVar.future_date.format(gridSimulatorCons.moment_format))\r\n}", "function cal2GoTo(date) {\n $cal2.fullCalendar('gotoDate', date);\n }" ]
[ "0.6323206", "0.62055784", "0.61925775", "0.612576", "0.60780406", "0.60475826", "0.6026153", "0.60052466", "0.5973589", "0.59710073", "0.59308934", "0.59096736", "0.5907215", "0.5896339", "0.58938015", "0.5850293", "0.5849054", "0.5823883", "0.58233225", "0.58056915", "0.5800968", "0.5795008", "0.5787337", "0.5784452", "0.57758677", "0.57720387", "0.57627785", "0.5762645", "0.5752863", "0.5751844", "0.5723726", "0.57179725", "0.5715493", "0.57095814", "0.5698978", "0.56971675", "0.5694658", "0.5683668", "0.5677914", "0.56727153", "0.56678355", "0.56645185", "0.5663297", "0.5663297", "0.56601375", "0.56563705", "0.56431603", "0.56412196", "0.5639831", "0.5638667", "0.56355256", "0.56345993", "0.56271315", "0.56221896", "0.56173164", "0.56139684", "0.56080806", "0.56037253", "0.55899626", "0.558935", "0.55882627", "0.5585144", "0.5583364", "0.55808467", "0.55784655", "0.55763644", "0.55685055", "0.5565576", "0.5543104", "0.55374336", "0.55268717", "0.5525773", "0.5523964", "0.5523858", "0.55223477", "0.55182946", "0.5517377", "0.55145067", "0.5511404", "0.55104476", "0.550988", "0.5502912", "0.5497068", "0.54956275", "0.54953444", "0.54910624", "0.54881173", "0.5470237", "0.54687303", "0.546799", "0.5467649", "0.54641134", "0.5463385", "0.5452693", "0.54523957", "0.54495555", "0.5448332", "0.5446106", "0.5443853", "0.5443489" ]
0.5703291
34
Display Report Time options for date clicked requires query database
function displayByTime(){ let URL = "http://localhost:3004/weather/"+this.id; $.get(URL, function(data){ let tableBody = document.getElementById("displayTableBody"); tableBody.innerHTML=""; // clear to start let weatherInfo = JSON.parse(data[0].weatherinfo); let date = data[0].date; addRowContent(tableBody, "Fecha", date.substring(0, date.length-14)); addRowContent(tableBody, "Hora", data[0].time); for(const property in weatherInfo){ addRowContent(tableBody, property, weatherInfo[property]); } let announcementString = "<strong>Anuncio:</strong> "+data[0].announcement; document.getElementById("displayTableAnnouncement").innerHTML=announcementString; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateReport(event) {\n \n cleanReport();\n \n // If the arrows where clicked, than update the arrows' timestamp\n updateTimeSpan(event);\n \n // extract report query from the DOM\n var reportQ = getReportQueryFromControlPanel();\n \n // write time span in human readable way\n var titleFrom = moment.unix(reportQ.start).format('YY MM DD HH:mm');\n var titleTo = moment.unix(reportQ.end).format('YY MM DD HH:mm');\n var verbalTimeSpanFormat = $(\"[name='radio-span']:checked\").data('verbal-format');\n var humanReadableTimespan = moment.unix(reportQ.end).format(verbalTimeSpanFormat);\n $('#report-title').html( /*titleFrom + '</br>' +*/ humanReadableTimespan /*+ '</br>' + titleTo*/ );\n\n // query data and update report\n getDataAndPopulateReport(reportQ);\n}", "function formatresults(){\nif (this.timesup==false){//if target date/time not yet met\nvar displaystring=\"<span style='background-color: #CFEAFE'>\"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds</span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"Launch time!\"\n}\nreturn displaystring\n}", "function formatresults2(){\nif (this.timesup==false){ //if target date/time not yet met\nvar displaystring=\"<span>\"+arguments[0]+\" <sup>days</sup> \"+arguments[1]+\" <sup>hours</sup> \"+arguments[2]+\" <sup>minutes</sup> \"+arguments[3]+\" <sup>seconds</sup></span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"\" //Don't display any text\nalert(\"Launch time!\") //Instead, perform a custom alert\n}\nreturn displaystring\n}", "timeDisplay(time) {\n let x = null\n switch((time)) {\n case \"metricGoalsMonths\":\n x = (\n <div>\n <h2 id='month'> Month <span class=\"required\">*</span></h2>\n <select\n onChange={(e) => this.updateSelectForm(e)}>\n {/* <option value=\"January\">January</option>\n <option value=\"February\">February</option>\n <option value=\"March\">March</option>\n <option value=\"April\">April</option>\n <option value=\"May\">May</option>\n <option value=\"June\">June</option>\n <option value=\"July\">July</option>\n <option value=\"August\">August</option>\n <option value=\"September\">September</option>\n <option value=\"October\">October</option>\n <option value=\"November\">November</option>\n <option value=\"December\">December</option> */}\n <option value={1}>January</option>\n <option value={2}>February</option>\n <option value={3}>March</option>\n <option value={4}>April</option>\n <option value={5}>May</option>\n <option value={6}>June</option>\n <option value={7}>July</option>\n <option value={8}>August</option>\n <option value={9}>September</option>\n <option value={10}>October</option>\n <option value={11}>November</option>\n <option value={12}>December</option>\n </select>\n </div>)\n break;\n case \"metricGoalsQuarters\":\n x = (\n <div>\n <h2 id='quarter'> Quarter <span class=\"required\">*</span></h2>\n <select\n onChange={(e) => this.updateSelectForm(e)}>\n <option selected=\"selected\">None</option>\n <option value=\"1\">Quarter 1</option>\n <option value=\"2\">Quarter 2</option>\n <option value=\"3\">Quarter 3</option>\n <option value=\"4\">Quarter 4</option> \n </select>\n </div>\n )\n break;\n case \"metricGoalsAnnuals\":\n x = (\n <div>\n No Action Needed\n </div>\n )\n break;\n }\n return x\n }", "startDatePanelClick() {\n // change time type to start time mode\n dispatch(modifyInnerState_timeType(1))\n // route to time selector page\n dispatch(modifyInnerState_route(3))\n }", "function viewtime(e) {\n const eventID = e.target.value;\n for(let i = 0; i < eventclass.length; i ++) {\n let apm = \"AM\";\n if(eventclass[i].apm == 0) {\n apm = \"AM\";\n } else {\n apm = \"PM\";\n }\n \n let endapm = \"AM\";\n if(eventclass[i].end_apm == 0) {\n endapm = \"AM\";\n } else {\n endapm = \"PM\";\n }\n let tag = eventclass[i].tag;\n if(tag == null) {\n tag = \"None\";\n }\n if(eventclass[i].id == eventID) {\n alert(\"Name: \" + eventclass[i].name +\"\\n Date: \" + eventclass[i].month + \"/\" + eventclass[i].day + \"/\" + eventclass[i].year + \"\\n Time: \"+ eventclass[i].hour + \":\" + eventclass[i].minute + \" \" + apm + \" - \" + eventclass[i].end_hour + \":\" + eventclass[i].end_minute + \" \" + endapm + \"\\n Tag: \" + tag);\n }\n }\n}", "function actionDateSelectedForAgendaManage(){\n\n\t}", "function formatresults(){\r\n if (this.timesup==false){//if target date/time not yet met\r\n var displaystring=arguments[0]+\" days \"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds left until Scott & Javaneh's Wedding\"\r\n }\r\n else{ //else if target date/time met\r\n var displaystring=\"Future date is here!\"\r\n }\r\n return displaystring\r\n}", "function showTime() {\r\n\t\r\n\r\n let today = new Date(),\r\n hour = today.getHours(),\r\n min = today.getMinutes(),\r\n sec = today.getSeconds();\r\n\r\n // Set AM or PM\r\n const amPm = hour >= 12 ? 'PM' : 'AM';\r\n\r\n // 12hr Format\r\n hour = hour % 12 || 12;\r\n\r\n // Output Time\r\n \r\n \tdashboardWelcomeText.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(\r\n sec\r\n \t)} ${showAmPm ? amPm : ''}`;\r\n \r\n \tcurrentDate = new Date();\r\n var currentYear = currentDate.getFullYear();\r\n var currentMonth = convertToMonth(currentDate.getMonth());\r\n var currentDay = convertToDayofWeek(currentDate.getDay());\r\n \r\n todayDayElement.innerHTML = currentDate.getDate();\r\n todayMonthElement.innerHTML = currentMonth;\r\n\r\n //auto join feature\r\n // Get classes from localStorage\r\n var classes = JSON.parse(localStorage.getItem('user')).evtList;\r\n var nextClass;\r\n var nextDate;\r\n notificationTable.innerHTML=\"\";\r\n\r\n // Loop through the classes\r\n for(var i = 0;i < classes.length;i++){\r\n\r\n \t\r\n var startTime = classes[i].start.toString();\r\n var endTime = classes[i].end.toString(); \r\n\r\n startDate = new Date(currentDate.getTime());\r\n startDate.setHours(startTime.split(\":\")[0]);\r\n startDate.setMinutes(startTime.split(\":\")[1]);\r\n startDate.setSeconds(startDate.getSeconds()-10)\r\n \r\n endDate = new Date(currentDate.getTime());\r\n endDate.setHours(endTime.split(\":\")[0]);\r\n endDate.setMinutes(endTime.split(\":\")[1]);\r\n\r\n var main=document.getElementById(\"main\");\r\n\r\n //warning system, next class notification, looping through the events until next event is found\r\n if(!nextDate && startDate>currentDate){\r\n \tnextClass = classes[i];\r\n\t nextDate = startDate;\r\n\t changeVariable = true;\r\n }\r\n \r\n if(startDate < nextDate && startDate>currentDate) {\r\n \t\tnextClass = classes[i];\r\n\t \tnextDate = startDate;\r\n\t \tchangeVariable = true;\r\n \t\r\n }\r\n \t\r\n \t//functions to automatically join zooms\r\n if( autojoin && hasJoined[i] == false && startDate < currentDate && endDate > currentDate){ \t\r\n \t//checking exact date if the repeated days aren't included. checks the day of weak of repeated\r\n \tif(classes[i].rptList.length == 0 && currentYear == classes[i].yr && currentMonth == classes[i].mt && currentDate.getDate() == classes[i].dy){\r\n \t\t//make a one time event that will not run again\r\n \t\thasJoined[i] = true;\r\n \t\twindow.open(classes[i].zoom);\r\n \t} \r\n \telse if(classes[i].rptList.includes(currentDay)){\r\n \t\t//make a one time event that will not run again\r\n \t\thasJoined[i] = true;\r\n \t\twindow.open(classes[i].zoom);\r\n \t}\r\n }\r\n else if(autojoin && hasJoined[i] == true && startDate < currentDate && endDate > currentDate){\r\n \t\r\n \tif(classes[i].rptList.length == 0 && currentYear == classes[i].yr && currentMonth == classes[i].mt && currentDate.getDate() == classes[i].dy){\r\n \t\tvar tr = document.createElement('TR');\r\n\t\t\t\tvar td = document.createElement('TD');\r\n\t\t\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\t\t\r\n\t\t \ttd.appendChild(document.createTextNode(\"- Currently in \"+classes[i].name));\r\n\t\t \ttr.appendChild(td);\r\n\t\t \tnotificationTable.appendChild(tr);\r\n \t} \r\n \telse if(classes[i].rptList.includes(currentDay)){\r\n\r\n \t\tvar tr = document.createElement('TR');\r\n\t\t\t\tvar td = document.createElement('TD');\r\n\t\t\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\t\tvar trButton = document.createElement('TR');\r\n\t\t \ttd.appendChild(document.createTextNode(\"- Currently in \"+classes[i].name));\r\n\t\t \ttr.appendChild(td);\r\n\t\t \ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+classes[i].name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+classes[i].zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\t\r\n \t\t\r\n\t\t \t\r\n\r\n\t\t \t\tnotificationTable.appendChild(tr);\r\n\t\t \t\tnotificationTable.appendChild(trButton);\r\n \t\t\r\n\r\n\r\n \t\t\r\n \t}\r\n \t\t\t\t\r\n\t\t \t\t\r\n\t\t \t\r\n \t\t}\r\n \t}\r\n\r\n\r\n \tvar moveon = true;\r\n\r\n \t\r\n\r\n \tif(nextClass != null && changeVariable){\r\n \tvar tr = document.createElement('TR');\r\n \tvar trButton = document.createElement('TR');\r\n\t\tvar td = document.createElement('TD');\r\n\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\r\n \ttd.appendChild(document.createTextNode(\"- Joining next event, \"+nextClass.name+\", at \"+nextClass.start));\r\n \ttr.appendChild(td);\r\n \t\r\n\t \t\r\n \tvar inlist = false;\r\n\r\n \tfor(var i=0;i<notifications.length;i++){\r\n \t\t\r\n\r\n\t\t if(notifications[i].innerHTML==tr.innerHTML){\r\n\t\t inlist = true;\r\n\t\t \r\n\t\t }\r\n\t\t \r\n\t\t }\r\n\r\n\t\t moveon = false;\r\n \tif(inlist == false){\r\n \t\tif(nextClass.rptList.length == 0 && currentYear == nextClass.yr && currentMonth == nextClass.mt && currentDate.getDate() == nextClass.dy){\r\n \t\ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+nextClass.name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+nextClass.zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\tnotificationTable.appendChild(tr);\r\n \t\tnotificationTable.appendChild(trButton);\r\n \t\tupdateColors();\r\n \t} \r\n \telse if(nextClass.rptList.includes(currentDay)){\r\n \t\ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\r\n\t\t\t\tbutton.setAttribute('style','background-color:'+centralColor+';')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+nextClass.name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+nextClass.zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\tnotificationTable.appendChild(tr);\r\n \t\tnotificationTable.appendChild(trButton);\r\n \t\tupdateColors();\r\n\r\n \t\t\r\n \t}else{\r\n \t\tmoveon = true;\r\n \t}\r\n \t\t\r\n \t}\r\n\r\n\t\t\r\n\r\n\r\n\t\tchangeVariable = false;\r\n }\r\n\r\n if(moveon){\r\n \tvar tr = document.createElement('TR');\r\n\t\tvar td = document.createElement('TD');\r\n\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\r\n\t\tvar noNewEventsString = \"- No events today.\";\r\n \t\r\n \tif(classes.length>0){\r\n \t\tvar noNewEventsString = \"- Congratulations, you have no more events today.\";\r\n \t}\r\n \ttd.appendChild(document.createTextNode(noNewEventsString));\r\n \ttr.appendChild(td);\r\n \t\r\n \t\r\n \tvar inlist = false;\r\n \tfor(var i=0;i<notifications.length;i++){\r\n \t\t\r\n\r\n\t\t if(notifications[i].innerHTML==tr.innerHTML){\r\n\t\t inlist = true;\r\n\t\t \r\n\t\t }\r\n\t\t \r\n\t\t }\r\n \tif(inlist == false){\r\n \t\tnotificationTable.appendChild(tr);\r\n \t}\r\n }\r\n\r\n // updateColors();\r\n\r\n \tsetTimeout(showTime, 1000);\r\n}", "showTime(time) {\n const current = new Date(time.time);\n\n const currentMonth = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][current.getMonth()];\n const currentDay = current.getDate();\n const currentYear = current.getFullYear();\n\n const curTime = ui.formatTime(current);\n\n\n this.sunrise.innerHTML = ui.formatTime(new Date(time.sunrise));\n this.sunset.innerHTML = ui.formatTime(new Date(time.sunset));\n this.currentTime.innerHTML = `${curTime}, ${currentMonth} ${currentDay}, ${currentYear}`;\n }", "function showTypeAndDate(){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar $reportHeaderMailingSelectorCount = $e.find(\".reportHeader-mailingSelector .count\");\n\t\tvar $reportHeaderMailingSelectorNeedS = $e.find(\".reportHeader-mailingSelector .needS\");\n\t\tvar $reportHeaderMailingSelectorType = $e.find(\".reportHeader-mailingSelector .type\");\n\t\tvar $reportHeaderMailingSelectorDate = $e.find(\".reportHeader-mailingSelector .date\");\n\t\tvar $reportHeaderPeriod = $e.find(\".reportHeader-period\");\n\t\tvar $reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\tvar setType = smr.getSetAndType(reportType);\n\t\tvar count = setType.set.list().length;\n\t\t//show mailings\t\t\n\t\tif(reportType == smr.REPORT_TYPE.DELIVERABILITY){\n\t\t\tvar title = setType.type;\n\t\t\tif(setType.type==\"VSG\") title = \"Mailing Server Group\";\n\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<span class='type'>\"+title+\"</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t (count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t}else if(reportType == smr.REPORT_TYPE.DELIVERABILITYDOMAINS){\n\t\t\tif(count==0){\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"All Mailing Server Groups\");\n\t\t\t}else{\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\"<span class='type'>Mailing Server Group</span>\" +\n\t\t\t\t\t\t(count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.AUDIENCE){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((selectorList[0].name && selectorList[0].name.length>30) ?selectorList[0].name.substring(0,27)+\"...\" : selectorList[0].name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.USERINSIGHT){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tvar curNum = setType.set.attr(\"UserInsightShowIndex\") || 1;\n\t\t\tvar item = selectorList[curNum-1];\n\t\t\tif(item){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((item.name && item.name.length>30) ?item.name.substring(0,27)+\"...\" : item.name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",item.name)\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(item.email);\n\t\t\t\t//hide the dateAdded 2013-09-16\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(item.dateAdded);\n\t\t\t\tvar renderObj = {\"currentNum\":curNum, \"total\": selectorList.length , \"hasControl\":(selectorList.length>1), \"haveNext\":(curNum<selectorList.length),\"havePrev\":(curNum>1)};\n\t\t\t\tvar html = smr.render(\"tmpl-reportHeader-userPage\",renderObj);\n\t\t\t\t$e.find(\".reportHeader-findUser .user-page\").html(html);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(\"no email\");\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(\"-\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.ABTEST){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else{\n\t\t\tvar selectorType = setType.type;\n\t\t\tvar list = setType.set.list();\n\t\t\tif(selectorType==\"Campaign\"){\n\t\t\t\tvar includeSubOrg = setType.set.attr(\"includeSubOrg\");\n\t\t\t\tif(includeSubOrg){\n\t\t\t\t\tvar tempList = [];\n\t\t\t\t\tvar tempName = {};\n\t\t\t\t\tfor(var i=0;i<list.length;i++){\n\t\t\t\t\t\tif(tempName[list[i].name]) continue;\n\t\t\t\t\t\ttempList.push(list[i]);\n\t\t\t\t\t\ttempName[list[i].name] = true;\n\t\t\t\t\t}\n\t\t\t\t\tcount = tempList.length;\n\t\t\t\t}\n\t\t\t}else if(selectorType==\"Tag\"){\n\t\t\t\tvar tempList = [];\n\t\t\t\tvar tempName = {};\n\t\t\t\t$.each(list,function(i,temp){\n\t\t\t\t\tif(tempName[temp.pid]) return;\n\t\t\t\t\ttempList.push(temp);\n\t\t\t\t\ttempName[temp.pid] = true;\n\t\t\t\t});\n\t\t\t\tcount = tempList.length;\n\t\t\t}\n\t\t\t\n\t\t\t$reportHeaderMailingSelectorCount.html(count);\n\t\t\tif(count != 1){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.show();\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.hide();\n\t\t\t}\n\t\t\tif(reportType==smr.REPORT_TYPE.DOMAINDRILLDOWN){\n\t\t\t\tselectorType = setType.set.attr(\"domainType\");\n\t\t\t\tif(selectorType == \"VSG\") selectorType=\"Mailing Server Group\" ;\n\t\t\t}\n\t\t\t$reportHeaderMailingSelectorType.html(selectorType);\n\t\t}\n\t\t\n\t\tif(setType.set.attr(\"limit\")){\n\t\t\t$reportHeaderPeriod.show();\n\t\t\tvar dateRange = setType.set.period().getDateRange(); \n\t\t\t\n\t\t\tif(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\t\tif(smr.allDateRangeShow){\n\t\t\t\t\t$reportHeaderDate.html(\"All\");\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t\tvar list = setType.set.list();\n\t\t\t\tvar mailingType = list[0]? list[0].mailingType: \"Batch\";\n\t\t\t\tif(mailingType != \"Transactional\" && mailingType != \"transactional\" && mailingType != \"Program\" && mailingType != \"program\"){\n\t\t\t\t\t$reportHeaderDate.parent().hide();\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.parent().show();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(reportType == \"userInsight\"){\n\t\t\t\t\tvar $reportSelectDate = $(\".reportHeader-selectdate\");\n\t\t\t\t\t$reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\t\t\t\tvar period = setType.set.period();\n\t\t\t\t\tif(period.dateType==\"inCustomDateRange\"){\n\t\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$reportHeaderDate.html($reportSelectDate.find(\"select.dateTypeSelect option[value='\"+period.dateType+\"']\").html());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$reportHeaderPeriod.hide();\n\t\t}\n\t}", "function loadTimePicker(){\n Quas.getEl(\"#publish-time-picker\").visible(true);\n let picker = Quas.getEl(\".date-picker\");\n Toolbar.curTime = new Date(Date.now());\n genDateTable();\n\n\n //clicking table data\n let td = document.querySelectorAll(\"#date-table td\");\n for(let i=0; i<td.length; i++){\n td[i].addEventListener('click', function(e) {\n if(this.className === \"allowed\"){\n let curActive = document.querySelector(\"#date-table td.active\");\n if(curActive){\n curActive.className = \"allowed\";\n }\n this.className += \" active\";\n Toolbar.curTime.setDate(Number(this.textContent));\n }\n });\n }\n\n //month buton event listener\n let monthBtns = document.querySelectorAll(\".picker-month\");\n for(let i=0; i<monthBtns.length; i++){\n monthBtns[i].addEventListener(\"click\", function(){\n monthChange(monthBtns[i]);\n });\n }\n}", "function displayReports(displayDay) {\n let displayYear = selectYear.value;\n let displayMonth = parseInt(selectMonth.value) + 1;\n\n if(displayMonth < 10){\n displayMonth = (\"0\" + displayMonth);\n }\n if(displayDay < 10){\n displayDay = (\"0\" + displayDay);\n }\n let displayDate = (displayYear + \"-\" + displayMonth + \"-\" + displayDay);\n let URL = \"http://localhost:3004/weather/\"+displayYear+\"/\"+displayMonth+\"/\"+displayDay;\n let buttonDiv = document.getElementById(\"timeButtons\");\n $.get(URL, function(data){\n let table = document.getElementById(\"reportWholeTable\");\n if(data.length==0){\n // hide table\n table.style.display = 'none';\n buttonDiv.innerHTML = \"No hay informes meteorológicos disponibles hoy\";\n document.getElementById(\"displayTableAnnouncement\").innerHTML = '';\n } else{\n table.style.display = '';\n data.forEach(element => {\n let button = document.createElement(\"button\");\n let textnode = document.createTextNode(element.time);\n button.id=element.id;\n button.classList.add(\"btn\");\n button.classList.add(\"btn-outline-primary\");\n button.addEventListener(\"click\", displayByTime);\n button.appendChild(textnode);\n buttonDiv.appendChild(button);\n });\n }\n \n });\n}", "endDatePanelClick() {\n // change time type to end time mode\n dispatch(modifyInnerState_timeType(2))\n // route to time selector page\n dispatch(modifyInnerState_route(3))\n }", "function onDatePick() {\n calRadioGroupSelectItem(\"view-field\", \"custom-range\");\n refreshHtml();\n}", "function printDate()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_date.innerHTML = time.day + '.' + time.monthNameShort + ' ' + time.year;\n\t}", "function calDisplay()\n{\nweek=7;\nselDate= new Date(opener.user_sel_val_holder);\ntoday = new Date(arguments[0]);\ncurrentVal = new Date(opener.cal_val_holder);\n// as of Danube, PT needs all the dates, including weekend dates, to be\n// hyperlinked in the Calendar for its Date type attributes, whereas PD\n// doesn't want weekend dates to be hyperlinked.\nhyperLinkWeekEndDates = arguments[1] == null ? false : arguments[1];\ncurr_day= today.getDate();\nsel_day= selDate.getDate();\nend_date= getEndDate(currentVal);\ncurrentVal.setDate(end_date);\nend_day=currentVal.getDay();\ncurrentVal.setDate(1);\nstart_day=currentVal.getDay();\nrow=0;\nend_week=week-end_day;\ndocument.writeln(\"<tr>\");\nfor (var odday=0;odday<start_day;odday++,row++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\n\nfor (var day=1;day<=end_date;day++,row++)\n{\nif(row == week)\n{\ndocument.writeln(\"</tr> <tr> \");\nrow=0;\n}\ndocument.writeln(\"<td class=\\\"calendarday\\\"\");\nif(curr_day == day && currentVal.getMonth() == today.getMonth() && currentVal.getFullYear() == today.getFullYear())\ndocument.writeln(\" id=\\\"today\\\" > \");\nelse if(sel_day == day && currentVal.getMonth() == selDate.getMonth() && currentVal.getFullYear() == selDate.getFullYear())\ndocument.writeln(\" id=\\\"selectedDate\\\" > \");\nelse\ndocument.writeln(\" > \");\n\nif(isWeekend(day,currentVal) && !hyperLinkWeekEndDates)\ndocument.writeln(day+\"</td>\");\nelse\n if(sel_day == day)\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\"; title=\\\"\"+ arguments[2]+\" \\\" >\"+day+\"</a></td>\");\n else\n document.writeln(\"<a href=\\\"javascript:selectPeriod(\"+day+\",\"+currentVal.getMonth()+\",\"+currentVal.getFullYear()+\");\\\" >\"+day+\"</a></td>\");\n}\n\nfor (var end=0;end<(end_week-1);end++)\n{\ndocument.writeln(\"<td class=\\\"\"+css[3]+\"\\\">&nbsp;</td>\");\n}\ndocument.writeln(\"</tr>\");\n\n\n}", "function showTime() {\n let today = new Date(),\n hour = today.getHours(),\n min = today.getMinutes(),\n sec = today.getSeconds();\n weekDay = today.getDay();\n day = today.getDate();\n month = today.getMonth();\n\n\n // Set AM or PM\n //const amPm = hour >= 12 ? 'PM' : 'AM';\n\n // 12hr Format\n // hour = hour % 12 || 12;\n\n // Output Time\n time.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(\n sec\n )}`;\n date.innerHTML = `${DAYS[weekDay]}<span> </span>${day}<span> </span>${MONTHS[month]}`;\n //${showAmPm ? amPm : ''}`;\n\n setTimeout(showTime, 1000);\n}", "function PaintDailyTime()\n{\n\tvar Static = true;\n\n\tif (TimeCard.View == 4 && TimeCard.Status != 2 && TimeCard.Status != 3)\n\t{\n\t\tStatic = false;\n\t}\n\t\n\tif (!RepaintScreen && !Static && typeof(self.TABLE.document.TimeEntry) != \"undefined\" && typeof(self.TABLE.document.TimeEntry.lineFc1) != \"undefined\")\n\t{\n\t\tself.TABLE.stylePage();\n\t\tfitToScreen();\n\t\tFillValues(\"Daily\");\n\t}\n\telse\n\t{\n\t\tvar divObj = self.TABLE.document.getElementById(\"paneBody2\");\n\t\tdivObj.innerHTML = PaintTimeCard(\"Daily\", Static);\n\t\tself.TABLE.stylePage();\n\t\tfitToScreen();\n\t\tif (!Static)\n\t\t{\n\t\t\tFillValues(\"Daily\")\n\t\t}\n\t}\n\tRepaintScreen = false;\n}", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function DisplaySchedule()\n{\nHTMLCode = \"<table cellspacing=0 cellpadding=3 border=3 bgcolor=purple bordercolor=#000033>\";\nQueryDay = DefDateDay(QueryYear,QueryMonth,QueryDate);\nWeekRef = DefWeekNum(QueryDate);\nWeekOne = DefWeekNum(1);\nHTMLCode += \"<tr align=center><td colspan=8 class=Titre><b>\" + MonthsList[QueryMonth] + \" \" + QueryYear + \"</b></td></tr><tr align=center>\";\n\nfor (s=1; s<8; s++)\n{\nif (QueryDay == s) { HTMLCode += \"<td><b><font color=#ff0000>\" + DaysList[s] + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><b>\" + DaysList[s] + \"</b></td>\"; }\n}\n\nHTMLCode += \"<td><b><font color=#888888>Sem</font></b></td></tr>\";\na = 0;\n\nfor (i=(1-DefDateDay(QueryYear,QueryMonth,1)); i<MonthLength[QueryMonth]; i++)\n{\nHTMLCode += \"<tr align=center>\";\nfor (j=1; j<8; j++)\n{\nif ((i+j) <= 0) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse if ((i+j) == QueryDate) { HTMLCode += \"<td><b><font color=#ff0000>\" + (i+j) + \"</font></b></td>\"; }\nelse if ((i+j) > MonthLength[QueryMonth]) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse { HTMLCode += \"<td>\" + (i+j) + \"</td>\"; }\n}\n\nif ((WeekOne+a) == WeekRef) { HTMLCode += \"<td><b><font color=#00aa00>\" + WeekRef + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><font color=#888888>\" + (WeekOne+a) + \"</font></td>\"; }\nHTMLCode += \"</tr>\";\na++;\ni = i + 6;\n}\n\nCalendrier.innerHTML = HTMLCode + \"</table>\";\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function dateDisplay()\n{\nduration= opener.repDuration;\nrep_Period= opener.currRepEnd;\nweek=7;\ndate= new Date(curr_date);\nsel_day=date.getDate();\nend_date= getEndDate(date);\ndate.setDate(end_date);\nend_day=date.getDay();\ndate.setDate(1);\nstart_day=date.getDay();\nrow=0;\nend_week=week-end_day;\ndocument.writeln(\"<tr>\"); \nfor (var odday=0;odday<start_day;odday++,row++)\n{\ndocument.writeln(\"<td class='\"+css[3]+\"'>&nbsp;</td>\");\n}\n\nfor (var day=1;day<=end_date;day++,row++)\n{\nif(row == week)\n{\ndocument.writeln(\"</tr> <tr align='right'> \");\nrow=0;\n}\ndocument.writeln(\"<td class='\"+getCssClass(day,duration,date,rep_Period)+\"'>\");\n\nif(isWeekend(day,date))\n{\ndocument.writeln(day+\"</td>\");\n}\nelse{\ndocument.writeln(\"<a href='javascript:clickDatePeriod(\"+day+\",\"+date.getMonth()+\",\"+date.getFullYear()+\");' >\"+day+\"</a></td>\");\n}\n\n}\n\nfor (var end=0;end<(end_week-1);end++)\n{\ndocument.writeln(\"<td class='\"+css[3]+\"'>&nbsp;</td>\");\n}\ndocument.writeln(\"</tr>\"); \n}", "function printTime() {\n $(\"#currentDay\").text(todaysDate);\n }", "function Calendar_OnDateSelected(sender, eventArgs) {\r\n // limpa o span das datas\t \r\n var dtSelecionada = document.getElementById(\"dtSelecionada\");\r\n dtSelecionada.innerHTML = \"\";\r\n // obtém a referencia para o calendario\r\n var calendario = $find(IdCalendario);\r\n // obtém as datas selecionadas\r\n var dates = calendario.get_selectedDates();\r\n\r\n // para cada data..\r\n for (var i = 0; i < dates.length; i++) {\r\n var date = dates[i];\r\n var data = date[2] + \"/\" + date[1] + \"/\" + date[0];\r\n data += \" \"; // adiciona um espaco ao final para dar espaco entre as datas\r\n dtSelecionada.innerHTML += data;\r\n }\r\n}", "function fillTimeReport(times) {\n\tvar tableBody = $('#time-pane tbody');\n\n\ttableBody.empty();\n\n\tvar categories = Object.keys(times);\n\tif(categories.length > 0) {\n\t\t$('#time-pane #no-categories').hide();\n\t\t$('#time-pane #categories').show();\n\n\t\tvar oneMinute = 60,\n\t\t\toneHour = oneMinute*60,\n\t\t\toneDay = oneHour*24;\n\n\t\tcategories.forEach(function (category) {\n\t\t\tvar line = $('<tr>');\n\t\t\tvar categoryCell = $('<td>', {'text': category.replace('_', ' ')});\n\n\t\t\tvar timeSpent = times[category].duration;\n\n\t\t\tvar days = Math.floor(timeSpent/oneDay),\n\t\t\t\thours = Math.floor((timeSpent%oneDay)/oneHour),\n\t\t\t\tminutes = Math.floor((timeSpent%oneDay)%oneHour/oneMinute),\n\t\t\t\tseconds = Math.floor(((timeSpent%oneDay)%oneHour)%oneMinute);\n\n\t\t\tvar daysString = days>0 ? days + ' day' + (days>1 ? 's ' : ' ') : '',\n\t\t\t\thoursString = hours>0 ? hours + ' hour' + (hours>1 ? 's ' : ' ') : '',\n\t\t\t\tminutesString = minutes>0 ? minutes + ' minute' + (minutes>1 ? 's ' : ' ') : '',\n\t\t\t\tsecondsString = seconds>0 ? seconds + ' second' + (seconds>1 ? 's' : '') : '';\n\n\t\t\tvar timeString = daysString + hoursString + minutesString + secondsString;\n\t\t\tif(timeString === '') {\n\t\t\t\ttimeString = self.options.no_time_spent;\n\t\t\t}\n\n\t\t\tvar timeSpentCell = $('<td>', {'text': timeString});\n\n\t\t\tline.append(categoryCell).append(timeSpentCell);\n\t\t\ttableBody.append(line);\n\t\t});\n\t} else {\n\t\t$('#time-pane #categories').hide();\n\t\t$('#time-pane #no-categories').show();\n\t}\n}", "function showDate()\r\n{\r\n\tvar today=new Date();\r\n\tvar displayDate = checkTime(today.getDate()) + '/' + checkTime(today.getMonth()+1) + '/' + today.getFullYear();\r\n\t$(\"#menu-date\").html(displayDate);\r\n}", "function showDate(choose){\n var chooseTimeZone = choose;\n chooseTimeZone.setMinutes(chooseTimeZone.getMinutes() - timeZoneToday);\n var local = $('#local').data('local')\n var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\n $('#date-choose').html(chooseTimeZone.toLocaleDateString(local, options));\n if (dateOpen.length){\n $.each(dateOpen, function(i, d) {\n var day = new Date(d.day.date.slice(0, 10));\n if (choose.getDate() == day.getDate() && choose.getMonth() == day.getMonth() && choose.getFullYear() == day.getFullYear()){\n $('#nb-places').html(1000 - d.nbVisitor);\n return false;\n }\n $('#nb-places').html('1000');\n });\n } else {\n $('#nb-places').html('1000');\n }\n $('#choose').css('display', 'block');\n // \n if ((choose.getDate() == today.getDate() && choose.getMonth() == today.getMonth() && choose.getFullYear() == today.getFullYear() && today.getHours() > 13)){\n $('#button-day').css('display', 'none');\n } else {\n $('#button-day').css('display', 'inline-block');\n }\n $('#button-half-day').css('display', 'inline-block');\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function initEventTimeOptions() {\n\t// Set default\n\t$('#selected_time').html(timeMap['any']);\n\t\n\tvar container = $('#time_options').empty();\n\tvar table = $('<table></table>');\n\tcontainer.append(table);\n\n\t// Add all time options to the dialog\t\n\tfor (var i in timeMap) {\n\t\tvar row = $('<tr></tr>');\n\t\ttable.append(row);\n\t\tvar col = $('<td></td>');\n\t\trow.append(col);\n\t\tcol.attr(\"onmouseover\", \"this.style.backgroundColor = '#ADDFFF';\");\n\t\tcol.attr(\"onmouseout\", \"this.style.backgroundColor = 'white';\");\n\t\tcol.attr(\"onclick\", \"handleTimeFilterClick('\" + i + \"', '\" + timeMap[i] + \"');\");\n\t\tcol.html(timeMap[i]);\n\t}\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function setDatetimeDefault() {\n\t$(\"#nav\").css({\"display\": \"none\"});\n\tvar x = new Date();\n\tvar formattedDate = new Date();\n\tvar dateString = (formattedDate.getDate().toString());\n\tvar monthString = ((formattedDate.getMonth()+1).toString());\n\tvar dateMonthString = (monthString + '/' + dateString);\n\tvar n = formattedDate.getDay();\n\tvar minutesLow = '';\n\tvar minutesHigh = '';\n\tvar ampmLow = '';\n\tvar ampmHigh = '';\n\tvar hoursLow = '';\n\tvar hoursHigh = '';\n\teventCoords = [];\t\n\tdateTime = getDayNow();\n\t// getDayNow();\n\t// getTimeNow();\n\tdocument.getElementById(\"selectedTime\").value = x.getHours() + (x.getMinutes()/60);\n\tdocument.getElementById('dayofweek').innerHTML = (days[n]+'&nbsp;'+dateMonthString);\n\tif (x.getMinutes() < 10) {\n\t\tminutes = '0' + String(x.getMinutes());\n\t} else {\n\t\tminutes = String(x.getMinutes());\n\t}\n\tif (selectedTime < 12) {\n\t\tampm = 'am';\n\t} else {\n\t\tampm = 'pm';\n\t}\n\n\n\tif ((Math.floor(selectedTime) % 12) === 0) {\n\t\thours = 12;\n\t} else {\n\t\thours = String(Math.floor(selectedTime) % 12);\n\t}\n\n\tvar prettyTime = \"Driver history from&nbsp;\" + hours + \":\" + minutes + \" \" + ampm;\n\tdocument.getElementById('timenavtime').innerHTML = (prettyTime);\n\tgetData();\n}", "function show_date(){\r\n\tvar date = new Date();\r\n\tvar get_date = date.getDate();\r\n\tvar get_month = date.getMonth();\r\n\tvar get_year = date.getFullYear();\r\n\tvar get_time = date.toLocaleTimeString();\r\n\tdocument.getElementById(\"date\").innerHTML = \"Date : \"+get_date+\"/\"+Number(get_month+1)+\"/\"+get_year;\r\n\tdocument.getElementById(\"time\").innerHTML = \"Time : \"+get_time;\r\n\r\n\r\n}", "function displayDate() { \n let d = new Date();\n\n // Day\n let day = d.getDate();\n\n // Month\n let month = d.getMonth();\n \n // Displayt the date. Hours section used for day and Minutes section for month.\n setHours(day);\n setMins(month);\n \n // Wait timeout seconds and then re-display the time.\n setTimeout(displayUpdate, settings[KEY_TIMEOUT].values[0].value * 1000);\n}", "function getRealSelectedTimeString() {\n return models[\"ChesapeakeBay_ADCIRCSWAN\"][\"lastForecast\"].clone().add(currentHourSetting, \"hours\").format(\"YYYY-MM-DD HH:MM:SS\")\n}", "function displayTimeFilter(chart) {\n var filters = chart.filters();\n var t = document.getElementById(\"time-chart-filter\");\n if(filters.length) {\n var range = filters[0];\n var format = d3version3.time.format(\"%m/%d/%Y\");\n t.innerHTML = \"<b>selected</b>: \" + format(range[0]) + ' to ' + format(range[1]);\n t.style.display = 'block';\n }\n else {\n t.innerHTML = \"\";\n t.style.display = 'none'\n }\n }", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "setDisplayDateTime() {\n this.displayDate = this.currentDate.toLocaleDateString(this._locale, {\n day: '2-digit',\n month: 'long',\n year: 'numeric'\n });\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale);\n }", "function time() {\n \n let currentdate = new Date(); \n let timenow = + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n document.getElementById(\"datebtn\").innerHTML = timenow;\n \n }", "function updateBannerText(time=\"entire\",dateindex=0,hourindex=0 )\n{\n\tdocument.getElementById(\"currentRequestText\").innerHTML = \"\";\n\tdocument.getElementById(\"currentRequestText\").innerHTML = \"P.A.W. Report For Area: <b><font color='#FFCC33'>\" + currentPage + \"</b></font><br>\";\n\t\n\tdocument.getElementById(\"currentRequestText\").innerHTML += \"Date(s): \";\n\t\n\tif (startDate.value == \"\" || endDate.value ==\"\") //Today\n\t{\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> Today</b></font><br>\";\n\t}\n\t\n\telse if (startDate.value == endDate.value ) //another day\n\t{\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+ startDate.value + \"</b></font><br>\";\n\t}\n\t\n\telse if (time == \"hour\" ) //one day\n\t{\n\t\t\n\t\tvar textDate = moment(startDate.value, 'YYYY-MM-DD').add(dateindex, 'days');\n\t\t\n\t\tvar day = textDate.format('DD');\n\t\tvar month = textDate.format('MM');\n\t\tvar year = textDate.format('YYYY');\n\t\tvar date = month + '-' + day + '-' + year;\n\t\t\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+ date + \"</b></font><br>\";\n\t}\n\t\n\telse // Set of Days\n\t{\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+ startDate.value + \"</b></font>\";\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> ~ </b></font> \"\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+endDate.value+ \"</b></font><br>\";\n\t}\n\t\t\n\t\t\n\tdocument.getElementById(\"currentRequestText\").innerHTML += \" Client Connection State:\" \n\t\n if (document.getElementById('all').checked){document.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> Connected and Probing</b></font>.<br> \";}\n else if (document.getElementById('detected').checked){document.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> Probing</b></font>.<br>\";}\n else{document.getElementById(\"currentRequestText\").innerHTML += \" <b><font color='#FFCC33'>Connected</b></font><br> \";}\n \n\t\n\tdocument.getElementById(\"currentRequestText\").innerHTML += \" Time: \";\n\t\n\tif (time ==\"entire\")\n\t{\n\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>All Day</b></font>\";\t\n\t}\n\t\n\telse\n\t{\n\t\t if (hourindex == 0)\n\t\t {\n\t\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> 12 AM</b></font>\";\t\n\t\t }\n\t\t\t\n\t\t else if (hourindex < 12)\n\t\t {\n\t\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+hourindex + \"AM</b></font>\";\t\n\t\t }\n\t\t else if (hourindex == 12)\n\t\t {\n\t\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'> 12 PM</b></font>\";\t\n\t\t }\n\t\t \n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"currentRequestText\").innerHTML += \"<b><font color='#FFCC33'>\"+ (parseInt(hourindex) - 12).toString() + \"PM</b></font>\";\t\n\t\t}\n\t}\n\t\n}", "function render_order_date_time(dateObj) {\n\tvar date = $.datepicker.formatDate(\"DD, MM d, yy\", dateObj);\n\t\n\tvar hours = dateObj.getHours();\n\tvar minutes = dateObj.getMinutes();\n\tvar ampm = hours >= 12 ? 'pm' : 'am';\n\thours = hours % 12;\n\thours = hours ? hours : 12; \n\tminutes = minutes < 10 ? '0' + minutes : minutes;\n\tvar time = hours + ':' + minutes + ' ' + ampm;\n\t\n\treturn date + \" \" + time;\n}", "setDisplayDateTime() {\n this.displayDate = this.currentDate.toLocaleDateString(this._locale)\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale)\n }", "function showTime(){\n // let today=new Date(2020,06,10,08,33,30);{Testing purpose}\n let today=new Date(),\n date=today.getDate(),\n hour=today.getHours(),\n min=today.getMinutes(),\n sec=today.getSeconds();\n\n //Set AM or PM using ternanary operator(Shortend)\n const amPm=hour >= 12 ? 'PM' :'AM' ;\n\n //12 hour format\n hour = hour % 12 || 12;\n time.innerHTML=`${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)} ${showAmPm ? amPm :''}`;\n setTimeout(showTime,1000); \n\n }", "function optionChanged(optDate) {\r\n\r\n updateDailyChart(optDate);\r\n selectedDate = optDate;\r\n}", "function printTime()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_timeday.innerHTML = time.hour + ':' + time.min;\n\t}", "toShowCompletedDate(){\n return `${this.toShowDate()}, ${this.toShowTime()}`;\n }", "function test_timepicker_should_show_date_when_chosen_once() {}", "function displayTimes() {\n\n // iterate through the daySchedule object then display the corresponding value in the time container on the page\n for (var t = 0; t < daySchedule.length; t++) {\n\n // set the format for the currentTime\n $('#time-' + t).text(moment(daySchedule[t].time, \"HH\").format(\"h A\"));\n\n }\n}", "function show_today(){\n period=1;\n draw_building_chart(period,variable);\n}", "function renderDate() {\n if (myStorage.getItem(\"use24hr\") == \"true\") {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, H:mm:\"));\n } else {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, h:mm:\"));\n }\n }", "function addReportTime (data, id) {\r\n\t//Div element where the report time will be added\r\n\tvar div = document.getElementById(id);\r\n\t//Create the heading element\r\n\tvar head = document.createElement(\"h3\");\r\n\t//Create the text\r\n\thead.appendChild(document.createTextNode(\"Report generated on:\"));\r\n\tvar par = document.createElement(\"p\");\r\n\tpar.appendChild(document.createTextNode(data[\"DateTime\"]));\r\n\t//Add to DOM\r\n\tdiv.appendChild(head);\r\n\tdiv.appendChild(par);\r\n}", "function fillTimes() {\n let now = new Date();\n startTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n endTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n}", "function onShowSchedule(){\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause(\"wr.wr_id\",$(\"wr.wr_id\").value,'=');\n\t\n\tView.openDialog(\"ab-helpdesk-workrequest-scheduling.axvw\",restriction);\n}", "function onTimeSelectionChange() {\n drawTimeBlocks();\n drawInfoBox(timeSelectionControl.value);\n updateTimeSelectionIndicator(timeSelectionControl.value);\n }", "function action() {\n var lblResultat = $(\"#\" + that.data.idLibelle);\n var now = new Date();\n // on affiche juste la date pour cet exemples\n lblResultat.append(\"<br/>\" + now);\n }", "function onDateSelect(event) {\n // Initialize the clock, if not already done\n initClock();\n\n var dateArray = this.getAttribute('data-date').split('-');\n currentDateTime.setFullYear(parseInt(dateArray[0]), parseInt(dateArray[1])-1, parseInt(dateArray[2]));\n\n btnPreviousMonth.style.display = 'none';\n btnNextMonth.style.display = 'none';\n addClass(calendar, 'datipi-circle-hidden');\n\n window.setTimeout(function () {\n calendar.style.display = 'none';\n headline.innerHTML = 'Select Hour';\n clock.style.display = 'block';\n }, 350);\n\n updateInputValue();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function displayTimeCET(data){\n const today = data.formatted.split('');\n console.log(today);\n const date = today[5]+today[6]+today[7]+today[8]+today[9]+today[4]+today[0]+today[1]+today[2]+today[3];\n console.log(date);\n document.getElementById('paris_date').innerHTML= date\n document.getElementById('berlin_date').innerHTML= date\n document.getElementById('barcelona_date').innerHTML= date\n document.getElementById('rome_date').innerHTML= date\n\n const time= today[11]+today[12]+today[13]+today[14]+today[15];\n console.log(time);\n document.getElementById('paris_time').innerHTML= time;\n document.getElementById('berlin_time').innerHTML= time;\n document.getElementById('barcelona_time').innerHTML= time;\n document.getElementById('rome_time').innerHTML= time;\n}", "function showTime() {\n\t\ttry {\n\t\t\tvar hours = time.getUTCHours();\n\t\t\tvar minutes = time.getUTCMinutes();\n\t\t\tvar seconds = time.getUTCSeconds();\n\t\n\t\t\t// build the human-readable format\n\t\t\tvar timeValue = \"\" + ((hours > 12) ? hours - 12 : hours);\n\t\t\ttimeValue += ((minutes < 10) ? \":0\" : \":\") + minutes;\n\t\t\ttimeValue += ((seconds < 10) ? \":0\" : \":\") + seconds;\n\t\t\ttimeValue += (hours >= 12) ? \" pm\" : \" am\";\n\t\n\t\t\tvar clockElement;\n\t\t\tif ((piratequesting.sidebar) && (clockElement = sidebar.contentDocument.getElementById('servertime'))) {\n\t\t\t\tclockElement.setAttribute(\"value\", timeValue);\n\t\t\t}\n\t\t} \n\t\tcatch (e) {\n\t\t\tdumpError(e);\n\t\t}\t\n\t}", "function paintGridDate(){\r\n $('.futureDate').text(gridSimulatorVar.future_date.format(gridSimulatorCons.moment_format))\r\n}", "function ShowTime() {\n $(\"#hdrDateTime\").html(formatAMPM());\n}", "function ShowDateAndTime(){\n\n var today = new Date();\n var month = today.getMonth();\n var day = today.getDay();\n var year = today.getFullYear();\n var hour = today.getHours();\n var minute = today.getMinutes();\n var seconds = today.getSeconds();\n const options_date = {year: 'numeric', month: 'long', day: 'numeric' };\n\t\tconst options_weekday = { weekday: 'long' };\n //document.getElementById('id_alarm_browser_width').innerHTML = 'Browser Height = ' + window.innerHeight;\n //document.getElementById('id_alarm_browser_heigth').innerHTML = 'Browser Width = ' + window.innerWidth;\n document.getElementById('id_header_date').innerHTML = today.toLocaleDateString('de-DE', options_date);\n document.getElementById('id_header_day_and_time').innerHTML = today.toLocaleDateString('de-DE', options_weekday) +\" \" + leadingzero(hour) + ':' + leadingzero(minute) + \":\" + leadingzero(seconds);\n document.getElementById('id_header_user').innerHTML = \"none\";\n \n \n /*if(window.innerWidth < 1000)\n sidebar_handle(\"id_alarm_sidebar\", 0);\n else\n sidebar_handle(\"id_alarm_sidebar\", 1);\n \n if(window.innerWidth < 700)\n sidebar_handle(\"id_navigation_sidebar\", 0);\n else\n sidebar_handle(\"id_navigation_sidebar\", 1);*/\n\t\t//window.status = \"test\";\n}", "function showTimeDay() {\r\n var today = new Date();\r\n var time = today.getHours() + \":\" + today.getMinutes(); //getting time \r\n\r\n document.getElementById('topTime').innerHTML = time\r\n\r\n document.getElementById('time').innerHTML = time; //showing time on page\r\n\r\n var weekDays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];//array of days\r\n document.getElementById('day').innerHTML = weekDays[today.getDay()] // showing todays day on page\r\n\r\n}", "setDisplayDateTime() {\n this._displayTime = new Date().toLocaleTimeString(this._locale);\n this._displayDate = new Date().toLocaleDateString(this._locale,\n {\n day: \"2-digit\",\n month: \"long\",\n year: \"numeric\"\n }\n );\n }", "function reportTime(){\n const date = new Date();\n const {time, mode} = getTime();\n const reportTime = `${time} ${mode} ${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()}`;\n return reportTime ;\n}", "function showTimeSelection() {\n showLoadingSpinner();\n if (canPickWebinar()) loadWebinars();\n\n registerLead($form, function(err) {\n hideLoadingSpinner();\n processing = false;\n if (err) {\n showError();\n } else if (canPickWebinar()) {\n transitionSteps(getCurrentStep(), $steps.webinars);\n } else {\n showSuccess();\n }\n });\n }", "function appointmentButton(event) {\n event.stopPropagation();\n closeOpenedPopups(event.target);\n if (event.target.parentElement.children[1].classList.contains(\"show\")) {\n var popupElement = event.target.parentElement.children[1];\n popupElement.classList.remove(\"show\");\n dayOptionSelected = popupElement.children[0].querySelector(\"option:checked\");\n hourOptionSelected = popupElement.children[1].querySelector(\"option:checked\");\n popupElement.parentElement.children[0].innerText = dayOptionSelected.innerText + \" \" + hourOptionSelected.innerText;\n var date = new Date(0);\n date.setMonth(1);\n var ms = date.getTime() + 86400000 * dayOptionSelected.value + 1000 * 60 * 60 * hourOptionSelected.value;\n var newDate = new Date(ms);\n popupElement.parentElement.setAttribute(\"time\", newDate.getTime());\n $(popupElement.parentElement).data('onClosePicker')();\n } else\n event.target.parentElement.children[1].classList.add(\"show\");\n}", "function displayDateAndTime() {\n return new Date();\n}", "function displayAll() {\n\thomeInterval = setInterval(function() {\n\t\tvar newDate = new Date();\n\tvar date = newDate.getDate();\nvar dayList = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nvar day = dayList[newDate.getDay()];\nvar monthList = [\"Jan\", \"Feb\", 'March', 'April', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];\nvar month = monthList[newDate.getMonth()];\nvar hours = newDate.getHours();\nvar mins = newDate.getMinutes();\n\tdocument.getElementById('date').innerHTML = day + \", \" + date + \" \" + month;\n\tif (hours < 10) {\n\t\tdocument.getElementsByClassName('time')[0].innerHTML = \"0\" + hours + \" : \";\n\t} else \tif (hours == 0) {\n\t\tdocument.getElementsByClassName('time')[0].innerHTML = \"00\" + \" : \";\n\t} else {\n\t\tdocument.getElementsByClassName('time')[0].innerHTML = hours + \" : \";\n\t}\n\tif (mins < 10) {\n\t\tdocument.getElementsByClassName('time')[1].innerHTML = \"0\" + mins;\n\t} else \tif (mins == 0) {\n\t\tdocument.getElementsByClassName('time')[1].innerHTML = \"00\";\n\t} else {\n\t\tdocument.getElementsByClassName('time')[1].innerHTML = mins;\n\t}\n}, 1000);\n}", "function today() {\n document.getElementById(\"day\").innerHTML = days[d.getDay()];\n\ndocument.getElementById(\"time\").innerHTML = d.timeNow();\n}", "function showdate() {\r\n \tdocument.getElementById(\"eventFunctions\").innerHTML = Date()\r\n }", "showSelectedData() {\n const findRanking = (dateString) => {\n return this.data.rankings.find((ranking) => {\n return Form.getDropDownDate(ranking.date) === dateString;\n });\n };\n this.updateGraph(findRanking(this.dateFromElement.value), findRanking(this.dateToElement.value), parseInt(this.topNRanksElement.value, 10));\n }", "function getTime() {\n\tvar today = new Date();\n\tseperator();\n\tOutput('<span>>time:<span><br>');\n\tOutput('<span>' + today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate() + ' ' + today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds() + '</span></br>');\n}", "function getSelectedDate()\n{\nreturn curr_date;\n}", "function dateAdvanced() {\n $(\"#mnth-list\").toggleClass(\"hidden\");\n $(\"#date-inp\").toggleClass(\"hidden\");\n $(\"#mnth-wraper\").toggleClass(\"text select\");\n date_src = !date_src;\n if (date_src) {\n $(\"#dsrc\").html(\"Date:\");\n } else {\n $(\"#dsrc\").html(\"Month:\");\n }\n // console.log(date_src);\n}", "function changeTime() {\n\tselectedTime = $(\"#selectedTime\").val();\n\t//map.setView(center, 12)\n\teventCoords = [];\n\tvar x = selectedTime * 2;\n\tvar min = '';\n\tif (x % 2 === 1) {\n\t\tmin = '30';\n\t} else if (x % 2 === 0) {\n\t\tmin = '00';\n\t}\n\tvar ampm = '';\n\tif (x < 24) {\n\t\tampm = 'am';\n\t} else if (x >= 24) {\n\t\tampm = 'pm';\n\t};\n\n\tvar hours = '';\n\tif (x === 0 || x === 1 ||\n\t\tx === 24 ||x === 25 ||\n\t\tx === 48) {\n\t\thours = '12';\n\t} else {\n\t\thours = String(Math.floor(selectedTime) % 12)\n\t}\n\tvar prettyTime = \"Driver history from&nbsp;\" + hours + \":\" + min + \" \" + ampm;\n\tdocument.getElementById('timenavtime').innerHTML = prettyTime;\n\tgetData();\n}", "onTimeChanged () {\n this.view.renderTimeAndDate();\n }", "function displayDateTime() {\n $(\"#currentDay\").text(\"Today is: \" + moment().format(\"dddd, MMMM Do YYYY\"));\n $(\"#currentTime\").text(\"Time is now: \" + moment().format(\"h:mm:ss A\"));\n }", "getTimePeriod() {\n var param = FlowRouter.getParam(\"reportType\");\n\n if(param == \"daily\") {\n return \"Daily Timesheet Report\";\n } else if (param == \"weekly\") {\n return \"Weekly Timesheet Report\";\n } else if (param == \"monthly\") {\n return \"Monthly Timesheet Report\";\n } else if (param == \"date_range\") {\n return \"Timesheet Report\";\n }\n }", "function executionDate(data){\n\t\n\tvar date = data.executionTime;\n\t\n\t$(\"#date\").append('<p class=\"date\">'+ date +'</p>');\n}", "function displayTime() {\n var curr = moment().format(\"MM-DD-YYYY HH:mm:ss\");\n currentDayEl.text(curr);\n}", "function showOption() {\n\tclearRow();\n\tshowCalendar($(\"#m_select\").val(), $(\"#y_select\").val());\n}", "showEvents() {\n this.showEventTimespans();\n this.showRaterTimelines();\n }", "function setPlanner() {\n let timerInterval = setInterval(function () {\n let currentDateTime = moment().format('dddd, MMMM Do YYYY, h:mm:ss a');\n date.text(currentDateTime);\n }, 1000);\n//display the saved events from the local storage in the event taskbar\n $.each(Object.entries(localStorage), function (x) {\n time = Object.entries(localStorage)[x][0];\n eventInfo = Object.entries(localStorage)[x][1];\n let eventDetails = $(`#eventDetails-${ JSON.parse(time) }`);\n if (eventInfo !== null) {\n eventDetails.val(JSON.parse(eventInfo));\n }\n });\n}", "function showHourly() {\n hourlyEntry.style.display = \"grid\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "function renderHourList(selectedDate) {\r\n var hourArr = [];\r\n for (var i = 0; i < 12; i++) {\r\n hourArr.push(i + 1);\r\n }\r\n fillSelectList(listHour, hourArr);\r\n listHour.selectedIndex = hourArr.indexOf(selectedDate.getHours() > 12 ? selectedDate.getHours() - 12 : selectedDate.getHours());\r\n }", "function timeChartMouseClick(d,i)\n{\n\tvar selectedDateTime = new Date(d.attributes[dimension]);\n\teventSliderTimeChartDotClicked.selectedDateTime = selectedDateTime;\n\t\n\t//Update Chart to Select this new date\n\tselectActivePoint(selectedDateTime);\n\n\t//Fire off an event so that the other layout controls can update\n\tdocument.dispatchEvent(eventSliderTimeChartDotClicked);\n}", "showDate() {\n\n const date = new Date(this.props.date);\n\n const hours = date.getHours();\n\n const minutes = (date.getMinutes()<10 ? '0' : '')+date.getMinutes();\n\n return (\n <td className=\"RideEntryField\" id=\"datestamp\">{hours}:{minutes}</td>\n );\n }", "function displayReport(report){\n var data = [];\n for(var key in report){\n data.push([Number(key), report[key]]);\n }\n data.sort(function(d){return d[0]});\n var report = d3.select(\"#report\");\n report.selectAll('*').remove();\n var title = report.append(\"h3\");\n var total = 0;\n report.selectAll('p')\n .data(data)\n .enter()\n .append('p')\n .text(function(d){\n // console.log(d[1])\n var weekSum = 0;\n for(var item of d[1]){\n weekSum += item.Amount;\n }\n total += weekSum;\n return `Week Starting ${weekToDate(d[0])}: $${weekSum}`;\n })\n var titleTxt\n if(!currentReport.all){\n titleTxt = `${window.myName}'s Total (${currentReport.start} to ${currentReport.end}): $${total}`;\n }\n else{\n titleTxt = `${window.myName}'s Total Expenses: $${total}`;\n }\n title.text(titleTxt);\n}", "function getReferralStatusTimeFrameChart(){\n\t\t$('#referralStatusWait').show();\n\t\tgetParamsForTimeFrame();\n\t\t$.ajax({\n\t\t\turl: referralByStatusUrl+'TimeFrame',\n\t context: document.body,\n\t method: \"POST\",\n\t data: { search_entity: searchEntity, from_time_val: fromTimeVal, to_time_val: toTimeVal },\n\t success: function(response){\n\t $('#referralStatusWait').hide();\n\t $('#referralStatusChart').html(response);\n\t }});\n\t}", "function getReportQueryFromControlPanel() {\n \n var reportQuery = {\n 'type': $(\"[name='radio-type']:checked\").val(),\n 'start': $('#time-span-button-start').data('time-span-start'),\n 'end': $('#time-span-button-end').data('time-span-end'),\n 'valence': $(\"[name='radio-valence']:checked\").val()\n };\n \n return reportQuery;\n}", "function show_date() {\n let time = document.getElementById('time');\n time.innerHTML = Date();\n}", "function displayPractice() {\n\tvar d = new Date();\n\tvar day = d.getDay();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n // in case of pool closing set day = 8 practice canceled for repairs; day=9 practice canceled for meet -------------------------------------------------\n //if (month == 6 && date == lastPractice) {day = 7};\n if (RVCCclosed === true) {day = 8};\n\n\tif (month === 4 && date < firstPractice) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n\t} else if((month === lastmonthPractice && date > lastPractice) || (month > lastmonthPractice) ) {\n\t\t\t\t$(\"#todayschedule\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n\t}else if ((month === 4 && date >= firstPractice) || (month === 5 && date < changeDate)) {\n\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n $(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"The RVCC Pool is CLOSED<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"The RVCC Pool is CLOSED<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n break;\n\n\t\t}\n } else if (month === lastmonthPractice && date == lastPractice) {\n switch (day) {\n default:\n $(\"#todayschedule\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n break;\n }\n\t} else if ( month === 5 && date >= changeDate || month === 6 || month === 7 && date <= lastPractice) {\n\t\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n break;\n case 7:\n $(\"#todayschedule\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n $(\"#todayschedule2\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"RVCC Closed for Repairs<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"RVCC Closed for Repairs<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n\n\t\t}\n\t} else if (month >= 0 && month < 4) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n\t} else {\n $(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n }\n}", "function handleTimePicker(time, inst) {\n\tif (_timeSelected) {\n\t\t_dataChegada = new Date(_dataChegada.getFullYear(), _dataChegada.getMonth(), _dataChegada.getDate(), inst.hours, inst.minutes);\n\t};\n\t_timeSelected = false;\n}", "function dateTimePopulate (event) {\n const currentDateTime = new Date();\n let currentDate, currentTime = '';\n let month = currentDateTime.getMonth() + 1;\n let day = currentDateTime.getDay() + 1;\n let hour = currentDateTime.getHours();\n let year = currentDateTime.getFullYear();\n let minutes = currentDateTime.getMinutes();\n\n if (month < 10) month = \"0\" + month;\n if (day < 10) day = \"0\" + day;\n if (hour < 10) hour = \"0\" + hour;\n if (minutes < 10) minutes = \"0\" + minutes;\n\n currentDate = `${year}-${month}-${day}`;\n currentTime = `${hour}:${minutes}`;\n\n $(event.currentTarget).next('form').find('.date-dash').val(currentDate);\n\n if ($(event.currentTarget).next('form').find('.time-dash')) {\n $(event.currentTarget).next('form').find('.time-dash').val(currentTime);\n }\n\n}", "function renderDates(data) {\n\tvar sunrise = new Date(1000 * data.sys.sunrise);\n\tvar sunset = new Date(1000 * data.sys.sunset);\n\n outputSunrise.textContent = moment(sunrise).format(\"HH:mm\");\n outputSunset.textContent = moment(sunset).format(\"HH:mm\");\n\t\n}", "function callInformation() {\n todaysTimes.forEach(function(_thisTime) {\n $(`#${_thisTime.id}`).val(_thisTime.information);\n })\n}", "function displayTime() {\n var today = new Date();\n \n //gathers information about current hour, min and sec. \n //Add zero at the head if it is a single digit number.\n var currentHour = addZero(today.getHours());\n var currentMin = addZero(today.getMinutes());\n var currentSec = addZero(today.getSeconds());\n \n // for formatting the display.\n hourElement.innerHTML = currentHour + \":\";\n minElement.innerHTML = currentMin + \":\";\n secElement.innerHTML = currentSec;\n }", "function C17270_Multiple_different_times_can_be_selected_Same_Date()\n{ \n InitializationEnviornment.initiliaze(); \n AppLoginLogout.login();\n var keyWordNm =\"Daily Admission\";\n var packageNm = \"Date/Time\";\n var subPakNm =\"Children (Ages 3-12)\"; \n var qty =3;\n var qty2 = qty+1;\n var dateD = CommonCalender.getTodaysDate();\n var dtFmt = aqConvert.DateTimeToFormatStr(dateD, \"%#m/%#d/%Y\");\n var givenPaymentType =\"Cash\";\n try {\n Log.AppendFolder(\"C17270_Multiple_different_times_can_be_selected_Same_Date\");\n// OrderInfo.prototype.OrderID = 0;\n// WrapperFunction.selectKeywordName(keyWordNm); \n// SelectQuantityFromHeader.selectQuantity(qty); \n// selectPackage(packageNm,subPakNm); \n// if(datetimeformSubWindow.Exists){ \n// selectDateFromSubWindow(dateD); //mm-dd-yyyy \n// selectAvailableTimeFromSubWindow(\"11:00 AM\"); \n// selectNextButtonFromSubWindow();\n// } \n// selectPackage(packageNm,subPakNm);\n// if(datetimeformSubWindow.Exists){ \n// selectDateFromSubWindow(dateD); //mm-dd-yyyy \n// try { \n// aqUtils.Delay(3000);\n// availableTimedatagroup.ListItem(1).Click();\n// aqUtils.Delay(1000);\n// } catch (e) {\n// \t\tmerlinLogError(\"Oops! There's some glitch in the script: Unable to select differnt time \" + e.message);\n// \t}\n// selectNextButtonFromSubWindow();\n// qty = qty+1;\n// } \n// VerifyCheckProperty.compareStringObj(labelExtralabel.Caption,\"(Multiple Date/Times)\");\n// var cnt = datagroupRateslistItems.ChildCount;\n// var itemCount =0;\n// for (let i=0;i<cnt;i++){\n// try{\n// temp = datagroupRateslistItems.Child(i).Group(0).Child(2).Caption;\n// itemCount = itemCount + parseInt(temp);\n// }catch(e){\n// merlinLogError(\"Unable to get count\");\n// }\n// } \n// if(itemCount != qty){\n// merlinLogError(\"Number of item added in cart is not matching with chart.\")\n// }\n OrderInfo.prototype.OrderID = 0;\n WrapperFunction.selectKeywordName(keyWordNm);\n SelectQuantityFromHeader.selectQuantity(qty); \n selectPackage(packageNm,subPakNm);\n var firstTime;\n var secondTime; \n if(datetimeformSubWindow.Exists){ \n selectDateFromSubWindow(dateD); //mm-dd-yyyy \n try { \n aqUtils.Delay(3000);\n availableTimedatagroup.Child(0).Click();\n firstTime = availableTimedatagroup.Child(0).HGroup(0).Label(\"timeLabel\").Caption;\n \n } catch (e) {\n \t\tmerlinLogError(\"Oops! There's some glitch in the script: Unable to select differnt time \" + e.message);\n \t}\n selectNextButtonFromSubWindow();\n Button.clickOnButton(selectablebuttonClosebutton);\n } \n aqUtils.Delay(1000);\n SelectQuantityFromHeader.selectQuantity(qty2); \n selectPackage(packageNm,subPakNm);\n if(datetimeformSubWindow.Exists){ \n selectDateFromSubWindow(dateD); //mm-dd-yyyy \n try { \n aqUtils.Delay(3000);\n availableTimedatagroup.Child(1).Click();\n secondTime = availableTimedatagroup.Child(1).HGroup(0).Label(\"timeLabel\").Caption;\n selectNextButtonFromSubWindow();\n aqUtils.Delay(1000);\n } catch (e) {\n \t\tmerlinLogError(\"Oops! There's some glitch in the script: Unable to select differnt time \" + e.message);\n \t}\n Button.clickOnButton(selectablebuttonClosebutton); \n } \n aqUtils.Delay(1000);\n cartaddedItemList.Refresh();\n aqUtils.Delay(3000);\n var firstPackageText = cartaddedItemList.Child(0).VGroup(\"cartVGroup\").List(\"ratesList\").Child(0).HGroup(0).HGroup(\"cartItemRateGrp\").Group(0).Label(\"rateNameLabel\").Caption;\n var firstQty=cartaddedItemList.Child(0).VGroup(\"cartVGroup\").List(\"ratesList\").Child(0).HGroup(0).HGroup(\"cartItemRateGrp\").Group(0).Label(\"quantityLabel\").Caption;\n var secondPackageText = cartaddedItemList.Child(0).VGroup(\"cartVGroup\").List(\"ratesList\").Child(1).HGroup(0).HGroup(\"cartItemRateGrp\").Group(0).Label(\"rateNameLabel\").Caption\n var secQty=cartaddedItemList.Child(0).VGroup(\"cartVGroup\").List(\"ratesList\").Child(1).HGroup(0).HGroup(\"cartItemRateGrp\").Group(0).Label(\"quantityLabel\").Caption;\n var f1 = subPakNm+\" \"+dtFmt+\" \"+firstTime;\n var f2 = subPakNm+\" \"+dtFmt+\" \"+secondTime;\n var q1 = \"Qty: \"+qty;\n var q2 = \"Qty: \"+qty2;\n VerifyCheckProperty.compareStringObj(firstPackageText,f2);\n VerifyCheckProperty.compareStringObj(secondPackageText,f1);\n VerifyCheckProperty.compareStringObj(firstQty,q2);\n VerifyCheckProperty.compareStringObj(secQty,q1);\n finilizeOrder();\n aqUtils.Delay(2000); \n var settlementTotal =orderDetailsTotal.Caption;\n Log.Message(\"Verified order details on settlement page\"); \n CashButton.Click(); \n applyAmount= aqString.Replace(settlementTotal,\"$\",\"\"); \n OrderInfo.prototype.OrderTotalAmount = applyAmount.trim();\n Log.Message(\"Order total amount is set:\",OrderInfo.prototype.OrderTotalAmount); \n WrapperFunction.setTextValue(PayamountTextBox,applyAmount);\n Button.clickOnButton(applyButton); \n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(2000);\n validateTicket(\"Don't Validate\");\n Log.Message(\"Don't Validate the order\"); \n verifyTotalOnConfirmationPage(settlementTotal);\n var orderId = cnf_orderID1.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n } \n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\n\t return;\n }\n finally { \n\t Log.PopLogFolder();\n } \n AppLoginLogout.logout(); \n}" ]
[ "0.6561142", "0.63937986", "0.6244584", "0.6187581", "0.6133716", "0.6130026", "0.61165226", "0.6114177", "0.60631114", "0.6043068", "0.6029009", "0.595768", "0.5942639", "0.59237856", "0.59106547", "0.58960134", "0.5884342", "0.58626086", "0.5860346", "0.58336765", "0.58221364", "0.581936", "0.58166283", "0.5815991", "0.58142227", "0.58138895", "0.58118224", "0.5787633", "0.57875466", "0.57827145", "0.5771696", "0.57709044", "0.57654786", "0.57654786", "0.5755533", "0.57545125", "0.5744271", "0.5743117", "0.57345206", "0.57326967", "0.572992", "0.57140356", "0.57115585", "0.5702162", "0.56883496", "0.56782454", "0.5675653", "0.56734407", "0.56630105", "0.56539184", "0.5645741", "0.56435233", "0.56361336", "0.5626608", "0.5625983", "0.56228673", "0.5620578", "0.5618381", "0.56183803", "0.5617352", "0.5615525", "0.56096166", "0.5597342", "0.5596905", "0.55905455", "0.5581172", "0.55810404", "0.5578453", "0.5577083", "0.55747205", "0.5573014", "0.55673826", "0.5565246", "0.5556357", "0.5555345", "0.55532557", "0.55480736", "0.55402994", "0.55385035", "0.55364", "0.5536263", "0.5533764", "0.55323726", "0.5528615", "0.5527295", "0.5524579", "0.5522392", "0.55192286", "0.55159223", "0.5510813", "0.55099916", "0.55020654", "0.5489925", "0.5487331", "0.5486112", "0.54834276", "0.548151", "0.5472475", "0.5472067", "0.54660094", "0.54658407" ]
0.0
-1
Imagine that I gave you 20 books to sort in alphabetical order. Express this as an algorithm and them implement your algorithm. ['a', 'ab', 'ccc'] ['def', 'ace']
function mergeStrArrays(arr1, arr2) { let arr1Idx = 0; let arr2Idx = 0; let result = []; while (arr1[arr1Idx] && arr2[arr2Idx]) { let str1 = arr1[arr1Idx].toLowerCase(); let str2 = arr2[arr2Idx].toLowerCase(); let str1Ptr = 0; let str2Ptr = 0; let compare = 0; while (str1[str1Ptr] && str2[str2Ptr]) { compare = str1[str1Ptr].localeCompare(str2[str2Ptr]); if (compare !== 0) { break; } else { str1Ptr++; str2Ptr++; } } if (compare === -1) { result.push(arr1[arr1Idx]); arr1Idx++; } else if (compare === 1) { result.push(arr2[arr2Idx]); arr2Idx++; } else { if (!str1[str1Ptr]) { // strings were tied but this word is shorter result.push(arr1[arr1Idx]); arr1Idx++; } else { result.push(arr2[arr2Idx]); arr2Idx++; } } } if (arr1[arr1Idx]) { result = result.concat(arr1.slice(arr1Idx)); } else if (arr2[arr2Idx]) { result = result.concat(arr2.slice(arr2Idx)); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "function orderAlphabetically() {}", "function orderAlphabetically(arr) {\n let sorted20s = [...arr]\n let finalList = []\n sorted20s = sorted20s.sort((a,b) =>{\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n })\n sorted20s = sorted20s.slice(0,20)\n for (let key in sorted20s) {\n // console.log(sorted20s[key].title)\n finalList.push(sorted20s[key].title)\n }\n return finalList\n}", "function orderAlphabetically(array){\n let titles = array.map(i=>i.title)\n if (array.length <= 20) {\n for (i = 0; i<array.length; i++) {\n console.log(titles.sort()[i]);\n }\n } else {\n for (i = 0; i<20; i++) {\n console.log(titles.sort()[i]);\n }\n }\n}", "function sortBooks(array, charLocation=0) {\n\n for (let i = 0; i < array.length; i++) { \n array[i] = array[i].toLowerCase().replace(/\\s/g, '');\n }\n\n let slotArray = new Array(27);\n let sortArray = [];\n let ASCIIShift = 97;\n\n for (let i = 0; i < array.length; i++) {\n if (slotArray[array[i].charCodeAt(charLocation) - ASCIIShift] === undefined) {\n slotArray[array[i].charCodeAt(charLocation) - ASCIIShift] = [array[i]];\n }\n else {\n slotArray[array[i].charCodeAt(charLocation) - ASCIIShift].push(array[i]);\n }\n }\n\n // for (let i = 0; i < slotArray.length; i++) {\n // if (slotArray[i].length > 1) {\n // for (let j = 0; j < slotArray[i].length; j++) {\n\n // }\n // }\n // }\n\n console.log(slotArray);\n}", "function sortBooksAlphabeticallyByTitle(books) {\n return books.sort(sortBy(\"title\"))\n}", "function orderAlphabetically(movies) {\nvar arrayTitleMovies = movies.sort(function(movie){\n return movie.title.sort();\n});\nvar i = 0; \nwhile (i<arrayTitleMovies.length) {\n if (i == 20) {\n break;\n }\n i += 1;\n}\n}", "function orderAlphabetically(tab){\n var tab2= tab.map(function(elt){\n return elt.title;\n })\n\n console.log(tab2);\n var res= tab2.sort();\n return res.slice(0,20);\n}", "function orderAlphabetically(alphabetOrderedArr) {\n let copiaMovies = Array.from(alphabetOrderedArr);\n\n function ordenarAZ(a,b) {\n return a.title.localeCompare(b.title);\n }\n\n copiaMovies.sort(ordenarAZ);\n\n copiaMovies = copiaMovies.map(movies => {\n\n return movies.title\n }).slice(0,20);\n\n return copiaMovies;\n}", "function sortingBooks(arr){\n if(arr.length <= 1){\n return arr; \n }\n\n let middle = Math.floor(arr.length/2); \n let leftArr = arr.slice(0, middle); \n let rightArr = arr.slice(middle,arr.length); \n leftArr = sortingBooks(leftArr); \n rightArr = sortingBooks(rightArr); \n\n return mergeBooks(leftArr, rightArr, arr); \n\n}", "function orderAlphabetically(arr){\n let contador = [];\n for(let i =0; i<arr.length; i++){\n contador.push(arr[i].title)\n }\n contador.sort();\n return contador.slice(0,20);\n }", "function sortBooks(array) {\n if (array.length <= 1) {\n return array;\n }\n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n left = sortBooks(left);\n right = sortBooks(right);\n return mergeBooksArray(left, right, array);\n}", "function orderAlphabetically(movies)\n{\n //ordenar per title\n //print els primers 20\n\n var moviesOrdered = movies.sort(function(movieA, movieB){\n if (movieA.title > movieB.title) return 1;\n else return -1;\n });\n var movies20 = moviesOrdered.slice(0,20);\n\n var titles = [];\n movies20.forEach(function(movie){\n titles.push(movie.title);\n });\n console.log(titles);\n return titles;\n}", "function orderAlphabetically(arr) {\n\n let orderArr = [];\n let total = 0;\n arr.sort((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 if (arr.length < 20) {\n total = arr.length;\n } else {\n total = 20;\n }\n for (let i = 0; i < total; i += 1) {\n orderArr.push(arr[i].title);\n }\n //console.log(orderArr)\n return orderArr;\n}", "function orderAlphabetically(movies) {\n const sorted = movies.map((item) => {\n return item.title;\n});\nsorted.sort ((a,b) => {\n return a.localeCompare(b);\n});\nreturn sorted.slice(0,20);\n}", "function sortBooks() {\n let sorted = extractBookElements();\n switch (getInputSortBy()) {\n case \"date\":\n sorted.sort( (a,b) => {\n return a.id < b.id ? -1 : 1;\n });\n break;\n case \"title\":\n sorted.sort( (a,b) => {\n return a.querySelector(\".title\").textContent < b.querySelector(\".title\").textContent ? -1 : 1;\n });\n break;\n case \"author\":\n sorted.sort( (a,b) => {\n return a.querySelector(\".author\").textContent.split(\" \").pop() < b.querySelector(\".author\").textContent.split(\" \").pop() ? -1 : 1;\n });\n break;\n case \"unread\":\n sorted.sort( (a,b) => {\n const unread = \"Not read\";\n const read = \"Already read\";\n if ( a.querySelector(\".status\").textContent === unread && b.querySelector(\".status\").textContent === read) {\n return -1;\n }\n if ( a.querySelector(\".status\").textContent === read && b.querySelector(\".status\").textContent === unread) {\n return 1;\n }\n return 0;\n });\n break;\n }\n attachBookElements(sorted);\n}", "function orderAlphabetically(movies){\n movies.sort(function(a,b){\n return a.title < b.title ? -1 : 1;\n });\n var first20=[];\n var limit = 20;\n if (movies.length<20){\n limit= movies.length;\n }\n for (var i = 0; i<limit; i++){\n first20.push(movies[i].title);\n }\n return first20;\n}", "function orderAlphabetically([...movies]){\n let orderArr = movies.sort( (a, b) => {\n if (a.title > b.title){\n return 1;\n } else {\n return -1;\n }\n })\n \n return orderArr.slice(0, 20).map(movie => movie.title);\n}", "function nonComparisonSortStrings(arr){\n let sortedArr = arr.slice();\n\n for (let i = arr.length - 1; i > - 1; i-- ){\n let buckets = new Array(26).fill(0).map(() => new Array());\n\n sortedArr.forEach(function(word) {\n let letter = word[i];\n let letterNum = letter.charCodeAt(0) - 97\n buckets[letterNum].push(word);\n })\n\n let updatingArr = []\n\n buckets.forEach(function(bucket) {\n bucket.forEach(function(word) {\n updatingArr.push(word)\n })\n })\n\n sortedArr = updatingArr;\n }\n\n return sortedArr;\n}", "function orderAlphabetically (movies){\n\n const array = [...movies].map(function(movie){\n\n return movie.title;\n}) \n var finalArray = array.sort();\n var top = finalArray.slice(0,20) \n\n return top;\n}", "function orderAlphabetically(array) {\nlet title = array.map( (elem) => {\n return array.titles < 20\n})\n\nlet orderedTitle = title.sort(first, second) => {\n if (first.title > second.title) {\n return 1\n }\n else if (first.title < second.title) {\n return 0\n }\n else {\n return 0\n }\n}\n\n return orderedTitle\n}", "function orderAlphabetically(array){\nlet newArray = array.map(function(order){\n return order.title\n});\nlet title = newArray.sort();\nreturn title.slice(0,20);\n}", "function orderAlphabetically(array) {\n // step1: create an array of strings (title of each movie)\n // step2: order them alphabetically\n // step3: return the first 20 movies (max)\n\n let myArray = array.map(function(elem) {\n return elem.title}); \n myArray.sort();\n return myArray.filter(function(elem, index) {\n return index < 20;\n });\n}", "function orderAlphabetically(arr){\n return arr.map(movie => {\n return movie.title\n }).sort((a,b) => {\n if(a > b) return 1;\n if( a < b) return -1;\n return 0;\n }).slice(0,20)\n }", "function orderAlphabetically(arr){\n let sorted = arr.concat().sort((a,b) => {\n if(a.title > b.title){\n return 1;\n } \n else if(a.title < b.title){\n return -1;\n }\n });\n let first20 = sorted.slice(0,20);\n let titles = first20.map(movie => {\n return movie.title;\n });\n return titles;\n}", "function orderAlphabetically(array) {\n let orderAlphArray = array.sort(function (movie1, movie2) { \n let title1 = movie1.title.toLowerCase();\n let title2 = movie2.title.toLowerCase();\n if (title1 > title2) { \n return 1;\n } else if (title1 < title2) {\n return -1;\n }\n return 0;\n })\n return orderAlphArray.map(function (movie) { \n return movie.title\n }).slice(0, 20) \n \n }", "function orderAlphabetically(array) {\n const alphabetArray = [...array]\n alphabetArray.sort((a, b) => {\n if (a.title < b.title) return -1\n if (a.title > b.title) return 1\n return 0\n\n })\n let titles = []\n alphabetArray.forEach(elm => titles.push(elm.title))\n\n let first20 = titles.filter((elm, index) => index < 20)\n return first20\n}", "sort() {\n\t}", "sort() {\n\t}", "function orderAlphabetically(arr) {\n return arr\n // let orderTop20 = [...arr].sort((a, b) => {\n // if (a.title > b.title) {\n // return 1;\n // } else if (a.title < b.title) {\n // return -1;\n // }\n // })\n .map(movies => movies.title)\n .sort()\n .slice(0, 20);\n return orderTop20;\n }", "function orderAlphabetically(movies) {\n var onlyMoviesTitle = []\n var alphabeticallOrder = movies.sort(function (movie1, movie2) {\n var title1 = movie1.title;\n var title2 = movie2.title;\n if (title1 > title2) {\n // console.log(title1 + \" should be under \" + title2);\n return +1;\n } else if (title1 < title2) {\n // console.log(title1 + \" should be above \" + title2);\n return -1;\n }\n })\n\n alphabeticallOrder.reduce(function (allmovietitle, movie) {\n onlyMoviesTitle.push(movie.title);\n }, []);\n // console.log(onlyMoviesTitle);\n if (onlyMoviesTitle.length <= 20) {\n return onlyMoviesTitle;\n } else {\n // console.log(onlyMoviesTitle.slice(0, 20))\n return onlyMoviesTitle.slice(0, 20)\n }\n}", "function orderAlphabetically(arr) {\n let resultArray = arr.sort((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})\n let titleArray = resultArray.map(x => {\n return x.title;\n });\n return titleArray.slice(0, 20);\n}", "function orderAlphabetically(array){\n var sortedArray =\n array.sort(function(a,b){\n if(a.title.toLowerCase() < b.title.toLowerCase()){\n return -1;\n } else if(a.title.toLowerCase() > b.title.toLowerCase()){\n return 1;\n }\n });\n var byTitle20 = [];\n // for(var i = 0; i < 20; i++){\n // byTitle20.push(sortedArray[i].title);\n // }\n var count = 0;\n sortedArray.forEach(function(oneMovie){\n if(count < 20){\n byTitle20.push(oneMovie.title);\n count++;\n } \n });\n \n return byTitle20;\n \n}", "function orderAlphabetically (movies) {\n var filmTitle = movies\n .map(function(film){\n return film.title\n })\n .sort(function(a,b){\n return a>b? 1 : -1 \n })\n \n if (filmTitle.length >20)\nreturn filmTitle.filter(function(film){\n return filmTitle.indexOf(film)<20;\n })\n else return filmTitle;\n }", "function orderAlphabetically(movies) {\n\n return movies.map(a => a.title).sort().slice(0, 20)\n\n}", "function orderAlphabetically(array) {\n if(array.length > 19) {\n let moviesArray= [...array];\n\n let alphabeticalMovies = moviesArray.sort(\n (a,b) => (a.title > b.title) ? 1 : -1\n )\n let alphaMovSliced = alphabeticalMovies.slice(0, 20);\n\n let movieByTitle = alphaMovSliced.map(movie => movie.title)\n \n return movieByTitle\n }\n let moviesArray= [...array];\n\n let alphabeticalMovies = moviesArray.sort(\n (a,b) => (a.title > b.title) ? 1 : -1\n )\n\n let movieByTitle = alphabeticalMovies.map(movie => movie.title)\n \n return movieByTitle\n\n}", "function orderAlphabetically(movies) {\r\n let moviesSorted = movies.sort((a, b) => {\r\n if (a.title < b.title) return -1\r\n else return 1\r\n });\r\n let result = [];\r\n if (moviesSorted.length < 20) {\r\n moviesSorted.forEach(e => result.push(e.title));\r\n }\r\n else {\r\n for (let index = 0; index < 20; index++) {\r\n result.push(moviesSorted[index].title);\r\n }\r\n }\r\n return result;\r\n}", "function orderAlphabetically(someArray) {\n\n let arryCopy = JSON.parse(JSON.stringify(someArray));\n let movieTitles = arryCopy.map(movie => movie.title)\n let sortedMovies = movieTitles.sort((a,b) => a - b);\n\n let only20 = [];\n let only20sorted = [];\n\n\n if (someArray.length > 20) {\n for (let i = 0; i < 20 ; i++) {\n only20 = sortedMovies.shift();\n only20sorted.push(only20);\n }\n } else {\n for (let i = 0; i < someArray.length; i++) {\n only20 = sortedMovies.shift();\n only20sorted.push(only20);\n }\n }\n\n return only20sorted;\n}", "function orderAlphabetically(arr) {\n const newOrderByTitle = arr.map(function toto(element) {\n return element.title;\n });\n\n newOrderByTitle.sort(function tata(a, b) {\n if (a.toLowerCase() < b.toLowerCase()) return -1;\n if (a.toLowerCase() > b.toLowerCase()) return 1;\n return 0;\n });\n const printTitle = newOrderByTitle.reduce(function tata(\n counter,\n currentValue,\n i\n ) {\n if (i < 20) {\n counter.push(currentValue);\n return counter;\n }\n return counter;\n },\n []);\n return printTitle;\n}", "function orderAlphabetically(movies) {\n const movieTitle = movies.map(movie => movie.title);\n return movieTitle.sort(function(a,b) {\n return a.localeCompare(b);\n }).slice(0,20)\n \n}", "function orderAlphabetically(movies) {\n let firstTwenty = movies.map(movie => movie.title);\n firstTwenty.sort();\n if (movies.length >=20){\n firstTwenty = firstTwenty.slice(0,20);\n }\n\n return firstTwenty;\n \n}", "function orderAlphabetically(movies){\n if (movies.length === 0) return 0;\n let titleList = movies.map(function(movie) {\n return movie.title;\n })\n titleList.sort(function(a,b){\n let title1 = a.toLowerCase();\n let title2 = b.toLowerCase();\n if (title1 < title2) return -1;\n if (title1 > title2) return 1;\n if (title1 === title2) return 0;\n })\n if (titleList.length < 20){\n return titleList.slice(0,titleList.length)\n }\n return titleList.slice(0,20)\n }", "function orderAlphabetically(arr) {\n let moviesCopy = [];\n let sortedTitles = [];\n for (let movie of arr) {moviesCopy.push(movie.title);}\n moviesCopy.sort();\n if (moviesCopy.length < 20) {\n for (let j = 0; j < moviesCopy.length; j++) {sortedTitles.push(moviesCopy[j]);}\n } else for (let i = 0; i < 20; i++) {sortedTitles.push(moviesCopy[i]);}\n return sortedTitles;\n}", "function orderAlphabetically (movies){\n var orden = movies.sort(function(a,b){\n if (a.title>b.title) return 1;\n if (a.title<b.title) return -1;\n if (a.title === b.title) return 0;\n });\n \n for (i=0; i<20; i++){\n console.log(orden[i].title);\n }\n }", "function orderAlphabetically(movies) {\n var moviesSorted = movies.sort(function(itemA, itemB) {\n if (itemA.title < itemB.title) {\n return -5;\n } else {\n return 10;\n }\n });\n var moviesFirst20 = [];\n for (var i = 0; i < 20; i += 1) {\n moviesFirst20.push(moviesSorted[i].title);\n }\n return moviesFirst20;\n}", "function orderAlphabetically(movie) {\n const alphabet = movie.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 const orderedTitles = alphabet.map(list => list.title)\n if (orderedTitles.length > 20) {\n return orderedTitles.slice(0, 20);\n }\n return orderedTitles;\n }", "function sortArray(arr)\n{\n var abc = 'abcdefghijklmnopqrstuvwxyz';\n var dummy = [];\n\n var assignPriority = function (e)\n {\n if (e === \"...\")\n return ((27 + 1) * 26);\n\n var content = e.split('');\n if (isNaN(content[1]))\n return (((abc.indexOf(content[0]) + 1) * 26) * 100);\n\n return (content[1] * 10) + abc.indexOf(content[0]);\n }\n\n arr.forEach(function (e)\n {\n dummy.push(e);\n dummy.sort(function (a, b)\n {\n return assignPriority(a) - assignPriority(b);\n })\n });\n\n arr.length = 0;\n dummy.forEach(function (e)\n {\n if (arr.indexOf(e) === -1)\n {\n arr.push(e);\n }\n });\n}", "function alphabetic_order(word) {\n var x=word.split(\"\");\n x=x.sort();\n x=x.join(\"\");\n \n return x;\n}", "function orderAlphabetically(arr) {\n arr.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 if(arr.length<20){\n return arr;\n \n }else{\n return arr.splice(0,20);\n }\n }", "function orderAlphabetically () {\n movies.sort(function (itemA,itemB){\n if (itemA.title<itemB.title){\n //if itemA comes before itemB return negative\n //(the order is good)\n return -1;\n }\n else{\n //if itemB comes before itemA return positive\n //they need to switch\n return 50;\n }\n })\n \n console.log(movies);\n}", "function orderAlphabetically(arr){\n let myArr = JSON.parse(JSON.stringify(arr));\n let alphabetical=myArr.sort(function(a,b){\n return a.title.localeCompare(b.title);\n }); \n let first20=alphabetical.filter(function(a,b){\n return a, b<20;\n })\n let first20Title=first20.map(function(movie){\n return movie.title\n })\n return first20Title;\n }", "function orderAlphabetically (data){\n const alphaSortedArry = data.slice(0).sort(function(a,b){\n if (a.title.toLowerCase() > b.title.toLowerCase()){\n return 1\n }else if (a.title.toLowerCase() < b.title.toLowerCase()){\n return -1\n }else{\n return 0\n }\n })\n \n const topTwenty = alphaSortedArry.slice(0,20);\n let topTitles = [];\n let arrLengthReturn = 0;\n \n if(topTwenty.length<20){\n arrLengthReturn = topTwenty.length\n }else{\n arrLengthReturn = 20\n }\n\n for (i=0; i<arrLengthReturn; i++){\n topTitles.push(topTwenty[i].title)\n }\n \n return topTitles\n \n\n\n}", "function titleAlphabet(){\n console.log('Sort Books by Title Alphabetically: ');\n myLibrary.sortTitleAlphabet();\n}", "function orderAlphabetically(movies){\n var orderMovies = movies.sort(function(a,b){\n if (a.title > b.title) {return 1;}\n else if (a.title < b.title) {return -1;} \n else {return 0;}\n });\n var newArray = [];\n orderMovies.forEach(function(orderMovies) {\n newArray.push(orderMovies.title);\n });\n return newArray.slice(0,20);\n}", "function high(x){\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\n let strArray = x.split(' '); \n let wordSums = {};\n let sortable = [];\n\n strArray.forEach(function(word){\n let sum = 0;\n word.split('').forEach(function(letter){\n sum += alphabet.indexOf(letter) + 1; \n })\n wordSums[word] = sum;\n })\n\n for (let word in wordSums) {\n sortable.push([word, wordSums[word]]);\n }\n\n sortable.sort(function(a, b) {\n return b[1] - a[1];\n });\n console.log(sortable);\n return sortable[0][0]; \n}", "function orderAlphabetically(moviesArray){\n return moviesArray.map((x) => x.title)\n sort()\n .slice(0, 20);\n}", "function orderAlphabetically(movies) {\n\n var movieTitles = [...movies];\n \n movieTitles = movies.map(movie => {\n return movie.title;\n });\n\n movieTitles.sort((a, b) => {\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n return 0;\n });\n\n\n const top20= movieTitles.slice(0,20);\n return top20;\n}", "function orderAlphabetically(moviesAlph) {\n let alphArray = moviesAlph.map(elm => {\n return elm.title\n })\n\n alphArray.sort((a, b) => {\n if (a > b) return 1\n if (a < b) return -1\n if (a == b) return 0\n })\n return alphArray.slice(0, 20)\n}", "function orderAlphabetically(movies) {\n let alphaOrder = movies.map(elm => elm.title).sort((a, b) => a.localeCompare(b))\n const top20Alpha = alphaOrder.splice(0, 20)\n return top20Alpha;\n}", "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}", "function orderAlphabetically(movies) {\n const ordered = 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 return ordered.slice(1, 20);\n\n}", "function orderAlphabetically(arrayOfMovies){\n const moviesByTitle = [...arrayOfMovies];\n moviesByTitle.sort((movieA, movieB) => {\n if (movieA.title.toLowerCase() > movieB.title.toLowerCase()) {\n return 1;\n } else if (movieA.title.toLowerCase() < movieB.title.toLowerCase()) {\n return -1;\n } else {\n return 0;\n }\n });\n //maximize the minimum\n let numberOfMoviesToReturn = Math.max(Math.min(moviesByTitle.length, 20), 0);\n const top20movieTitles = [];\n for (let i=0; i<numberOfMoviesToReturn; i++){\n top20movieTitles.push(moviesByTitle[i].title);\n }\n return top20movieTitles;\n}", "function orderAlphabetically(arr) {\n let clone = JSON.parse(JSON.stringify(arr))\n \n clone.sort((first, second) =>{\n if(first.title > second.title){\n return 1\n }\n else if(first.title < second.title){\n return -1\n }\n else{\n return 0\n }\n })\n \n return clone.map((elem) => {\n return elem.title\n }).slice(0,20)\n}", "function orderAlphabetically(movies) {\n let moviesArr = [...movies];\n let newArr = moviesArr.sort((x, y) => {\n if (x.title > y.title) {\n return 1;\n } else if (x.title < y.title) {\n return -1;\n }\n });\n return newArr\n .map(function(movies) {\n return movies.title;\n })\n .slice(0, 20);\n}", "function orderAlphabetically (array) {\n const clone = Array.from(array)\n const sorted = clone.sort((movieA, movieB) => {\n if (movieA.title < movieB.title) {\n return -1\n } else if (movieA.title > movieB.title) {\n return 1\n } else {\n return 0\n }\n })\n return sorted.reduce((total, movie) => {\n if (total.length < 20) {\n total.push(movie.title)\n }\n return total\n }, [])\n}", "function orderAlphabetically(movies){\n let titles = movies.map(movie => movie.title);\n return titles.sort().splice(0,20);\n}", "Sort() {\n\n }", "function alphabeticalOrder(arr) {\n // Add your code below this line\n return arr.sort()\n\n // Add your code above this line\n}", "function orderAlphabetically (arrayOfMovies) {\n let sortedArr = arrayOfMovies.slice().sort((a,b) => {\n if (a.title > b.title) return 1;\n if (a.title < b.title) return -1;\n }); \n let limitArr = [];\n for (let i=0; (i<sortedArr.length)&&i<20; i++) {\n limitArr.push(sortedArr[i].title);\n } \n return limitArr; \n}", "function orderAlphabetically(arr) {\n let titles = arr.map(function(movie) {\n return movie.title\n });\n let alphabeticOrder = titles.sort(function(a , b) {\n return a.localeCompare(b)\n });\n return alphabeticOrder.slice(0, 20)\n}", "function orderAlphabetically(movies) {\n const copySortTitle = [...movies].sort((a, b) => a.title.localeCompare(b.title))\n const twentyTitles = copySortTitle.map(elm => elm.title).slice(0, 20)\n return twentyTitles\n}", "function orderAlphabetically(collection){\n var arrayTitleSort = collection.sort(function(movieA,movieB){\n var movieAupper = movieA.title.toUpperCase();\n var movieBupper = movieB.title.toUpperCase();\n if (movieAupper < movieBupper){\n return -1;\n }\n if (movieAupper > movieBupper){\n return 1;\n }\n });\n var titlesArray = [];\n arrayTitleSort.forEach(function(movie,index) {\n if (index < 20)\n {\n titlesArray[index] = movie.title;\n }\n });\n return titlesArray;\n}", "function orderAlphabetically(movies) {\n let movAlphab = 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 return movAlphab.map(function(item){\n return item.title\n }).slice(0, 20);\n}", "function AlphabetSoup(str) {\n let array = [];\n const lowerString = str.toLowerCase();\n for (let index = 0; index < str.length; index++) {\n array.push(lowerString[index]);\n }\n array.sort();\n // console.log(array);\n return array;\n}", "function orderAlphabetically (array) { \n array.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 const titles = array.map((value) => { \n return value.title\n }); \n const topTwenty = titles.slice(0, 20); \n return topTwenty; \n }", "function orderAlphabetically(array){\n const arrayOfTitles = array.map(element => element.title)\n const sortedArrayOfTitles = arrayOfTitles.sort()\n if(arrayOfTitles.length < 20){\n return sortedArrayOfTitles\n }\n else{\n return sortedArrayOfTitles.slice(0,20)\n }\n}", "function sortAlpha(a, b){\r\n\t if(a < b) return -1;\r\n\t if(a > b) return 1;\r\n\t return 0;\r\n}//sortAlpha", "function orderAlphabetically (movies) {\n const first20Titles = movies.map(aMovie => aMovie.title).sort();\n // if (first20Titles.length < 20) {\n // return firstTwentyTitles;\n // }\n // else {\n return first20Titles.slice(0, 20);\n }", "function orderAlphabetically(myArray) {\n\tconst titleArray = []\n\tfor (const movie of myArray) {\n\t\ttitleArray.push(movie.title.toLowerCase());\n\t}\n\ttitleArray.sort()\n\treturn titleArray.slice(0,20)\n}", "function orderTitlesAlphabetically(a, b) {\n\n if (a.title < b.title) {\n\n return -1\n\n } else if (a.title > b.title) {\n\n return 1\n\n } else {\n\n return 0;\n\n }\n\n\n}", "function solution4(givenWord, givenList){\n sortString = str => {\n return str.toLowerCase().split('').sort().join('') }\n let sortedWord = sortString(givenWord);\n let anagrams = givenList.reduce((acc, item) => {\n sortedWord === sortString(item) && acc.push(item)\n return acc;\n }, []);\nreturn anagrams; \n}", "function orderAlphabetically(peliculas) {\n const sortedPeliculas = [...peliculas];\n let tituloPeliculas = sortedPeliculas.map(function(pelicula) {\n return pelicula.title\n })\n tituloPeliculas.sort((a, b) => {\n if (a < b) return -1\n else if (a > b) return 1\n else return 0\n })\n if (tituloPeliculas.length > 20) {\n tituloPeliculas = tituloPeliculas.slice(0, 20)\n }\n return tituloPeliculas\n}", "function orderAlphabetically(movies) {\n movieTitles = [];\n for (let i = 0; i < movies.length; i++) {\n movieTitles.push(movies[i].title);\n }\n var sortedTitles = movieTitles.sort(function(a, b) {\n if (a > b) return 1;\n if (a < b) return -1;\n return 0;\n });\n var longSortedTitles = [];\n if (sortedTitles.length <= 20) {\n return sortedTitles;\n } else if (sortedTitles.length > 20) {\n for (let i = 0; i < 20; i++) {\n longSortedTitles.push(sortedTitles[i]);\n }\n return longSortedTitles;\n }\n}", "function orderAlphabetically (array){\n\n var titulosPeliculas = array.map(function(element){\n \n return element.title;\n });\n\n return titulosPeliculas.sort().slice(0,20);\n}", "function alphabetic_order(word) {\n var arr = word.split(\"\"); // split the string at each characters\n //console.log(arr.length);\n arr.sort();\n //for(var i = 0; i < res.length; i++)\n //{\n // console.log(i + \" \" + res[i] );\n //}\n\n var str = arr.join(); // 5:33 check this function\n for(var i = 0; i < str.length; i++)\n str = str.replace(',' , '');\n return str;\n }", "sort(){\n\n }", "function alphabetic_order(word) {\n // var a= word.sort();\n var arr = word.split(\"\");\n var a= arr.sort();\n var t =\"\";\n for (var i = 0; i < a.length; i++) {\n t = t + a[i] ;\n }\n return t;\n}", "_alphabetizeIds(ids) {\n return ids.sort((a, b) => {\n return this.getWord(a).title.localeCompare(this.getWord(b).title);\n });\n }", "function alphaSort(str)\n//converting the function into an array & converting back into string.\n {\nreturn str.split('').sort().join('');\n }", "function orderAlphabetically(lotsOfMovies) {\n return [...lotsOfMovies]\n .sort((a, b) => {\n if (a.title > b.title) return 1;\n else if (a.title < b.title) return -1;\n else return 0;\n })\n .map((eachMovie) => eachMovie.title)\n .slice(0, 20);\n}", "function sortAlpha(obj, a, b) {\n if (obj[b] - obj[a] < 0) return -1;\n if (obj[b] - obj[a] > 0) return 1;\n if (obj[b] - obj[a] === 0) {\n return a.localeCompare(b); // if the keywords occur the same number of times, sort alphabetically\n }\n }", "function orderAlphabetically(movies) {\n return movies\n .map(movie => movie.title)\n .sort((a, b) => a.localeCompare(b))\n .slice(0, 20);\n}", "sortAndReduceOrderBook() {\n const asks = ptoHelper.sortOrders(this.asks, 'ascending');\n const bids = ptoHelper.sortOrders(this.bids, 'descending');\n this.asks = ptoHelper.reduceOrders(asks);\n this.bids = ptoHelper.reduceOrders(bids);\n }", "function orderAlphabetically (array) {\n array.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 let titleArray = [];\n if (array.length > 0){\n if (array.length < 20) {\n for (let i = 0; i < array.length; i++){\n titleArray.push(array[i].title);\n }\n } else {\n for (let i = 0; i < 20; i++) {\n titleArray.push(array[i].title);\n }\n }\n }\n\n return titleArray\n}", "function orderAlphabetically(param) {\n const movieTitle = param.map(anything => anything.title)\n\n const sortTitle = movieTitle.sort().splice(0, 20);\n return sortTitle;\n}", "function orderAlphabetically(arr) {\n let newArray = arr.sort((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 newArray = newArray.map(function (movie) {\n return movie.title;\n });\n return newArray.slice(0, 20);\n}", "function orderAlphabetically(array) {\n let newList = [...array];\n\n newList.sort(function (a, b) {\n return a.title.localeCompare(b.title);\n });\n\n if (newList.length > 20) {\n newList.splice(20);\n }\n newList = newList.map(function (x) {\n return x.title;\n });\n\n return newList;\n}", "function orderAlphabetically(arr) {\n let movieTitles = arr.map(movie => movie.title);\n const alpha = movieTitles.sort((a, b) => a > b ? 1 : -1).slice(0, 20);\n return alpha;\n}", "function alphabeticalOrder(arr) {\n \nreturn arr.sort(function(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n});\n\n \n}", "function orderAlphabetically(arrayMovies) {\n var orderedMovies = [];\n var iterator = 0;\n var lengthOfArray = 0;\n if (arrayMovies.length > -1) {\n arrayMovies.sort(function (elementA, elementB) {\n if (elementA.title > elementB.title) {\n return 1;\n } else if (elementA.title < elementB.title) {\n return -1;\n } else {\n return 0;\n }\n });\n\n lengthOfArray = (arrayMovies.length < 20 ? arrayMovies.length : 20);\n\n for (var i = 0; i < lengthOfArray; i++) {\n orderedMovies.push(arrayMovies[i].title);\n }\n return orderedMovies;\n } else {\n return undefined;\n }\n}", "function sortAsc(a, b) {\n return a - b;\n }" ]
[ "0.70105124", "0.6857319", "0.675106", "0.6736326", "0.673103", "0.67084", "0.66918606", "0.6604332", "0.65888286", "0.65693635", "0.6567048", "0.65587556", "0.65186906", "0.65112525", "0.6510139", "0.64835376", "0.64709395", "0.6465834", "0.645842", "0.64557886", "0.6445624", "0.6425384", "0.640556", "0.63945997", "0.63925356", "0.6390555", "0.63831455", "0.6347972", "0.6347972", "0.6345807", "0.6340337", "0.6338149", "0.6332414", "0.6332096", "0.6322971", "0.6314838", "0.6300145", "0.62883884", "0.6284552", "0.6283224", "0.6280958", "0.62774414", "0.6272284", "0.6261945", "0.6261436", "0.6259469", "0.62500143", "0.6247697", "0.6246691", "0.6242899", "0.623886", "0.6238635", "0.62358695", "0.6227097", "0.62149554", "0.62135255", "0.6204884", "0.61972564", "0.6194155", "0.619412", "0.61925507", "0.6184585", "0.61823326", "0.61744964", "0.61723924", "0.6165737", "0.6161446", "0.6150435", "0.61455864", "0.6141146", "0.61124986", "0.61119914", "0.6111954", "0.61077726", "0.6103033", "0.6102976", "0.6096134", "0.60864544", "0.60844606", "0.60827", "0.6081027", "0.60743535", "0.60729444", "0.60714966", "0.6067882", "0.60641366", "0.6062691", "0.6059803", "0.6055729", "0.6053409", "0.6050512", "0.60483783", "0.6045577", "0.6044598", "0.6031967", "0.603088", "0.6024652", "0.60219103", "0.60154176", "0.60121", "0.6011723" ]
0.0
-1
When the hamburger icon is clicked run this function to toggle nav menu.
function menuDrop() { // Create variable and assign the nav menu to the variable. const hiddenText = document.getElementById('hidden'); // If the class of nav is exactly "topnav" then add the class of responsive and return function. if (hiddenText.className === "topnav") { hiddenText.className += " responsive"; // If class name is not exactly "topnav", then make it "topnav" and return function. } else { hiddenText.className = "topnav"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleNav() {\n if (menuOpen) {\n closeNav();\n } else {\n openNav();\n }\n}", "function hamburgerMenu() {\n mainNav.classList.toggle('slide-toggle');\n hamNavCon.classList.toggle('slide-toggle');\n hamburger.classList.toggle('expanded');\n }", "function headerFunciton() {\n\n\n // Toggle nav menu\n $(document).on('click', '.nav-toggle', function(e) {\n $('.nav-menu').toggleClass('nav-menu-active');\n $('.nav-toggle').toggleClass('nav-toggle-active');\n $('.nav-toggle i').toggleClass('fa-times');\n $('#hamburger-dot').toggle();\n \n });\n \n\n}", "function burgerMenu(e) {\n $('.icon-one').click(function() {\n $('.sideSection nav ul li').toggle('show')\n })\n }", "function toggleHamburger(){\r\n navbar.classList.toggle(\"showNav\")\r\n ham.classList.toggle(\"showClose\")\r\n hamClose.classList.toggle(\"showClose\")\r\n }", "function toggleNav () {\n var hamIcon = document.getElementById('ham-icon');\n\n // animate from 3 bars to X or vice versa\n $('.animated-ham-icon').toggleClass('open');\n\n // if the hamburger icon has the class open then open the menu as well, otherwise close the menu\n if (hamIcon.className === 'animated-ham-icon open') {\n document.getElementById('overlay').style.height = '264px';\n } else {\n document.getElementById('overlay').style.height = '0';\n }\n}", "function toggleHamburger(){\r\n navbar.classList.toggle(\"showNav\")\r\n ham.classList.toggle(\"showClose\")\r\n}", "function hamburger_click() {\n var x = document.getElementById(\"hamburger\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n }", "function toggleHamburger() {\n navbar.classList.toggle(\"showNav\");\n ham.classList.toggle(\"showClose\");\n}", "function toggleHamburger() {\n navbar.classList.toggle(\"showNav\");\n ham.classList.toggle(\"showClose\");\n}", "toggleNav() {\n $('.nav-toggle').toggleClass('is-active');\n $('.nav-menu').toggleClass('is-active');\n }", "function openAndCloseHamburgerMenu() {\r\n hamburgerMenu.classList.toggle(\"header_nav-active\");\r\n}", "function toggleHamburger(){\n navbar.classList.toggle(\"showNav\")\n ham.classList.toggle(\"showClose\")\n}", "function mobileMenu() {\n hamburger.classList.toggle(\"active\");\n navMenu.classList.toggle(\"active\");\n}", "function toggleMenu() {\n document.getElementById(\"nav-menu\").classList.toggle(\"show-menu\");\n}", "function toggleNav() {\n // check if the menu is open already\n const menuOpen = headerContainer.classList.contains('header__content_open');\n if (!menuOpen) {\n // if menu is not open\n // extend overlay to device height\n header.classList.add('header_open');\n // change hamburger icon\n hamburger.src = './images/hamburger-close.svg';\n // extend nav container to display hidden links\n headerContainer.classList.add('header__content_open');\n // change logo color\n logo.classList.add('header__logo_opened');\n // listen for click on overlay outside of open nav menu\n header.addEventListener('click', toggleNavOnOverlay);\n } else {\n // if menu is open already, undo the above\n header.classList.remove('header_open');\n hamburger.src = './images/hamburger-open.svg';\n headerContainer.classList.remove('header__content_open');\n logo.classList.remove('header__logo_opened');\n header.removeEventListener('click', toggleNavOnOverlay);\n }\n}", "function hamburgerMenu() {\r\n let nav = document.getElementById('ppalNav');\r\n nav.classList.toggle('active');\r\n}", "function toggleMenu() {\n menuNav.classList.toggle('menu-toggle');\n }", "function toggleMenu(){\r\n\t\tlet navigation = document.querySelector('.navigation');\r\n\t\tnavigation.classList.toggle('opensidebar');\r\n\t}", "function toggleNav(){\n\tdocument.getElementById('nav-toggle').classList.toggle('hide-menu');\n}", "function mobileMenu() {\n document.getElementsByClassName('affix')[0].classList.toggle('nav-toggle')\n document.getElementById('hamburger').children[0].classList.toggle('opened')\n document.getElementById('hamburger').children[1].classList.toggle('opened')\n}", "function navActions () {\n $navMain.slideToggle();\n toggleClassOnVisibility($siteLogo, classToToggle);\n}", "function hamburgerFunctionBase() {\n var x = document.getElementById(\"navbar-header-links\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "function toggleBurger() {\n\t\tvar toggles = $(\".c-hamburger\");\n\n\t\ttoggles.click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$(this).toggleClass('is-active');\n\t\t\t$(\"#rhd-nav-menu\").slideToggle();\n\t\t});\n\t}", "function navbar() {\r\n $('.site-header .primary-navigation .toggle-btn').click(function() {\r\n $('body').addClass('openNav');\r\n });\r\n $('.site-header .main-navigation .close-btn').click(function() {\r\n $('body').removeClass('openNav');\r\n });\r\n }", "function toggleMenu() {\n if (nav.classList.contains(\"show-menu\")) {\n nav.classList.remove(\"show-menu\")\n } else {\n nav.classList.add(\"show-menu\")\n }\n}", "function navtoggle(){\n\tvar navTop = document.querySelector('.nav-top');\n\t\n\tdocument.querySelector('.nav-btn').addEventListener('click', function(e){\n\t\te.preventDefault(); \n\t\n\t\t//if the \n\t\tif (navTop.getAttribute('data-state') == 'expanded'){\n\t\t\t\n\t\t\tnavTop.setAttribute('data-state', 'collapsed');\n\t\t\tthis.setAttribute('data-state','inactive');\n\t\t}else{\n\t\t\n\t\t\tnavTop.setAttribute('data-state', 'expanded');\n\t\t\tthis.setAttribute('data-state','active');\n\t\t}\n\t});\n}", "function toggleNav() {\n if (nav.hidden) {\n openNav()\n nav.hidden = false\n } else {\n closeNav()\n nav.hidden = true\n }\n}", "toggleHamburger() {\n if (!this.state.isHamburgerEnabled) {\n return;\n }\n\n // Dismiss keyboard before toggling sidebar\n Keyboard.dismiss();\n\n // If the hamburger currently is not shown, we want to make it visible before the animation\n if (!this.props.isSidebarShown) {\n showSidebar();\n return;\n }\n\n // Otherwise, we want to hide it after the animation\n this.animateHamburger(true);\n }", "function navBtnClick() {\n document.getElementById(\"nav-li\").classList.toggle(\"show\");\n}", "menuToggle(event) {\n var navItem = document.getElementsByTagName('nav')[0];\n if ('block' === navItem.style.display) {\n navItem.style.display = 'none';\n } else {\n navItem.style.display = 'block';\n navItem.className = navItem.className + ' menuhidden';\n }\n\n }", "function toggleNavigation() {\n $(\"body\").toggleClass(\"no-scroll\");\n $(\".hamburger\").toggleClass(\"open\");\n $(\".main-nav ul\").toggleClass(\"open\");\n $(\".main-nav ul li\").toggleClass(\"open\");\n $(\".gallery-nav ul\").toggleClass(\"open\");\n $(\".gallery-nav ul li\").toggleClass(\"open\");\n $(\".overlay\").toggleClass(\"open\");\n }", "function toggleMenu() {\n navUl.classList.toggle(\"open\");\n}", "function hamburgerMenu(){\n\tdocument.getElementsByClassName(\"menu\")[0].classList.toggle(\"responsive\");\n}", "function openHeaderMenuOnMobile() {\n $('#nav-icon-menu').click(function(){\n $(this).toggleClass('open');\n $('body').toggleClass('navigation-opened');\n });\n}", "function toggleNav(){\n // if nav is open, close it\n if($(\"nav\").is(\":visible\")){\n $(\"nav\").fadeOut();\n $(\"button\").removeClass(\"menu\");\n }\n // if nav is closed, open it\n else{\n $(\"button\").addClass(\"menu\");\n $(\"nav\").fadeIn().css('display', 'flex');\n }\n}", "function navBar(){\n\t\t$('.nav-button').click(function(){\n\t\t\t$('.nav-content').toggleClass('nav-hide');\n\t\t});\t\n\t}", "function toggleNavMenu() {\n document.getElementById(\"nav-hidden-menu\").classList.toggle(\"ninja\")\n \n}", "function toggleNav() {\n document.getElementById(\"nav\").classList.toggle(\"open\");\n}", "function onClickMenuIcon() {\n\t\t$(this).toggleClass(\"active\");\n\t\t$mobileNav.toggleClass(\"active\");\n\t}", "function navBar() {\n console.log(\"it got clicked\")\n if (menu.style.display === \"none\") {\n menu.classList.toggle(\"close\")\n \n \n } else if (menu.style.display === \"\") {\n menu.classList.toggle(\"open\")\n \n }\n\n}", "toggleMenu() {\n const navEle = document.querySelector('.header-wrapper .navigation');\n\n if (navEle) {\n if (navEle.classList.contains('active')) {\n navEle.classList.remove('active');\n this.showOverlay(false);\n } else {\n navEle.classList.add('active');\n this.showOverlay(true);\n }\n }\n }", "function toggle() {\n const state = isActiveMenuState();\n const burgerMenuMarketingImage = document.querySelector('.js-burger-menu-marketing-widget__img');\n\n initLayeredMenuState();\n\n if (state) { // closing the menu\n switchClass(document.body, 'nav-is-closed-body', 'nav-is-open-body');\n switchClass(getContentWrapper(), 'nav-is-closed', 'nav-is-open');\n switchClass(getCurtain(), 'nav-is-closed-curtain', 'nav-is-open-curtain');\n switchClass(getButton(), INACTIVE_STATE_CLASS, ACTIVE_STATE_CLASS);\n } else { // opening the menu\n switchClass(document.body, 'nav-is-open-body', 'nav-is-closed-body');\n switchClass(getContentWrapper(), 'nav-is-open', 'nav-is-closed');\n switchClass(getCurtain(), 'nav-is-open-curtain', 'nav-is-closed-curtain');\n switchClass(getButton(), ACTIVE_STATE_CLASS, INACTIVE_STATE_CLASS);\n\n // lazyload the image for the burger-menu-marketing widget\n if (burgerMenuMarketingImage) {\n lazyLoading.lazyLoadImage(burgerMenuMarketingImage);\n }\n }\n\n triggerMenuStateEvent(state);\n}", "function handleHamburger() {\n // Déclenche l'animation du menu mobile\n if (liensNavMobile.classList.contains(\"liensNavMobileHidden\")) {\n liensNavMobile.classList.replace(\"liensNavMobileHidden\", \"liensNavMobileVisible\");\n main.style.opacity = \"0.2\";\n } else {\n liensNavMobile.classList.replace(\"liensNavMobileVisible\", \"liensNavMobileHidden\");\n main.style.opacity = \"1\";\n }\n // Déclenche l'animation du menu hamburger\n if (menuHamburger.classList.contains(\"menuHamburger\")) {\n menuHamburger.classList.replace(\"menuHamburger\", \"menuHamburgerClicked\");\n } else {\n menuHamburger.classList.replace(\"menuHamburgerClicked\", \"menuHamburger\");\n }\n }", "function toggleNavbar() {\n\n (burger.classList.contains('open'))? burger.classList.remove('open'): burger.classList.add('open'); \n navMenu.classList.toggle('active-navbar');\n \n}", "function toggleNav() {\n\tvar ele = document.getElementById(\"mobile-navigation-toggle\");\n\tvar text = document.getElementById(\"mobile-nav-button-link\");\n\tif(ele.style.display == \"block\") {\n \t\tele.style.display = \"none\";\n \t}\n\telse {\n\t\tele.style.display = \"block\";\n\t}\n}", "function hamburgerAnimate() {\r\n hamburgerIcon.classList.toggle('active');\r\n}", "function navToggleClickEventHandler(event) {\n toggleMainNav(this);\n}", "function openNav() {\n\tdocument.querySelector(\".mobile-navigation\").style.display = \"block\";\n\n\tif (document.getElementById(\"close\").src == \"icon-close.svg\") {\n\t\tdocument.getElementById(\"open\").src = \"icon-hamburger.svg\";\n\t} else {\n\t\tdocument.getElementById(\"close\").src = \"icon-close.svg\";\n\t\tdocument.getElementById(\"close\").style.display = \"block\";\n\t\tdocument.getElementById(\"open\").style.display = \"none\";\n\t}\n\n }", "function toggleNavigation() {\r\n\tif ($('#main-container').hasClass('display-nav')) {\r\n\t\t// Close Nav\r\n\t\t$('#main-container').removeClass('display-nav');\r\n\t} else {\r\n\t\t// Open Nav\r\n\t\t$('#main-container').addClass('display-nav');\r\n\t}\r\n}", "function addHamburgerClick() {\n if (isMobileView()) {\n var hamburger = $('.breadcrumb-hamburger-nav');\n\n hamburger.on('click', function (e) {\n if ($('#toc-column').hasClass('in')) {\n $('#feature_content').show();\n $('#breadcrumb-hamburger').show();\n $('#breadcrumb-hamburger-title').show();\n } else {\n $('#feature_content').hide();\n $('#breadcrumb-hamburger').hide();\n $('#breadcrumb-hamburger-title').hide();\n $('#background-container').css('height', 'auto');\n if (window.location.hash) { \n updateHashInUrl('');\n }\n }\n });\n }\n}", "function navopen() {\n $('#nav').click(function() {\n $(this).toggleClass('open');\n });\n}", "toggleTheMenu() {\n\t\t// alert(this);\n\t\tthis.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n\t\tthis.siteHeader.toggleClass(\"site-header--is-expanded\");\n\t\tthis.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n\t}", "function toggleNav() {\n jQuery('.menu-toggle').click(function() {\n\n var navWidth,\n mobileNavMenu = jQuery('.mobile-nav-menu'),\n pageWrapper = jQuery('.wrapper'),\n menuSpeed = 250;\n\n // Copy navigation to mobile once when needed, and move register button to top of list\n if (!mobileNavMenu.find('.menu').length > 0) {\n jQuery('.primary-nav').find('.menu').clone().appendTo('.mobile-nav-menu');\n mobileNavMenu.find('.register').prependTo(mobileNavMenu.find('.menu'));\n }\n\n // Show and hide navigation\n if (pageWrapper.hasClass('open')) {\n pageWrapper.removeClass('open').animate({left: '0', right: '0'}, menuSpeed);\n mobileNavMenu.removeClass('open');\n } else {\n navWidth = mobileNavMenu.width();\n pageWrapper.addClass('open').animate({left: '-'+navWidth+'px', right: navWidth+'px'}, menuSpeed);\n mobileNavMenu.addClass('open');\n }\n });\n}", "function toggleMenu() {\n\t\ttoggle.classList.toggle('navbar-collapsed');\n\t\t// collapse.classList.toggle('mtn-navbar__collapse');\n\t\tcollapse.classList.toggle('in');\n\t}", "function toggleNav() {\n const nav = body.querySelector('#nav');\n \n nav.classList.toggle('toggle-nav');\n}", "function navOpen() {\n\t\t\t$('.navbar-toggle').on('click', function() {\n\t\t\t\t$('body').toggleClass('nav-open');\n\t\t\t});\n\t\t}", "onHamburgerMenuClick() {\n this.setState({\n isOpenMenu: !this.state.isOpenMenu\n })\n }", "function initHamburger() {\n\n // Set up hamburger toggle\n $(\".navbar-hamburger\").click(function toggleHamburger(evt) {\n\n // Mind you own business!\n evt.preventDefault();\n\n // If menu has never been opened before, add closed state\n var $body = $(\"body\");\n if ( !$body.hasClass(CSS_NAVBAR_CLOSED) && !$body.hasClass(CSS_NAVBAR_OPEN) ) {\n $body.addClass(CSS_NAVBAR_CLOSED);\n }\n\n // Handle case where menu is currently closed\n if ( $body.hasClass(CSS_NAVBAR_CLOSED) ) {\n showMenu($body);\n }\n // Handle case where menu is currently open\n else {\n hideMenu($body, true);\n }\n });\n }", "function toggleMobileMenu(e) {\n e.preventDefault();\n toggleButtonIcon();\n if (!navListOpen) {\n navListOpen = true;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"auto\",\n });\n } else {\n navListOpen = false;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"0\",\n });\n }\n}", "function togglemenu(){\n this.isopen = !this.isopen;\n }", "function toggleMenuBar() {\n // Toggle class: topnav <- -> topnav.responsive\n // Toggle at the same time symbol: \"hamburger <- -> \"cross\"\n // NOTE: I don't like the name 'responsive' too much. It's confusing in my\n // opinion.\n var x = document.getElementById(\"myTopnav\");\n var hamburgerSymbol = document.getElementById(\"hamburgerSymbol\");\n var crossSymbol = document.getElementById(\"crossSymbol\");\n if (x.className === \"topnav\") { // menu does not show\n x.className += \" responsive\";\n hamburgerSymbol.style.display = \"none\";\n crossSymbol.style.display = \"block\";\n } else { // menu shows\n x.className = \"topnav\";\n hamburgerSymbol.style.display = \"block\";\n crossSymbol.style.display = \"none\";\n }\n}", "toggleMenu(){\n this.menuContent.toggleClass('site-nav--is-visible');\n this.siteHeader.toggleClass('site-header--is-expanded');\n this.menuIcon.toggleClass('site-header__menu-icon--close-x');\n this.siteHeaderLogo.toggleClass ('site-header__logo--transparent');\n }", "function toggleMobileMenu() {\n \ttoggleIcon.addEventListener('click', function(){\n\t\t this.classList.toggle(\"open\");\n\t\t mobileMenu.classList.toggle(\"open\");\n \t});\n }", "function toggleMenu() {\n document.querySelector('.main-nav').classList.toggle('display-menu');\n document.querySelector('.screen').toggleAttribute('hidden');\n}", "function toggleNavExpansion() {\n $(\"#menu-toggle\").click(function() {\n if ($(\"#navbar\").hasClass(\"reduced\")) {\n $(\"#navbar\").removeClass(\"reduced\");\n $(\"#navbar\").addClass(\"expanded\");\n } else {\n $(\"#navbar\").removeClass(\"expanded\");\n $(\"#navbar\").addClass(\"reduced\");\n }\n });\n\n $(\".extended-list-item\").click(e => {\n $(\"#navbar\").removeClass(\"expanded\");\n $(\"#navbar\").addClass(\"reduced\");\n $(\".hamburger-menu\").removeClass(\"active\");\n });\n}", "function menu() {\n html.classList.toggle('menu-active');\n }", "function trigger() {\r\n\tif (menu.classList.contains('show')) {\r\n\t\t//close menu\r\n\t\tmenu.classList.remove('show');\r\n\t\tdocument.body.style.overflow = 'auto';\r\n\t} else {\r\n\t\t//open menu\r\n\t\tmenu.classList.add('show');\r\n\t\tdocument.body.style.overflow = 'hidden';\r\n\t}\r\n\r\n\t//toggle icon between hamburger (open) to x (close)\r\n\ticon.classList.toggle('close');\r\n\ticon.classList.toggle('open');\r\n}", "function toggleNav() {\n if ($('#site-wrapper').hasClass('show-nav')) {\n // Do things on Nav Close\n $('#site-wrapper').removeClass('show-nav');\n } else {\n // Do things on Nav Open\n $('#site-wrapper').addClass('show-nav');\n }\n\n //$('#site-wrapper').toggleClass('show-nav');\n}", "function toggleMobileMenu() {\n if (mobileMenuVisible) {\n //close menu\n nav.style.removeProperty(\"top\");\n burgerMenuSpan.forEach(span => {\n span.style.removeProperty(\"background\");\n });\n } else {\n //open menu\n nav.style.top = \"0px\";\n burgerMenuSpan.forEach(span => {\n span.style.background = \"#e9e9e9\";\n });\n }\n mobileMenuVisible = !mobileMenuVisible;\n}", "function toggleMenu(){\n if(onNewsPost == \"yes\"){\n goBackToTabs();\n return;\n }\n console.log(\"Toggle Menu\");\n $(\".mdl-layout__drawer-button\").click();\n}", "function toggleMenu() {\n hamburger.classList.toggle('active');\n overlay.classList.toggle('open');\n document.body.classList.toggle('noScroll');\n }", "function toggleMenu(menu) {\n // toggkes the hamburger menu\n menu.classList.toggle(\"change\");\n\n // opens the menu\n let navmenu = document.querySelector(\".open-menu\");\n\n // check the menu's state and toggles it\n let menuIsClosed = !navmenu.classList.contains(\"opened\");\n if (menuIsClosed) {\n navmenu.classList.add(\"opened\");\n } else {\n navmenu.classList.remove(\"opened\");\n }\n}", "function openNav() {\n sidenav.css(\"margin-left\", \"0\");\n sidenav.css(\"overflow\", \"auto\");\n backButton.addClass(\"active_background\");\n enableHamburger();\n menuOpen = true;\n}", "function toggleNav(){\n\n var hamburgerMenu = $(\".hamburger-toggle\");\n var navBar = $(\".nav-container\");\n var navBarMenu = $(\"#menu1\");\n var stickyClass = \"sticky\";\n var menuActive = \"active\";\n\n $(hamburgerMenu).click(function(){\n\n if( !$(navBarMenu).hasClass(menuActive) ){\n $(navBarMenu).addClass(menuActive);\n } else{\n $(navBarMenu).removeClass(menuActive);\n }\n\n if( !$(navBar).hasClass(stickyClass)){\n $(navBar).addClass(stickyClass);\n }\n });\n\n}", "function openNav() {\n\tvar links = document.getElementById(\"mobileNavLinks\");\n\tvar hamburger = document.getElementById(\"mobileNav\");\n\n\tif (links.style.display === \"block\" && hamburger.classList.contains(\"fa-times\")) {\n\t\tlinks.style.display = \"none\";\n\t\thamburger.classList.remove(\"fa-times\");\n\t\thamburger.classList.add(\"fa-bars\");\n\t}\n\telse {\n\t\tlinks.style.display = \"block\";\n\t\thamburger.classList.remove(\"fa-bars\");\n\t\thamburger.classList.add(\"fa-times\");\n\t}\n}", "function hamburger(x) {\n x.classList.toggle(\"change\");\n}", "function toggleNav() {\n if ($('.site-wrapper').hasClass('show-nav')) {\n // Do things on Nav Close\n $('.site-wrapper').removeClass('show-nav');\n } else {\n // Do things on Nav Open\n $('.site-wrapper').addClass('show-nav');\n }\n\n //$('#site-wrapper').toggleClass('show-nav');\n}", "function toggleMenu() {\n\t\t$('.header__burger').toggleClass('active');\n\t\t$('.header__menu').toggleClass('active');\n\t\t$('body').toggleClass('lock');\n\t}", "function toggleMobileNav() {\n\n\t//Getting the elements\n\tlet hamburgerBtn = document.getElementById('mobileNav'),\n\t\tnavigation = document.querySelector('.grid__header--nav'),\n\t\tmobileNavLink = document.querySelectorAll('.grid__header--nav--item');\n\n\t//Adding click event on the mobile menu button\n\thamburgerBtn.addEventListener('click', function() {\n\t\t//Toggle classes on the mobile menu btn and main navigation\n\t\thamburgerBtn.classList.toggle('active-mobile');\n\t\tnavigation.classList.toggle('open');\n\t});\n\n\t//Looping thrught all navigation link and adding click event on them\n\tfor (let i = 0; i < mobileNavLink.length; i++) {\n\n\t\tmobileNavLink[i].addEventListener('click', function() {\n\t\t\t//On click on the nav link remove open and active menu class\n\t\t\tnavigation.classList.remove('open');\n\t\t\thamburgerBtn.classList.remove('active-mobile');\n\t\t});\n\t}\n}", "function toggleMenu() {\n const burger = document.querySelector('.navbar-burger');\n const mobileMenu = document.getElementsByClassName('navbar-menu-link');\n for (let i = 0; i < mobileMenu.length; i += 1) {\n mobileMenu[i].classList.toggle('open');\n }\n burger.classList.toggle('open');\n}", "function toggleMenu() {\r\n var sidemenu = document.getElementById(\"sidemenu\");\r\n sidemenu.classList.toggle(\"active\");\r\n\r\n var menuBtnIcon = document.querySelector(\"#menuBtn i\");\r\n menuBtnIcon.classList.toggle(\"fa-bars\");\r\n menuBtnIcon.classList.toggle(\"fa-times\");\r\n }", "toggleMenu(){\n const toggleButton = document.querySelector('.header-toggle-menu')\n const headerMenu = document.querySelector('.header-menu')\n\n toggleButton.classList.toggle('clicked-toggle')\n headerMenu.classList.toggle('display-menu')\n }", "function toggleMenu(event) {\n\tif (event.type === \"touchstart\") event.preventDefault();\n\n\n\tconst navigationMenu = document.querySelector(\".c-menu\");\n\n\tnavigationMenu.classList.toggle(\"is-menu--active\");\n\n\tconst activeNavigation = navigationMenu.classList.contains(\n\t\t\"is-menu--active\"\n\t);\n\tevent.currentTarget.setAttribute(\"aria-expanded\", activeNavigation);\n\n\n\tif (activeNavigation) {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Fechar Menu\");\n\t\t\n\t} else {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Abrir Menu\");\n\t}\n}", "toggleNav() {\n if ($(\"#offcanvas-menu-react\").hasClass(\"navslide-show\")) {\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n }\n else {\n $(\".nav-canvas\").css(\"position\", \"relative\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".navbar\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n }\n }", "function toggleMenu() {\n document.querySelector('.mobile-menu').classList.toggle('active')\n}", "toggleTheMenu() { // run the action \"Toggle the menu content\" (visible/unvisible)\n // console.log(\"Hooray - the icon was clicked!\"); // test message\n // Attention \"this\" variable points to object, from which method was called\n // from! In this particular case: Jquery menuIcon object\n // console.log(this);\n this.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n this.siteHeader.toggleClass(\"site-header--is-expanded\");\n this.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n }", "function openNav() {\n document.getElementById(\"myNav\").style.display = \"block\";\n document.getElementsByClassName(\"menu-toggle\")[0].style.display = \"none\";\n navOpen = true;\n}", "function toggleMenuBtn() {\n document.querySelector(\".menu-btn\").classList.toggle(\"toggle-nav-btn\");\n}", "function toggleMenu() {\n const navbarLinks = document.querySelector(\"ul\");\n navbarLinks.classList.toggle('active');\n}", "function hamburgerMenuFunc() {\n var menu = document.getElementById(\"myLinks\");\n if (menu.style.display === \"block\") {\n menu.style.display = \"none\";\n } else {\n menu.style.display = \"block\";\n }\n} // end hamburgerMenuFunc", "function togglemenu(){\r\n\t\tvar menuToggle = document.querySelector('.toggle');\r\n\t\tvar menu = document.querySelector('.menu');\r\n\t\tmenuToggle.classList.toggle('active');\r\n\t\tmenu.classList.toggle('active');\r\n\t}", "function toggleMobileNav(){ \n const mobileUL=document.querySelector('.ul-div');\n\n if(hamburger.classList.contains('show-bar-div')){ \n $SC(hamburger, 'show-bar-div', 'show-close-btn' )\n hamburger.innerHTML='<div><img src=\"./images/icon-close.svg\" /></div>';\n $SC(mobileUL, 'hide-ul', 'show-ul' )\n } else if(hamburger.classList.contains('show-close-btn')){ \n $SC(hamburger, 'show-close-btn', 'show-bar-div' )\n hamburger.innerHTML='<div class=\"bar\"></div><div class=\"bar\"></div><div class=\"bar\"></div>'; \n $SC(mobileUL, 'show-ul', 'hide-ul');\n } else {\n return false;\n } \n}", "function onClickMenu(){\n\tdocument.getElementById(\"menu\").classList.toggle(\"change\");\n\tdocument.getElementById(\"nav\").classList.toggle(\"change\");\n\tdocument.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n}", "function toggleNav(){\n\t\t\tvar x = document.getElementById(\"myTopnav\");\n\t\t\tif (x.className === \"topnav\"){\n\t\t\t\tx.className += \" opened\";\n\t\t\t} else {\n\t\t\t\tx.className = \"topnav\";\n\t\t\t}\n\t\t}", "function mobileNav() {\n $('.mobile-nav-toggle').on('click', function(){\n var status = $(this).hasClass('is-open');\n if(status){\n $('.mobile-nav-toggle, .mobile-nav').removeClass('is-open');\n } else {\n $('.mobile-nav-toggle, .mobile-nav').addClass('is-open');\n }\n });\n $('.alt-mobile-nav-toggle').on('click', function(){\n var status = $(this).hasClass('is-open');\n if(status){\n $('.alt-mobile-nav-toggle, .alt-mobile-nav').removeClass('is-open');\n } else {\n $('.alt-mobile-nav-toggle, .alt-mobile-nav').addClass('is-open');\n }\n });\n}", "function toggleMainNavi() {\n\t$('header').toggleClass('reduced');\n\t$('nav').toggleClass('reduced');\n\n\t/* menu.js */\n\tsetMenuPosition();\n}", "showHamburger() {\n if (this.props.isSidebarShown) {\n return;\n }\n\n this.toggleHamburger();\n }" ]
[ "0.80133754", "0.80133754", "0.80133754", "0.79227173", "0.78491664", "0.7825522", "0.7754517", "0.7680551", "0.75981253", "0.75579923", "0.7549522", "0.7546149", "0.7533177", "0.7518053", "0.7498128", "0.7484153", "0.74762154", "0.7474002", "0.7461529", "0.74336207", "0.74189985", "0.74152267", "0.7394053", "0.73890555", "0.73548996", "0.73329926", "0.73285764", "0.7324727", "0.7312116", "0.7301836", "0.72831523", "0.72813106", "0.72661686", "0.726559", "0.72408354", "0.7227266", "0.7226632", "0.7221871", "0.7184136", "0.71667945", "0.7156107", "0.7154457", "0.7132789", "0.7132356", "0.7127327", "0.712182", "0.71181345", "0.71176696", "0.7115446", "0.7113242", "0.7112842", "0.71048826", "0.7100436", "0.70958793", "0.7092496", "0.70881844", "0.7081069", "0.7078859", "0.7074866", "0.706554", "0.7064792", "0.70608646", "0.70558935", "0.7044153", "0.70305866", "0.702291", "0.70213705", "0.7019667", "0.70140105", "0.70008373", "0.6997886", "0.6997613", "0.6997487", "0.69951284", "0.69949275", "0.6987685", "0.6983212", "0.69780564", "0.69750357", "0.6973605", "0.69736034", "0.6971436", "0.6970736", "0.69673204", "0.69671327", "0.69639885", "0.69563824", "0.69556373", "0.6953633", "0.6951147", "0.69366944", "0.69340247", "0.6918991", "0.69146514", "0.691429", "0.691397", "0.69132626", "0.69111603", "0.69099915", "0.6908922", "0.6906744" ]
0.0
-1